GeometryGym.Ifc.IfcNamedUnit.getSIFactor C# (CSharp) Méthode

getSIFactor() private méthode

private getSIFactor ( ) : double
Résultat double
        internal virtual double getSIFactor()
        {
            return 1;
        }

Usage Example

Exemple #1
0
        internal void setStructuralUnits()
        {
            if (mStructuralSet)
            {
                return;
            }
            mStructuralSet = true;
            DatabaseIfc m = mDatabase;

            IfcNamedUnit fu = Find(IfcUnitEnum.FORCEUNIT);

            if (fu == null)
            {
                fu = new IfcSIUnit(m, IfcUnitEnum.FORCEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.NEWTON);
                AddUnit(fu);
            }
            IfcSIUnit lengthSI = m.Factory.SILength, volumeSI = m.Factory.SIVolume;

            if (Find(IfcDerivedUnitEnum.TORQUEUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(lengthSI, 1), IfcDerivedUnitEnum.TORQUEUNIT));
            }
            if (Find(IfcDerivedUnitEnum.LINEARFORCEUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(lengthSI, -1), IfcDerivedUnitEnum.LINEARFORCEUNIT));
            }
            if (Find(IfcDerivedUnitEnum.LINEARMOMENTUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), IfcDerivedUnitEnum.LINEARMOMENTUNIT));
            }
            if (Find(IfcDerivedUnitEnum.PLANARFORCEUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(lengthSI, -2), IfcDerivedUnitEnum.PLANARFORCEUNIT));
            }
            if (Find(IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(lengthSI, -2), IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT));
            }

            IfcNamedUnit time = Find(IfcUnitEnum.TIMEUNIT);

            if (time == null || Math.Abs(time.getSIFactor() - 1) < mDatabase.Tolerance)
            {
                time = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND);
            }
            if (Find(IfcDerivedUnitEnum.ACCELERATIONUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(lengthSI, 1), new IfcDerivedUnitElement(time, -2), IfcDerivedUnitEnum.ACCELERATIONUNIT));
            }
            if (Find(IfcUnitEnum.PRESSUREUNIT) == null)
            {
                AddUnit(new IfcSIUnit(m, IfcUnitEnum.PRESSUREUNIT, IfcSIPrefix.NONE, IfcSIUnitName.PASCAL));
            }
            if (Find(IfcDerivedUnitEnum.SECTIONMODULUSUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(lengthSI, 3), IfcDerivedUnitEnum.SECTIONMODULUSUNIT));
            }
            if (Find(IfcDerivedUnitEnum.MOMENTOFINERTIAUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(lengthSI, 4), IfcDerivedUnitEnum.MOMENTOFINERTIAUNIT));
            }
            IfcSIUnit massu = Find(IfcUnitEnum.MASSUNIT) as IfcSIUnit;

            if (massu == null)
            {
                massu = new IfcSIUnit(m, IfcUnitEnum.MASSUNIT, IfcSIPrefix.KILO, IfcSIUnitName.GRAM);
                AddUnit(massu);
            }
            if (Find(IfcDerivedUnitEnum.MASSDENSITYUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(massu, 1), new IfcDerivedUnitElement(volumeSI, -1), IfcDerivedUnitEnum.MASSDENSITYUNIT));
            }
            IfcSIUnit kelvin = Find(IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT) as IfcSIUnit;

            if (kelvin == null)
            {
                kelvin = new IfcSIUnit(m, IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT, IfcSIPrefix.NONE, IfcSIUnitName.KELVIN);
                AddUnit(kelvin);
            }
            if (Find(IfcDerivedUnitEnum.THERMALEXPANSIONCOEFFICIENTUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(kelvin, -1), IfcDerivedUnitEnum.THERMALEXPANSIONCOEFFICIENTUNIT));
            }
            if (Find(IfcDerivedUnitEnum.LINEARSTIFFNESSUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(lengthSI, -1), IfcDerivedUnitEnum.LINEARSTIFFNESSUNIT));
            }

            IfcNamedUnit radians = Find(IfcUnitEnum.PLANEANGLEUNIT);

            if (radians == null || Math.Abs(radians.getSIFactor() - 1) < mDatabase.Tolerance)
            {
                radians = new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN);
            }
            if (Find(IfcDerivedUnitEnum.ROTATIONALSTIFFNESSUNIT) == null)
            {
                AddUnit(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(lengthSI, 1), new IfcDerivedUnitElement(radians, -1), IfcDerivedUnitEnum.ROTATIONALSTIFFNESSUNIT));
            }
        }