Inheritance: IfcObject, IfcProductSelect
Beispiel #1
0
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "RelatedElements") == 0)
         {
             List <IfcProduct> products = new List <IfcProduct>();
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcProduct p = mDatabase.ParseXml <IfcProduct>(cn as XmlElement);
                 if (p != null)
                 {
                     products.Add(p);
                 }
             }
             RelatedElements = products;
         }
         else if (string.Compare(name, "RelatingStructure") == 0)
         {
             RelatingStructure = mDatabase.ParseXml <IfcSpatialElement>(child as XmlElement);
         }
     }
 }
Beispiel #2
0
 internal IfcGeographicElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r)
 {
     if (mDatabase.mRelease == ReleaseVersion.IFC2x3)
     {
         throw new Exception(KeyWord + " only supported in IFC4!");
     }
 }
        internal override void parseJObject(JObject obj)
        {
            base.parseJObject(obj);
            JArray array = obj.GetValue("ShapeOfProduct", StringComparison.InvariantCultureIgnoreCase) as JArray;

            if (array != null)
            {
                foreach (JObject jobj in array)
                {
                    IfcProduct product = mDatabase.ParseJObject <IfcProduct>(jobj);
                    if (product != null)
                    {
                        mShapeOfProduct.Add(product);
                    }
                }
            }
            array = obj.GetValue("HasShapeAspects", StringComparison.InvariantCultureIgnoreCase) as JArray;
            if (array != null)
            {
                List <IfcShapeAspect> aspects = mDatabase.extractJArray <IfcShapeAspect>(array);
                for (int icounter = 0; icounter < aspects.Count; icounter++)
                {
                    aspects[icounter].PartOfProductDefinitionShape = this;
                }
            }
        }
            internal void updateReferences()
            {
                IfcObjectDefinition objectDefinition = mObject as IfcObjectDefinition;

                if (objectDefinition != null)
                {
                    foreach (IfcRelDefinesByProperties isDefinedBy in mIsDefinedBy)
                    {
                        isDefinedBy.RelatedObjects.Add(objectDefinition);
                    }

                    if (mDecomposes != null)
                    {
                        mDecomposes.RelatedObjects.Add(objectDefinition);
                    }
                    if (mNests != null)
                    {
                        mNests.RelatedObjects.Add(objectDefinition);
                    }

                    IfcObject obj = mObject as IfcObject;
                    if (obj != null)
                    {
                        IfcProduct product = objectDefinition as IfcProduct;
                        if (product != null)
                        {
                            if (mContainedIn != null)
                            {
                                mContainedIn.RelatedElements.Add(product);
                            }
                        }
                    }
                }
            }
 internal override void ParseXml(XmlElement xml)
 {
     base.ParseXml(xml);
     foreach (XmlNode child in xml.ChildNodes)
     {
         string name = child.Name;
         if (string.Compare(name, "ShapeOfProduct") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcProduct product = mDatabase.ParseXml <IfcProduct>(cn as XmlElement);
                 if (product != null)
                 {
                     mShapeOfProduct.Add(product);
                 }
             }
         }
         if (string.Compare(name, "HasShapeAspects") == 0)
         {
             foreach (XmlNode cn in child.ChildNodes)
             {
                 IfcShapeAspect aspect = mDatabase.ParseXml <IfcShapeAspect>(cn as XmlElement);
                 if (aspect != null)
                 {
                     mHasShapeAspects.Add(aspect);
                 }
             }
         }
     }
 }
Beispiel #6
0
 public IfcBridgePrismaticElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcBridgePrismaticElementType type) : base(host, p, r)
 {
     if (mDatabase.mRelease == ReleaseVersion.IFC2x3 || mDatabase.mRelease == ReleaseVersion.IFC4 || mDatabase.mRelease == ReleaseVersion.IFC4A1)
     {
         throw new Exception(KeyWord + " only supported in IFC5!");
     }
     mPredefinedType = type;
 }
Beispiel #7
0
		protected IfcObjectPlacement(DatabaseIfc db, IfcProduct p) : base(db)
		{
			if (p != null)
			{
				p.Placement = this;
				if (!mPlacesObject.Contains(p))
					mPlacesObject.Add(p);
			}
		}
Beispiel #8
0
 public IfcBridgeSegment(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcBridgeSegmentType type, List <IfcCivilElementPart> parts) : base(host, p, r)
 {
     if (mDatabase.mRelease == ReleaseVersion.IFC2x3 || mDatabase.mRelease == ReleaseVersion.IFC4 || mDatabase.mRelease == ReleaseVersion.IFC4A1)
     {
         throw new Exception(KeyWord + " only supported in IFC5!");
     }
     mSegmentType  = type;
     mSegmentParts = parts.ConvertAll(x => x.mIndex);
 }
Beispiel #9
0
        public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height)
            : base(container, new IfcLocalPlacement(container.Placement, placement), null)
        {
            DatabaseIfc db  = mDatabase;
            double      tol = mDatabase.Tolerance;

            setMaterial(layerSetUsage);

            IfcShapeRepresentation asr  = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db, 0, 0, 0), new IfcCartesianPoint(db, length, 0, 0)));
            List <IfcShapeModel>   reps = new List <IfcShapeModel>();

            reps.Add(asr);
            double t = layerSetUsage.ForLayerSet.MaterialLayers.ToList().ConvertAll(x => x.LayerThickness).Sum();

            reps.Add(new IfcShapeRepresentation(new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db, "", length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db, length / 2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t / 2.0, 0)), height)));
            Representation = new IfcProductDefinitionShape(reps);
        }
Beispiel #10
0
        internal static void parseFields(IfcGrid g, List <string> arrFields, ref int ipos, ReleaseVersion schema)
        {
            IfcProduct.parseFields(g, arrFields, ref ipos);
            g.mUAxes = ParserSTEP.SplitListLinks(arrFields[ipos++]);
            g.mVAxes = ParserSTEP.SplitListLinks(arrFields[ipos++]);
            string s = arrFields[ipos++];

            if (s != "$")
            {
                g.mWAxes = ParserSTEP.SplitListLinks(s);
            }
            if (schema != ReleaseVersion.IFC2x3)
            {
                s = arrFields[ipos++];
                if (s[0] == '.')
                {
                    g.mPredefinedType = (IfcGridTypeEnum)Enum.Parse(typeof(IfcGridTypeEnum), s.Replace(".", ""));
                }
            }
        }
            internal GlobalIdChangeManager(BaseClassIfc obj)
            {
                mObject = obj;
                IfcObjectDefinition objectDefinition = obj as IfcObjectDefinition;

                if (objectDefinition != null)
                {
                    mIsDefinedBy.AddRange(objectDefinition.mIsDefinedBy);
                    foreach (IfcRelDefinesByProperties rdp in mIsDefinedBy)
                    {
                        rdp.RelatedObjects.Remove(objectDefinition);
                    }

                    mDecomposes = objectDefinition.mDecomposes;
                    if (mDecomposes != null)
                    {
                        mDecomposes.RelatedObjects.Remove(objectDefinition);
                    }
                    mNests = objectDefinition.mNests;
                    if (mNests != null)
                    {
                        mNests.RelatedObjects.Remove(objectDefinition);
                    }

                    IfcObject o = mObject as IfcObject;
                    if (o != null)
                    {
                        IfcProduct product = objectDefinition as IfcProduct;
                        if (product != null)
                        {
                            mContainedIn = product.mContainedInStructure;
                            if (mContainedIn != null)
                            {
                                mContainedIn.RelatedElements.Remove(product);
                            }
                        }
                    }
                }
            }
Beispiel #12
0
		internal IfcElectricTimeControl(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { }
 protected static void parseFields(IfcPositioningElement p, List <string> arrFields, ref int ipos)
 {
     IfcProduct.parseFields(p, arrFields, ref ipos);
 }
Beispiel #14
0
		internal IfcGeographicElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception(mKW + " only supported in IFC4!"); }
Beispiel #15
0
 internal IfcUnitaryControlElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcDistributionSystem system) : base(host, p, r, system)
 {
 }
Beispiel #16
0
 internal IfcWasteTerminal(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
Beispiel #17
0
		internal IfcTendonAnchor(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { }
Beispiel #18
0
		public IfcElement GenerateMappedItemElement(IfcProduct container, IfcCartesianTransformationOperator transform)  
		{
			string typename = this.GetType().Name;
			typename = typename.Substring(0, typename.Length - 4);
			IfcProductDefinitionShape pds = new IfcProductDefinitionShape(new IfcShapeRepresentation(new IfcMappedItem(RepresentationMaps[0], transform)));
			IfcElement element = IfcElement.constructElement(typename, container,null, pds);
			element.RelatingType = this;
			return element;
		}
Beispiel #19
0
 public IfcVibrationIsolator(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r)
 {
 }
Beispiel #20
0
 internal IfcBridgeContactElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation)
 {
 }
        protected void ReplaceDatabase(BaseClassIfc revised)
        {
            IfcRoot thisRoot = this as IfcRoot, revisedRoot = revised as IfcRoot;

            if (thisRoot != null && revisedRoot != null)
            {
                revisedRoot.GlobalId     = thisRoot.GlobalId;
                revisedRoot.OwnerHistory = thisRoot.OwnerHistory;
                revisedRoot.Name         = thisRoot.Name;
                revisedRoot.Description  = thisRoot.Description;
                IfcObjectDefinition thisObjectDefinition = this as IfcObjectDefinition, revisedObjectDefinition = revised as IfcObjectDefinition;
                if (thisObjectDefinition != null && revisedObjectDefinition != null)
                {
                    foreach (IfcRelAggregates rel in thisObjectDefinition.IsDecomposedBy.ToList())
                    {
                        rel.RelatingObject = revisedObjectDefinition;
                    }
                    foreach (IfcRelNests rel in thisObjectDefinition.IsNestedBy.ToList())
                    {
                        rel.RelatingObject = revisedObjectDefinition;
                    }

                    foreach (IfcRelAssigns assigns in thisObjectDefinition.HasAssignments.ToList())
                    {
                        assigns.RelatedObjects.Remove(thisObjectDefinition);
                        assigns.RelatedObjects.Add(revisedObjectDefinition);
                    }
                    IfcRelDeclares relDeclares = thisObjectDefinition.HasContext;
                    if (relDeclares != null)
                    {
                        relDeclares.RelatedDefinitions.Remove(thisObjectDefinition);
                        relDeclares.RelatedDefinitions.Add(revisedObjectDefinition);
                    }
                    foreach (IfcRelAssociates associates in thisObjectDefinition.HasAssociations.ToList())
                    {
                        associates.RelatedObjects.Remove(thisObjectDefinition);
                        associates.RelatedObjects.Add(revisedObjectDefinition);
                    }
                    IfcObject thisObject = this as IfcObject, revisedObject = revised as IfcObject;
                    if (thisObject != null && revisedObject != null)
                    {
                        revisedObject.ObjectType = thisObject.ObjectType;

                        if (thisObject.mIsTypedBy != null)
                        {
                            thisObject.mIsTypedBy.mRelatedObjects.Remove(thisObject);
                        }
                        IfcProduct thisProduct = this as IfcProduct, revisedProduct = revised as IfcProduct;
                        if (thisProduct != null && revisedProduct != null)
                        {
                            thisProduct.detachFromHost();
                            IfcElement thisElement = this as IfcElement, revisedElement = revised as IfcElement;
                            if (thisElement != null && revisedElement != null)
                            {
                                revisedElement.Tag = thisElement.Tag;
                            }
                        }
                    }
                    else
                    {
                        IfcTypeObject thisTypeObject = this as IfcTypeObject, revisedTypeObject = revised as IfcTypeObject;
                        if (thisTypeObject != null && revisedTypeObject != null)
                        {
                            IfcTypeProduct thisTypeProduct = this as IfcTypeProduct, revisedTypeProduct = revised as IfcTypeProduct;
                            if (thisTypeProduct != null && revisedTypeProduct != null)
                            {
                                revisedTypeProduct.Tag = thisTypeProduct.Tag;
                                IfcElementType thisElementType = this as IfcElementType, revisedElementType = revised as IfcElementType;
                                if (thisElementType != null && revisedElementType != null)
                                {
                                    revisedElementType.ElementType = thisElementType.ElementType;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                IfcRepresentationItem representationItem = this as IfcRepresentationItem, revisedItem = revised as IfcRepresentationItem;
                if (representationItem != null && revisedItem != null)
                {
                    IfcStyledItem styledItem = representationItem.StyledByItem;
                    if (styledItem != null)
                    {
                        styledItem.Item = revisedItem;
                    }

                    foreach (IfcShapeModel shapeModel in representationItem.mRepresents.ToList())
                    {
                        shapeModel.Items.Remove(representationItem);
                        shapeModel.Items.Add(revisedItem);
                    }
                    IfcPresentationLayerAssignment layerAssignment = representationItem.mLayerAssignment;
                    if (layerAssignment != null)
                    {
                        layerAssignment.AssignedItems.Remove(representationItem);
                        layerAssignment.AssignedItems.Add(revisedItem);
                    }
                }
            }
            mDatabase[revised.mIndex] = null;
            revised.mIndex            = mIndex;
            mDatabase[mIndex]         = revised;
        }
Beispiel #22
0
		internal IfcAnnotation(IfcProduct host) : base(host)
		{
			if (mDatabase.mModelView != ModelView.If2x3NotAssigned && mDatabase.mModelView != ModelView.Ifc4NotAssigned)
				throw new Exception("Invalid Model View for " + KeyWord + " : " + mDatabase.ModelView.ToString());
		}
Beispiel #23
0
		internal IfcAirToAirHeatRecovery(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { }
Beispiel #24
0
		internal IfcUnitaryControlElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcDistributionSystem system) : base(host,p,r, system) { }
Beispiel #25
0
		internal static IfcElement constructElement(string className, IfcProduct container, IfcObjectPlacement pl, IfcProductRepresentation r) { return constructElement(className, container, pl, r, null); }
Beispiel #26
0
		public IfcCurtainWall(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { }
Beispiel #27
0
		public IfcElementAssembly(IfcProduct host, IfcAssemblyPlaceEnum place, IfcElementAssemblyTypeEnum type) : base(host.mDatabase) { mHost = host; AssemblyPlace = place; PredefinedType = type; }
Beispiel #28
0
		internal IfcCableCarrierFitting(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { }
Beispiel #29
0
		internal IfcEvaporativeCooler(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { }
Beispiel #30
0
		public IfcCivilElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " only supported in IFC4!"); }
Beispiel #31
0
		public IfcVibrationIsolator(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { }
Beispiel #32
0
		public IfcColumn(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { }
Beispiel #33
0
        public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height)
            : base(container,new IfcLocalPlacement(container.Placement, placement),null)
        {
            DatabaseIfc db = mDatabase;
            double tol = mDatabase.Tolerance;
            setMaterial(layerSetUsage);

            IfcShapeRepresentation asr = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db,0,0,0),new IfcCartesianPoint(db,length,0,0)));
            List<IfcShapeModel> reps = new List<IfcShapeModel>();
            reps.Add(asr);
            double t = layerSetUsage.ForLayerSet.MaterialLayers.ConvertAll(x=>x.LayerThickness).Sum();

            reps.Add(new IfcShapeRepresentation( new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db,"",length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db,length/2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t/2.0, 0)), height)));
            Representation = new IfcProductDefinitionShape(reps);
        }
Beispiel #34
0
		internal IfcMechanicalFastener(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { }
Beispiel #35
0
		internal IfcDistributionElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcDistributionSystem system) : this(host,p,r) { if (system != null) system.assign(this); }
Beispiel #36
0
 internal IfcBridgeSegmentPart(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation)
 {
 }
Beispiel #37
0
            internal void setAggregate(BaseClassIfc obj)
            {
                IfcProduct product = obj as IfcProduct;

                if (product != null)
                {
                    mProducts.Add(product);
                    IfcBuildingStorey buildingStorey = obj as IfcBuildingStorey;
                    if (buildingStorey != null)
                    {
                        mBuildingStories.Add(buildingStorey);
                    }
                    IfcGrid grid = obj as IfcGrid;
                    if (grid != null)
                    {
                        mGrids.Add(grid);
                    }
                    IfcSlab slab = product as IfcSlab;
                    if (slab != null)
                    {
                        mSlabs.Add(slab);
                    }
                    IfcStructuralItem structuralItem = obj as IfcStructuralItem;
                    if (structuralItem != null)
                    {
                        mStructItems.Add(structuralItem);
                    }
                    IfcWall wall = product as IfcWall;
                    if (wall != null)
                    {
                        mWalls.Add(wall);
                    }
                    return;
                }
                //IfcApplication application = obj as IfcApplication;
                //if (application != null)
                //	mApplications.Add(application);
                IfcComplexProperty cp = obj as IfcComplexProperty;

                if (cp != null)
                {
                    mComplexProperties.Add(cp);
                    return;
                }
                IfcCoordinateOperation coordOp = obj as IfcCoordinateOperation;

                if (coordOp != null)
                {
                    mCoordinateOperations.Add(coordOp);
                    return;
                }

                IfcEdgeCurve edgeCurve = obj as IfcEdgeCurve;

                if (edgeCurve != null)
                {
                    mEdgeCurves.Add(edgeCurve);
                    return;
                }
                IfcExternalReferenceRelationship externalReferenceRelationship = obj as IfcExternalReferenceRelationship;

                if (externalReferenceRelationship != null)
                {
                    mExternalRelationships.Add(externalReferenceRelationship);
                    return;
                }
                //IfcExtrudedAreaSolid extrudedAreaSolid = result as IfcExtrudedAreaSolid;
                //if(extrudedAreaSolid != null)
                //{
                //	if(result as IfcExtrudedAreaSolidTapered == null)
                //		aggregate.mExtrusions.Add(extrudedAreaSolid);
                //	return extrudedAreaSolid;
                //}
                IfcGeometricRepresentationSubContext geometricRepresentationContext = obj as IfcGeometricRepresentationSubContext;

                if (geometricRepresentationContext != null)
                {
                    mGeomContexts.Add(geometricRepresentationContext);
                    return;
                }


                IfcGroup group = obj as IfcGroup;

                if (group != null)
                {
                    IfcZone zone = group as IfcZone;
                    if (zone != null)
                    {
                        mZones.Add(zone);
                        return;
                    }
                    mGroups.Add(group);
                    return;
                }
                IfcIndexedColourMap indexedColourMap = obj as IfcIndexedColourMap;

                if (indexedColourMap != null)
                {
                    mIndexedColourMap.Add(indexedColourMap);
                    return;
                }
                IfcIndexedTextureMap indexedTextureMap = obj as IfcIndexedTextureMap;

                if (indexedTextureMap != null)
                {
                    mIndexedTextureMap.Add(indexedTextureMap);
                    return;
                }
                IfcLocalPlacement localPlacement = obj as IfcLocalPlacement;

                if (localPlacement != null)
                {
                    mLocalPlacements.Add(localPlacement);
                    return;
                }
                IfcMappedItem mi = obj as IfcMappedItem;

                if (mi != null)
                {
                    mMappedItems.Add(mi);
                    return;
                }
                IfcMaterial material = obj as IfcMaterial;

                if (material != null)
                {
                    mMaterials.Add(material);
                    return;
                }
                IfcMaterialProperties materialProperties = obj as IfcMaterialProperties;

                if (materialProperties != null)
                {
                    mMaterialProperties.Add(materialProperties);
                    return;
                }
                IfcMaterialPropertiesSuperSeded materialPropertiesSS = obj as IfcMaterialPropertiesSuperSeded;

                if (materialPropertiesSS != null)
                {
                    mMaterialPropertiesSS.Add(materialPropertiesSS);
                    return;
                }
                //	IfcMechanicalFastener mechanicalFastener = result as IfcMechanicalFastener;
                //if(mechanicalFastener != null)
                //{
                //	mFasteners.Add(mechanicalFastener);
                //	return mechanicalFastener;
                //}
                //IfcOwnerHistory ownerHistory = result as IfcOwnerHistory;
                //if(ownerHistory != null)
                //{
                //	mOwnHistories.Add(ownerHistory);
                //	return ownerHistory;
                //}
                IfcPresentationLayerAssignment presentationLayerAssignment = obj as IfcPresentationLayerAssignment;

                if (presentationLayerAssignment != null)
                {
                    mPresentationLayerAssignments.Add(presentationLayerAssignment);
                    return;
                }
                IfcProductRepresentation productRepresentation = obj as IfcProductRepresentation;

                if (productRepresentation != null)
                {
                    mProductReps.Add(productRepresentation);
                    return;
                }
                IfcPropertySet propSet = obj as IfcPropertySet;

                if (propSet != null)
                {
                    mPropertySets.Add(propSet);
                    return;
                }
                //IfcProfileDef profileDef = obj as IfcProfileDef;
                //if (profileDef != null)
                //{
                //	mProfiles.Add(profileDef);
                //	return profileDef;
                //}
                IfcRelationship relationship = obj as IfcRelationship;

                if (relationship != null)
                {
                    mRelationships.Add(relationship);
                    return;
                }
                IfcRepresentation representation = obj as IfcRepresentation;

                if (representation != null)
                {
                    mRepresentations.Add(representation);
                    return;
                }
                //IfcRepresentationMap representationMap = obj as IfcRepresentationMap;
                //if (representationMap != null)
                //{
                //	mRepMaps.Add(representationMap);
                //	return representationMap;
                //}
                IfcResourceConstraintRelationship rcr = obj as IfcResourceConstraintRelationship;

                if (rcr != null)
                {
                    mConstraintRelationships.Add(rcr);
                    return;
                }
                IfcShapeAspect shapeAspect = obj as IfcShapeAspect;

                if (shapeAspect != null)
                {
                    mShapeAspects.Add(shapeAspect);
                    return;
                }
                IfcStyledItem styledItem = obj as IfcStyledItem;

                if (styledItem != null)
                {
                    mStyledItems.Add(styledItem);
                    return;
                }

                IfcTypeProduct typeProduct = obj as IfcTypeProduct;

                if (typeProduct != null)
                {
                    mTypeProducts.Add(typeProduct);
                    return;
                }
                setCustomAggregate(obj);
            }
Beispiel #38
0
		public IfcRoof(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { }
Beispiel #39
0
		internal IfcElectricFlowStorageDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { }
Beispiel #40
0
		internal IfcReinforcingMesh(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { }
Beispiel #41
0
		protected IfcElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { }
Beispiel #42
0
		public IfcRampFlight(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { }
Beispiel #43
0
		internal static IfcElement constructElement(string className, IfcProduct container, IfcObjectPlacement pl, IfcProductRepresentation r, IfcDistributionSystem system)
		{
			string str = className, definedType = "";
			if (!string.IsNullOrEmpty(str))
			{
				string[] fields = str.Split(".".ToCharArray());
				if (fields.Length > 1)
				{
					str = fields[0];
					definedType = fields[1];
				}
			}
			IfcElement element = null;
			Type type = Type.GetType("GeometryGym.Ifc." + str);
			if (type != null)
			{
				ConstructorInfo ctor = type.GetConstructor(new[] { typeof(IfcProduct), typeof(IfcObjectPlacement), typeof(IfcProductRepresentation) });
				if (ctor == null)
				{
					ctor = type.GetConstructor(new[] { typeof(IfcProduct), typeof(IfcObjectPlacement), typeof(IfcProductRepresentation), typeof(IfcDistributionSystem) });
					if (ctor == null)
						throw new Exception("XXX Unrecognized Ifc Constructor for " + className);
					else
						element = ctor.Invoke(new object[] { container, pl, r, system }) as IfcElement;
				}
				else
					element = ctor.Invoke(new object[] { container, pl, r }) as IfcElement;
			}
			if (element == null)
				element = new IfcBuildingElementProxy(container, pl, r);

			if (!string.IsNullOrEmpty(definedType))
			{
				if (container.mDatabase.mSchema == Schema.IFC2x3)
					element.ObjectType = definedType;
				else
				{
					type = element.GetType();
					PropertyInfo pi = type.GetProperty("PredefinedType");
					if (pi != null)
					{
						Type enumType = Type.GetType("GeometryGym.Ifc." + type.Name + "TypeEnum");
						if (enumType != null)
						{
							FieldInfo fi = enumType.GetField(definedType);
							if (fi == null)
							{
								element.ObjectType = definedType;
								fi = enumType.GetField("NOTDEFINED");
							}
							if (fi != null)
							{
								int i = (int)fi.GetValue(enumType);
								object newEnumValue = Enum.ToObject(enumType, i);
								pi.SetValue(element, newEnumValue, null);
							}
							else
								element.ObjectType = definedType;
						}
						else
							element.ObjectType = definedType;
					}
					else
						element.ObjectType = definedType;
				}
			}
			return element;
		}
Beispiel #44
0
 protected IfcBridgeElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r)
 {
 }
Beispiel #45
0
		protected IfcElementComponent(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host,placement,representation) { }
Beispiel #46
0
 internal IfcHeatExchanger(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
Beispiel #47
0
		internal IfcEnergyConversionDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { }
Beispiel #48
0
 internal IfcUnitaryEquipment(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
Beispiel #49
0
		internal IfcTendon(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, double diam, double area, double forceMeasure, double pretress, double fricCoeff, double anchorSlip, double minCurveRadius)
			: base(host, placement,representation)
		{
			mNominalDiameter = diam;
			mCrossSectionArea = area;
			mTensionForce = forceMeasure;
			mPreStress = pretress;
			mFrictionCoefficient = fricCoeff;
			mAnchorageSlip = anchorSlip;
			mMinCurvatureRadius = minCurveRadius;
		}
Beispiel #50
0
 internal IfcLightFixture(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system)
 {
 }
Beispiel #51
0
		internal IfcTransportElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { }
Beispiel #52
0
 public IfcBeamStandardCase(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length) : base(host, profile, placement, length)
 {
 }
Beispiel #53
0
		internal IfcValve(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { }
Beispiel #54
0
 public IfcBeamStandardCase(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, Tuple <double, double> arcOrigin, double arcAngle) : base(host, profile, placement, arcOrigin, arcAngle)
 {
 }
Beispiel #55
0
 public IfcWall(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r)
 {
 }
Beispiel #56
0
 protected IfcBuildingElement(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, Tuple <double, double> arcOrigin, double arcAngle) : base(host, profile, placement, arcOrigin, arcAngle)
 {
 }
        protected void ReplaceDatabase(BaseClassIfc revised)
        {
            IfcRoot thisRoot = this as IfcRoot, revisedRoot = revised as IfcRoot;

            if (thisRoot != null && revisedRoot != null)
            {
                revisedRoot.GlobalId     = thisRoot.GlobalId;
                revisedRoot.OwnerHistory = thisRoot.OwnerHistory;
                revisedRoot.Name         = thisRoot.Name;
                revisedRoot.Description  = thisRoot.Description;
                IfcObjectDefinition thisObjectDefinition = this as IfcObjectDefinition, revisedObjectDefinition = revised as IfcObjectDefinition;
                if (thisObjectDefinition != null && revisedObjectDefinition != null)
                {
                    foreach (IfcRelAggregates rel in thisObjectDefinition.IsDecomposedBy.ToList())
                    {
                        rel.RelatingObject = revisedObjectDefinition;
                    }
                    foreach (IfcRelNests rel in thisObjectDefinition.IsNestedBy.ToList())
                    {
                        rel.RelatingObject = revisedObjectDefinition;
                    }

                    IfcRelAggregates relAggregates = thisObjectDefinition.Decomposes;
                    if (relAggregates != null)
                    {
                        relAggregates.RelatedObjects.Remove(thisObjectDefinition);
                        relAggregates.RelatedObjects.Add(revisedObjectDefinition);
                    }
                    IfcRelNests relNests = thisObjectDefinition.Nests;
                    if (relNests != null)
                    {
                        relNests.RelatedObjects.Remove(thisObjectDefinition);
                        relNests.RelatedObjects.Add(thisObjectDefinition);
                    }

                    foreach (IfcRelDefinesByProperties relDefinesByProperties in thisObjectDefinition.mIsDefinedBy.ToList())
                    {
                        relDefinesByProperties.RelatedObjects.Remove(thisObjectDefinition);
                        relDefinesByProperties.RelatedObjects.Add(revisedObjectDefinition);
                    }

                    foreach (IfcRelAssigns assigns in thisObjectDefinition.HasAssignments.ToList())
                    {
                        assigns.RelatedObjects.Remove(thisObjectDefinition);
                        assigns.RelatedObjects.Add(revisedObjectDefinition);
                    }
                    IfcRelDeclares relDeclares = thisObjectDefinition.HasContext;
                    if (relDeclares != null)
                    {
                        relDeclares.RelatedDefinitions.Remove(thisObjectDefinition);
                        relDeclares.RelatedDefinitions.Add(revisedObjectDefinition);
                    }
                    foreach (IfcRelAssociates associates in thisObjectDefinition.HasAssociations.ToList())
                    {
                        associates.RelatedObjects.Remove(thisObjectDefinition);
                        associates.RelatedObjects.Add(revisedObjectDefinition);
                    }
                    IfcObject thisObject = this as IfcObject, revisedObject = revised as IfcObject;
                    if (thisObject != null && revisedObject != null)
                    {
                        if (!string.IsNullOrEmpty(thisObject.ObjectType))
                        {
                            revisedObject.ObjectType = thisObject.ObjectType;
                        }

                        if (thisObject.mIsTypedBy != null)
                        {
                            thisObject.mIsTypedBy.mRelatedObjects.Remove(thisObject);
                        }
                        IfcProduct thisProduct = this as IfcProduct, revisedProduct = revised as IfcProduct;
                        if (thisProduct != null && revisedProduct != null)
                        {
                            IfcRelContainedInSpatialStructure containedInSpatialStructure = thisProduct.mContainedInStructure;
                            if (containedInSpatialStructure != null)
                            {
                                containedInSpatialStructure.RelatedElements.Remove(thisProduct);
                                containedInSpatialStructure.RelatedElements.Add(revisedProduct);
                            }
                            IfcElement thisElement = this as IfcElement, revisedElement = revised as IfcElement;
                            if (thisElement != null && revisedElement != null)
                            {
                                revisedElement.Tag = thisElement.Tag;
                                List <IfcRelVoidsElement> voids = thisElement.HasOpenings.ToList();
                                foreach (var relVoids in voids)
                                {
                                    relVoids.RelatingBuildingElement = revisedElement;
                                }
                            }
                            IfcSpatialElement thisSpatial = this as IfcSpatialElement, revisedSpatial = revised as IfcSpatialElement;
                            if (thisSpatial != null && revisedSpatial != null)
                            {
                                foreach (IfcRelContainedInSpatialStructure contained in thisSpatial.ContainsElements.ToList())
                                {
                                    contained.RelatingStructure = revisedSpatial;
                                }
                            }
                            else if (revisedSpatial != null && thisElement != null)
                            {
                                if (containedInSpatialStructure != null)
                                {
                                    containedInSpatialStructure.RelatedElements.Remove(revisedProduct);
                                    containedInSpatialStructure.RelatingStructure.AddAggregated(revisedProduct);
                                }
                                List <IfcProduct> subProducts = thisObjectDefinition.IsDecomposedBy.SelectMany(x => x.RelatedObjects).OfType <IfcProduct>().ToList();
                                if (subProducts.Count > 0)
                                {
                                    new IfcRelContainedInSpatialStructure(subProducts, revisedSpatial);
                                }
                                foreach (IfcRelAssociatesMaterial associates in revisedSpatial.HasAssociations.OfType <IfcRelAssociatesMaterial>().ToList())
                                {
                                    associates.RelatedObjects.Remove(revisedSpatial);
                                }

                                IfcFacilityPart facilityPart = revisedSpatial as IfcFacilityPart;
                                if (facilityPart != null)
                                {
                                    IfcFacility facility = revisedSpatial.FindHost <IfcFacility>();
                                    if (facility != null)
                                    {
                                        facility.AddAggregated(revisedSpatial);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        IfcTypeObject thisTypeObject = this as IfcTypeObject, revisedTypeObject = revised as IfcTypeObject;
                        if (thisTypeObject != null && revisedTypeObject != null)
                        {
                            IfcTypeProduct thisTypeProduct = this as IfcTypeProduct, revisedTypeProduct = revised as IfcTypeProduct;
                            if (thisTypeProduct != null && revisedTypeProduct != null)
                            {
                                revisedTypeProduct.Tag = thisTypeProduct.Tag;
                                IfcElementType thisElementType = this as IfcElementType, revisedElementType = revised as IfcElementType;
                                if (thisElementType != null && revisedElementType != null)
                                {
                                    revisedElementType.ElementType = thisElementType.ElementType;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                IfcRepresentationItem representationItem = this as IfcRepresentationItem, revisedItem = revised as IfcRepresentationItem;
                if (representationItem != null && revisedItem != null)
                {
                    IfcStyledItem styledItem = representationItem.StyledByItem;
                    if (styledItem != null)
                    {
                        styledItem.Item = revisedItem;
                    }

                    foreach (IfcShapeModel shapeModel in representationItem.Represents.ToList())
                    {
                        shapeModel.Items.Remove(representationItem);
                        shapeModel.Items.Add(revisedItem);
                    }
                    IfcPresentationLayerAssignment layerAssignment = representationItem.mLayerAssignment;
                    if (layerAssignment != null)
                    {
                        layerAssignment.AssignedItems.Remove(representationItem);
                        layerAssignment.AssignedItems.Add(revisedItem);
                    }
                }
            }
            mDatabase[revised.mStepId] = null;
            revised.mStepId            = StepId;
            mDatabase[StepId]          = revised;
        }
Beispiel #58
0
 public IfcBuildingElementProxy(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length) : base(host, profile, placement, length)
 {
 }
Beispiel #59
0
 public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, IfcProductDefinitionShape shape)
     : base(container, new IfcLocalPlacement(container.Placement, placement), null)
 {
     setMaterial(layerSetUsage);
     Representation = shape;
 }
Beispiel #60
0
		internal IfcDistributionElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { }