protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); if (!double.IsNaN(mTransparency)) { obj["Transparency"] = Transparency; } setJSON(DiffuseColour, "DiffuseColour", obj, this, options); setJSON(TransmissionColour, "TransmissionColour", obj, this, options); setJSON(DiffuseTransmissionColour, "DiffuseTransmissionColour", obj, this, options); setJSON(ReflectionColour, "ReflectionColour", obj, this, options); setJSON(SpecularColour, "SpecularColour", obj, this, options); if (SpecularHighlight != null) { BaseClassIfc baseClass = SpecularHighlight as BaseClassIfc; if (baseClass != null) { obj["SpecularHighlight"] = baseClass.getJson(this, options); } else { IfcValue value = SpecularHighlight as IfcValue; if (value != null) { obj["SpecularHighlight"] = DatabaseIfc.extract(value); } ; } } obj["ReflectanceMethod"] = ReflectanceMethod.ToString(); }
protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed) { base.setJSON(obj, host, processed); obj["EnumerationValues"] = new JArray(EnumerationValues.ConvertAll(x => DatabaseIfc.extract(x))); if (mEnumerationReference > 0) { obj["EnumerationReference"] = EnumerationReference.getJson(this, processed); } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); setAttribute(obj, "Name", Name); setAttribute(obj, "Description", Description); if (mAppliedValue != null) { IfcValue value = mAppliedValue as IfcValue; if (value != null) { obj["AppliedValue"] = DatabaseIfc.extract(value); } else { obj["AppliedValue"] = mAppliedValue.getJson(this, options); } } if (mUnitBasis > 0) { obj["UnitBasis"] = UnitBasis.getJson(this, options); } //todo setAttribute(obj, "Category", Category); setAttribute(obj, "Condition", Condition); if (mArithmeticOperator != IfcArithmeticOperatorEnum.NONE) { obj["ArithmeticOperator"] = ArithmeticOperator.ToString(); } if (mComponents.Count > 0) { obj["Components"] = new JArray(Components.ToList().ConvertAll(x => x.getJson(this, options))); } if (mHasExternalReference.Count > 0) { obj["HasExternalReference"] = new JArray(HasExternalReference.ToList().ConvertAll(x => x.getJson(this, options))); } if (mHasConstraintRelationships.Count > 0) { JArray array = new JArray(); foreach (IfcResourceConstraintRelationship r in HasConstraintRelationships) { if (r.mIndex != host.mIndex) { array.Add(r.getJson(this, options)); } } if (array.Count > 0) { obj["HasConstraintRelationships"] = array; } } }
internal JArray getJSON(DatabaseIfc db) { JArray result = new JArray(); if (!double.IsNaN(ParameterValue)) { result.Add(DatabaseIfc.extract(new IfcParameterValue(ParameterValue))); } if (CartesianPoint != null) { result.Add(CartesianPoint.getJson(null, new BaseClassIfc.SetJsonOptions())); } return(result); }
protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed) { base.setJSON(obj, host, processed); IfcValue value = mValueComponent; if (value != null) { obj["ValueComponent"] = DatabaseIfc.extract(value); } IfcUnit unit = UnitComponent; if (unit != null) { obj["UnitComponent"] = mDatabase[mUnitComponent].getJson(this, processed); } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); IfcValue value = NominalValue; if (value != null) { obj["NominalValue"] = DatabaseIfc.extract(value); } IfcUnit unit = Unit; if (unit != null) { obj["Unit"] = unit.getJson(this, options); } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); IfcValue value = mValueComponent; if (value != null) { obj["ValueComponent"] = DatabaseIfc.extract(value); } IfcUnit unit = UnitComponent; if (unit != null) { obj["UnitComponent"] = mUnitComponent.getJson(this, options); } }
public static void setJSON(IfcColourOrFactor colourOrFactor, string name, JObject obj, BaseClassIfc host, SetJsonOptions options) { if (colourOrFactor == null) { return; } IfcNormalisedRatioMeasure normalisedRatioMeasure = colourOrFactor as IfcNormalisedRatioMeasure; if (normalisedRatioMeasure != null) { obj[name] = DatabaseIfc.extract(normalisedRatioMeasure); } else { obj[name] = (colourOrFactor as BaseClassIfc).getJson(host, options); } }
protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed) { base.setJSON(obj, host, processed); obj["BenchMark"] = mBenchMark.ToString(); setAttribute(obj, "ValueSource", ValueSource); if (mDataValue > 0) { obj["DataValue"] = mDatabase[mDataValue].getJson(this, processed); } else if (mDataValueValue != null) { obj["DataValue"] = DatabaseIfc.extract(mDataValueValue); } if (mReferencePath > 0) { obj["ReferencePath"] = ReferencePath.getJson(this, processed); } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["BenchMark"] = mBenchMark.ToString(); setAttribute(obj, "ValueSource", ValueSource); if (mDataValue is BaseClassIfc o) { obj["DataValue"] = o.getJson(this, options); } else if (mDataValue is IfcValue val) { obj["DataValue"] = DatabaseIfc.extract(val); } if (mReferencePath != null) { obj["ReferencePath"] = ReferencePath.getJson(this, options); } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); if (mUpperBoundValue != null) { obj["UpperBoundValue"] = DatabaseIfc.extract(UpperBoundValue); } if (mLowerBoundValue != null) { obj["LowerBoundValue"] = DatabaseIfc.extract(LowerBoundValue); } if (mUnit > 0) { obj["Unit"] = mDatabase[mUnit].getJson(this, options); } if (mSetPointValue != null) { obj["SetPointValue"] = DatabaseIfc.extract(SetPointValue); } }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["EnumerationValues"] = new JArray(EnumerationValues.ToList().ConvertAll(x => DatabaseIfc.extract(x))); if (mEnumerationReference > 0) { obj["EnumerationReference"] = EnumerationReference.getJson(this, options); } }
public JObject getJson(BaseClassIfc host, BaseClassIfc.SetJsonOptions options) { return(DatabaseIfc.extract(this)); }