Esempio n. 1
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Undeformed Surface", "S", "", GH_ParamAccess.item);
     pManager.AddSurfaceParameter("Deformed Surface", "s", "", GH_ParamAccess.item);
     pManager.AddNumberParameter("Youngs Modulus", "E", "", GH_ParamAccess.item);
     pManager.AddNumberParameter("Poissons Ration", "ν", "", GH_ParamAccess.item);
     pManager.AddNumberParameter("Thickness", "t", "", GH_ParamAccess.item);
     pManager.AddIntegerParameter("Direction", "D", "", GH_ParamAccess.item, 3);
     Utility.AddNamedValues <Path.Types>(Params.Input[5]);
 }
Esempio n. 2
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "", GH_ParamAccess.item);
     pManager.AddIntegerParameter("U Count", "U", "", GH_ParamAccess.item);
     pManager.AddIntegerParameter("V Count", "V", "", GH_ParamAccess.item);
     pManager.AddNumberParameter("Value", "v", "", GH_ParamAccess.item);
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddParameter(new PathParameter(), "Path Type", "T", "", GH_ParamAccess.item);
     pManager.AddSurfaceParameter("Surface", "S", "", GH_ParamAccess.item);
     pManager.AddVectorParameter("Point", "P", "", GH_ParamAccess.item);
     pManager.AddNumberParameter("Step Size", "H", "", GH_ParamAccess.item, 0.1);
 }
Esempio n. 4
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Srf", "Surface.", GH_ParamAccess.item);
     pManager.AddGenericParameter("StiffnessMatrix4Type", "D", "Membrane stiffness matrix", GH_ParamAccess.item);
     pManager.AddGenericParameter("StiffnessMatrix4Type", "K", "Flexural stiffness matrix", GH_ParamAccess.item);
     pManager.AddGenericParameter("StiffnessMatrix2Type", "H", "Shear stiffness matrix", GH_ParamAccess.item);
     pManager.AddNumberParameter("Density", "Density", "Density [t/m2]", GH_ParamAccess.item, 1);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("t1", "t1", "t1 [m]", GH_ParamAccess.item, 0.1);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("t2", "t2", "t2 [m]", GH_ParamAccess.item, 0.1);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("Alpha1", "Alpha1", "Alpha1 [1/°C]", GH_ParamAccess.item, 0.00001);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("Alpha2", "Alpha2", "Alpha2 [1/°C]", GH_ParamAccess.item, 0.00001);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddBooleanParameter("IgnoreInStImpCalc", "IgnoreInStImpCalc", "Ignore in stability/imperfection calculation", GH_ParamAccess.item, false);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("EdgeConnection", "EdgeConnection", "Optional, rigid if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalX", "LocalX", "Set local x-axis. Vector must be perpendicular to surface local z-axis. Local y-axis will be adjusted accordingly. Optional, local x-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalZ", "LocalZ", "Set local z-axis. Vector must be perpendicular to surface local x-axis. Local y-axis will be adjusted accordingly. Optional, local z-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("AverageSurfaceElementSize", "AvgSrfElemSize", "Finite element size. Set average surface element size. If set to 0 FEM-Design will automatically caculate the average surface element size. [m]", GH_ParamAccess.item, 0);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddTextParameter("Identifier", "Identifier", "Identifier.", GH_ParamAccess.item, "FS");
     pManager[pManager.ParamCount - 1].Optional = true;
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "The terrain surface", GH_ParamAccess.item);
     pManager[0].Optional = false;
     pManager.AddVectorParameter("Aspect", "A", "Vector representing the direction to measure aspect against", GH_ParamAccess.item, new Vector3d(0, 1, 0));
     pManager[1].Optional = true;
     // TODO: add Mesh construction settings/parameters (Param_MeshParameters)
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddTextParameter("Identifier", "Identifier", "Identifier.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddTextParameter("Comment", "Comment", "Comment.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "Surface", GH_ParamAccess.item);
     pManager.AddBooleanParameter("Flip", "F", "Set True to flip normal", GH_ParamAccess.item, false);
     pManager.AddBooleanParameter("Swap", "S", "Swap {u} and {v} directions", GH_ParamAccess.item, false);
     pManager.AddBooleanParameter("Reverse U", "U", "Reverse {u} direction", GH_ParamAccess.item, false);
     pManager.AddBooleanParameter("Reverse V", "V", "Reverse {v} direction", GH_ParamAccess.item, false);
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddVectorParameter("Force", "Force", "Force.", GH_ParamAccess.item);
     pManager.AddGenericParameter("LoadCase", "LoadCase", "LoadCase.", GH_ParamAccess.item);
     pManager.AddTextParameter("Comment", "Comment", "Comment.", GH_ParamAccess.item);
     pManager[3].Optional = true;
 }
Esempio n. 9
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surfaces", "Srfs", "Item or list of surfaces of section. Surfaces must lie in the XY-plane at z=0.", GH_ParamAccess.list);
     pManager.AddTextParameter("Name", "Name", "Name of section", GH_ParamAccess.item);
     pManager.AddTextParameter("MaterialType", "MatType", "Material type. Choice: SteelRolled/SteelColdWorked/SteelWelded/Concrete/Timber", GH_ParamAccess.item);
     pManager.AddTextParameter("GroupName", "GroupName", "Name of section group", GH_ParamAccess.item);
     pManager.AddTextParameter("TypeName", "TypeName", "Name of section type", GH_ParamAccess.item);
     pManager.AddTextParameter("SizeName", "SizeName", "Name of section size", GH_ParamAccess.item);
 }
Esempio n. 10
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddVectorParameter("Direction", "Direction", "Direction.", GH_ParamAccess.item);
     pManager.AddGenericParameter("TopBotLocationValue", "TopBotLocVal", "Temperature at top and bottom of surface. Either 1 value (uniform) or 3 values (variable). [\x00B0C]", GH_ParamAccess.list);
     pManager.AddGenericParameter("LoadCase", "LoadCase", "LoadCase.", GH_ParamAccess.item);
     pManager.AddTextParameter("Comment", "Comment", "Comment.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
 }
Esempio n. 11
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddVectorParameter("Direction", "Direction", "Vector. Direction of force.", GH_ParamAccess.item);
     pManager.AddGenericParameter("LoadLocationValue", "LoadLocationValue", "LoadLocationValue objects. List of 3 items [q1, q2, q3].", GH_ParamAccess.list);
     pManager.AddGenericParameter("LoadCase", "LoadCase", "LoadCase.", GH_ParamAccess.item);
     pManager.AddTextParameter("Comment", "Comment", "Comment.", GH_ParamAccess.item);
     pManager[4].Optional = true;
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "Surface to extend", GH_ParamAccess.item);
     pManager.AddNumberParameter("West Edge", "W", "Length to extend west edge (0 for no extension)", GH_ParamAccess.item, 0);
     pManager.AddNumberParameter("South Edge", "S", "Length to extend south edge (0 for no extension)", GH_ParamAccess.item, 0);
     pManager.AddNumberParameter("East Edge", "E", "Length to extend east edge (0 for no extension)", GH_ParamAccess.item, 0);
     pManager.AddNumberParameter("North Edge", "N", "Length to extend north edge (0 for no extension)", GH_ParamAccess.item, 0);
     pManager.AddBooleanParameter("Extension Type", "T", "Set True for smooth extension, False for ruled",
                                  GH_ParamAccess.item, true);
 }
Esempio n. 13
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface. Surface must be flat.", GH_ParamAccess.item);
     pManager.AddGenericParameter("SupportingBars", "SupportingBars", "Single bar element or list of bar elements. List cannot be nested.", GH_ParamAccess.list);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("SupportingSlabs", "SupportingSlabs", "Single slab element or list of slab elements. List cannot be nested.", GH_ParamAccess.list);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddTextParameter("Identifier", "Identifier", "Identifier.", GH_ParamAccess.item, "CO");
     pManager[pManager.ParamCount - 1].Optional = true;
 }
Esempio n. 14
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddVectorParameter("Force", "Force", "Force. [kN/m²]", GH_ParamAccess.item);
     pManager.AddBooleanParameter("LoadProjection", "LoadProjection", "LoadProjection. \nFalse: Intensity meant along action line (eg. dead load). \nTrue: Intensity meant perpendicular to direction of load (eg. snow load).", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("LoadCase", "LoadCase", "LoadCase.", GH_ParamAccess.item);
     pManager.AddTextParameter("Comment", "Comment", "Comment.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "Base landscape form (as a surface) for the flow calculation", GH_ParamAccess.item);
     pManager.AddPointParameter("Points", "P", "Start points for the flow paths. These should be above the surface (they will be projected on to it)", GH_ParamAccess.list);
     pManager.AddNumberParameter("Fidelity", "F", "Amount to move for each flow iteration. Small numbers may take a long time to compute. If not specified or set to 0 a (hopefully) sensible step size will be calculated.", GH_ParamAccess.item, 0);
     pManager[2].Optional = true;
     pManager.AddIntegerParameter("Steps", "L", "A limit to the number of flow iterations. Leave unset or to 0 for an unlimited set of iterations", GH_ParamAccess.item, 0);
     pManager[3].Optional = true;
     pManager.AddBooleanParameter("Thread", "T", "Whether to multithread the solution (this can speed up long calculations)", GH_ParamAccess.item, false);
     pManager[4].Optional = true;
 }
Esempio n. 16
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddVectorParameter("LoadDirection", "Direction", "Vector. Direction of force.", GH_ParamAccess.item);
     pManager.AddGenericParameter("LoadCase", "LoadCase", "LoadCase.", GH_ParamAccess.item);
     pManager.AddNumberParameter("z0", "z0", "Surface level of soil/water (on the global Z axis). [m]", GH_ParamAccess.item);
     pManager.AddNumberParameter("q0", "q0", "Load intensity at the surface level. [kN/m²]", GH_ParamAccess.item);
     pManager.AddNumberParameter("qh", "qh", "Increment of load intensity per meter (along the global Z axis). [kN/m²/m]", GH_ParamAccess.item);
     pManager.AddTextParameter("Comment", "Comment", "Comment.", GH_ParamAccess.item);
     pManager[6].Optional = true;
 }
Esempio n. 17
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface defining the SurfaceSupport.", GH_ParamAccess.item);
     pManager.AddGenericParameter("Motions", "Motions", "Motions release for the surface support.", GH_ParamAccess.item);
     pManager.AddGenericParameter("Plastic Limits Forces Motions", "PlaLimM", "Plastic limits forces for motion springs. Optional.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalX", "LocalX", "Set local x-axis. Vector must be perpendicular to surface local z-axis. Local y-axis will be adjusted accordingly. Optional, local x-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalZ", "LocalZ", "Set local z-axis. Vector must be perpendicular to surface local x-axis. Local y-axis will be adjusted accordingly. Optional, local z-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddTextParameter("Identifier", "Identifier", "Identifier. Optional, default value if undefined.", GH_ParamAccess.item, "S");
     pManager[pManager.ParamCount - 1].Optional = true;
 }
Esempio n. 18
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface must be flat.", GH_ParamAccess.item);
     pManager.AddNumberParameter("Thickness", "Thickness", "Thickness. [m]", GH_ParamAccess.item);
     pManager.AddGenericParameter("Material", "Material", "Material.", GH_ParamAccess.item);
     pManager.AddGenericParameter("ShellEccentricity", "Eccentricity", "ShellEccentricity. Optional.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("ShellOrthotropy", "Orthotropy", "ShellOrthotropy. Optional.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("EdgeConnection", "EdgeConnection", "EdgeConnection. Optional.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalX", "LocalX", "Set local x-axis. Vector must be perpendicular to surface local z-axis. Local y-axis will be adjusted accordingly. Optional, local x-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalZ", "LocalZ", "Set local z-axis. Vector must be perpendicular to surface local x-axis. Local y-axis will be adjusted accordingly. Optional, local z-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddTextParameter("Identifier", "Identifier", "Identifier. Optional.", GH_ParamAccess.item, "P");
     pManager[pManager.ParamCount - 1].Optional = true;
 }
Esempio n. 19
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddGenericParameter("TimberPlateMaterial", "Material", "Timber plate material.", GH_ParamAccess.item);
     pManager.AddVectorParameter("SpanDirection", "Direction", "Span direction of the timber plate.", GH_ParamAccess.item);
     pManager.AddNumberParameter("PanelWidth", "PanelWidth", "Width of each individual CLT panel in region. 1.5m if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("ShellEccentricity", "Eccentricity", "ShellEccentricity. Optional.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("BorderEdgeConnection", "BorderEdgeConnection", "EdgeConnection of the external border of the panel. Optional. If not defined hinged will be used.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalX", "LocalX", "Set local x-axis. Vector must be perpendicular to surface local z-axis. Local y-axis will be adjusted accordingly. Optional, local x-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalZ", "LocalZ", "Set local z-axis. Vector must be perpendicular to surface local x-axis. Local y-axis will be adjusted accordingly. Optional, local z-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("AvgMeshSize", "AverageMeshSize", "Average mesh size. If zero an automatic value will be used by FEM-Design. Optional. [m]", GH_ParamAccess.item, 0);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddTextParameter("Identifier", "Identifier", "Identifier. Optional.", GH_ParamAccess.item, "PP");
     pManager[pManager.ParamCount - 1].Optional = true;
 }
Esempio n. 20
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Srf", "Surface.", GH_ParamAccess.item);
     pManager.AddGenericParameter("Material", "Mat", "Material.", GH_ParamAccess.item);
     pManager.AddGenericParameter("Section", "Sec", "Section.", GH_ParamAccess.item);
     pManager.AddGenericParameter("ShellEccentricity", "Eccentricity", "ShellEccentricity. Optional.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("OrthoRatio", "OrthoRatio", "Transversal flexural stiffness factor.", GH_ParamAccess.item, 1);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddGenericParameter("BorderEdgeConnection", "BorderEdgeConnection", "EdgeConnection of the external border of the panel. Optional. If not defined hinged will be used.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalX", "LocalX", "Set local x-axis. Vector must be perpendicular to surface local z-axis. Local y-axis will be adjusted accordingly. Optional, local x-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddVectorParameter("LocalZ", "LocalZ", "Set local z-axis. Vector must be perpendicular to surface local x-axis. Local y-axis will be adjusted accordingly. Optional, local z-axis from surface coordinate system used if undefined.", GH_ParamAccess.item);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddNumberParameter("AvgMeshSize", "AverageMeshSize", "Average mesh size. If zero an automatic value will be used by FEM-Design. Optional. [m]", GH_ParamAccess.item, 0);
     pManager[pManager.ParamCount - 1].Optional = true;
     pManager.AddTextParameter("Identifier", "Identifier", "Identifier. Optional.", GH_ParamAccess.item, "PP");
     pManager[pManager.ParamCount - 1].Optional = true;
 }
Esempio n. 21
0
 /// <summary>
 /// Registers all the input parameters for this component.
 /// </summary>
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     base.RegisterInputParams(pManager);
     pManager.AddSurfaceParameter(RS.surfaceName, RS.surfaceNickname, "Surface for emitter.", GH_ParamAccess.item);
 }
Esempio n. 22
0
 /// <summary>
 /// Registers all the input parameters for this component.
 /// </summary>
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter(RS.surfaceName, RS.surfaceNickname, RS.surfaceForEnvironmentDescription, GH_ParamAccess.item);
 }
Esempio n. 23
0
 /// <summary>
 /// Registers all the input parameters for this component.
 /// </summary>
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "s", "Untrimmed surface to be meshed", GH_ParamAccess.item);
 }
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "The terrain surface", GH_ParamAccess.item);
     pManager[0].Optional = false;
     // TODO: add Mesh construction settings/parameters (Param_MeshParameters)
 }
Esempio n. 25
0
 /// <summary>
 /// Registers all the input parameters for this component.
 /// </summary>
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
   base.RegisterInputParams(pManager);
   pManager.AddSurfaceParameter(RS.surfaceName, RS.surfaceNickname, "Surface for emitter.", GH_ParamAccess.item);
 }
Esempio n. 26
0
 /// <summary>
 /// Registers all the input parameters for this component.
 /// </summary>
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "s", "Untrimmed surface to be meshed", GH_ParamAccess.item);
     pManager.AddIntegerParameter("U", "u", "U paramter for mesh", GH_ParamAccess.item);
     pManager.AddIntegerParameter("V", "v", "V paramter for mesh", GH_ParamAccess.item);
 }
 /// <summary>
 /// Registers all the input parameters for this component.
 /// </summary>
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
   pManager.AddSurfaceParameter(RS.surfaceName, RS.surfaceNickname, RS.surfaceForEnvironmentDescription, GH_ParamAccess.item);
   pManager.AddBooleanParameter(RS.wrapName, RS.wrapNickname, RS.wrapDescription, GH_ParamAccess.item, RS.wrapDefault);
 }
Esempio n. 28
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "", GH_ParamAccess.item);
     pManager.AddCurveParameter("Curve", "C", "", GH_ParamAccess.item);
 }
        // :(
        //// This object MUST be static??
        //static Dictionary<Type, Func<GH_InputParamManager, MACHINA_InputParameProps, int>> AddParameterFunctionMap =
        //    new Dictionary<Type, Func<GH_InputParamManager, MACHINA_InputParameProps, int>>()
        //{
        //    //{ typeof (),                        (pm, p) => pm.AddAngleParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Arc),               (pm, p) => pm.AddArcParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Boolean),           (pm, p) => pm.AddBooleanParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Box),               (pm, p) => pm.AddBoxParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Brep),              (pm, p) => pm.AddBrepParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Circle),            (pm, p) => pm.AddCircleParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Colour),            (pm, p) => pm.AddColourParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Complex),           (pm, p) => pm.AddComplexNumberParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Culture),           (pm, p) => pm.AddCultureParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Curve),             (pm, p) => pm.AddCurveParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Field),             (pm, p) => pm.AddFieldParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_GenericObject),     (pm, p) => pm.AddGenericParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Geometry),          (pm, p) => pm.AddGeometryParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Group),             (pm, p) => pm.AddGroupParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Integer),           (pm, p) => pm.AddIntegerParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Interval2D),        (pm, p) => pm.AddInterval2DParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Interval),          (pm, p) => pm.AddIntervalParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Line),              (pm, p) => pm.AddLineParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Matrix),            (pm, p) => pm.AddMatrixParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_MeshFace),          (pm, p) => pm.AddMeshFaceParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Mesh),              (pm, p) => pm.AddMeshParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Number),            (pm, p) => pm.AddNumberParameter(p.name, p.nickname, p.description, p.access) },
        //    //{ typeof (),                        (pm, p) => pm.AddParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_FilePath),          (pm, p) => pm.AddPathParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Plane),             (pm, p) => pm.AddPlaneParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Point),             (pm, p) => pm.AddPointParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Rectangle),         (pm, p) => pm.AddRectangleParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_ScriptVariable),    (pm, p) => pm.AddScriptVariableParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Surface),           (pm, p) => pm.AddSurfaceParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_String),            (pm, p) => pm.AddTextParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Time),              (pm, p) => pm.AddTimeParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Transform),         (pm, p) => pm.AddTransformParameter(p.name, p.nickname, p.description, p.access) },
        //    { typeof (Param_Vector),            (pm, p) => pm.AddVectorParameter(p.name, p.nickname, p.description, p.access) }
        //};

        //// Wanted to do this programmatically with a dictionary of delegates, but couldn't really make it work... :(
        //AddParameterFunctionMap[input.dataType](pManager, input);
        protected void RegisterTypedParam(GH_InputParamManager pManager, GH_InputParamProps p, int index)
        {
            // I am so embarrased about having to do this... urgh X(
            if (p.defaultValue == null)
            {
                try
                {
                    // Sorted by popularity order, estimated by my guts
                    if (p.dataType == typeof(Param_Number))
                    {
                        pManager.AddNumberParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Plane))
                    {
                        pManager.AddPlaneParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Point))
                    {
                        pManager.AddPointParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Vector))
                    {
                        pManager.AddVectorParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_String))
                    {
                        pManager.AddTextParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Boolean))
                    {
                        pManager.AddBooleanParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_GenericObject))
                    {
                        pManager.AddGenericParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Integer))
                    {
                        pManager.AddIntegerParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_FilePath))
                    {
                        pManager.AddPathParameter(p.name, p.nickname, p.description, p.access);
                    }

                    // I don't think Machina uses any of these so far...
                    else if (p.dataType == typeof(Param_Arc))
                    {
                        pManager.AddArcParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Box))
                    {
                        pManager.AddBoxParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Brep))
                    {
                        pManager.AddBrepParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Circle))
                    {
                        pManager.AddCircleParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Colour))
                    {
                        pManager.AddColourParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Complex))
                    {
                        pManager.AddComplexNumberParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Culture))
                    {
                        pManager.AddCultureParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Curve))
                    {
                        pManager.AddCurveParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Field))
                    {
                        pManager.AddFieldParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Geometry))
                    {
                        pManager.AddGeometryParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Group))
                    {
                        pManager.AddGroupParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Interval2D))
                    {
                        pManager.AddInterval2DParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Interval))
                    {
                        pManager.AddIntervalParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Line))
                    {
                        pManager.AddLineParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Matrix))
                    {
                        pManager.AddMatrixParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_MeshFace))
                    {
                        pManager.AddMeshFaceParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Mesh))
                    {
                        pManager.AddMeshParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Rectangle))
                    {
                        pManager.AddRectangleParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_ScriptVariable))
                    {
                        pManager.AddScriptVariableParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Surface))
                    {
                        pManager.AddSurfaceParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Time))
                    {
                        pManager.AddTimeParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Transform))
                    {
                        pManager.AddTransformParameter(p.name, p.nickname, p.description, p.access);
                    }

                    else
                    {
                        this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Cannot register parameter of type " + p.dataType);
                    }
                }
                catch
                {
                    this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, $"Something went wrong registering input parameter {p.dataType}");
                }
            }
            else
            {
                try
                {
                    // Sorted by popularity order, estimated by my guts
                    if (p.dataType == typeof(Param_Number))
                    {
                        pManager.AddNumberParameter(p.name, p.nickname, p.description, p.access, (double)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Plane))
                    {
                        pManager.AddPlaneParameter(p.name, p.nickname, p.description, p.access, (Plane)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Point))
                    {
                        pManager.AddPointParameter(p.name, p.nickname, p.description, p.access, (Point3d)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Vector))
                    {
                        pManager.AddVectorParameter(p.name, p.nickname, p.description, p.access, (Vector3d)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_String))
                    {
                        pManager.AddTextParameter(p.name, p.nickname, p.description, p.access, (string)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Boolean))
                    {
                        pManager.AddBooleanParameter(p.name, p.nickname, p.description, p.access, (bool)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_GenericObject))
                    {
                        pManager.AddGenericParameter(p.name, p.nickname, p.description, p.access);                                                  // generic objects don't accept default values...
                    }
                    else if (p.dataType == typeof(Param_Integer))
                    {
                        pManager.AddIntegerParameter(p.name, p.nickname, p.description, p.access, (int)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_FilePath))
                    {
                        pManager.AddPathParameter(p.name, p.nickname, p.description, p.access);                                             // no def value accepted
                    }
                    // I don't think Machina uses any of these so far...
                    else if (p.dataType == typeof(Param_Arc))
                    {
                        pManager.AddArcParameter(p.name, p.nickname, p.description, p.access, (Arc)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Box))
                    {
                        pManager.AddBoxParameter(p.name, p.nickname, p.description, p.access, (Box)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Brep))
                    {
                        pManager.AddBrepParameter(p.name, p.nickname, p.description, p.access);                                         // no def value accepted
                    }
                    else if (p.dataType == typeof(Param_Circle))
                    {
                        pManager.AddCircleParameter(p.name, p.nickname, p.description, p.access, (Circle)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Colour))
                    {
                        pManager.AddColourParameter(p.name, p.nickname, p.description, p.access, (Color)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Complex))
                    {
                        pManager.AddComplexNumberParameter(p.name, p.nickname, p.description, p.access, (GH_ComplexNumber)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Culture))
                    {
                        pManager.AddCultureParameter(p.name, p.nickname, p.description, p.access, (CultureInfo)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Curve))
                    {
                        pManager.AddCurveParameter(p.name, p.nickname, p.description, p.access);                                          // no def value
                    }
                    else if (p.dataType == typeof(Param_Field))
                    {
                        pManager.AddFieldParameter(p.name, p.nickname, p.description, p.access);                                          // no def val
                    }
                    else if (p.dataType == typeof(Param_Geometry))
                    {
                        pManager.AddGeometryParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Group))
                    {
                        pManager.AddGroupParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Interval2D))
                    {
                        pManager.AddInterval2DParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Interval))
                    {
                        pManager.AddIntervalParameter(p.name, p.nickname, p.description, p.access, (Interval)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Line))
                    {
                        pManager.AddLineParameter(p.name, p.nickname, p.description, p.access, (Line)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Matrix))
                    {
                        pManager.AddMatrixParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_MeshFace))
                    {
                        pManager.AddMeshFaceParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Mesh))
                    {
                        pManager.AddMeshParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Rectangle))
                    {
                        pManager.AddRectangleParameter(p.name, p.nickname, p.description, p.access, (Rectangle3d)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_ScriptVariable))
                    {
                        pManager.AddScriptVariableParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Surface))
                    {
                        pManager.AddSurfaceParameter(p.name, p.nickname, p.description, p.access);
                    }
                    else if (p.dataType == typeof(Param_Time))
                    {
                        pManager.AddTimeParameter(p.name, p.nickname, p.description, p.access, (DateTime)p.defaultValue);
                    }
                    else if (p.dataType == typeof(Param_Transform))
                    {
                        pManager.AddTransformParameter(p.name, p.nickname, p.description, p.access);
                    }

                    else
                    {
                        this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Cannot register parameter of type " + p.dataType);
                    }
                }
                catch
                {
                    this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, $"Something went wrong registering input parameter {p.dataType} with value {p.defaultValue}");
                }
            }

            // If this last input is optional, flag it
            if (p.optional)
            {
                pManager[index].Optional = true;
            }
        }
Esempio n. 30
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "S", "", GH_ParamAccess.item);
     pManager.AddPointParameter("Parameter Point", "uv", "", GH_ParamAccess.item);
 }
Esempio n. 31
0
 protected override void RegisterInputParams(GH_InputParamManager pManager)
 {
     pManager.AddSurfaceParameter("Surface", "Surface", "Surface.", GH_ParamAccess.item);
     pManager.AddGenericParameter("Straight", "Straight", "Straight reinforcement layout.", GH_ParamAccess.item);
     pManager.AddGenericParameter("Wire", "Wire", "Wire.", GH_ParamAccess.item);
 }