parseMeasureValue() static private method

static private parseMeasureValue ( string str ) : IfcMeasureValue
str string
return IfcMeasureValue
Beispiel #1
0
        internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary)
        {
            base.parse(str, ref pos, release, len, dictionary);
            Directrix = dictionary[ParserSTEP.StripLink(str, ref pos, len)] as IfcCurve;
            string field = ParserSTEP.StripField(str, ref pos, len);

            if (field.StartsWith("I"))
            {
                mStartParam = ParserIfc.parseMeasureValue(field) as IfcCurveMeasureSelect;
            }
            else
            {
                double d = ParserSTEP.ParseDouble(field);
                if (!double.IsNaN(d))
                {
                    mStartParam = new IfcParameterValue(d);
                }
            }
            field = ParserSTEP.StripField(str, ref pos, len);
            if (field.StartsWith("I"))
            {
                mEndParam = ParserIfc.parseMeasureValue(field) as IfcCurveMeasureSelect;
            }
            else
            {
                double d = ParserSTEP.ParseDouble(field);
                if (!double.IsNaN(d))
                {
                    mEndParam = new IfcParameterValue(d);
                }
            }
        }
        internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary)
        {
            base.parse(str, ref pos, release, len, dictionary);
            string s = ParserSTEP.StripField(str, ref pos, len);

            if (!double.TryParse(s, System.Globalization.NumberStyles.Any, ParserSTEP.NumberFormat, out mWeightValue))
            {
                IfcMeasureValue mv = ParserIfc.parseMeasureValue(s);
                if (mv != null)
                {
                    mWeightValue = mv.Measure;
                }
            }
            if (release > ReleaseVersion.IFC2x3)
            {
                mFormula = ParserIfc.Decode(ParserSTEP.StripString(str, ref pos, len));
            }
        }
Beispiel #3
0
        internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary)
        {
            base.parse(str, ref pos, release, len, dictionary);
            string s = ParserSTEP.StripField(str, ref pos, len);

            if (!double.TryParse(s, out mVolumeValue))
            {
                IfcMeasureValue mv = ParserIfc.parseMeasureValue(s);
                if (mv != null)
                {
                    mVolumeValue = mv.Measure;
                }
            }
            if (release != ReleaseVersion.IFC2x3)
            {
                mFormula = ParserSTEP.StripString(str, ref pos, len);
            }
        }
Beispiel #4
0
        internal static IfcQuantityWeight Parse(string str, ReleaseVersion schema)
        {
            IfcQuantityWeight q = new IfcQuantityWeight();
            int pos = 0, len = str.Length;

            q.Parse(str, ref pos, len);
            string s = ParserSTEP.StripField(str, ref pos, len);

            if (!double.TryParse(s, out q.mWeightValue))
            {
                IfcMeasureValue mv = ParserIfc.parseMeasureValue(s);
                if (mv != null)
                {
                    q.mWeightValue = mv.Measure;
                }
            }
            if (schema != ReleaseVersion.IFC2x3)
            {
                q.mFormula = ParserSTEP.StripString(str, ref pos, len);
            }
            return(q);
        }
Beispiel #5
0
        internal static void parseFields(IfcQuantityVolume q, List <string> arrFields, ref int ipos, ReleaseVersion schema)
        {
            IfcPhysicalSimpleQuantity.parseFields(q, arrFields, ref ipos);
            string str = arrFields[ipos++];
            double vol;

            if (double.TryParse(str, out vol))
            {
                q.mVolumeValue = vol;
            }
            else
            {
                IfcMeasureValue mv = ParserIfc.parseMeasureValue(str);
                if (mv != null)
                {
                    q.mVolumeValue = mv.Measure;
                }
            }
            if (schema != ReleaseVersion.IFC2x3)
            {
                q.mFormula = arrFields[ipos++].Replace("'", "");
            }
        }