protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { if (mRepresentationContexts.Count > 0) { JArray array = new JArray() { }; foreach (IfcRepresentationContext representationContext in RepresentationContexts) { array.Add(representationContext.getJson(this, options)); } obj["RepresentationContexts"] = array; } IfcUnitAssignment unitsInContext = UnitsInContext; if (unitsInContext != null) { obj["UnitsInContext"] = unitsInContext.getJson(this, options); } base.setJSON(obj, host, options); setAttribute(obj, "ObjectType", ObjectType); setAttribute(obj, "LongName", LongName); setAttribute(obj, "Phase", Phase); if (mIsDefinedBy.Count > 0 && options.Style != SetJsonOptions.JsonStyle.Repository) { JArray array = new JArray(); foreach (IfcRelDefinesByProperties rdp in mIsDefinedBy) { array.Add(rdp.getJson(this, options)); } obj["IsDefinedBy"] = array; } if (mDeclares.Count > 0) { JArray array = new JArray() { }; foreach (IfcRelDeclares declare in Declares) { if (declare.RelatedDefinitions.Count > 0) { array.Add(declare.getJson(this, options)); } } if (array.Count > 0) { obj["Declares"] = array; } } }
protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed) { base.setJSON(obj, host, processed); setAttribute(obj, "ObjectType", ObjectType); setAttribute(obj, "LongName", LongName); setAttribute(obj, "Phase", Phase); if (mRepresentationContexts.Count > 0) { JArray array = new JArray() { }; foreach (IfcRepresentationContext representationContext in RepresentationContexts) { array.Add(representationContext.getJson(this, processed)); } obj["RepresentationContexts"] = array; } IfcUnitAssignment unitsInContext = UnitsInContext; if (unitsInContext != null) { obj["UnitsInContext"] = unitsInContext.getJson(this, processed); } //INVERSE //public List<IfcRelDefinesByProperties> IsDefinedBy { get { return mIsDefinedBy; } } if (mDeclares.Count > 0) { JArray array = new JArray() { }; foreach (IfcRelDeclares declare in Declares) { if (declare.RelatedDefinitions.Count > 0) { array.Add(declare.getJson(this, processed)); } } if (array.Count > 0) { obj["Declares"] = array; } } }
internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db) { u.mUnits.ForEach(x => AddUnit(db.Factory.Duplicate(u.mDatabase[x]) as IfcUnit)); }
internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db) { Units = u.mUnits.ConvertAll(x => db.Factory.Duplicate(u.mDatabase[x]) as IfcUnit); }
internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db) { Units.AddRange(u.Units.ConvertAll(x => db.Factory.Duplicate(u.mDatabase[x.Index]) as IfcUnit)); }
protected IfcContext(DatabaseIfc m, string name, IfcUnitAssignment.Length length) : base(m) { Name = name; if (m.mGeomRepContxt != null) mRepresentationContexts.Add(m.mGeomRepContxt.mIndex); IfcUnitAssignment u = new IfcUnitAssignment(m); u.SetUnits(length); mUnitsInContext = u.mIndex; mIsDecomposedBy.Clear(); //??? Jon }
internal static void parseFields(IfcUnitAssignment a, List<string> arrFields, ref int ipos) { a.mUnits = ParserSTEP.SplitListLinks(arrFields[ipos++]); }
public IfcProject(IfcBuilding building, string name, IfcUnitAssignment.Length length) : this(building.mDatabase, name, length) { IfcRelAggregates ra = new IfcRelAggregates(building.mDatabase, "Project", "Building", this, building); }
internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db) { Units.AddRange(u.Units.Select(x => db.Factory.Duplicate <IfcUnit>(x))); }
internal IfcUnitAssignment(IfcUnitAssignment v) : base() { mUnits = new List<int>(v.mUnits.ToArray()); }
public IfcProjectLibrary(DatabaseIfc m, string name, IfcUnitAssignment.Length length) : base(m, name, length) { if (m.ModelView == ModelView.Ifc4Reference || m.ModelView == ModelView.Ifc2x3Coordination) throw new Exception("Invalid Model View for IfcProjectLibrary : " + m.ModelView.ToString()); if (string.IsNullOrEmpty(Name)) Name = "UNKNOWN PROJECTLIBRARY"; }
private IfcProject(DatabaseIfc m, string name, IfcUnitAssignment.Length length) : base(m, name, length) { m.mContext = this; if (string.IsNullOrEmpty(Name)) Name = "UNKNOWN PROJECT"; }
public IfcProject(IfcSite site, string name, IfcUnitAssignment.Length length) : this(site.mDatabase, name, length) { IfcRelAggregates ra = new IfcRelAggregates(site.mDatabase, "Project", "Site", this, site); }
internal static void parseFields(IfcUnitAssignment a, List <string> arrFields, ref int ipos) { a.mUnits = ParserSTEP.SplitListLinks(arrFields[ipos++]); }
internal static IfcUnitAssignment Parse(string strDef) { IfcUnitAssignment a = new IfcUnitAssignment(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; }
internal static IfcUnitAssignment Parse(string strDef) { IfcUnitAssignment a = new IfcUnitAssignment(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return(a); }
internal IfcUnitAssignment(IfcUnitAssignment v) : base() { mUnits = new List <int>(v.mUnits.ToArray()); }