コード例 #1
0
        private BbPiece(string name, string objectType, BbProfile profile,
                        double length, BbCoordinate3D position, BbDirection3D zAxis,
                        BbDirection3D xAxis, BbDirection3D extrudeDirection,
                        BbLocalPlacement3D hostPlacement, Type ifcEntityType)
        {
            Length  = length;
            Profile = profile;
            var pos = BbPosition3D.Create(position, zAxis, xAxis);

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostPlacement, pos);

            var semExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                extrudeDirection,
                Length);

            _ifcElement = Activator.CreateInstance(ifcEntityType) as IfcElement;
            if (_ifcElement == null)
            {
                return;
            }

            _ifcElement.GlobalId        = IfcGloballyUniqueId.ConvertToIfcGuid(Guid);
            _ifcElement.OwnerHistory    = BbHeaderSetting.Setting3D.IfcOwnerHistory;
            _ifcElement.Name            = name;
            _ifcElement.ObjectType      = objectType;
            _ifcElement.ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement;
            _ifcElement.Representation  = semExtrudedGeometry.IfcProductDefinitionShape;
            //_ifcElement.Tag = id;
        }
コード例 #2
0
        public BbExtrudedGeometry(
			BbProfile profile,
			BbPosition3D position3D,
			BbDirection3D direction3D,
			double depth
			)
        {
            _ifcExtrudedAreaSolid = new IfcExtrudedAreaSolid{
                SweptArea = profile.IfcProfileDef,
                Position = position3D.IfcAxis2Placement3D,
                ExtrudedDirection = direction3D.IfcDirection,
                Depth = depth,
            };

            _ifcShapeRepresentation = new IfcShapeRepresentation
            {
                ContextOfItems = BbHeaderSetting.Setting3D.GeometricRepresentationContext,
                RepresentationIdentifier = "Body",
                RepresentationType = "SweptSolid",
                Items = new List<IfcRepresentationItem>(),
            };
            _ifcShapeRepresentation.Items.Add(_ifcExtrudedAreaSolid);

            _ifcProductDefinitionShape = new IfcProductDefinitionShape
            {
                // Name=
                // Description =
                Representations = new List<IfcRepresentation>(),
            };
            _ifcProductDefinitionShape.Representations.Add(_ifcShapeRepresentation);
        }
コード例 #3
0
        //        ExtrudedElement(
        //            string name,
        //            Profile profile,
        //            double length,
        //            Coordinate3D position,
        //            Direction3D zAxis,
        //            Direction3D xAxis,
        //            Direction3D extrudeDirection,
        //            Element container)
        //            :this (name, profile, length, position, zAxis, xAxis, extrudeDirection,
        //                   container.ObjectLocalPlacement, container.IfcElement.OwnerHistory)
        //        {}
        //
        //        ExtrudedElement(
        //            string name,
        //            Profile profile,
        //            double length,
        //            Coordinate3D position,
        //            Direction3D zAxis,
        //            Direction3D xAxis,
        //            Direction3D extrudeDirection,
        //            SpatialElement container)
        //            :this (name, profile, length, position, zAxis, xAxis, extrudeDirection,
        //                   container.ObjectLocalPlacement, container.IfcSpatialStructureElement.OwnerHistory)
        //        {}
        BbExtrudedElement(
			string name,
			BbProfile profile,
			double length,
			BbCoordinate3D position,
			BbDirection3D zAxis,
			BbDirection3D xAxis,
			BbDirection3D extrudeDirection,
			BbLocalPlacement3D containerLocation,
			IfcOwnerHistory ownerHistory,
			Type ifcEntityType)
        {
            Name = name;
            Profile = profile;
            Length = length;
            BbPosition3D pos = BbPosition3D.Create(position, zAxis, xAxis);

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                containerLocation, pos	);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                Length);

            _ifcElement = Activator.CreateInstance(ifcEntityType) as IfcElement;
            _ifcElement.GlobalId = IfcGloballyUniqueId.NewGuid();
            _ifcElement.OwnerHistory = ownerHistory;
            _ifcElement.Name = Name;
                //ObjectType = ,
            _ifcElement.ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement;
            _ifcElement.Representation = bbExtrudedGeometry.IfcProductDefinitionShape;
        }
