상속: BaseClassIfc, IfcAppliedValueSelect
예제 #1
0
 internal void SetUnits(Length length)
 {
     if (length == Length.Millimetre)
     {
         mUnits.Add(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.MILLI, IfcSIUnitName.METRE).mIndex);
         mDatabase.ScaleSI = 0.001;
     }
     else if (length == Length.Centimetre)
     {
         mUnits.Add(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.CENTI, IfcSIUnitName.METRE).mIndex);
         mDatabase.ScaleSI = 0.01;
     }
     else if (length == Length.Inch)
     {
         IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(0.0254), mDatabase.Factory.SILength);
         mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Inches", mwu).mIndex);
         mDatabase.ScaleSI = 0.0254;
     }
     else if (length == Length.Foot)
     {
         IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(FeetToMetre), mDatabase.Factory.SILength);
         mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Feet", mwu).mIndex);
         mDatabase.ScaleSI = FeetToMetre;
     }
     else
     {
         mUnits.Add(mDatabase.Factory.SILength.mIndex);
         mDatabase.ScaleSI = 1;
     }
     SetUnits();
 }
예제 #2
0
 internal void SetUnits()
 {
     if (Find(IfcUnitEnum.AREAUNIT) == null)
     {
         mUnits.Add(mDatabase.Factory.SIArea.mIndex);
     }
     if (Find(IfcUnitEnum.VOLUMEUNIT) == null)
     {
         mUnits.Add(mDatabase.Factory.SIVolume.mIndex);
     }
     if (Find(IfcUnitEnum.PLANEANGLEUNIT) == null)
     {
         IfcSIUnit radians = new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN);
         mUnits.Add(mDatabase.Factory.Options.AngleUnitsInRadians ? radians.mIndex : new IfcConversionBasedUnit(IfcUnitEnum.PLANEANGLEUNIT, "DEGREE", new IfcMeasureWithUnit(new IfcPlaneAngleMeasure(Math.PI / 180.0), radians)).mIndex);
     }
     if (Find(IfcUnitEnum.TIMEUNIT) == null)
     {
         IfcSIUnit seconds = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND);
         if (mDatabase.mTimeInDays)
         {
             IfcMeasureWithUnit mu = new IfcMeasureWithUnit(new IfcTimeMeasure(60 * 60 * 24), seconds);
             mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.TIMEUNIT, "DAY", mu).mIndex);
         }
         else
         {
             mUnits.Add(seconds.mIndex);
         }
     }
 }
예제 #3
0
 internal void SetUnits()
 {
     if (this[IfcUnitEnum.AREAUNIT] == null)
     {
         Units.Add(mDatabase.Factory.SIArea);
     }
     if (this[IfcUnitEnum.VOLUMEUNIT] == null)
     {
         Units.Add(mDatabase.Factory.SIVolume);
     }
     if (this[IfcUnitEnum.PLANEANGLEUNIT] == null)
     {
         if (mDatabase.Factory.Options.AngleUnitsInRadians)
         {
             Units.Add(new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN));
         }
         else
         {
             Units.Add(mDatabase.Factory.ConversionUnit(IfcConversionBasedUnit.Common.degree));
         }
     }
     if (this[IfcUnitEnum.TIMEUNIT] == null)
     {
         IfcSIUnit seconds = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND);
         if (mDatabase.mTimeInDays)
         {
             IfcMeasureWithUnit mu = new IfcMeasureWithUnit(new IfcTimeMeasure(60 * 60 * 24), seconds);
             Units.Add(new IfcConversionBasedUnit(IfcUnitEnum.TIMEUNIT, "DAY", mu));
         }
         else
         {
             Units.Add(seconds);
         }
     }
 }
예제 #4
0
 public IfcUnit LengthUnit(IfcUnitAssignment.Length length)
 {
     if (length == IfcUnitAssignment.Length.Millimetre)
     {
         return(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.MILLI, IfcSIUnitName.METRE));
     }
     if (length == IfcUnitAssignment.Length.Centimetre)
     {
         return(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.CENTI, IfcSIUnitName.METRE));
     }
     if (length == IfcUnitAssignment.Length.Inch)
     {
         IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(0.0254), SILength);
         return(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Inches", mwu));
     }
     if (length == IfcUnitAssignment.Length.Foot)
     {
         IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(IfcUnitAssignment.FeetToMetre), SILength);
         return(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Feet", mwu));
     }
     return(SILength);
 }
예제 #5
0
파일: IFC M.cs 프로젝트: jenca-cloud/ggIFC
		internal static IfcMeasureWithUnit Parse(string strDef) { IfcMeasureWithUnit m = new IfcMeasureWithUnit(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; }
예제 #6
0
파일: IFC M.cs 프로젝트: jenca-cloud/ggIFC
		internal static void parseFields(IfcMeasureWithUnit m, List<string> arrFields, ref int ipos)
		{
			string s = arrFields[ipos++];
			m.mValueComponent = ParserIfc.parseValue(s);
			if (m.mValueComponent == null)
				m.mVal = s; m.mUnitComponent = ParserSTEP.ParseLink(arrFields[ipos++]);
		}
예제 #7
0
파일: IFC M.cs 프로젝트: jenca-cloud/ggIFC
		internal IfcMeasureWithUnit(IfcMeasureWithUnit m) : base() { mValueComponent = m.mValueComponent; mUnitComponent = m.mUnitComponent; }
예제 #8
0
파일: IFC C.cs 프로젝트: jenca-cloud/ggIFC
		internal IfcConversionBasedUnitWithOffset(IfcUnitEnum unit, string name, IfcMeasureWithUnit mu, double offset)
			: base(unit, name, mu) { mConversionOffset = offset; }
예제 #9
0
파일: IFC C.cs 프로젝트: jenca-cloud/ggIFC
		internal IfcConversionBasedUnit(IfcUnitEnum unit, string name, IfcMeasureWithUnit mu)
			: base(mu.mDatabase, unit, true) { Name = name.Replace("'", ""); mConversionFactor = mu.mIndex; }
예제 #10
0
 internal void SetUnits()
 {
     if (Find(IfcUnitEnum.AREAUNIT) == null)
         mUnits.Add(mDatabase.Factory.SIArea.mIndex);
     if (Find(IfcUnitEnum.VOLUMEUNIT) == null)
         mUnits.Add(mDatabase.Factory.SIVolume.mIndex);
     if (Find(IfcUnitEnum.PLANEANGLEUNIT) == null)
     {
         IfcSIUnit radians = new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN);
         mUnits.Add(mDatabase.Factory.Options.AngleUnitsInRadians ? radians.mIndex : new IfcConversionBasedUnit(IfcUnitEnum.PLANEANGLEUNIT, "DEGREE", new IfcMeasureWithUnit(new IfcPlaneAngleMeasure(Math.PI / 180.0), radians)).mIndex);
     }
     if (Find(IfcUnitEnum.TIMEUNIT) == null)
     {
         IfcSIUnit seconds = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND);
         if (mDatabase.mTimeInDays)
         {
             IfcMeasureWithUnit mu = new IfcMeasureWithUnit(new IfcTimeMeasure(60 * 60 * 24), seconds);
             mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.TIMEUNIT, "DAY", mu).mIndex);
         }
         else
             mUnits.Add(seconds.mIndex);
     }
 }
예제 #11
0
        internal void SetUnits(Length length)
        {
            if (length == Length.Millimetre)
            {
                mUnits.Add(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.MILLI, IfcSIUnitName.METRE).mIndex);
                mDatabase.ScaleSI = 0.001;
            }
            else if (length == Length.Centimetre)
            {
                mUnits.Add(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.CENTI, IfcSIUnitName.METRE).mIndex);
                mDatabase.ScaleSI = 0.01;

            }
            else if (length == Length.Inch)
            {
                IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(0.0254), mDatabase.Factory.SILength);
                mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Inches", mwu).mIndex);
                mDatabase.ScaleSI = 0.0254;
            }
            else if (length == Length.Foot)
            {
                IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(FeetToMetre), mDatabase.Factory.SILength);
                mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Feet", mwu).mIndex);
                mDatabase.ScaleSI = FeetToMetre;
            }
            else
            {
                mUnits.Add(mDatabase.Factory.SILength.mIndex);
                mDatabase.ScaleSI = 1;
            }
            SetUnits();
        }