internal override void ParseXml(XmlElement xml) { base.ParseXml(xml); foreach (XmlNode child in xml.ChildNodes) { string name = child.Name; if (string.Compare(name, "RelatingConstraint") == 0) { RelatingConstraint = mDatabase.ParseXml <IfcConstraint>(child as XmlElement); } else if (string.Compare(name, "RelatedResourceObjects") == 0) { List <IfcResourceObjectSelect> related = new List <IfcResourceObjectSelect>(child.ChildNodes.Count); foreach (XmlNode cn in child.ChildNodes) { IfcResourceObjectSelect r = mDatabase.ParseXml <IfcResourceObjectSelect>(cn as XmlElement); if (r != null) { related.Add(r); } } RelatedResourceObjects = related; } } }
internal override void ParseXml(XmlElement xml) { base.ParseXml(xml); foreach (XmlNode child in xml.ChildNodes) { string name = child.Name; if (string.Compare(name, "RelatingReference") == 0) { RelatingReference = mDatabase.ParseXml <IfcExternalReference>(child as XmlElement); } else if (string.Compare(name, "RelatedResourceObjects") == 0) { List <IfcResourceObjectSelect> objects = new List <IfcResourceObjectSelect>(); foreach (XmlNode cn in child.ChildNodes) { IfcResourceObjectSelect o = mDatabase.ParseXml <IfcResourceObjectSelect>(cn as XmlElement); if (o != null) { objects.Add(o); } } RelatedResourceObjects = objects; } } }
internal static IfcMetric CreateConstraint(string name, IfcElementType elementType, IfcResourceObjectSelect related, string referenceDesc) { IfcMetric metric = new IfcMetric(elementType.Database, name, IfcConstraintEnum.HARD) { ReferencePath = IfcReference.ParseDescription(elementType.Database, referenceDesc), BenchMark = IfcBenchmarkEnum.EQUALTO }; IfcResourceConstraintRelationship rcr = new IfcResourceConstraintRelationship(metric, related); new IfcRelAssociatesConstraint(elementType, metric); return(metric); }
public IfcResourceConstraintRelationship(string name, string description, IfcConstraint constraint, IfcResourceObjectSelect related) : this(name, description, constraint, new List<IfcResourceObjectSelect>() { related }) { }
internal void addRelated(IfcResourceObjectSelect r) { mRelatedResourceObjects.Add(r.Index); r.HasExternalReferences.Add(this); }
public IfcExternalReferenceRelationship(IfcExternalReference reference, IfcResourceObjectSelect related) : this(reference, new List<IfcResourceObjectSelect>() { related }) { }