Ejemplo n.º 1
0
        public IIfcElement CreateExtrusion(
            ref List <IIfcProduct> elements,
            List <Point> points,
            List <double> chamfers,
            double height,
            Guid guid)
        {
            IfcAxis2Placement          plateLocation          = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirZ, this.DirY));
            IIfcAxis2Placement3D       axis2Placement3D       = IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(0.0, 0.0, 0.0), IfcTools.CreateDirection(0.0, 1.0, 0.0), IfcTools.CreateDirection(0.0, 0.0, 1.0));
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)IfcTools.CreateExtrudedAreaSolid((IIfcProfileDef)IfcTools.CreateArbitraryClosedProfileDef(IfcProfileTypeEnum.IFC_AREA, (IIfcCurve)IfcTools.CreateChamferedCurvedPolyline(points, chamfers)), axis2Placement3D, IfcTools.CreateDirection(0.0, 0.0, 1.0), (IfcPositiveLengthMeasure)height), "Body", "SweptSolid")
            });
            IIfcPlate plate = IfcTools.CreatePlate(plateLocation, (IIfcProductRepresentation)productDefinitionShape, guid);

            IfcTools.AddQuantities((IIfcObject)plate);
            IfcTools.AddColorToElement((IIfcElement)plate, "brown");
            IfcTools.AddMaterialToElement(new List <IIfcRoot>()
            {
                (IIfcRoot)plate
            }, "Undefined");
            if (!string.IsNullOrEmpty(this.Reference))
            {
                Dictionary <string, object> attributes = new Dictionary <string, object>()
                {
                    {
                        "PDMS_ID",
                        (object)(IfcLabel)this.Reference
                    }
                };
                IfcTools.AddProperties((IIfcObject)plate, "PDMS Common", attributes);
            }
            elements.Add((IIfcProduct)plate);
            return((IIfcElement)plate);
        }
Ejemplo n.º 2
0
 public IfcLocalPlacement(IfcAxis2Placement relativePlacement)
     : this()
 {
     if (relativePlacement == null)
         throw new ArgumentNullException("relativePlacement argument can not be null");
     _relativePlacement = relativePlacement;
 }
Ejemplo n.º 3
0
        public IIfcElement CreateCylinder(
            ref List <IIfcProduct> elements,
            double height,
            double radius,
            Guid guid)
        {
            IfcAxis2Placement          beamLocation           = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirZ, this.DirY));
            IIfcAxis2Placement2D       axis2Placement2D       = IfcTools.CreateAxis2Placement2D(IfcTools.CreatePoint(0.0, 0.0), IfcTools.CreateDirection(1.0, 0.0));
            IIfcAxis2Placement3D       axis2Placement3D       = IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(0.0, 0.0, -height / 2.0), IfcTools.CreateDirection(0.0, 0.0, 1.0), IfcTools.CreateDirection(0.0, -1.0, 0.0));
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)IfcTools.CreateExtrudedAreaSolid((IIfcProfileDef)IfcTools.IfcDatabase.CreateIfcCircleProfileDef(new IfcProfileTypeEnum?(IfcProfileTypeEnum.IFC_AREA), (IfcLabel)string.Empty, axis2Placement2D, (IfcPositiveLengthMeasure)radius), axis2Placement3D, IfcTools.CreateDirection(0.0, 0.0, 1.0), (IfcPositiveLengthMeasure)height), "Body", "SweptSolid")
            });
            IIfcBeam beam = IfcTools.CreateBeam(beamLocation, (IIfcProductRepresentation)productDefinitionShape, guid);

            IfcTools.AddQuantities((IIfcObject)beam);
            IfcTools.AddColorToElement((IIfcElement)beam, "yellow");
            IfcTools.AddMaterialToElement(new List <IIfcRoot>()
            {
                (IIfcRoot)beam
            }, "Undefined");
            if (!string.IsNullOrEmpty(this.Reference))
            {
                Dictionary <string, object> attributes = new Dictionary <string, object>()
                {
                    {
                        "PDMS_ID",
                        (object)(IfcLabel)this.Reference
                    }
                };
                IfcTools.AddProperties((IIfcObject)beam, "PDMS Common", attributes);
            }
            elements.Add((IIfcProduct)beam);
            return((IIfcElement)beam);
        }
