示例#1
0
        public BbDirectionGeometry(
            BbDirection3D bbDirection
            )
        {
            _ifcDirection = bbDirection.IfcDirection;



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

            _ifcProductDefinitionShape = new IfcProductDefinitionShape
            {
                // Name=
                // Description =
                Representations = new List <IfcRepresentation>(),
            };
            _ifcProductDefinitionShape.Representations.Add(_ifcShapeRepresentation);
        }
示例#2
0
        public static BbDirection3D Create(double[] x)
        {
            var direction3D = new BbDirection3D(x);

            BbInstanceDB.AddToExport(direction3D);
            return(direction3D);
        }
示例#3
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;
        }
示例#4
0
        BbBrepElement(
            string name,
            BbBRepGeometry brepGeometry,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis,
            BbLocalPlacement3D containerLocation,
            IfcOwnerHistory ownerHistory,
            Type IfcEntityType)
        {
            Name = name;
            //Profile = profile;
            BbPosition3D pos = BbPosition3D.Create(position, zAxis, xAxis);

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                containerLocation, pos	);

            //			ifcBuildingElement = Activator.CreateInstance(EbConstants.Part21NSName, EbConstants.Part21NSName + "." + ifcEntityName);
            ifcElement = Activator.CreateInstance(IfcEntityType) as IfcElement;

            ifcElement.GlobalId = IfcGloballyUniqueId.NewGuid();
            ifcElement.OwnerHistory = ownerHistory;
            ifcElement.Name = Name;
            //ObjectType = ,
            ifcElement.ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement;
            ifcElement.Representation = brepGeometry.IfcProductDefinitionShape;
        }
示例#5
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;
        }
示例#6
0
        public static BbAssembly Create(
            string assemblyId,
            string assemblyName,
            string assemblyMark,
            string clientMark,
            string prelimMark,
            string shippingMark,
            string barCode,
            BbSpatialElement floor,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis)
        {
            var steelAssembly = new BbAssembly(
                assemblyId,
                assemblyName, assemblyMark, clientMark,
                prelimMark,
                shippingMark,
                barCode, floor,
                position, zAxis, xAxis);

            //floor.AddContained(steelAssembly);
            BbInstanceDB.AddToExport(steelAssembly);
            return(steelAssembly);
        }
        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);
        }
示例#8
0
        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;
        }
//		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;
        }
示例#10
0
        BbBrepElement(
            string name,
            BbBRepGeometry brepGeometry,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis,
            BbLocalPlacement3D containerLocation,
            IfcOwnerHistory ownerHistory,
            Type IfcEntityType)
        {
            Name = name;
            //Profile = profile;
            BbPosition3D pos = BbPosition3D.Create(position, zAxis, xAxis);

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                containerLocation, pos);



//			ifcBuildingElement = Activator.CreateInstance(EbConstants.Part21NSName, EbConstants.Part21NSName + "." + ifcEntityName);
            ifcElement = Activator.CreateInstance(IfcEntityType) as IfcElement;

            ifcElement.GlobalId     = IfcGloballyUniqueId.NewGuid();
            ifcElement.OwnerHistory = ownerHistory;
            ifcElement.Name         = Name;
            //ObjectType = ,
            ifcElement.ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement;
            ifcElement.Representation  = brepGeometry.IfcProductDefinitionShape;
        }
示例#11
0
        public static BbDirection3D Create(double x, double y, double z)
        {
            var direction3D = new BbDirection3D(x, y, z);

            BbInstanceDB.AddToExport(direction3D);
            return(direction3D);
        }
示例#12
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);
        }
示例#13
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)
        {
        }
