public IfcOpeningElement(IfcElement host, IfcObjectPlacement placement, IfcProductRepresentation rep) : base(host.mDatabase) { if (placement == null) Placement = new IfcLocalPlacement(host.Placement, new IfcAxis2Placement3D(Database.Factory.Origin)); else Placement = placement; Representation = rep; IfcRelVoidsElement rve = new IfcRelVoidsElement(host, this); }
internal static void parseFields(IfcGeographicElement e, List <string> arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); string s = arrFields[ipos++]; if (s.StartsWith(".")) { e.mPredefinedType = (IfcGeographicElementTypeEnum)Enum.Parse(typeof(IfcGeographicElementTypeEnum), s.Replace(".", "")); } }
public IfcOpeningStandardCase(IfcElement host, IfcObjectPlacement placement, IfcExtrudedAreaSolid eas) : base(host, placement, new IfcProductDefinitionShape(new IfcShapeRepresentation(eas))) { }
public IfcVoidingFeature(IfcElement host, IfcProductRepresentation rep, IfcVoidingFeatureTypeEnum type) : base(host, rep) { mPredefinedType = type; }
protected IfcRelProjectsElement(IfcElement e, IfcFeatureElementAddition a) : base(e.mDatabase) { mRelatingElement = e.mIndex; mRelatedFeatureElement = a.mIndex; }
protected IfcElement(DatabaseIfc db, IfcElement e, bool downStream) : base(db, e,downStream) { mTag = e.mTag; #warning todo finish inverse foreach (IfcRelVoidsElement ve in e.mHasOpenings) { IfcRelVoidsElement dve = db.Factory.Duplicate(ve) as IfcRelVoidsElement; dve.RelatingBuildingElement = this; } foreach(IfcRelConnectsElements ce in e.mConnectedTo) { IfcElement element = ce.RelatingElement; if(db.Factory.mDuplicateMapping.ContainsKey(element.mIndex)) { IfcRelConnectsElements rce = db.Factory.Duplicate(ce) as IfcRelConnectsElements; rce.RelatedElement = this; rce.RelatingElement = db[db.Factory.mDuplicateMapping[element.mIndex]] as IfcElement; } } foreach (IfcRelConnectsElements ce in e.mConnectedFrom) { IfcElement element = ce.RelatedElement; if (db.Factory.mDuplicateMapping.ContainsKey(element.mIndex)) { IfcRelConnectsElements rce = db.Factory.Duplicate(ce) as IfcRelConnectsElements; rce.RelatingElement = this; rce.RelatedElement = db[db.Factory.mDuplicateMapping[element.mIndex]] as IfcElement; } } foreach(IfcRelVoidsElement ve in e.mHasOpenings) { IfcRelVoidsElement rv = db.Factory.Duplicate(ve) as IfcRelVoidsElement; rv.RelatingBuildingElement = this; } if (e.mContainedInStructure != null) (db.Factory.Duplicate(e.mContainedInStructure, false) as IfcRelContainedInSpatialStructure).add(this); foreach (IfcRelConnectsStructuralActivity rcss in e.mAssignedStructuralActivity) { IfcRelConnectsStructuralActivity rc = db.Factory.Duplicate(rcss) as IfcRelConnectsStructuralActivity; rc.RelatingElement = this; } foreach (IfcRelConnectsStructuralElement rcse in e.mHasStructuralMember) { IfcRelConnectsStructuralElement rc = db.Factory.Duplicate(rcse) as IfcRelConnectsStructuralElement; rc.RelatingElement = this; } }
internal void removeObject(IfcElement e) { e.mContainedInStructure = null; mRelatedElements.Remove(e.mIndex); }
internal IfcRelCoversBldgElements(IfcElement e, List<IfcCovering> coverings) : base(e.mDatabase) { mRelatingBuildingElement = e.mIndex; e.mHasCoverings.Add(this); for (int icounter = 0; icounter < coverings.Count; icounter++) { mRelatedCoverings.Add(coverings[icounter].mIndex); coverings[icounter].mCoversElements = this; } }
public Pset_ManufacturerTypeInformation(IfcElement element) : base(element.mDatabase, "Pset_ManufacturerTypeInformation") { DefinesOccurrence.Assign(element); }
protected IfcFeatureElementSubtraction(IfcElement host, IfcProductRepresentation rep) : base(host.mDatabase) { new IfcRelVoidsElement(host, this); Representation = rep; ObjectPlacement = new IfcLocalPlacement(host.ObjectPlacement, mDatabase.Factory.XYPlanePlacement); }
public IfcOpeningElement(IfcElement host, IfcObjectPlacement placement, IfcProductRepresentation rep) : base(host.mDatabase) { Placement = placement; Representation = rep; IfcRelVoidsElement rve = new IfcRelVoidsElement(host, this); }
public Pset_ManufacturerOccurrence(IfcElement element) : base(element.mDatabase, "Pset_ManufacturerOccurrence") { DefinesOccurrence.Assign(element); }
public IfcDistributionPort(IfcElement host) : base(host) { }
protected IfcPort(IfcElement e) : base(e.mDatabase) { if (mDatabase.mSchema == Schema.IFC2x3) { new IfcRelConnectsPortToElement(this, e); } else { if (e.mIsNestedBy.Count == 0) e.mIsNestedBy.Add(new IfcRelNests(e, this)); else e.mIsNestedBy[0].addObject(this); } }
public virtual bool AddElement(IfcElement s) { for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) { IfcRelAggregates a = mIsDecomposedBy[icounter] as IfcRelAggregates; if (a.Description.EndsWith("Elements", true, System.Globalization.CultureInfo.CurrentCulture)) { a.addObject(s); return true; } } IfcRelAggregates ra = new IfcRelAggregates(mDatabase, KeyWord.Substring(3), "Element", this); ra.addObject(s); return true; }
protected static void parseFields(IfcElement e, List<string> arrFields, ref int ipos) { IfcProduct.parseFields(e, arrFields, ref ipos); e.mTag = arrFields[ipos++].Replace("'", ""); }
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; }
public IfcVoidingFeature(IfcElement host,IfcProductRepresentation rep,IfcVoidingFeatureTypeEnum type) : base(host,rep) { mPredefinedType = type; }
protected IfcFeatureElementSubtraction(IfcElement host, IfcProductRepresentation rep) : base(host.mDatabase) { new IfcRelVoidsElement(host, this); Representation = rep; Placement = new IfcLocalPlacement(host.Placement, mDatabase.Factory.PlaneXYPlacement); }
internal IfcRelConnectsWithRealizingElements(IfcConnectionGeometry cg, IfcElement relating, IfcElement related, IfcElement realizing, string connection) : base(relating, related) { ConnectionGeometry = cg; mRealizingElements.Add(realizing.mIndex); if (!string.IsNullOrEmpty(connection)) mConnectionType = connection.Replace("'", ""); }
internal void associateElement(IfcElement el) { Associates.mRelatedObjects.Add(el.mIndex); }
internal IfcRelCoversBldgElements(IfcElement e, IfcCovering covering) : base(e.mDatabase) { mRelatingBuildingElement = e.mIndex; e.mHasCoverings.Add(this); if (covering != null) { mRelatedCoverings.Add(covering.mIndex); covering.mCoversElements = this; } }
internal IfcRelSpaceBoundary1stLevel(IfcSpaceBoundarySelect s, IfcElement e, IfcConnectionGeometry g, IfcPhysicalOrVirtualEnum virt, IfcInternalOrExternalEnum intern, IfcRelSpaceBoundary1stLevel parent) : base(s, e, g, virt, intern) { mParentBoundary = parent.mIndex; }
internal IfcRelFillsElement(IfcOpeningElement oe, IfcElement e) : base(oe.mDatabase) { mRelatingOpeningElement = oe.mIndex; mRelatedBuildingElement = e.mIndex; }
public IfcRelVoidsElement(IfcElement host, IfcFeatureElementSubtraction fes) : base(host.mDatabase) { mRelatingBuildingElement = host.mIndex; host.mHasOpenings.Add(this); mRelatedOpeningElement = fes.mIndex; fes.mVoidsElement = this; }
internal IfcRelSpaceBoundary(IfcSpaceBoundarySelect s, IfcElement e, IfcConnectionGeometry g, IfcPhysicalOrVirtualEnum virt, IfcInternalOrExternalEnum intern) : base(s.Database) { mRelatingSpace = s.Index; s.BoundedBy.Add(this); mRelatedBuildingElement = e.mIndex; if (g != null) mConnectionGeometry = g.mIndex; mPhysicalOrVirtualBoundary = virt; mInternalOrExternalBoundary = intern; }
protected IfcElement(IfcElement basis) : base(basis) { mTag = basis.mTag; #warning todo finish inverse }
internal IfcRelSpaceBoundary2ndLevel(IfcSpaceBoundarySelect s, IfcElement e, IfcConnectionGeometry g, IfcPhysicalOrVirtualEnum virt, IfcInternalOrExternalEnum intern, IfcRelSpaceBoundary1stLevel parent, IfcRelSpaceBoundary2ndLevel corresponding) : base(s, e, g, virt, intern, parent) { if (corresponding != null) mCorrespondingBoundary = corresponding.mIndex; }
internal IfcRelConnectsElements(IfcElement relating, IfcElement related) : base(relating.mDatabase) { mRelatingElement = relating.mIndex; relating.mConnectedFrom.Add(this); mRelatedElement = related.mIndex; related.mConnectedTo.Add(this); }
internal IfcRelConnectsElements(IfcConnectionGeometry cg, IfcElement relating, IfcElement related) : this(relating, related) { mConnectionGeometry = cg.mIndex; }
internal IfcElement getConnected(IfcElement e) { return mDatabase.mIfcObjects[(mRelatingElement == e.mIndex ? mRelatedElement : mRelatingElement)] as IfcElement; }
internal static void parseFields(IfcVirtualElement e, List <string> arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); }
internal IfcRelConnectsPortToElement(IfcPort p, IfcElement e) : base(p.mDatabase) { mRelatingPort = p.mIndex; p.mContainedIn = this; mRelatedElement = e.mIndex; e.mHasPorts.Add(this); }
protected IfcElement(IfcElement e) : base(e) { mTag = e.mTag; }
internal IfcRelConnectsPorts(IfcPort relatingPort, IfcPort relatedPort, IfcElement realizingElement) : base(relatingPort.mDatabase) { mRelatingPort = relatingPort.mIndex; mRelatedPort = relatedPort.mIndex; if (realizingElement != null) mRealizingElement = realizingElement.mIndex; }
public override bool AddElement(IfcElement s) { if (mIsDecomposedBy.Count == 0 || mIsDecomposedBy[0].mRelatedObjects.Count == 0) mHost.AddElement(this); return base.AddElement(s); }
internal IfcRelConnectsStructuralElement(IfcElement elem, IfcStructuralMember memb) : base(elem.mDatabase) { if (elem.mDatabase.mSchema != Schema.IFC2x3) throw new Exception(KeyWord + " Deleted IFC4!"); mRelatingElement = elem.mIndex; mRelatedStructuralMember = memb.mIndex; }
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; }
public IfcOpeningStandardCase(IfcElement host, IfcObjectPlacement placement, IfcExtrudedAreaSolid eas) : base(host, placement, new IfcProductDefinitionShape(new IfcShapeRepresentation(eas))) { }