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);
}
}