示例#14
0
        //		public Position3D (double[] position)
        //			:this(Coordinate3D.Create(position))
        //		{
        //		}

        //		public static Position3D Create ()
        //		{
        //			Position3D position = new Position3D ();
        //
        //			BbInstanceDB.Add (position);
        //			return position;
        //		}


        //		public static Position3D Create (double[] position)
        //		{
        //			Position3D position3D = new Position3D (position);
        //			BbInstanceDB.Add (position3D);
        //			return position3D;
        //		}


        //public static BbPosition3D Create()
        //{
        //    return Create(BbCoordinate3D.Create());
        //}

        //public static BbPosition3D Create(BbCoordinate3D coordinate3D)
        //{
        //    BbPosition3D position3D = new BbPosition3D(coordinate3D);
        //    BbInstanceDB.AddToExport(position3D);
        //    return position3D;
        //}

        public static BbPosition3D Create(BbCoordinate3D coordinate3D,
                                          BbDirection3D axis, BbDirection3D refDirection)
        {
            BbPosition3D position = new BbPosition3D(coordinate3D, axis, refDirection);

            BbInstanceDB.AddToExport(position);
            return(position);
        }
示例#15
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))
 {
 }
示例#16
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))
 {
 }
示例#17
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,
            };
        }
示例#18
0
 protected BbStiffener(
     string id, string name,
     double width, double height,
     double length, BbCoordinate3D position, BbDirection3D zAxis,
     BbDirection3D xAxis, BbDirection3D extrudeDirection,
     BbElement container)
     : base(id, name, "Stiffener", BbNamedRectangleProfile.Create(width, height), length, position, zAxis, xAxis, extrudeDirection, container)
 {
 }
示例#19
0
        public static BbDirectionGeometry Create(
            BbDirection3D bbDirection
            )
        {
            var extrudedGeometry = new BbDirectionGeometry(bbDirection);

            BbInstanceDB.AddToExport(extrudedGeometry);
            return(extrudedGeometry);
        }
示例#20
0
 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;
 }
示例#21
0
 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;
 }
示例#22
0
 void SetBbDirection3D()
 {
     XAxis               = RefDirection = BbDirection3D.Create(1, 0, 0);
     YAxis               = BbDirection3D.Create(0, 1, 0);
     ZAxis               = Axis = BbDirection3D.Create(0, 0, 1);
     XAxisMinus          = BbDirection3D.Create(-1, 0, 0);
     YAxisMinus          = BbDirection3D.Create(0, -1, 0);
     ZAxisMinus          = BbDirection3D.Create(0, 0, -1);
     DefaultOrigin       = BbCoordinate3D.Create();
     DefaultBbPosition3D = BbPosition3D.Create(DefaultOrigin, Axis, RefDirection);
 }
示例#23
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);
 }
示例#24
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;
        }
示例#25
0
        public static BbExtrudedGeometry Create(
            BbProfile profile,
            BbPosition3D position3D,
            BbDirection3D direction3D,
            double depth)
        {
            var extrudedGeometry = new BbExtrudedGeometry(profile,
                                                          position3D,
                                                          direction3D,
                                                          depth);

            return(extrudedGeometry);
        }
示例#26
0
        //BbPosition3D()
        //    : this(BbCoordinate3D.Origin)
        //{
        //}
        //BbPosition3D(BbCoordinate3D coordinate3D)
        //    : this(coordinate3D,  BbDirection3D.Axis, BbDirection3D.RefDirection)
        //{
        //}
        BbPosition3D(BbCoordinate3D coordinate3D,
                          BbDirection3D axis, BbDirection3D refDirection)
        {
            Coordinate3D = coordinate3D;
            Axis = axis;
            RefDirection = refDirection;

            ifcAxis2Placement3D = new IfcAxis2Placement3D
            {
                Location = coordinate3D.IfcCartesianPoint,
                RefDirection = refDirection.IfcDirection,
                Axis = axis.IfcDirection,
            };
        }
示例#27
0
        //BbPosition3D()
        //    : this(BbCoordinate3D.Origin)
        //{
        //}

        //BbPosition3D(BbCoordinate3D coordinate3D)
        //    : this(coordinate3D,  BbDirection3D.Axis, BbDirection3D.RefDirection)
        //{
        //}

        BbPosition3D(BbCoordinate3D coordinate3D,
                     BbDirection3D axis, BbDirection3D refDirection)
        {
            Coordinate3D = coordinate3D;
            Axis         = axis;
            RefDirection = refDirection;

            ifcAxis2Placement3D = new IfcAxis2Placement3D
            {
                Location     = coordinate3D.IfcCartesianPoint,
                RefDirection = refDirection.IfcDirection,
                Axis         = axis.IfcDirection,
            };
        }
示例#28
0
        public static BbStiffener Create(
            string id, string pieceName,
            double width, double height,
            double depth, BbCoordinate3D position, BbDirection3D zAxis,
            BbDirection3D xAxis, BbElement container
            )
        {
            var stiffener = new BbStiffener(
                id, pieceName, width, height, depth, position, zAxis, xAxis, BbHeaderSetting.Setting3D.ZAxis, container);

            stiffener.AddToHostObject(container);
            BbInstanceDB.AddToExport(stiffener);
            return(stiffener);
        }
示例#29
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);
        }
示例#30
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);
        }
示例#31
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);
        }
示例#32
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);
        }
示例#33
0
        /// <summary>
        /// incomplete function need revise
        /// </summary>
        /// <param name="zAxis"></param>
        /// <param name="container"></param>
        /// <returns></returns>
        private static BbDirection3D GetTrueZDirection(BbDirection3D zAxis, BbAssembly container)
        {
            var ifcLocalPlacement = container.ObjectBbLocalPlacement.IfcLocalPlacement;
            var baseLoc           = ifcLocalPlacement.PlacementRelTo as IfcLocalPlacement;
            var relLoc            = ifcLocalPlacement.RelativePlacement.AIfcAxis2Placement3D;
            var ifcDirection      = relLoc.Axis;

            while (baseLoc != null)
            {
                baseLoc = baseLoc.PlacementRelTo as IfcLocalPlacement;
                if (baseLoc != null)
                {
                    relLoc = baseLoc.RelativePlacement.AIfcAxis2Placement3D;
                }
            }

            return(zAxis);
        }
示例#34
0
 public static BbBrepElement Create(
     string name,
     BbBRepGeometry brepGeometry,
     BbCoordinate3D position,
     BbDirection3D zAxis,
     BbDirection3D xAxis,
     BbSpatialElement container,
     Type ifcEntityType
     )
 {
     var mainPart = new BbBrepElement(
         name, brepGeometry, position, zAxis, xAxis,
         container.ObjectBbLocalPlacement,
         container.IfcSpatialStructureElement.OwnerHistory,
         ifcEntityType);
     //container.AddContained (mainPart);
     mainPart.AddToSpatialElement(container);
     BbInstanceDB.AddToExport(mainPart);
     return mainPart;
 }
示例#35
0
        public static BbBrepElement Create(
            string name,
            BbBRepGeometry brepGeometry,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis,
            BbSpatialElement container,
            Type ifcEntityType
            )
        {
            var mainPart = new BbBrepElement(
                name, brepGeometry, position, zAxis, xAxis,
                container.ObjectBbLocalPlacement,
                container.IfcSpatialStructureElement.OwnerHistory,
                ifcEntityType);

            //container.AddContained (mainPart);
            mainPart.AddToSpatialElement(container);
            BbInstanceDB.AddToExport(mainPart);
            return(mainPart);
        }
示例#36
0
        public BbDirectionGeometry(
             BbDirection3D bbDirection
            )
        {
            _ifcDirection = bbDirection.IfcDirection;

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

            _ifcProductDefinitionShape = new IfcProductDefinitionShape
                {
                    // Name=
                    // Description =
                    Representations = new List<IfcRepresentation>(),
                };
            _ifcProductDefinitionShape.Representations.Add(_ifcShapeRepresentation);
        }
示例#37
0
        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);
        }
示例#38
0
 public static BbDirectionGeometry Create(
     BbDirection3D bbDirection
     )
 {
     var extrudedGeometry = new BbDirectionGeometry(bbDirection);
     BbInstanceDB.AddToExport(extrudedGeometry);
     return extrudedGeometry;
 }
示例#39
0
        protected BbAssembly(
            string assemblyId,
            string assemblyName,
            string assemblyMark,
            string clientMark,
            string prelimMark,
            string shippingMark,
            string barCode,
            BbSpatialElement floor,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis
        )
        {
            //AssemblyName = assemblyName;
            //AssemblyMark = assemblyMark;

            var pos = BbPosition3D.Create(position, zAxis, xAxis);

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

            _ifcElementAssembly = new IfcElementAssembly
            {
                GlobalId = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = floor.IfcSpatialStructureElement.OwnerHistory,
                Name = assemblyName,
                Description = null,
                ObjectType = null,

                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation = null,
                Tag = assemblyId,
                AssemblyPlace = IfcAssemblyPlaceEnum.NOTDEFINED,
                PredefinedType = IfcElementAssemblyTypeEnum.RIGID_FRAME
            };


            BbAssemblyIdentity = BbAssemblyIdentity.Create(
                //				assemblyName, 
                assemblyMark, clientMark, prelimMark, shippingMark,
                                                       barCode);
            BbAssemblyIdentity.AssignTo(this);

            AddToSpatialElement(floor);

            // var relContaineds = EarlyBindingInstanceModel.GetDataByType("IfcRelContainedInSpatialStructure");

            //var thecontained = from y in ( from x in relContaineds
            //                   select x.Value as IfcRelContainedInSpatialStructure)
            //                       where y.;

            //var b = BbInstanceDB.GetTypedList(typeof(BbAssembly));


            //if (b == null)
            //{
            //    IfcRelContainedInSpatialStructure = new IfcRelContainedInSpatialStructure
            //    {
            //        GlobalId = IfcGloballyUniqueId.NewGuid(),
            //        OwnerHistory = _ifcElementAssembly.OwnerHistory,
            //        RelatingStructure = floor.IfcSpatialStructureElement,
            //        RelatedElements = new List<IfcProduct>(),
            //    };
            //}
            //else
            //{

            //    var otherAssemblies = (from x in b.OfType<BbAssembly>()

            //                           select x).ToList();

            //    //var a = otherAssemblies as IList<BbAssembly>;

            //    var other = (from x in otherAssemblies
            //                 where x.BbSpatialElement.IfcSpatialStructureElement.Name
            //                 == BbSpatialElement.IfcSpatialStructureElement.Name
            //                 select x).First();
            //    if (other == null)
            //    {
            //        IfcRelContainedInSpatialStructure = new IfcRelContainedInSpatialStructure
            //        {
            //            GlobalId = IfcGloballyUniqueId.NewGuid(),
            //            OwnerHistory = _ifcElementAssembly.OwnerHistory,
            //            RelatingStructure = BbSpatialElement.IfcSpatialStructureElement,
            //            RelatedElements = new List<IfcProduct>(),
            //        };
            //    }
            //    else
            //    {
            //        IfcRelContainedInSpatialStructure = other.IfcRelContainedInSpatialStructure;
            //    }
            //}

            //IfcRelContainedInSpatialStructure.RelatedElements.Add(_ifcElementAssembly);

        }
示例#40
0
 public static BbAssembly Create(
     string assemblyId,
     string assemblyName,
     string assemblyMark,
     string clientMark,
     string prelimMark,
     string shippingMark,
     string barCode,
     BbSpatialElement floor,
     BbCoordinate3D position,
     BbDirection3D zAxis,
     BbDirection3D xAxis)
 {
     var steelAssembly = new BbAssembly(
         assemblyId,
         assemblyName, assemblyMark, clientMark,
          prelimMark,
          shippingMark,
          barCode, floor,
         position, zAxis, xAxis);
     //floor.AddContained(steelAssembly);
     BbInstanceDB.AddToExport(steelAssembly);
     return steelAssembly;
 }
示例#41
0
        protected BbAssembly(
            string assemblyId,
            string assemblyName,
            string assemblyMark,
            string clientMark,
            string prelimMark,
            string shippingMark,
            string barCode,
            BbSpatialElement floor,
            BbCoordinate3D position,
            BbDirection3D zAxis,
            BbDirection3D xAxis
            )
        {
            //AssemblyName = assemblyName;
            //AssemblyMark = assemblyMark;

            var pos = BbPosition3D.Create(position, zAxis, xAxis);

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

            _ifcElementAssembly = new IfcElementAssembly
            {
                GlobalId     = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = floor.IfcSpatialStructureElement.OwnerHistory,
                Name         = assemblyName,
                Description  = null,
                ObjectType   = null,

                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation  = null,
                Tag             = assemblyId,
                AssemblyPlace   = IfcAssemblyPlaceEnum.NOTDEFINED,
                PredefinedType  = IfcElementAssemblyTypeEnum.RIGID_FRAME
            };


            BbAssemblyIdentity = BbAssemblyIdentity.Create(
                //				assemblyName,
                assemblyMark, clientMark, prelimMark, shippingMark,
                barCode);
            BbAssemblyIdentity.AssignTo(this);

            AddToSpatialElement(floor);

            // var relContaineds = EarlyBindingInstanceModel.GetDataByType("IfcRelContainedInSpatialStructure");

            //var thecontained = from y in ( from x in relContaineds
            //                   select x.Value as IfcRelContainedInSpatialStructure)
            //                       where y.;

            //var b = BbInstanceDB.GetTypedList(typeof(BbAssembly));


            //if (b == null)
            //{
            //    IfcRelContainedInSpatialStructure = new IfcRelContainedInSpatialStructure
            //    {
            //        GlobalId = IfcGloballyUniqueId.NewGuid(),
            //        OwnerHistory = _ifcElementAssembly.OwnerHistory,
            //        RelatingStructure = floor.IfcSpatialStructureElement,
            //        RelatedElements = new List<IfcProduct>(),
            //    };
            //}
            //else
            //{

            //    var otherAssemblies = (from x in b.OfType<BbAssembly>()

            //                           select x).ToList();

            //    //var a = otherAssemblies as IList<BbAssembly>;

            //    var other = (from x in otherAssemblies
            //                 where x.BbSpatialElement.IfcSpatialStructureElement.Name
            //                 == BbSpatialElement.IfcSpatialStructureElement.Name
            //                 select x).First();
            //    if (other == null)
            //    {
            //        IfcRelContainedInSpatialStructure = new IfcRelContainedInSpatialStructure
            //        {
            //            GlobalId = IfcGloballyUniqueId.NewGuid(),
            //            OwnerHistory = _ifcElementAssembly.OwnerHistory,
            //            RelatingStructure = BbSpatialElement.IfcSpatialStructureElement,
            //            RelatedElements = new List<IfcProduct>(),
            //        };
            //    }
            //    else
            //    {
            //        IfcRelContainedInSpatialStructure = other.IfcRelContainedInSpatialStructure;
            //    }
            //}

            //IfcRelContainedInSpatialStructure.RelatedElements.Add(_ifcElementAssembly);
        }
