Inheritance: BaseClassIfc
Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
        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;
                }
            }
        }
Ejemplo n.º 3
0
 internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db)
 {
     u.mUnits.ForEach(x => AddUnit(db.Factory.Duplicate(u.mDatabase[x]) as IfcUnit));
 }
Ejemplo n.º 4
0
 internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db)
 {
     Units = u.mUnits.ConvertAll(x => db.Factory.Duplicate(u.mDatabase[x]) as IfcUnit);
 }
Ejemplo n.º 5
0
 internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db)
 {
     Units.AddRange(u.Units.ConvertAll(x => db.Factory.Duplicate(u.mDatabase[x.Index]) as IfcUnit));
 }
Ejemplo n.º 6
0
		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
		}
Ejemplo n.º 7
0
 internal static void parseFields(IfcUnitAssignment a, List<string> arrFields, ref int ipos)
 {
     a.mUnits = ParserSTEP.SplitListLinks(arrFields[ipos++]);
 }
Ejemplo n.º 8
0
		public IfcProject(IfcBuilding building, string name, IfcUnitAssignment.Length length) : this(building.mDatabase, name, length) { IfcRelAggregates ra = new IfcRelAggregates(building.mDatabase, "Project", "Building", this, building); }
Ejemplo n.º 9
0
 internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u)
     : base(db)
 {
     Units = u.mUnits.ConvertAll(x => db.Factory.Duplicate(u.mDatabase[x]) as IfcUnit);
 }
Ejemplo n.º 10
0
 internal IfcUnitAssignment(DatabaseIfc db, IfcUnitAssignment u) : base(db)
 {
     Units.AddRange(u.Units.Select(x => db.Factory.Duplicate <IfcUnit>(x)));
 }
Ejemplo n.º 11
0
		internal IfcUnitAssignment(IfcUnitAssignment v) : base() { mUnits = new List<int>(v.mUnits.ToArray()); }
Ejemplo n.º 12
0
		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";
		}
Ejemplo n.º 13
0
		private IfcProject(DatabaseIfc m, string name, IfcUnitAssignment.Length length)
			: base(m, name, length)
		{
			m.mContext = this;
			if (string.IsNullOrEmpty(Name))
				Name = "UNKNOWN PROJECT";
		} 
Ejemplo n.º 14
0
		public IfcProject(IfcSite site, string name, IfcUnitAssignment.Length length) : this(site.mDatabase, name, length) { IfcRelAggregates ra = new IfcRelAggregates(site.mDatabase, "Project", "Site", this, site); }
Ejemplo n.º 15
0
 internal static void parseFields(IfcUnitAssignment a, List <string> arrFields, ref int ipos)
 {
     a.mUnits = ParserSTEP.SplitListLinks(arrFields[ipos++]);
 }
Ejemplo n.º 16
0
 internal static IfcUnitAssignment Parse(string strDef)
 {
     IfcUnitAssignment a = new IfcUnitAssignment(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a;
 }
Ejemplo n.º 17
0
 internal static IfcUnitAssignment Parse(string strDef)
 {
     IfcUnitAssignment a = new IfcUnitAssignment(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return(a);
 }
Ejemplo n.º 18
0
 internal IfcUnitAssignment(IfcUnitAssignment v) : base()
 {
     mUnits = new List <int>(v.mUnits.ToArray());
 }