コード例 #4
0
        public static BbDerivedProfile Create(BbProfile parentProfile, double rotationAngle)
        {
            var derivedProfile = new BbDerivedProfile(parentProfile, rotationAngle);

            BbInstanceDB.AddToExport(derivedProfile);
            return(derivedProfile);
        }
コード例 #5
0
ファイル: BbMainPiece.cs プロジェクト: JackTing/ifctoolkit
        public static BbMainPiece Create(
            string id, string pieceName, BbProfile profile,
            double depth, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbAssembly container
        )
        {
            var trueZ = GetTrueZDirection(zAxis, container);

            BbMainPiece mainPart;
            if (IsColumn(trueZ))
            {
                mainPart = new BbMainPiece(
                id, pieceName, "Column", profile, depth, position, zAxis, xAxis,
                BbHeaderSetting.Setting3D.ZAxis, container, typeof(IfcColumn));
            }
            else if (IsBeam(trueZ))
            {
                mainPart = new BbMainPiece(
                id, pieceName, "Beam", profile, depth, position, zAxis, xAxis,
                BbHeaderSetting.Setting3D.ZAxis, container, typeof(IfcBeam));
            }
            else
            {
                mainPart = new BbMainPiece(
                id, pieceName, "Member", profile, depth, position, zAxis, xAxis,
                BbHeaderSetting.Setting3D.ZAxis, container, typeof(IfcMember));
            }

            //container.AddElement(mainPart);

            mainPart.AddToHostObject(container);
            BbInstanceDB.AddToExport(mainPart);
            return mainPart;
        }
