Beispiel #1
0
        public Room(Polygon @perimeter, Vector3 @direction, string @suite_Name, string @suite_Number, string @department, string @number, double @design_Area, double @design_Ratio, double @rotation, double @elevation, double @height, double @area, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
            : base(transform, material, representation, isElementDefinition, id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <Room>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @direction, @suite_Name, @suite_Number, @department, @number, @design_Area, @design_Ratio, @rotation, @elevation, @height, @area, @transform, @material, @representation, @isElementDefinition, @id, @name });
            }

            this.Perimeter    = @perimeter;
            this.Direction    = @direction;
            this.Suite_Name   = @suite_Name;
            this.Suite_Number = @suite_Number;
            this.Department   = @department;
            this.Number       = @number;
            this.Design_Area  = @design_Area;
            this.Design_Ratio = @design_Ratio;
            this.Rotation     = @rotation;
            this.Elevation    = @elevation;
            this.Height       = @height;
            this.Area         = @area;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #2
0
 public ProceduralMassGenInputs(Elements.Geometry.Polygon perimeter, double minBuildHeight, double maxBuildHeight, double startParam, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) : base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
 {
     this.Perimeter      = perimeter;
     this.MinBuildHeight = minBuildHeight;
     this.MaxBuildHeight = maxBuildHeight;
     this.StartParam     = startParam;
 }
Beispiel #3
0
 public LevelPerimeter(double @area, double @elevation, Polygon @perimeter, System.Guid @id = default, string @name = null)
     : base(id, name)
 {
     this.Area      = @area;
     this.Elevation = @elevation;
     this.Perimeter = @perimeter;
 }
Beispiel #4
0
        public Roof(Mesh @envelope, Mesh @topside, Mesh @underside, Polygon @perimeter, double @elevation, double @highpoint, double @thickness, double @area, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
            : base(transform, material, representation, isElementDefinition, id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <Roof>
                                ();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @envelope, @topside, @underside, @perimeter, @elevation, @highpoint, @thickness, @area, @transform, @material, @representation, @isElementDefinition, @id, @name });
            }

            this.Envelope  = @envelope;
            this.Topside   = @topside;
            this.Underside = @underside;
            this.Perimeter = @perimeter;
            this.Elevation = @elevation;
            this.Highpoint = @highpoint;
            this.Thickness = @thickness;
            this.Area      = @area;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
 public EnvelopeBySketchInputs(Elements.Geometry.Polygon perimeter, double buildingheight, double setbackinterval, double setbackdepth, double minimumtierarea, double foundationdepth, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) : base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
 {
     this.Perimeter       = perimeter;
     this.BuildingHeight  = buildingheight;
     this.SetbackInterval = setbackinterval;
     this.SetbackDepth    = setbackdepth;
     this.MinimumTierArea = minimumtierarea;
     this.FoundationDepth = foundationdepth;
 }
        public override void UpdateRepresentations()
        {
            var polygon = new Polygon(this.viz.Vertices);
            var lamina  = new Lamina(polygon);
            // TODO: make more robust. This is currently frail to assume origin is center of view cone.
            var circle = new Lamina(new Circle(this.viz.Vertices[1], 1).ToPolygon());

            this.Representation = new Representation(new List <SolidOperation> {
                lamina, circle
            });
        }
Beispiel #7
0
        public Site(Polygon @perimeter, Transform @transform, Material @material, Representation @representation, System.Guid @id, string @name)
            : base(transform, material, representation, id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <Site>();

            if (validator != null)
            {
                validator.Validate(new object[] { @perimeter, @transform, @material, @representation, @id, @name });
            }

            this.Perimeter = @perimeter;
        }
Beispiel #8
0
        public void SubtractWithProblematicPolygons()
        {
            var wallPerimeter = new Elements.Geometry.Polygon(new Vector3(-48.41, 0, 0), new Vector3(-48.53, 0, 0), new Vector3(-51.48, 0, 0), new Vector3(-51.48, 0, 3.81), new Vector3(-46.27, 0, 3.81));
            var wall          = new WallByProfile(wallPerimeter,
                                                  0.2, new Line(new Vector3(0, 0, 0), new Vector3(1, 0, 0)));
            var oP = new Elements.Geometry.Polygon(new Vector3(-46.27, 0, 0.00), new Vector3(-46.42, 0, 0.00), new Vector3(-46.42, 0, 2.13), new Vector3(-47.34, 0, 2.13), new Vector3(-47.34, 0, 0.00));

            wall.AddOpening(oP);

            wall.UpdateRepresentations();
            var solid = wall.GetFinalCsgFromSolids();
        }
Beispiel #9
0
        public LevelPerimeter(double @elevation, Polygon @perimeter, System.Guid @id, string @name)
            : base(id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <LevelPerimeter>();

            if (validator != null)
            {
                validator.Validate(new object[] { @elevation, @perimeter, @id, @name });
            }

            this.Elevation = @elevation;
            this.Perimeter = @perimeter;
        }
Beispiel #10
0
        public EnvelopeFootprintValue(Polygon @perimeter)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <EnvelopeFootprintValue>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter });
            }

            this.Perimeter = @perimeter;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #11
0
        public GridExtentsValue(Polygon @extents)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <GridExtentsValue>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @extents });
            }

            this.Extents = @extents;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #12
0
        public SiteBySketchInputs(Polygon @perimeter, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) :
            base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <SiteBySketchInputs>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter });
            }

            this.Perimeter = @perimeter;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #13
0
        public Lamina(Polygon @perimeter, bool @isVoid)
            : base(isVoid)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <Lamina>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @isVoid });
            }

            this.Perimeter = @perimeter;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #14
0
        public PolygonReference(Polygon @boundary, System.Guid @id, string @name)
            : base(id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <PolygonReference>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @boundary, @id, @name });
            }

            this.Boundary = @boundary;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #15
0
        public Profile(Polygon @perimeter, IList <Polygon> @voids, System.Guid @id, string @name)
            : base(id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <Profile>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @voids, @id, @name });
            }

            this.Perimeter = @perimeter;
            this.Voids     = @voids;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #16
0
        public Site(Polygon @perimeter, double @area, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
            : base(transform, material, representation, isElementDefinition, id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <Site>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @area, @transform, @material, @representation, @isElementDefinition, @id, @name });
            }

            this.Perimeter = @perimeter;
            this.Area      = @area;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #17
0
        public SpaceSubdivide2Inputs(IList <Polyline> @centerLines, Polygon @sketch, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) :
            base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <SpaceSubdivide2Inputs>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @centerLines, @sketch });
            }

            this.CenterLines = @centerLines;
            this.Sketch      = @sketch;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #18
0
        /// <summary>
        /// Convert the coordinate array to a collection of polylines.
        /// The last position of the polygon is dropped.
        /// </summary>
        /// <returns></returns>
        public Elements.Geometry.Polygon[] ToPolygons()
        {
            var plineArr = new Elements.Geometry.Polygon[Coordinates.Length];

            for (var i = 0; i < plineArr.Length; i++)
            {
                var coords = this.Coordinates[i];
                var verts  = new Vector3[coords.Length - 1];
                // Drop the last position.
                for (var j = 0; j < coords.Length - 1; j++)
                {
                    verts[j] = coords[j].ToVectorMeters();
                }
                var pline = new Elements.Geometry.Polygon(verts);
                plineArr[i] = pline;
            }
            return(plineArr);
        }
Beispiel #19
0
        public Exclusion(Polygon @perimeter, double @elevation, System.Guid @id, string @name)
            : base(id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <Exclusion>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @elevation, @id, @name });
            }

            this.Perimeter = @perimeter;
            this.Elevation = @elevation;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
        public TestFunction2Inputs(double @length, double @width, Polygon @outline, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) :
            base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <TestFunction2Inputs>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @length, @width, @outline });
            }

            this.Length  = @length;
            this.Width   = @width;
            this.Outline = @outline;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
        public LevelPerimeter(double @area, double @elevation, Polygon @perimeter, System.Guid @id, string @name)
            : base(id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <LevelPerimeter>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @area, @elevation, @perimeter, @id, @name });
            }

            this.Area      = @area;
            this.Elevation = @elevation;
            this.Perimeter = @perimeter;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
        public ZoningDistrict(string @zone_Name, Polygon @boundary, double @latitude, double @longitude, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
            : base(transform, material, representation, isElementDefinition, id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <ZoningDistrict>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @zone_Name, @boundary, @latitude, @longitude, @transform, @material, @representation, @isElementDefinition, @id, @name });
            }

            this.Zone_Name = @zone_Name;
            this.Boundary  = @boundary;
            this.Latitude  = @latitude;
            this.Longitude = @longitude;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
        public CutAndFillInputs(Polygon @sitePerimeter, IList <Polygon> @perimeters, double @elevation, double @batterAngle, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) :
            base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <CutAndFillInputs>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @sitePerimeter, @perimeters, @elevation, @batterAngle });
            }

            this.SitePerimeter = @sitePerimeter;
            this.Perimeters    = @perimeters;
            this.Elevation     = @elevation;
            this.BatterAngle   = @batterAngle;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
Beispiel #24
0
        public StairEnclosure(Polygon @perimeter, Vector3 @direction, double @rotation, double @elevation, double @height, double @area, string @number, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
            : base(transform, material, representation, isElementDefinition, id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <StairEnclosure>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @direction, @rotation, @elevation, @height, @area, @number, @transform, @material, @representation, @isElementDefinition, @id, @name });
            }

            this.Perimeter = @perimeter;
            this.Direction = @direction;
            this.Rotation  = @rotation;
            this.Elevation = @elevation;
            this.Height    = @height;
            this.Area      = @area;
            this.Number    = @number;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
        public EnvelopeBySketchInputs(Polygon @perimeter, double @buildingHeight, double @foundationDepth, bool @useSetbacks, double @setbackInterval, double @setbackDepth, double @minimumTierArea, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) :
            base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <EnvelopeBySketchInputs>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @buildingHeight, @foundationDepth, @useSetbacks, @setbackInterval, @setbackDepth, @minimumTierArea });
            }

            this.Perimeter       = @perimeter;
            this.BuildingHeight  = @buildingHeight;
            this.FoundationDepth = @foundationDepth;
            this.UseSetbacks     = @useSetbacks;
            this.SetbackInterval = @setbackInterval;
            this.SetbackDepth    = @setbackDepth;
            this.MinimumTierArea = @minimumTierArea;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
        public MechanicalCorridor(Polygon @perimeter, Vector3 @direction, double @rotation, Vector3 @start, Vector3 @end, double @length, double @volume, string @number, Transform @transform, Material @material, Representation @representation, bool @isElementDefinition, System.Guid @id, string @name)
            : base(transform, material, representation, isElementDefinition, id, name)
        {
            var validator = Validator.Instance.GetFirstValidatorForType <MechanicalCorridor>();

            if (validator != null)
            {
                validator.PreConstruct(new object[] { @perimeter, @direction, @rotation, @start, @end, @length, @volume, @number, @transform, @material, @representation, @isElementDefinition, @id, @name });
            }

            this.Perimeter = @perimeter;
            this.Direction = @direction;
            this.Rotation  = @rotation;
            this.Start     = @start;
            this.End       = @end;
            this.Length    = @length;
            this.Volume    = @volume;
            this.Number    = @number;

            if (validator != null)
            {
                validator.PostConstruct(this);
            }
        }
 public LevelsFromGraphQLAndPerimeterInputs(InputData connection, Elements.Geometry.Polygon perimeter, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) : base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
 {
     this.Connection = connection;
     this.Perimeter  = perimeter;
 }
 /// <summary>
 /// Construct a LevelsFromGraphQLAndPerimeterInputs with default inputs.
 /// This should be used for testing only.
 /// </summary>
 public LevelsFromGraphQLAndPerimeterInputs() : base()
 {
     this.Connection = new InputData("default_input.json");
     this.Perimeter  = Elements.Geometry.Polygon.Rectangle(1, 1);
 }
 public Site(Polygon @perimeter, double @area, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
     : base(transform, material, representation, isElementDefinition, id, name)
 {
     this.Perimeter = @perimeter;
     this.Area      = @area;
 }
 public LevelBySketchInputs(Elements.Geometry.Polygon perimeter, double levelElevation, string bucketName, string uploadsBucket, Dictionary <string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey) : base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
 {
     this.Perimeter      = perimeter;
     this.LevelElevation = levelElevation;
 }