Ejemplo n.º 4
0
        internal override void CopyValues(IfcObjectPlacement value)
        {
            IfcLocalPlacement lp = value as IfcLocalPlacement;

            PlacementRelTo    = lp.PlacementRelTo;
            RelativePlacement = lp.RelativePlacement;
        }
Ejemplo n.º 5
0
 private static bool?NullableIfcCorrectLocalPlacement(IfcAxis2Placement AxisPlacement, IfcObjectPlacement RelPlacement)
 {
     if (EXISTS(RelPlacement))
     {
         if (RelPlacement is IfcGridPlacement)
         {
             return(null);
         }
         if (RelPlacement is IfcLocalPlacement)
         {
             if (AxisPlacement is IfcAxis2Placement2D)
             {
                 return(true);
             }
             if (AxisPlacement is IfcAxis2Placement3D)
             {
                 if ((RelPlacement as IfcLocalPlacement).RelativePlacement.Dim == 3)
                 {
                     return(true);
                 }
                 else
                 {
                     return(false);
                 }
             }
         }
     }
     else
     {
         return(true);
     }
     return(null);
 }
Ejemplo n.º 6
0
 private static bool?NullableIfcCorrectLocalPlacement(IfcAxis2Placement AxisPlacement, IfcObjectPlacement RelPlacement)
 {
     if ((EXISTS(RelPlacement)))
     {
         if (((INTYPEOF(RelPlacement, "IFC4.IFCGRIDPLACEMENT"))))
         {
             return(null);
         }
         if (((INTYPEOF(RelPlacement, "IFC4.IFCLOCALPLACEMENT"))))
         {
             if (((INTYPEOF(AxisPlacement, "IFC4.IFCAXIS2PLACEMENT2D"))))
             {
                 return(true);
             }
             if (((INTYPEOF(AxisPlacement, "IFC4.IFCAXIS2PLACEMENT3D"))))
             {
                 if (((RelPlacement as IfcLocalPlacement).RelativePlacement.Dim == 3))
                 {
                     return(true);
                 }
                 else
                 {
                     return(false);
                 }
             }
         }
     }
     else
     {
         return(true);
     }
     return(null);
 }
Ejemplo n.º 7
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.IfcParse(propIndex, value);
                break;

            case 2:
                _coordinateSpaceDimension = (sbyte)value.IntegerVal;
                break;

            case 3:
                _precision = value.RealVal;
                break;

            case 4:
                _worldCoordinateSystem = (IfcAxis2Placement)value.EntityVal;
                break;

            case 5:
                _trueNorth = (IfcDirection)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 8
0
 public IfcLocalPlacement(IfcObjectPlacement relativeTo, IfcAxis2Placement placement) : this(placement)
 {
     if (relativeTo != null)
     {
         PlacementRelTo = relativeTo;
     }
 }
Ejemplo n.º 9
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 2:
                _coordinateSpaceDimension = value.IntegerVal;
                return;

            case 3:
                _precision = value.RealVal;
                return;

            case 4:
                _worldCoordinateSystem = (IfcAxis2Placement)(value.EntityVal);
                return;

            case 5:
                _trueNorth = (IfcDirection)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 10
0
 public IfcRepresentationMap(IfcAxis2Placement __MappingOrigin, IfcRepresentation __MappedRepresentation)
 {
     this.MappingOrigin        = __MappingOrigin;
     this.MappedRepresentation = __MappedRepresentation;
     this.HasShapeAspects      = new HashSet <IfcShapeAspect>();
     this.MapUsage             = new HashSet <IfcMappedItem>();
 }
Ejemplo n.º 11
0
 public IfcLocalPlacement(IfcAxis2Placement relativePlacement, IfcObjectPlacement placementRelTo)
     : this()
 {
     if (relativePlacement == null)
         throw new ArgumentNullException("relativePlacement argument can not be null");
     _relativePlacement = relativePlacement;
     _placementRelTo = placementRelTo;
 }
 public IfcGeometricRepresentationContext(IfcLabel?__ContextIdentifier, IfcLabel?__ContextType, IfcDimensionCount __CoordinateSpaceDimension, IfcReal?__Precision, IfcAxis2Placement __WorldCoordinateSystem, IfcDirection __TrueNorth)
     : base(__ContextIdentifier, __ContextType)
 {
     this._CoordinateSpaceDimension = __CoordinateSpaceDimension;
     this._Precision             = __Precision;
     this._WorldCoordinateSystem = __WorldCoordinateSystem;
     this._TrueNorth             = __TrueNorth;
 }
Ejemplo n.º 13
0
 internal IfcLocalPlacement(DatabaseIfc db, IfcLocalPlacement p) : base(db, p)
 {
     if (p.mPlacementRelTo > 0)
     {
         PlacementRelTo = db.Factory.Duplicate(p.PlacementRelTo) as IfcObjectPlacement;
     }
     RelativePlacement = db.Factory.Duplicate(p.mDatabase[p.mRelativePlacement]) as IfcAxis2Placement;
 }
Ejemplo n.º 14
0
 public IfcLocalPlacement(IfcObjectPlacement relativeTo, IfcAxis2Placement placement) : this(placement)
 {
     if (relativeTo != null)
     {
         mPlacementRelTo = relativeTo.mIndex;
         relativeTo.mReferencedByPlacements.Add(this);
     }
 }
Ejemplo n.º 15
0
 public IfcLocalPlacement(IfcAxis2Placement relativePlacement)
     : this()
 {
     if (relativePlacement == null)
     {
         throw new ArgumentNullException("relativePlacement argument can not be null");
     }
     _relativePlacement = relativePlacement;
 }
 static public IfcCircle Create(this IfcCircle c, IfcAxis2Placement position, double radius)
 {
     IfcCircle circle = new IfcCircle()
     {
         Position = position,
         Radius = radius
     };
     return circle;
 }
Ejemplo n.º 17
0
        public IIfcElement CreatePyramid(
            ref List <IIfcProduct> elements,
            double height,
            double botX,
            double botY,
            double topX,
            double topY,
            double deltaX,
            double deltaY,
            Guid guid)
        {
            List <IIfcCompositeCurveSegment> Segments         = new List <IIfcCompositeCurveSegment>();
            IfcAxis2Placement           beamLocation          = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirZ, this.DirX));
            IIfcAxis2Placement2D        axis2Placement2D      = IfcTools.CreateAxis2Placement2D(IfcTools.CreatePoint(0.0, 0.0), IfcTools.CreateDirection(1.0, 0.0));
            List <IIfcAxis2Placement3D> CrossSectionPositions = new List <IIfcAxis2Placement3D>()
            {
                IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(-deltaX / 2.0, -deltaY / 2.0, -height / 2.0), IfcTools.CreateDirection(0.0, 0.0, 1.0), IfcTools.CreateDirection(1.0, 0.0, 0.0)),
                IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(deltaX / 2.0, deltaY / 2.0, height / 2.0), IfcTools.CreateDirection(0.0, 0.0, 1.0), IfcTools.CreateDirection(1.0, 0.0, 0.0))
            };
            List <IIfcProfileDef> CrossSections = new List <IIfcProfileDef>()
            {
                (IIfcProfileDef)IfcTools.IfcDatabase.CreateIfcRectangleProfileDef(new IfcProfileTypeEnum?(IfcProfileTypeEnum.IFC_AREA), (IfcLabel)string.Empty, axis2Placement2D, (IfcPositiveLengthMeasure)botX, (IfcPositiveLengthMeasure)botY),
                (IIfcProfileDef)IfcTools.IfcDatabase.CreateIfcRectangleProfileDef(new IfcProfileTypeEnum?(IfcProfileTypeEnum.IFC_AREA), (IfcLabel)string.Empty, axis2Placement2D, (IfcPositiveLengthMeasure)topX, (IfcPositiveLengthMeasure)topY)
            };
            IIfcCompositeCurveSegment compositeCurveSegment = IfcTools.IfcDatabase.CreateIfcCompositeCurveSegment(new IfcTransitionCode?(IfcTransitionCode.IFC_CONTINUOUS), new bool?(true), (IIfcCurve)IfcTools.IfcDatabase.CreateIfcPolyline(new List <IIfcCartesianPoint>()
            {
                IfcTools.CreatePoint(-deltaX / 2.0, -deltaY / 2.0, -height / 2.0),
                IfcTools.CreatePoint(deltaX / 2.0, deltaY / 2.0, height / 2.0)
            }));

            Segments.Add(compositeCurveSegment);
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)IfcTools.IfcDatabase.CreateIfcSectionedSpine(IfcTools.IfcDatabase.CreateIfcCompositeCurve(Segments, new LogicalEnum?(LogicalEnum.IFC_FALSE)), CrossSections, CrossSectionPositions), "Body", "SectionedSpine")
            });
            IIfcBeam beam = IfcTools.CreateBeam(beamLocation, (IIfcProductRepresentation)productDefinitionShape, guid);

            IfcTools.AddQuantities((IIfcObject)beam);
            IfcTools.AddColorToElement((IIfcElement)beam, "green");
            IfcTools.AddMaterialToElement(new List <IIfcRoot>()
            {
                (IIfcRoot)beam
            }, "Undefined");
            if (!string.IsNullOrEmpty(this.Reference))
            {
                Dictionary <string, object> attributes = new Dictionary <string, object>()
                {
                    {
                        "PDMS_ID",
                        (object)(IfcLabel)this.Reference
                    }
                };
                IfcTools.AddProperties((IIfcObject)beam, "PDMS Common", attributes);
            }
            elements.Add((IIfcProduct)beam);
            return((IIfcElement)beam);
        }
Ejemplo n.º 18
0
 public IfcLocalPlacement(IfcAxis2Placement relativePlacement, IfcObjectPlacement placementRelTo)
     : this()
 {
     if (relativePlacement == null)
     {
         throw new ArgumentNullException("relativePlacement argument can not be null");
     }
     _relativePlacement = relativePlacement;
     _placementRelTo    = placementRelTo;
 }
Ejemplo n.º 19
0
        internal static bool IfcCorrectLocalPlacement(IfcAxis2Placement relativePlacement, IfcObjectPlacement placementRelTo)
        {
            var val = NullableIfcCorrectLocalPlacement(relativePlacement, placementRelTo);

            if (!val.HasValue)
            {
                throw new ArgumentException("Undetermined value in where clause.");
            }
            return(val.Value);
        }
Ejemplo n.º 20
0
        internal void initGeom()
        {
            IfcCartesianPoint point     = Origin;
            IfcDirection      direction = XAxis;

            direction = YAxis;
            direction = ZAxis;
            IfcAxis2Placement   pl        = this.WorldCoordinatePlacement;
            IfcAxis2Placement2D placement = Origin2dPlace;
        }
Ejemplo n.º 21
0
        static public IfcCircle Create(this IfcCircle circle, IfcAxis2Placement position, double radius)
        {
            var model = circle.Model;

            return(model.Instances.New <IfcCircle>(c =>
            {
                c.Position = position;
                c.Radius = radius;
            }));
        }
        static public IfcCircle Create(this IfcCircle c, IfcAxis2Placement position, double radius)
        {
            IfcCircle circle = new IfcCircle()
            {
                Position = position,
                Radius   = radius
            };

            return(circle);
        }
Ejemplo n.º 23
0
        public static XbimMatrix3D ToMatrix3D(this IfcAxis2Placement placement)
        {
            var ax3 = placement as IfcAxis2Placement3D;
            var ax2 = placement as IfcAxis2Placement2D;

            if (ax3 != null)
            {
                return(ax3.ToMatrix3D());
            }
            return(ax2 != null?ax2.ToMatrix3D() : XbimMatrix3D.Identity);
        }
Ejemplo n.º 24
0
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _position = (IfcAxis2Placement) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Ejemplo n.º 25
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _position = (IfcAxis2Placement)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 26
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _position = (IfcAxis2Placement)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Ejemplo n.º 27
0
        public IIfcBeam CreateStraight(
            ref List <IIfcProduct> elements,
            IIfcProfileDef profile,
            double length,
            Guid guid)
        {
            IfcAxis2Placement          beamLocation           = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirZ, this.DirX));
            IIfcAxis2Placement3D       axis2Placement3D       = IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(0.0, 0.0, 0.0), IfcTools.CreateDirection(0.0, 0.0, 1.0), IfcTools.CreateDirection(1.0, 0.0, 0.0));
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)IfcTools.CreateExtrudedAreaSolid(profile, axis2Placement3D, IfcTools.CreateDirection(0.0, 0.0, 1.0), (IfcPositiveLengthMeasure)length), "Body", "SweptSolid")
            });

            return(IfcTools.CreateBeam(beamLocation, (IIfcProductRepresentation)productDefinitionShape, guid));
        }
Ejemplo n.º 28
0
        public IIfcBeam CreateCurve(
            ref List <IIfcProduct> elements,
            IIfcProfileDef profile,
            double radius,
            double angle,
            Guid guid)
        {
            IfcAxis2Placement          beamLocation           = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirX, this.DirZ));
            IIfcAxis2Placement3D       axis2Placement3D       = IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(0.0, 0.0, 0.0), IfcTools.CreateDirection(1.0, 0.0, 0.0), IfcTools.CreateDirection(0.0, 1.0, 0.0));
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)IfcTools.CreateCurvedBeam(profile, axis2Placement3D, IfcTools.IfcDatabase.CreateIfcAxis1Placement(IfcTools.CreatePoint(0.0, 0.0, 0.0), IfcTools.CreateDirection(1.0, 0.0, 0.0)), (IfcPlaneAngleMeasure)angle), "Body", "SweptSolid")
            });

            return(IfcTools.CreateBeam(beamLocation, (IIfcProductRepresentation)productDefinitionShape, guid));
        }
Ejemplo n.º 29
0
        public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _mappingOrigin = (IfcAxis2Placement)value.EntityVal;
                break;

            case 1:
                _mappedRepresentation = (IfcRepresentation)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 30
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _placementRelTo = (IfcObjectPlacement)value.EntityVal;
                break;

            case 1:
                _relativePlacement = (IfcAxis2Placement)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Ejemplo n.º 31
0
        public static XbimMatrix3D ToMatrix3D(this IfcAxis2Placement placement)
        {
            IfcAxis2Placement3D ax3 = placement as IfcAxis2Placement3D;
            IfcAxis2Placement2D ax2 = placement as IfcAxis2Placement2D;

            if (ax3 != null)
            {
                return(ax3.ToMatrix3D());
            }
            else if (ax2 != null)
            {
                return(ax2.ToMatrix3D());
            }
            else
            {
                return(XbimMatrix3D.Identity);
            }
        }
Ejemplo n.º 32
0
        public IIfcElement CreateSlopedCylinder(
            ref List <IIfcProduct> elements,
            double height,
            double radius,
            double botX,
            double botY,
            double topX,
            double topY,
            Guid guid)
        {
            double                     num1                   = Math.Max(radius * Math.Tan(Math.Abs(botX * Math.PI / 180.0)), radius * Math.Tan(Math.Abs(botY * Math.PI / 180.0)));
            double                     num2                   = Math.Max(radius * Math.Tan(Math.Abs(topX * Math.PI / 180.0)), radius * Math.Tan(Math.Abs(topY * Math.PI / 180.0)));
            IfcAxis2Placement          beamLocation           = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirZ, this.DirY));
            IIfcAxis2Placement2D       axis2Placement2D       = IfcTools.CreateAxis2Placement2D(IfcTools.CreatePoint(0.0, 0.0), IfcTools.CreateDirection(1.0, 0.0));
            IIfcAxis2Placement3D       axis2Placement3D       = IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(0.0, 0.0, -height / 2.0 - num1), IfcTools.CreateDirection(0.0, 0.0, 1.0), IfcTools.CreateDirection(1.0, 0.0, 0.0));
            IIfcExtrudedAreaSolid      extrudedAreaSolid      = IfcTools.CreateExtrudedAreaSolid((IIfcProfileDef)IfcTools.IfcDatabase.CreateIfcCircleProfileDef(new IfcProfileTypeEnum?(IfcProfileTypeEnum.IFC_AREA), (IfcLabel)string.Empty, axis2Placement2D, (IfcPositiveLengthMeasure)radius), axis2Placement3D, IfcTools.CreateDirection(0.0, 0.0, 1.0), (IfcPositiveLengthMeasure)(height + num1 + num2));
            IIfcBooleanClippingResult  booleanClippingResult1 = (IIfcBooleanClippingResult)null;
            IIfcBooleanClippingResult  booleanClippingResult2 = (IIfcBooleanClippingResult)null;
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                booleanClippingResult2 == null ? (booleanClippingResult1 == null ? IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)extrudedAreaSolid, "Body", "SweptSolid") : IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)booleanClippingResult1, "Body", "Clipping")) : IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)booleanClippingResult2, "Body", "Clipping")
            });
            IIfcBeam beam = IfcTools.CreateBeam(beamLocation, (IIfcProductRepresentation)productDefinitionShape, guid);

            IfcTools.AddQuantities((IIfcObject)beam);
            IfcTools.AddColorToElement((IIfcElement)beam, "green");
            IfcTools.AddMaterialToElement(new List <IIfcRoot>()
            {
                (IIfcRoot)beam
            }, "Undefined");
            if (!string.IsNullOrEmpty(this.Reference))
            {
                Dictionary <string, object> attributes = new Dictionary <string, object>()
                {
                    {
                        "PDMS_ID",
                        (object)(IfcLabel)this.Reference
                    }
                };
                IfcTools.AddProperties((IIfcObject)beam, "PDMS Common", attributes);
            }
            elements.Add((IIfcProduct)beam);
            return((IIfcElement)beam);
        }
Ejemplo n.º 33
0
        public IIfcElement CreatePolyHedron(
            ref List <IIfcProduct> elements,
            List <List <Point> > faces,
            Guid guid)
        {
            List <IIfcFace>   CfsFaces     = new List <IIfcFace>();
            IfcAxis2Placement beamLocation = new IfcAxis2Placement(IfcTools.CreateAxis2Placement3D(IfcTools.CreatePoint(this.Position.get_X(), this.Position.get_Y(), this.Position.get_Z()), this.DirZ, this.DirX));

            foreach (List <Point> face in faces)
            {
                face.Reverse();
                List <IIfcCartesianPoint> Polygon = new List <IIfcCartesianPoint>();
                foreach (Point point in face)
                {
                    Polygon.Insert(0, IfcTools.CreatePoint(point.X, point.Y, point.Z));
                }
                CfsFaces.Add(IfcTools.CreatePolygon((IIfcFaceBound)IfcTools.IfcDatabase.CreateIfcFaceOuterBound((IIfcLoop)IfcTools.IfcDatabase.CreateIfcPolyLoop(Polygon), new bool?(true))));
            }
            IIfcProductDefinitionShape productDefinitionShape = IfcTools.IfcDatabase.CreateIfcProductDefinitionShape((IfcLabel)null, (IfcText)null, new List <IIfcRepresentation>()
            {
                IfcTools.CreateShapeRepresentation((IIfcRepresentationItem)IfcTools.IfcDatabase.CreateIfcFacetedBrep(IfcTools.IfcDatabase.CreateIfcClosedShell(CfsFaces)), "Body", "Brep")
            });
            IIfcBeam beam = IfcTools.CreateBeam(beamLocation, (IIfcProductRepresentation)productDefinitionShape, guid);

            IfcTools.AddQuantities((IIfcObject)beam);
            IfcTools.AddColorToElement((IIfcElement)beam, "green");
            IfcTools.AddMaterialToElement(new List <IIfcRoot>()
            {
                (IIfcRoot)beam
            }, "Undefined");
            if (!string.IsNullOrEmpty(this.Reference))
            {
                Dictionary <string, object> attributes = new Dictionary <string, object>()
                {
                    {
                        "PDMS_ID",
                        (object)(IfcLabel)this.Reference
                    }
                };
                IfcTools.AddProperties((IIfcObject)beam, "PDMS Common", attributes);
            }
            elements.Add((IIfcProduct)beam);
            return((IIfcElement)beam);
        }
Ejemplo n.º 34
0
 private static Transform ToTransform(this IfcAxis2Placement placement)
 {
     // SELECT IfcAxis2Placement3d, IfcAxis2Placement2d
     if (placement.Choice.GetType() == typeof(IfcAxis2Placement2D))
     {
         var cs = (IfcAxis2Placement2D)placement.Choice;
         return(cs.ToTransform());
     }
     else if (placement.Choice.GetType() == typeof(IfcAxis2Placement3D))
     {
         var cs = (IfcAxis2Placement3D)placement.Choice;
         var t  = cs.ToTransform();
         return(t);
     }
     else
     {
         throw new Exception($"The specified placement of type, {placement.GetType().ToString()}, cannot be converted to a Transform.");
     }
 }
Ejemplo n.º 35
0
		internal IfcCircle(IfcAxis2Placement ap, double radius) : base(ap) { mRadius = radius; }
Ejemplo n.º 36
0
        private int mRelativePlacement; // : IfcAxis2Placement;

        #endregion Fields

        #region Constructors

        public IfcLocalPlacement(IfcAxis2Placement placement)
            : base(placement.Database)
        {
            RelativePlacement = placement;
        }
Ejemplo n.º 37
0
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _placementRelTo = (IfcObjectPlacement) value.EntityVal;
             break;
         case 1:
             _relativePlacement = (IfcAxis2Placement)value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Ejemplo n.º 38
0
 public IfcLocalPlacement(IfcObjectPlacement relativeTo, IfcAxis2Placement placement)
     : this(placement)
 {
     if (relativeTo != null)
     {
         mPlacementRelTo = relativeTo.mIndex;
         relativeTo.mReferencedByPlacements.Add(this);
     }
 }
Ejemplo n.º 39
0
 internal override void CopyValues(IfcObjectPlacement value)
 {
     IfcLocalPlacement lp = value as IfcLocalPlacement;
     PlacementRelTo = lp.PlacementRelTo;
     RelativePlacement = lp.RelativePlacement;
 }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _LocationAtRelatingElement = (IfcAxis2Placement)value.EntityVal;
             break;
         case 1:
             _LocationAtRelatedElement = (IfcAxis2Placement)value.EntityVal;
             break;
         case 2:
             _ProfileOfPort = (IfcProfileDef)value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Ejemplo n.º 41
0
		public IfcLocalPlacement(IfcObjectPlacement relativeTo, IfcAxis2Placement placement) : this(placement) { if(relativeTo != null) mPlacementRelTo = relativeTo.mIndex; }
Ejemplo n.º 42
0
        private IfcCoordinateOperation mHasCoordinateOperation = null; //IFC4

        #endregion Fields

        #region Constructors

        public IfcGeometricRepresentationContext(int coordinateSpaceDimension, IfcAxis2Placement worldCoordinateSystem)
            : base(worldCoordinateSystem.Database)
        {
            mCoordinateSpaceDimension = coordinateSpaceDimension; WorldCoordinateSystem = worldCoordinateSystem;
        }
Ejemplo n.º 43
0
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _literal = value.StringVal;
             break;
         case 1:
             _placement = (IfcAxis2Placement) value.EntityVal;
             break;
         case 2:
             _path = (IfcTextPath) Enum.Parse(typeof (IfcTextPath), value.EnumVal, true);
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Ejemplo n.º 44
0
		public IfcRepresentationMap(IfcAxis2Placement placement, IfcRepresentation representation) : base(representation.mDatabase) { mMappingOrigin = placement.Index; mMappedRepresentation = representation.mIndex; }
Ejemplo n.º 45
0
		internal IfcEllipse(IfcAxis2Placement pl, double axis1, double axis2) : base(pl) { mSemiAxis1 = axis1; mSemiAxis2 = axis2; }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
             base.IfcParse(propIndex, value);
             break;
         case 2:
             _coordinateSpaceDimension = (sbyte) value.IntegerVal;
             break;
         case 3:
             _precision = value.RealVal;
             break;
         case 4:
             _worldCoordinateSystem = (IfcAxis2Placement) value.EntityVal;
             break;
         case 5:
             _trueNorth = (IfcDirection) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Ejemplo n.º 47
0
		public IfcLocalPlacement(IfcAxis2Placement placement) : base(placement.Database, null) { mRelativePlacement = placement.Index; }
Ejemplo n.º 48
0
		protected IfcConic(IfcAxis2Placement ap) : base(ap.Database) { mPosition = ap.Index; }