CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdIfcUnitConverter Class Reference

#include <IfcUnitConverter.h>

Inheritance diagram for OdIfcUnitConverter:

Public Member Functions

double convertToSIUnit (const OdAnsiString &unitType, double val) const override
 
void appendUnit (const OdAnsiString &unitType, const OdDAIObjectId &unitId) override
 
void appendUnit (const OdDAIObjectId &unitId) override
 
bool getConversionUnitName (const OdAnsiString &unitType, OdAnsiString &unitName, OdAnsiString &unitPrefix) override
 
void clearUnits () override
 

Friends

class OdIfcFile
 

Detailed Description

A class that implements conversion of different units to the SI units.

Definition at line 43 of file IfcUnitConverter.h.

Member Function Documentation

◆ appendUnit() [1/2]

void OdIfcUnitConverter::appendUnit ( const OdAnsiString & unitType,
const OdDAIObjectId & unitId )
override

Appends a new convertible unit.

Parameters
unitType[in] A string that contains the type of the convertible unit.
unitId[in] An identifier of the corresponding IfcConversionBasedUnit object.
Remarks
The unit type value must belong to the IfcUnitEnum of the current schema.

◆ appendUnit() [2/2]

void OdIfcUnitConverter::appendUnit ( const OdDAIObjectId & unitId)
override

Appends a new convertible unit.

Parameters
unitId[in] An identifier of the corresponding IfcConversionBasedUnit object.

◆ clearUnits()

void OdIfcUnitConverter::clearUnits ( )
override

Removes all convertible units.

◆ convertToSIUnit()

double OdIfcUnitConverter::convertToSIUnit ( const OdAnsiString & unitType,
double val ) const
override

Performs an attempt to convert a specified unit to the SI unit.

Parameters
unitType[in] A string that contains the type of the unit to be converted.
val[in] A unit value.
Returns
A double value that contains the converted value of the specified unit type.
Remarks
The unit type value must belong to the IfcUnitEnum of the current schema.

◆ getConversionUnitName()

bool OdIfcUnitConverter::getConversionUnitName ( const OdAnsiString & unitType,
OdAnsiString & unitName,
OdAnsiString & unitPrefix )
override

Gets name and prefix of convertion type.

Parameters
unitType[in] A string that contains the type of the unit to be returned.
unitName[out] A unit name.
unitPrefix[out] A unit prefix name. If no prefix then the value is empty.
Returns
True if the attributes are retrieved successfully, false otherwise.

Friends And Related Symbol Documentation

◆ OdIfcFile

friend class OdIfcFile
friend

Definition at line 92 of file IfcUnitConverter.h.


The documentation for this class was generated from the following file: