public IfcZone(IfcSpatialElement e, string name, List <IfcSpace> spaces) : base(e, name) { if (spaces != null && spaces.Count > 0) { new IfcRelAssignsToGroup(spaces, this); } }
private void init(IfcSpatialElement container) { if (container != null) { container.AddAggregated(this); } }
internal IfcZone(IfcSpatialElement e, string name, string longname, List <IfcSpace> spaces) : base(e, name) { if (spaces != null) { mIsGroupedBy[0].mRelatedObjects.AddRange(spaces.ConvertAll(x => x.mIndex)); } }
public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List <IfcGridAxis> uAxes, List <IfcGridAxis> vAxes) : base(new IfcLocalPlacement(host.ObjectPlacement, placement), getRepresentation(uAxes, vAxes, null)) { host.addGrid(this); UAxes.AddRange(uAxes); VAxes.AddRange(vAxes); }
internal void IsolateObject(string filename) { DatabaseIfc db = new DatabaseIfc(mDatabase); IfcSpatialElement spatial = this as IfcSpatialElement; IfcElementAssembly eas = this as IfcElementAssembly; if (spatial != null || eas != null) db.Factory.Duplicate(this, true); else db.Factory.Duplicate(this); db.WriteFile(filename); }
public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List <IfcGridAxis> uAxes, List <IfcGridAxis> vAxes) : base(new IfcLocalPlacement(host.Placement, placement), getRepresentation(uAxes, vAxes, null)) { host.addGrid(this); if (uAxes != null) { mUAxes = uAxes.ConvertAll(x => x.mIndex); } if (vAxes != null) { mVAxes = vAxes.ConvertAll(x => x.mIndex); } }
private void validateWorker(List <IConceptRoot> conceptRoots, List <IfcPropertySetTemplate> propertySetTemplates, ref Dictionary <IfcRoot, List <ValidationResult> > results) { List <ValidationResult> validationResults = new List <ValidationResult>(); foreach (var propertySetTemplate in propertySetTemplates) { List <ValidationResult> templateResults = validatePropertySetTemplate(propertySetTemplate); if (templateResults != null) { validationResults.AddRange(templateResults); } } foreach (var conceptRoot in conceptRoots) { List <ValidationResult> rootResults = conceptRoot.Validate(this); if (rootResults != null) { validationResults.AddRange(rootResults); } } if (validationResults.Count > 0) { results[this] = validationResults; } foreach (var od in IsDecomposedBy.SelectMany(x => x.RelatedObjects)) { od.validateWorker(conceptRoots, propertySetTemplates, ref results); } foreach (var od in IsNestedBy.SelectMany(x => x.RelatedObjects)) { od.validateWorker(conceptRoots, propertySetTemplates, ref results); } IfcSpatialElement spatialElement = this as IfcSpatialElement; if (spatialElement != null) { foreach (var relatedElement in spatialElement.ContainsElements.SelectMany(x => x.RelatedElements)) { relatedElement.validateWorker(conceptRoots, propertySetTemplates, ref results); } foreach (var relatingSystem in spatialElement.ServicedBySystems.Select(x => x.RelatingSystem)) { relatingSystem.validateWorker(conceptRoots, propertySetTemplates, ref results); } } }
public IfcGeotechnicalStratum(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host.Database) { IfcSpatialElement spatialElement = host as IfcSpatialElement; if (spatialElement != null) { spatialElement.AddElement(this); } else { host.AddNested(this); } ObjectPlacement = placement; Representation = representation; }
internal void IsolateObject(string filename) { DatabaseIfc db = new DatabaseIfc(mDatabase); IfcSpatialElement spatial = this as IfcSpatialElement; IfcElementAssembly eas = this as IfcElementAssembly; db.Factory.Duplicate(this, true); IfcSite site = db.Project.RootElement as IfcSite; if (site != null) { IfcProductRepresentation pr = site.Representation; if (pr != null) { site.Representation = null; pr.Destruct(true); } } db.WriteFile(filename); }
public IfcGroup(IfcSpatialElement spatial, string name) : base(spatial.Database) { Name = name; if (!(this is IfcZone)) { if (spatial.mDatabase.Release <= ReleaseVersion.IFC4X3_RC1) { IfcSystem system = this as IfcSystem; if (system != null) { new IfcRelServicesBuildings(system, spatial) { Name = name }; } } else { spatial.ReferenceElement(this); } } }
internal override void ParseXml(XmlElement xml) { base.ParseXml(xml); foreach (XmlNode child in xml.ChildNodes) { string name = child.Name; if (string.Compare(name, "RelatingSystem") == 0) { RelatingSystem = mDatabase.ParseXml <IfcSystem>(child as XmlElement); } else if (string.Compare(name, "RelatedBuildings") == 0) { foreach (XmlNode cn in child.ChildNodes) { IfcSpatialElement s = mDatabase.ParseXml <IfcSpatialElement>(cn as XmlElement); if (s != null) { addRelated(s); } } } } }
static int CountStories(IfcSpatialElement element) { if (element == null) return 0; int result = 0; List<IfcRelAggregates> aggregates = element.IsDecomposedBy; foreach(IfcRelAggregates rag in aggregates) { List<IfcObjectDefinition> objects = rag.RelatedObjects; foreach(IfcObjectDefinition obj in objects) { IfcBuildingStorey storey = obj as IfcBuildingStorey; if (storey != null) result++; else { IfcSpatialElement se = obj as IfcSpatialElement; if (se != null) result += CountStories(se); } } } return result; }
protected IfcSpatialElement(IfcSpatialElement host, string name) : this(host.mDatabase) { Name = name; IfcBuilding building = this as IfcBuilding; if(building != null) host.addBuilding(building); else { building = host as IfcBuilding; IfcBuildingStorey bs = this as IfcBuildingStorey; if (building != null && bs != null) building.addStorey(bs); else { IfcSpace space = this as IfcSpace; if (space != null) host.addSpace(space); else host.AddAggregated(this); } } }
protected static void parseFields(IfcSpatialElement s, List<string> arrFields, ref int ipos) { IfcProduct.parseFields(s, arrFields, ref ipos); s.mLongName = arrFields[ipos++].Replace("'", ""); }
private void init(IfcSpatialElement container) { IfcRelAggregates ra = new IfcRelAggregates(mDatabase, "Building", "Building Storie", this); if (container != null) container.addBuilding(this); //mBuildingAddress = new IfcPostalAddress(mModel, IfcAddressTypeEnum.NOTDEFINED).mIndex; }
public IfcBuildingSystem(IfcSpatialElement bldg, string name, IfcBuildingSystemTypeEnum type) : base(bldg, name) { mPredefinedType = type; }
public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List<IfcGridAxis> uAxes, List<IfcGridAxis> vAxes, List<IfcGridAxis> wAxes) : this(host,placement, uAxes,vAxes) { WAxes = wAxes; }
public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List <IfcGridAxis> uAxes, List <IfcGridAxis> vAxes, List <IfcGridAxis> wAxes) : this(host, placement, uAxes, vAxes) { WAxes.AddRange(wAxes); }
protected static void parseFields(IfcExternalSpatialStructureElement s, List <string> arrFields, ref int ipos) { IfcSpatialElement.parseFields(s, arrFields, ref ipos); }
internal IfcBuildingSystem(IfcSpatialElement bldg, string name, IfcBuildingSystemTypeEnum type) : base(bldg, name) { mPredefinedType = type; }
internal IfcZone(IfcSpatialElement e, string name, string longname, List<IfcSpace> spaces) : base(e, name) { if (spaces != null) mIsGroupedBy[0].mRelatedObjects.AddRange(spaces.ConvertAll(x => x.mIndex)); }
internal IfcSystem(IfcSpatialElement e, string name) : base(e.mDatabase, name) { mServicesBuildings = new IfcRelServicesBuildings(this, e) { Name = name }; }
internal IfcDistributionSystem(IfcSpatialElement bldg, string name, IfcDistributionSystemEnum type) : base(bldg, name) { mPredefinedType = type; }
internal IfcDistributionCircuit(IfcSpatialElement bldg, string name,IfcDistributionSystemEnum type) : base(bldg, name, type) { }
public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List <IfcGridAxis> uAxes, List <IfcGridAxis> vAxes, List <IfcGridAxis> wAxes) : this(host, placement, uAxes, vAxes) { wAxes.ForEach(x => AddWAxis(x)); }
private List<int> mWAxes = new List<int>(); // : OPTIONAL LIST [1:?] OF UNIQUE IfcGridAxis; #endregion Fields #region Constructors public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List<IfcGridAxis> uAxes, List<IfcGridAxis> vAxes) : base(new IfcLocalPlacement(host.Placement, placement), getRepresentation(uAxes,vAxes, null)) { host.addGrid(this); if(uAxes != null) mUAxes = uAxes.ConvertAll(x=>x.mIndex); if (vAxes != null) mVAxes = vAxes.ConvertAll(x => x.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; }
internal IfcRelContainedInSpatialStructure(IfcSpatialElement e) : base(e.mDatabase) { string containerName = ""; if (e as IfcBuilding != null) containerName = "Building"; else if (e as IfcBuildingStorey != null) containerName = "BuildingStorey"; else if (e as IfcExternalSpatialElement != null) containerName = "ExternalSpatialElement"; else if (e as IfcSite != null) containerName = "Site"; else if (e as IfcSpace != null) containerName = "Space"; Name = containerName; Description = containerName + " Container for Elements"; mRelatingStructure = e.mIndex; e.mContainsElements.Add(this); }
protected IfcSpatialElement(IfcSpatialElement e) : base(e) { mLongName = e.mLongName; }
internal IfcRelServicesBuildings(IfcSystem sys, IfcSpatialElement se) : base(sys.mDatabase) { mRelatingSystem = sys.mIndex; mRelatedBuildings.Add(se.mIndex); se.mServicedBySystems.Add(this); }
internal IfcStructuralAnalysisModel(IfcSpatialElement bldg, string name, IfcAnalysisModelTypeEnum type) : base(bldg, name) { mPredefinedType = type; }
public IfcAnnotation(IfcSpatialElement host) : base(host.Database) { host.AddElement(this); }