示例#42
0
 //        public Position3D (double[] position)
 //            :this(Coordinate3D.Create(position))
 //        {
 //        }
 //        public static Position3D Create ()
 //        {
 //            Position3D position = new Position3D ();
 //
 //            BbInstanceDB.Add (position);
 //            return position;
 //        }
 //        public static Position3D Create (double[] position)
 //        {
 //            Position3D position3D = new Position3D (position);
 //            BbInstanceDB.Add (position3D);
 //            return position3D;
 //        }
 //public static BbPosition3D Create()
 //{
 //    return Create(BbCoordinate3D.Create());
 //}
 //public static BbPosition3D Create(BbCoordinate3D coordinate3D)
 //{
 //    BbPosition3D position3D = new BbPosition3D(coordinate3D);
 //    BbInstanceDB.AddToExport(position3D);
 //    return position3D;
 //}
 public static BbPosition3D Create(BbCoordinate3D coordinate3D,
                                  BbDirection3D axis, BbDirection3D refDirection)
 {
     BbPosition3D position = new BbPosition3D(coordinate3D, axis, refDirection);
     BbInstanceDB.AddToExport(position);
     return position;
 }
示例#43
0
 private static bool IsBeam(BbDirection3D zAxis)
 {
     return(zAxis.Z.Equals(0));
 }
示例#44
0
 private static bool IsBeam(BbDirection3D zAxis)
 {
     return zAxis.Z.Equals(0);
 }
示例#45
0
        /// <summary>
        /// incomplete function need revise
        /// </summary>
        /// <param name="zAxis"></param>
        /// <param name="container"></param>
        /// <returns></returns>
        private static BbDirection3D GetTrueZDirection(BbDirection3D zAxis, BbAssembly container)
        {
            var ifcLocalPlacement = container.ObjectBbLocalPlacement.IfcLocalPlacement;
            var baseLoc = ifcLocalPlacement.PlacementRelTo as IfcLocalPlacement;
            var relLoc = ifcLocalPlacement.RelativePlacement.AIfcAxis2Placement3D;
            var ifcDirection = relLoc.Axis;
            while (baseLoc != null)
            {
                baseLoc = baseLoc.PlacementRelTo as IfcLocalPlacement;
                if (baseLoc != null)
                    relLoc = baseLoc.RelativePlacement.AIfcAxis2Placement3D;
            }

            return zAxis;
        }
示例#46
0
 public static BbDirection3D Create(double[] x)
 {
     var direction3D = new BbDirection3D(x);
     BbInstanceDB.AddToExport(direction3D);
     return direction3D;
 }
示例#47
0
 public static BbDirection3D Create(double x, double y, double z)
 {
     var direction3D = new BbDirection3D(x, y, z);
     BbInstanceDB.AddToExport(direction3D);
     return direction3D;
 }
示例#48
0
 void SetBbDirection3D()
 {
     XAxis = RefDirection = BbDirection3D.Create(1, 0, 0);
     YAxis = BbDirection3D.Create(0, 1, 0);
     ZAxis = Axis = BbDirection3D.Create(0, 0, 1);
     XAxisMinus = BbDirection3D.Create(-1, 0, 0);
     YAxisMinus = BbDirection3D.Create(0, -1, 0);
     ZAxisMinus = BbDirection3D.Create(0, 0, -1);
     DefaultOrigin = BbCoordinate3D.Create();
     DefaultBbPosition3D = BbPosition3D.Create(DefaultOrigin, Axis, RefDirection);
 }
示例#49
0
        public static BbExtrudedGeometry Create(
			BbProfile profile,
			BbPosition3D position3D,
			BbDirection3D direction3D,
			double depth)
        {
            var extrudedGeometry = new BbExtrudedGeometry(profile,
                                         position3D,
                                         direction3D,
                                         depth);

            return extrudedGeometry;
        }
示例#50
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;
        }
示例#51
0
 private static bool IsColumn(BbDirection3D zAxis)
 {
     return zAxis.Z.Equals(1) && zAxis.X.Equals(0) && zAxis.Y.Equals(0);
 }
示例#52
0
 private static bool IsColumn(BbDirection3D zAxis)
 {
     return(zAxis.Z.Equals(1) && zAxis.X.Equals(0) && zAxis.Y.Equals(0));
 }