internal void Replace(IfcConversionBasedUnit cbu) { for (int icounter = 0; icounter < mUnits.Count; icounter++) { IfcNamedUnit u = mDatabase[mUnits[icounter]] as IfcNamedUnit; if (u != null && u.UnitType == cbu.UnitType) { mUnits[icounter] = cbu.mIndex; return; } } }
internal double ScaleSI(IfcUnitEnum unitType) { IfcNamedUnit namedUnit = this[unitType]; if (namedUnit != null) { IfcSIUnit siUnit = namedUnit as IfcSIUnit; if (siUnit != null) { return(siUnit.SIFactor); } IfcConversionBasedUnit conversionBasedUnit = namedUnit as IfcConversionBasedUnit; if (conversionBasedUnit != null) { return(conversionBasedUnit.SIFactor); } } return(1); }
internal double ScaleSI(IfcUnitEnum unitType) { foreach (IfcNamedUnit namedUnit in Units.OfType <IfcNamedUnit>()) { if (namedUnit.UnitType == unitType) { IfcSIUnit siUnit = namedUnit as IfcSIUnit; if (siUnit != null) { return(siUnit.SIFactor); } IfcConversionBasedUnit conversionBasedUnit = namedUnit as IfcConversionBasedUnit; if (conversionBasedUnit != null) { return(conversionBasedUnit.SIFactor); } } } return(1); }
internal double getScaleSI(IfcUnitEnum unitType) { foreach (IfcUnit u in Units) { IfcNamedUnit nu = u as IfcNamedUnit; if (nu != null && nu.UnitType == unitType) { IfcSIUnit si = nu as IfcSIUnit; if (si != null) { return(si.getSIFactor()); } IfcConversionBasedUnit cbu = nu as IfcConversionBasedUnit; if (cbu != null) { return(cbu.getSIFactor()); } } } return(1); }
internal static void parseFields(IfcConversionBasedUnit u, List<string> arrFields, ref int ipos) { IfcNamedUnit.parseFields(u, arrFields, ref ipos); u.mName = arrFields[ipos++].Replace("'", ""); u.mConversionFactor = ParserSTEP.ParseLink(arrFields[ipos++]); }
internal static IfcConversionBasedUnit Parse(string strDef) { IfcConversionBasedUnit u = new IfcConversionBasedUnit(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; }
internal IfcConversionBasedUnit(IfcConversionBasedUnit el) : base(el) { mName = el.mName; mConversionFactor = el.mConversionFactor; }
internal void Replace(IfcConversionBasedUnit cbu) { for (int icounter = 0; icounter < mUnits.Count; icounter++) { IfcNamedUnit u = mDatabase[mUnits[icounter]] as IfcNamedUnit; if (u != null && u.UnitType == cbu.UnitType) { mUnits[icounter] = cbu.mIndex; return; } } }