protected IfcObjectDefinition(DatabaseIfc db, IfcObjectDefinition o, bool downStream) : base(db, o) { foreach (IfcRelAssigns assigns in o.mHasAssignments) { IfcRelAssigns dup = db.Factory.Duplicate(assigns, false) as IfcRelAssigns; dup.AddRelated(this); } if (o.mDecomposes != null) { (db.Factory.Duplicate(o.mDecomposes, false) as IfcRelAggregates).addObject(this); } foreach (IfcRelAssociates associates in o.mHasAssociations) { IfcRelAssociates dup = db.Factory.Duplicate(associates) as IfcRelAssociates; dup.addRelated(this); } if (mHasContext != null) { (db.Factory.Duplicate(mHasContext, false) as IfcRelDeclares).AddRelated(this); } if (downStream) { foreach (IfcRelAggregates rag in o.mIsDecomposedBy) { mDatabase.Factory.Duplicate(rag, true); } foreach (IfcRelNests rn in o.mIsNestedBy) { mDatabase.Factory.Duplicate(rn, true); } } }
internal override void ParseXml(XmlElement xml) { base.ParseXml(xml); foreach (XmlNode child in xml.ChildNodes) { string name = child.Name; if (string.Compare(name, "HasAssignments") == 0) { foreach (XmlNode node in child.ChildNodes) { IfcRelAssigns ra = mDatabase.ParseXml <IfcRelAssigns>(node as XmlElement); if (ra != null) { ra.AddRelated(this); } } } else if (string.Compare(name, "IsNestedBy") == 0) { foreach (XmlNode node in child.ChildNodes) { IfcRelNests rn = mDatabase.ParseXml <IfcRelNests>(node as XmlElement); if (rn != null) { rn.RelatingObject = this; } } } else if (string.Compare(name, "IsDecomposedBy") == 0) { foreach (XmlNode node in child.ChildNodes) { IfcRelAggregates ra = mDatabase.ParseXml <IfcRelAggregates>(node as XmlElement); if (ra != null) { ra.RelatingObject = this; } } } else if (string.Compare(name, "HasAssociations") == 0) { foreach (XmlNode node in child.ChildNodes) { IfcRelAssociates ra = mDatabase.ParseXml <IfcRelAssociates>(node as XmlElement); if (ra != null) { ra.addAssociation(this); } } } } }
internal override void changeSchema(ReleaseVersion schema) { for (int icounter = 0; icounter < mHasAssignments.Count; icounter++) { IfcRelAssigns assigns = mDatabase[mHasAssignments[icounter].Index] as IfcRelAssigns; if(assigns != null) assigns.changeSchema(schema); } for (int icounter = 0; icounter < mIsNestedBy.Count; icounter++) mIsNestedBy[icounter].changeSchema(schema); for (int icounter = 0; icounter < mHasAssociations.Count; icounter++) mHasAssociations[icounter].changeSchema(schema); for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) mIsDecomposedBy[icounter].changeSchema(schema); base.changeSchema(schema); }
protected IfcObjectDefinition(DatabaseIfc db, IfcObjectDefinition o) : base (db, o)//, bool downStream) : base(db, o) { foreach(IfcRelAssigns assigns in o.mHasAssignments) { IfcRelAssigns dup = db.Factory.Duplicate(assigns) as IfcRelAssigns; dup.AddRelated(this); } if (o.mDecomposes != null) (db.Factory.Duplicate(o.mDecomposes, false) as IfcRelAggregates).addObject(this); foreach (IfcRelAssociates associates in o.mHasAssociations) { IfcRelAssociates dup = db.Factory.Duplicate(associates) as IfcRelAssociates; dup.addAssociation(this); } if (mHasContext != null) (db.Factory.Duplicate(mHasContext, false) as IfcRelDeclares).AddRelated(this); }
protected static void parseString(IfcRelAssigns a, string str, ref int pos) { a.parseString(str, ref pos); a.mRelatedObjects = ParserSTEP.StripListLink(str, ref pos); ParserSTEP.StripField(str, ref pos); }
protected static void parseFields(IfcRelAssigns c, List<string> arrFields, ref int ipos) { IfcRelationship.parseFields(c, arrFields, ref ipos); c.mRelatedObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); ipos++; //string str = arrFields[ipos++]; //if(!str.Contains("$")) c.mRelatedObjectsType = (IfcObjectTypeEnum) Enum.Parse(typeof(IfcObjectTypeEnum),str.Replace(".","")); }
protected IfcRelAssigns(IfcRelAssigns a) : base(a) { mRelatedObjects = new List<int>(a.mRelatedObjects.ToArray()); }