コード例 #6
0
        public static BbDerivedProfile Create(BbProfile parentProfile, bool mirrorXAxis, bool mirrorYAxis)
        {
            var derivedProfile = new BbDerivedProfile(parentProfile, mirrorXAxis, mirrorYAxis);

            BbInstanceDB.AddToExport(derivedProfile);
            return(derivedProfile);
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlackBox.Aisc.EM11.DerivedProfile"/> class.
        /// </summary>
        /// <param name='parentProfile'>
        /// Parent profile.
        /// </param>
        /// <param name='mirrorXAxis'>
        /// If set to <c>true</c> mirror X axis.
        /// </param>
        /// <param name='mirrorYAxis'>
        /// If set to <c>true</c> mirror Y axis.
        /// </param>
        public BbDerivedProfile(BbProfile parentProfile, bool mirrorXAxis, bool mirrorYAxis)
            : this(parentProfile)
        {
            IfcDirection axis1 = null;
            IfcDirection axis2 = null;

            if (mirrorXAxis && mirrorYAxis)
            {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;
            }
            else if (mirrorXAxis && !mirrorYAxis)
            {
                axis1 = BbHeaderSetting.Setting3D.XAxis2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;
            }
            else if (!mirrorXAxis && mirrorYAxis)
            {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxis2D.IfcDirection;
            }


            var ifcCartesianTransformationOperator2D
                = new IfcCartesianTransformationOperator2D {
                Axis1       = axis1,
                Axis2       = axis2,
                LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
                Scale       = 1,
                };
            _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
        }
コード例 #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlackBox.Aisc.EM11.DerivedProfile"/> class.
        /// </summary>
        /// <param name='parentProfile'>
        /// Parent profile.
        /// </param>
        /// <param name='mirrorXAxis'>
        /// If set to <c>true</c> mirror X axis.
        /// </param>
        /// <param name='mirrorYAxis'>
        /// If set to <c>true</c> mirror Y axis.
        /// </param>
        public BbDerivedProfile(BbProfile parentProfile, bool mirrorXAxis, bool mirrorYAxis)
            : this(parentProfile)
        {
            IfcDirection axis1 = null;
            IfcDirection axis2 = null;

            if (mirrorXAxis && mirrorYAxis) {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;

            } else if (mirrorXAxis && !mirrorYAxis) {
                axis1 = BbHeaderSetting.Setting3D.XAxis2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;
            } else if (!mirrorXAxis && mirrorYAxis) {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxis2D.IfcDirection;
            }

            var ifcCartesianTransformationOperator2D
            = new IfcCartesianTransformationOperator2D{
                Axis1 = axis1,
                Axis2 = axis2,
                LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
                Scale = 1,
            };
            _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
        }
コード例 #9
0
        public BbExtrudedGeometry(
            BbProfile profile,
            BbPosition3D position3D,
            BbDirection3D direction3D,
            double depth
            )
        {
            _ifcExtrudedAreaSolid = new IfcExtrudedAreaSolid {
                SweptArea         = profile.IfcProfileDef,
                Position          = position3D.IfcAxis2Placement3D,
                ExtrudedDirection = direction3D.IfcDirection,
                Depth             = depth,
            };

            _ifcShapeRepresentation = new IfcShapeRepresentation
            {
                ContextOfItems           = BbHeaderSetting.Setting3D.GeometricRepresentationContext,
                RepresentationIdentifier = "Body",
                RepresentationType       = "SweptSolid",
                Items = new List <IfcRepresentationItem>(),
            };
            _ifcShapeRepresentation.Items.Add(_ifcExtrudedAreaSolid);

            _ifcProductDefinitionShape = new IfcProductDefinitionShape
            {
                // Name=
                // Description =
                Representations = new List <IfcRepresentation>(),
            };
            _ifcProductDefinitionShape.Representations.Add(_ifcShapeRepresentation);
        }
コード例 #10
0
//		ExtrudedElement(
//			string name,
//			Profile profile,
//			double length,
//			Coordinate3D position,
//			Direction3D zAxis,
//			Direction3D xAxis,
//			Direction3D extrudeDirection,
//			Element container)
//			:this (name, profile, length, position, zAxis, xAxis, extrudeDirection,
//			       container.ObjectLocalPlacement, container.IfcElement.OwnerHistory)
//		{}
//
//		ExtrudedElement(
//			string name,
//			Profile profile,
//			double length,
//			Coordinate3D position,
//			Direction3D zAxis,
//			Direction3D xAxis,
//			Direction3D extrudeDirection,
//			SpatialElement container)
//			:this (name, profile, length, position, zAxis, xAxis, extrudeDirection,
//			       container.ObjectLocalPlacement, container.IfcSpatialStructureElement.OwnerHistory)
//		{}

        BbExtrudedElement(
            string name,
            BbProfile profile,
            double length,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis,
            BbDirection3D extrudeDirection,
            BbLocalPlacement3D containerLocation,
            IfcOwnerHistory ownerHistory,
            Type ifcEntityType)
        {
            Name    = name;
            Profile = profile;
            Length  = length;
            BbPosition3D pos = BbPosition3D.Create(position, zAxis, xAxis);

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                containerLocation, pos);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                Length);

            _ifcElement              = Activator.CreateInstance(ifcEntityType) as IfcElement;
            _ifcElement.GlobalId     = IfcGloballyUniqueId.NewGuid();
            _ifcElement.OwnerHistory = ownerHistory;
            _ifcElement.Name         = Name;
            //ObjectType = ,
            _ifcElement.ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement;
            _ifcElement.Representation  = bbExtrudedGeometry.IfcProductDefinitionShape;
        }
コード例 #11
0
        //IfcElement _ifcElement;

        //[EarlyBindingInstance]
        //public override IfcElement IfcElement
        //{
        //    get { return _ifcElement; }
        //    set { _ifcElement = value; }
        //}

        //private BbLocalPlacement3D _objectSemLocalPlacement;

        //public override BbLocalPlacement3D ObjectBbLocalPlacement
        //{
        //    get { return _objectSemLocalPlacement; }
        //    set { _objectSemLocalPlacement = value; }
        //}

        protected BbClipAngle(
            string id, string name, BbProfile profile,
            double length, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbDirection3D extrudeDirection,
            BbElement container)
            : base(id, name, "Clip Angle", profile, length, position, zAxis, xAxis, extrudeDirection, container)
        {
        }
コード例 #12
0
ファイル: BbAccessory.cs プロジェクト: JackTing/ifctoolkit
 protected BbAccessory(
     string id, string name, string objectType, BbProfile profile,
     double length, BbCoordinate3D position, BbDirection3D zAxis,
     BbDirection3D xAxis, BbDirection3D extrudeDirection,
     BbElement container)
     : base(id, name, objectType, profile, length, position, zAxis, xAxis, extrudeDirection, container, typeof(IfcDiscreteAccessory))
 {
 }
コード例 #13
0
 protected BbAccessory(
     string id, string name, string objectType, BbProfile profile,
     double length, BbCoordinate3D position, BbDirection3D zAxis,
     BbDirection3D xAxis, BbDirection3D extrudeDirection,
     BbElement container)
     : base(id, name, objectType, profile, length, position, zAxis, xAxis, extrudeDirection, container, typeof(IfcDiscreteAccessory))
 {
 }
コード例 #14
0
        public BbCutCope(
            BbElement hostElement,
            BbProfile profile,
            double length,
            double[] zAxis,
            double[] xAxis,
            double[] extrudeDirection,
            double[] position)
        {
            //ObjectLocalPlacement = new LocalPlacement3D(hostElement.ObjectLocalPlacement, new Position3D(position));

            /// from main piece
            BbPosition3D pos = BbPosition3D.Create(
                BbCoordinate3D.Create(position),
                BbDirection3D.Create(zAxis),
                BbDirection3D.Create(xAxis));

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbDirection3D exDir;

            if (Math.Round(extrudeDirection[0], 8) == 0.0 && Math.Round(extrudeDirection[0], 8) == 0 && Math.Round(extrudeDirection[0], 8) == 1)
            {
                exDir = BbHeaderSetting.Setting3D.ZAxis;
            }
            else
            {
                exDir = BbDirection3D.Create(extrudeDirection);
            }


            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                exDir,
                length);

            _ifcOpeningElement = new IfcOpeningElement
            {
                GlobalId     = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = hostElement.IfcObject.OwnerHistory,
                // Name =
                // Description =
                ObjectType      = "Opening",
                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation  = bbExtrudedGeometry.IfcProductDefinitionShape,
            };

            _ifcRelVoidsElement = new IfcRelVoidsElement
            {
                GlobalId                = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory            = hostElement.IfcObject.OwnerHistory,
                Name                    = "Cope",
                RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                RelatedOpeningElement   = _ifcOpeningElement,
            };
        }
コード例 #15
0
ファイル: BbCutCope.cs プロジェクト: JackTing/ifctoolkit
        public BbCutCope(
            BbElement hostElement,
            BbProfile profile,
            double length,
            double[] zAxis,
            double[] xAxis,
            double[] extrudeDirection,
            double[] position)
        {
            //ObjectLocalPlacement = new LocalPlacement3D(hostElement.ObjectLocalPlacement, new Position3D(position));

            /// from main piece
            BbPosition3D pos = BbPosition3D.Create(
                BbCoordinate3D.Create(position),
                BbDirection3D.Create(zAxis),
                BbDirection3D.Create(xAxis));

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbDirection3D exDir;

            if (Math.Round(extrudeDirection[0], 8) == 0.0 && Math.Round(extrudeDirection[0], 8) == 0 && Math.Round(extrudeDirection[0], 8) == 1)
            {
                exDir = BbHeaderSetting.Setting3D.ZAxis;
            }
            else
            {
                exDir = BbDirection3D.Create(extrudeDirection);
            }

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                exDir,
                length);

            _ifcOpeningElement = new IfcOpeningElement
            {
                GlobalId = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = hostElement.IfcObject.OwnerHistory,
                // Name =
                // Description =
                ObjectType = "Opening",
                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation = bbExtrudedGeometry.IfcProductDefinitionShape,
            };

            _ifcRelVoidsElement = new IfcRelVoidsElement
            {
                GlobalId = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = hostElement.IfcObject.OwnerHistory,
                Name = "Cope",
                RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                RelatedOpeningElement = _ifcOpeningElement,
            };
        }
コード例 #16
0
ファイル: BbMainPiece.cs プロジェクト: mind-peace/ifctoolkit
 protected BbMainPiece(
     string id, string name, string objectType, BbProfile profile,
     double length, BbCoordinate3D position, BbDirection3D zAxis,
     BbDirection3D xAxis, BbDirection3D extrudeDirection,
     BbAssembly container,
     Type ifcType)
     : base(id, name, objectType, profile, length, position, zAxis, xAxis, extrudeDirection, container, ifcType)
 {
     _ifcBuildingElement = base.IfcObject as IfcBuildingElement;
 }
コード例 #17
0
ファイル: BbMainPiece.cs プロジェクト: JackTing/ifctoolkit
 protected BbMainPiece(
     string id, string name, string objectType, BbProfile profile,
     double length, BbCoordinate3D position, BbDirection3D zAxis,
     BbDirection3D xAxis, BbDirection3D extrudeDirection,
     BbAssembly container,
     Type ifcType)
     : base(id, name, objectType, profile, length, position, zAxis, xAxis, extrudeDirection, container, ifcType)
 {
     _ifcBuildingElement = base.IfcObject as IfcBuildingElement;
 }
コード例 #18
0
ファイル: BbOpening.cs プロジェクト: mind-peace/ifctoolkit
        public static BbOpening Create(BbElement hostElement,
                                       BbCoordinate2D position,
                                       BbProfile profile,
                                       SemHoleLocation location,
                                       bool through,
                                       string type)
        {
            var hole = new BbOpening(hostElement, position, profile, location, through, type);

            BbInstanceDB.AddToExport(hole);
            return(hole);
        }
コード例 #19
0
        public BbDerivedProfile(BbProfile parentProfile)
        {
            _ifcDerivedProfileDef = new IfcDerivedProfileDef {
                ProfileType   = IfcProfileTypeEnum.AREA,
                ParentProfile = parentProfile.IfcProfileDef,
            };

            Name = parentProfile.Name;

            Width = parentProfile.Width;
            Depth = parentProfile.Depth;
        }
コード例 #20
0
        public BbDerivedProfile(BbProfile parentProfile)
        {
            _ifcDerivedProfileDef = new IfcDerivedProfileDef{
                ProfileType = IfcProfileTypeEnum.AREA,
                ParentProfile = parentProfile.IfcProfileDef,
            };

            Name = parentProfile.Name;

            Width = parentProfile.Width;
            Depth = parentProfile.Depth;
        }
コード例 #21
0
 public BbDerivedProfile(BbProfile parentProfile, double rotationRadian)
     : this(parentProfile)
 {
     var ifcCartesianTransformationOperator2D
         = new IfcCartesianTransformationOperator2D {
         Axis1       = new IfcDirection(Math.Cos(rotationRadian), Math.Sin(rotationRadian)),
         Axis2       = new IfcDirection(-Math.Sin(rotationRadian), Math.Cos(rotationRadian)),
         LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
         Scale       = 1,
         };
     _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
 }
コード例 #22
0
 protected BbPiece(
     string id, string name, string objectType, BbProfile profile,
     double length, BbCoordinate3D position, BbDirection3D zAxis,
     BbDirection3D xAxis, BbDirection3D extrudeDirection,
     BbElement hostElement, Type ifcEntityType)
     : this(name, objectType, profile,
            length, position, zAxis,
            xAxis, extrudeDirection,
            hostElement.ObjectBbLocalPlacement, ifcEntityType)
 {
     //AddToHostObject(hostElement);
 }
コード例 #23
0
        public BbDerivedProfile(BbProfile parentProfile, double rotationRadian)
            : this(parentProfile)
        {
            var ifcCartesianTransformationOperator2D
            = new IfcCartesianTransformationOperator2D{

                Axis1 = new IfcDirection(Math.Cos(rotationRadian), Math.Sin(rotationRadian)),
                Axis2 = new IfcDirection(-Math.Sin(rotationRadian), Math.Cos(rotationRadian)),
                LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
                Scale = 1,
            };
            _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
        }
コード例 #24
0
        public static BbExtrudedGeometry Create(
            BbProfile profile,
            BbPosition3D position3D,
            BbDirection3D direction3D,
            double depth)
        {
            var extrudedGeometry = new BbExtrudedGeometry(profile,
                                                          position3D,
                                                          direction3D,
                                                          depth);

            return(extrudedGeometry);
        }
コード例 #25
0
ファイル: BbAccessory.cs プロジェクト: JackTing/ifctoolkit
        public static BbAccessory Create(
            string id, string pieceName, string objectType, BbProfile profile,
            double depth, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbElement container
        )
        {
            var mainPart = new BbAccessory(
                id, pieceName, objectType, profile, depth, position, zAxis, xAxis, BbHeaderSetting.Setting3D.ZAxis, container);
            //container.AddElement(mainPart);

            BbInstanceDB.AddToExport(mainPart);
            return mainPart;
        }
コード例 #26
0
        //private BbClipAngle()
        //{
        //}

        public static BbClipAngle Create(
            string id, string pieceName, BbProfile profile,
            double depth, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbElement container
            )
        {
            var clipAngle = new BbClipAngle(
                id, pieceName, profile, depth, position, zAxis, xAxis, BbHeaderSetting.Setting3D.ZAxis, container);

            clipAngle.AddToHostObject(container);

            BbInstanceDB.AddToExport(clipAngle);
            return(clipAngle);
        }
コード例 #27
0
        public static BbAccessory Create(
            string id, string pieceName, string objectType, BbProfile profile,
            double depth, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbElement container
            )
        {
            var mainPart = new BbAccessory(
                id, pieceName, objectType, profile, depth, position, zAxis, xAxis, BbHeaderSetting.Setting3D.ZAxis, container);

            //container.AddElement(mainPart);

            BbInstanceDB.AddToExport(mainPart);
            return(mainPart);
        }
コード例 #28
0
        public static BbClipAngle Create(
            string id, string pieceName, BbProfile profile,
            double depth, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbElement container,
            string indicationMark, string pieceMark, string prelimMark, string barCode)
        {
            var clipAngle = new BbClipAngle(
                id, pieceName, profile, depth, position, zAxis, xAxis, BbHeaderSetting.Setting3D.ZAxis, container);

            //container.AddElement(mainPart);
            clipAngle.BbAccessoryIdentity = BbPieceIdentity.Create(indicationMark, pieceMark, prelimMark, barCode, false);
            clipAngle.AddToHostObject(container);
            BbInstanceDB.AddToExport(clipAngle);
            return(clipAngle);
        }
コード例 #29
0
//		ExtrudedElement(
//			string name, Profile profile, double length,
//			Coordinate3D position, Direction3D zAxis, Direction3D xAxis, Element container)
//			: this(name, profile, length, position, zAxis, xAxis, Direction3D.RefDirection, container)
//		{
//		}


        public static BbExtrudedElement Create(
            string name,
            BbProfile profile,
            double depth,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis,
            BbElement container,
            Type ifcEntityType
            )
        {
            var mainPart = new BbExtrudedElement(
                name, profile, depth, position, zAxis, xAxis, BbHeaderSetting.Setting3D.RefDirection, container.ObjectBbLocalPlacement, container.IfcObject.OwnerHistory, ifcEntityType);

            BbInstanceDB.AddToExport(mainPart);
            return(mainPart);
        }
コード例 #30
0
        public static BbCutCope Create(BbElement hostElement,
                                       BbProfile profile,
                                       double length,
                                       double[] zAxis,
                                       double[] xAxis,
                                       double[] extrudeDirection,
                                       double[] position)
        {
            var cutCope = new BbCutCope(hostElement,
                                        profile,
                                        length,
                                        zAxis,
                                        xAxis,
                                        extrudeDirection,
                                        position);

            BbInstanceDB.AddToExport(cutCope);
            return(cutCope);
        }
コード例 #31
0
ファイル: BbMainPiece.cs プロジェクト: mind-peace/ifctoolkit
        public static BbMainPiece Create(
            string id, string pieceName, BbProfile profile,
            double depth, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbAssembly container
            )
        {
            var trueZ = GetTrueZDirection(zAxis, container);

            BbMainPiece mainPart;

            if (IsColumn(trueZ))
            {
                mainPart = new BbMainPiece(
                    id, pieceName, "Column", profile, depth, position, zAxis, xAxis,
                    BbHeaderSetting.Setting3D.ZAxis, container, typeof(IfcColumn));
            }
            else if (IsBeam(trueZ))
            {
                mainPart = new BbMainPiece(
                    id, pieceName, "Beam", profile, depth, position, zAxis, xAxis,
                    BbHeaderSetting.Setting3D.ZAxis, container, typeof(IfcBeam));
            }
            else
            {
                mainPart = new BbMainPiece(
                    id, pieceName, "Member", profile, depth, position, zAxis, xAxis,
                    BbHeaderSetting.Setting3D.ZAxis, container, typeof(IfcMember));
            }

            //container.AddElement(mainPart);


            mainPart.AddToHostObject(container);
            BbInstanceDB.AddToExport(mainPart);
            return(mainPart);
        }
コード例 #32
0
ファイル: BbCutCope.cs プロジェクト: JackTing/ifctoolkit
        public static BbCutCope Create(BbElement hostElement,
                                     BbProfile profile,
                                     double length,
                                     double[] zAxis,
                                     double[] xAxis,
                                     double[] extrudeDirection,
                                     double[] position)
        {
            var cutCope = new BbCutCope(hostElement,
                                       profile,
                                       length,
                                       zAxis,
                                      xAxis,
                                       extrudeDirection,
                                      position);

            BbInstanceDB.AddToExport(cutCope);
            return cutCope;
        }
コード例 #33
0
ファイル: BbOpening.cs プロジェクト: JackTing/ifctoolkit
 public static BbOpening Create(BbElement hostElement,
                              BbCoordinate2D position,
                              BbProfile profile,
                              SemHoleLocation location,
                              bool through,
     string type)
 {
     var hole = new BbOpening(hostElement, position, profile, location, through, type);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
コード例 #34
0
ファイル: BbOpening.cs プロジェクト: JackTing/ifctoolkit
        protected BbOpening(
            BbElement hostElement,
            BbCoordinate2D position,
            BbProfile profile,
            SemHoleLocation location,
            bool through,
            string type
            )
        {
            var mainPart = hostElement as BbPiece;
            if (mainPart == null)
                return;

            double thickness;
            BbPosition3D pos;

            // x direction follows extrusion direction
            // extrude origin  projected to bottom or left becomes the origin

            switch (location)
            {

                case SemHoleLocation.Left:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            -(mainPart.Profile.Width / 2),
                            position.Y,
                            position.X),
                        BbHeaderSetting.Setting3D.XAxis,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Width;
                    else
                        thickness = mainPart.Profile.Width / 2;
                    break;
                case SemHoleLocation.Right:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            (mainPart.Profile.Width / 2),
                            position.Y,
                            position.X),
                        BbHeaderSetting.Setting3D.XAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Width;
                    else
                        thickness = mainPart.Profile.Width / 2;
                    break;
                case SemHoleLocation.Web:
                    if (through)
                    {
                        pos = BbPosition3D.Create(
                            BbCoordinate3D.Create(
                                (mainPart.Profile.Width / 2),
                                position.Y,
                                position.X
                                ),
                            BbHeaderSetting.Setting3D.XAxisMinus,
                            BbHeaderSetting.Setting3D.ZAxis);
                        thickness = mainPart.Profile.Width;
                    }
                    else
                    {
                        pos = BbPosition3D.Create(
                            BbCoordinate3D.Create(
                                (mainPart.Profile.Width / 4),
                                position.Y,
                                position.X
                                ),
                            BbHeaderSetting.Setting3D.XAxisMinus,
                            BbHeaderSetting.Setting3D.ZAxis);
                        thickness = mainPart.Profile.Width / 2;
                    }
                    break;

                case SemHoleLocation.Bottom:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            position.Y,
                            -(mainPart.Profile.Depth / 2),
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.YAxis,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Depth;
                    else
                        thickness = mainPart.Profile.Depth / 2;
                    break;
                case SemHoleLocation.Top:
                default:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            position.Y,
                            (mainPart.Profile.Depth / 2),
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.YAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Depth;
                    else
                        thickness = mainPart.Profile.Depth / 2;
                    break;
            }

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                thickness);

            _ifcOpeningElement = new IfcOpeningElement
                {
                    GlobalId = IfcGloballyUniqueId.NewGuid(),
                    OwnerHistory = hostElement.IfcObject.OwnerHistory,
                    // Name =
                    // Description =
                    ObjectType = "Opening",
                    ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                    Representation = bbExtrudedGeometry.IfcProductDefinitionShape,
                };

            _ifcRelVoidsElement = new IfcRelVoidsElement
                {
                    GlobalId = IfcGloballyUniqueId.NewGuid(),
                    OwnerHistory = hostElement.IfcObject.OwnerHistory,
                    Name = type,
                    RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                    RelatedOpeningElement = _ifcOpeningElement,
                };
        }
コード例 #35
0
 public static BbDerivedProfile Create(BbProfile parentProfile, double rotationAngle)
 {
     var derivedProfile = new BbDerivedProfile(parentProfile, rotationAngle);
     BbInstanceDB.AddToExport(derivedProfile);
     return derivedProfile;
 }
コード例 #36
0
        public static BbExtrudedElement Create(
			string name,
			BbProfile profile,
			double depth,
			BbCoordinate3D position,
			BbDirection3D zAxis,
			BbDirection3D xAxis,
			BbSpatialElement container,
			Type ifcEntityType
			)
        {
            var mainPart = new BbExtrudedElement(
                name, profile, depth, position, zAxis, xAxis, BbHeaderSetting.Setting3D.RefDirection, container.ObjectBbLocalPlacement, container.IfcSpatialStructureElement.OwnerHistory, ifcEntityType);
            //container.AddContained (mainPart);
            mainPart.AddToSpatialElement(container);
            BbInstanceDB.AddToExport(mainPart);
            return mainPart;
        }
コード例 #37
0
 public static BbDerivedProfile Create(BbProfile parentProfile, bool mirrorXAxis, bool mirrorYAxis)
 {
     var derivedProfile = new BbDerivedProfile(parentProfile, mirrorXAxis, mirrorYAxis);
     BbInstanceDB.AddToExport(derivedProfile);
     return derivedProfile;
 }
コード例 #38
0
        public static BbExtrudedGeometry Create(
			BbProfile profile,
			BbPosition3D position3D,
			BbDirection3D direction3D,
			double depth)
        {
            var extrudedGeometry = new BbExtrudedGeometry(profile,
                                         position3D,
                                         direction3D,
                                         depth);

            return extrudedGeometry;
        }
コード例 #39
0
ファイル: BbOpening.cs プロジェクト: mind-peace/ifctoolkit
        protected BbOpening(
            BbElement hostElement,
            BbCoordinate2D position,
            BbProfile profile,
            SemHoleLocation location,
            bool through,
            string type
            )
        {
            var mainPart = hostElement as BbPiece;

            if (mainPart == null)
            {
                return;
            }


            double       thickness;
            BbPosition3D pos;

            // x direction follows extrusion direction
            // extrude origin  projected to bottom or left becomes the origin

            switch (location)
            {
            case SemHoleLocation.Left:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        -(mainPart.Profile.Width / 2),
                        position.Y,
                        position.X),
                    BbHeaderSetting.Setting3D.XAxis,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Width;
                }
                else
                {
                    thickness = mainPart.Profile.Width / 2;
                }
                break;

            case SemHoleLocation.Right:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        (mainPart.Profile.Width / 2),
                        position.Y,
                        position.X),
                    BbHeaderSetting.Setting3D.XAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Width;
                }
                else
                {
                    thickness = mainPart.Profile.Width / 2;
                }
                break;

            case SemHoleLocation.Web:
                if (through)
                {
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            (mainPart.Profile.Width / 2),
                            position.Y,
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.XAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    thickness = mainPart.Profile.Width;
                }
                else
                {
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            (mainPart.Profile.Width / 4),
                            position.Y,
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.XAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    thickness = mainPart.Profile.Width / 2;
                }
                break;

            case SemHoleLocation.Bottom:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        position.Y,
                        -(mainPart.Profile.Depth / 2),
                        position.X
                        ),
                    BbHeaderSetting.Setting3D.YAxis,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Depth;
                }
                else
                {
                    thickness = mainPart.Profile.Depth / 2;
                }
                break;

            case SemHoleLocation.Top:
            default:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(
                        position.Y,
                        (mainPart.Profile.Depth / 2),
                        position.X
                        ),
                    BbHeaderSetting.Setting3D.YAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                if (through)
                {
                    thickness = mainPart.Profile.Depth;
                }
                else
                {
                    thickness = mainPart.Profile.Depth / 2;
                }
                break;
            }

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                thickness);

            _ifcOpeningElement = new IfcOpeningElement
            {
                GlobalId     = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = hostElement.IfcObject.OwnerHistory,
                // Name =
                // Description =
                ObjectType      = "Opening",
                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation  = bbExtrudedGeometry.IfcProductDefinitionShape,
            };

            _ifcRelVoidsElement = new IfcRelVoidsElement
            {
                GlobalId                = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory            = hostElement.IfcObject.OwnerHistory,
                Name                    = type,
                RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                RelatedOpeningElement   = _ifcOpeningElement,
            };
        }