コード例 #1
0
ファイル: BbAssembly.cs プロジェクト: mind-peace/ifctoolkit
        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);
        }
コード例 #2
0
        //public List<BbPaintFinish> PaintFinishes { get; protected set; }


        //public void AddPaintFinish(BbPaintFinish paintFinish)
        //{
        //    if (PaintFinishes == null)
        //    {
        //        PaintFinishes = new List<BbPaintFinish>();
        //    }

        //    if (IfcRelCoversBldgElements == null)
        //    {
        //        IfcRelCoversBldgElements = new IfcRelCoversBldgElements
        //            {
        //                GlobalId = IfcGloballyUniqueId.NewGuid(),
        //                OwnerHistory = BbHeaderSetting.Setting3D.IfcOwnerHistory,
        //                RelatingBuildingElement = IfcObject as IfcElement,
        //                RelatedCoverings = new List<IfcCovering>(),
        //            };
        //    }

        //    IfcRelCoversBldgElements.RelatedCoverings.Add(paintFinish.IfcCovering);


        //    PaintFinishes.Add(paintFinish);
        //}

        //public void AddPaintFinish(SemPaintFinishPatch semPaintFinish, BbLocalPlacement3D semLocalPlacement3D)
        //{
        //    AddPaintFinish(semPaintFinish);
        //    semPaintFinish.BbLocalPlacement3D = semLocalPlacement3D;
        //}

        //public ICollection<BbElement> Retrieve();

        public void AddToSpatialElement(BbSpatialElement bbSpatialElement)
        {
            BbSpatialElement = bbSpatialElement;
            var a = EarlyBindingInstanceModel.GetReferencedEntities(bbSpatialElement.IfcSpatialStructureElement.EIN).Values;

            var b = (from x in a.OfType <IfcRelContainedInSpatialStructure>()
                     where x.RelatingStructure.EIN == bbSpatialElement.IfcSpatialStructureElement.EIN
                     select x).ToList();

            switch (b.Count)
            {
            case 0:
                IfcRelContainedInSpatialStructure = new IfcRelContainedInSpatialStructure
                {
                    GlobalId          = IfcGloballyUniqueId.NewGuid(),
                    OwnerHistory      = IfcObject.OwnerHistory,
                    RelatingStructure = bbSpatialElement.IfcSpatialStructureElement,
                    RelatedElements   = new List <IfcProduct>()
                    {
                    },
                };
                break;

            case 1:
                IfcRelContainedInSpatialStructure = b[0];
                break;

            default:
                throw new NotImplementedException();
            }

            IfcRelContainedInSpatialStructure.RelatedElements.Add(IfcObject as IfcElement);
        }
コード例 #3
0
ファイル: BbAssembly.cs プロジェクト: mind-peace/ifctoolkit
 protected BbAssembly(
     BbSpatialElement floor,
     IfcElementAssembly assembly,
     IfcRelContainedInSpatialStructure spatialStructure)
 {
     //BbSpatialElement = floor;
     _ifcElementAssembly = assembly;
     AddToSpatialElement(floor);
 }
コード例 #4
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);
        }
コード例 #5
0
ファイル: BbAssembly.cs プロジェクト: mind-peace/ifctoolkit
 protected BbAssembly(
     string assemblyId,
     string assemblyName,
     string assemblyMark,
     string clientMark,
     string prelimMark,
     string shippingMark,
     string barCode,
     BbSpatialElement floor)
     : this(assemblyId,
            assemblyName,
            assemblyMark,
            clientMark,
            prelimMark,
            shippingMark,
            barCode, floor,
            BbHeaderSetting.Setting3D.DefaultOrigin,
            BbHeaderSetting.Setting3D.ZAxis,
            BbHeaderSetting.Setting3D.XAxis)
 {
 }
コード例 #6
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);
        }
コード例 #7
0
ファイル: BbAssembly.cs プロジェクト: mind-peace/ifctoolkit
        public static BbAssembly Create(
            string assemblyId,
            string assemblyName,
            string assemblyMark,
            string clientMark,
            string prelimMark,
            string shippingMark,
            string barCode,
            BbSpatialElement floor)
        {
            var steelAssembly = new BbAssembly(
                assemblyId,
                assemblyName, assemblyMark, clientMark,
                prelimMark,
                shippingMark,
                barCode, floor);

            //floor.AddContained(steelAssembly);
            //steelAssembly.AddToSpatialElement(floor);
            BbInstanceDB.AddToExport(steelAssembly);
            return(steelAssembly);
        }
コード例 #8
0
ファイル: BbAssembly.cs プロジェクト: mind-peace/ifctoolkit
        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);
        }