CFx SDK Documentation  2022 SP0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
OdUnitsFormatter Class Referenceabstract

#include <OdUnitsFormatter.h>

Inheritance diagram for OdUnitsFormatter:
OdRxObject OdDbBaseUnitsFormatter OdDbUnitsFormatter CFxUnitsFormatter OdDbUnitsFormatterImpl

Public Types

enum  LUnits {
  kScientific = 1 , kDecimal = 2 , kEngineering = 3 , kArchitectural = 4 ,
  kFractional = 5 , kWindowsDesktop = 6
}
 
enum  DimzinValues {
  kSuppressesZeroFeetAndPreciselyZeroInches = 0 , kIncludesZeroFeetAndPreciselyZeroInches = 1 , kIncludesZeroFeetAndSuppressesZeroInches = 2 , kIncludesZeroInchesAndSuppressesZeroFeet = 3 ,
  kSuppressesLeadingZeros = 4 , kSuppressesTrailingZeros = 8 , kSuppressesBothLeadingAndTrailingZeros = 12
}
 
enum  AUnits {
  kDegrees = 0 , kDegMinSec = 1 , kGrads = 2 , kRadians = 3 ,
  kSurveyors = 4
}
 

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdUnitsFormatter)
 
virtual OdString formatCmColor (const OdCmColorBase &value) const =0
 
virtual OdSharedPtr< OdCmColorBaseunformatCmColor (const OdString &string) const =0
 
virtual OdString formatLinear (double value) const =0
 
virtual double unformatLinear (const OdString &string) const =0
 
virtual OdString formatAngle (double value) const =0
 
virtual double unformatAngle (const OdString &string) const =0
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static bool isZeroFeetSuppressed (int dimzin)
 
static bool isZeroInchesSuppressed (int dimzin)
 
static OdString formatL (double value, LUnits lUnits, int precision, int dimzin, int unitMode, const OdChar *decsep=0, const OdChar *thsep=0)
 
static OdString formatArea (double value, LUnits lUnits, int precision, int dimzin, int unitMode, const OdChar *decsep=0, const OdChar *thsep=0)
 
static double unformatL (const OdString &string)
 
static OdString formatA (double value, AUnits aUnits, int precision, int dimzin, int unitMode, const OdChar *decsep=0)
 
static double unformatA (const OdString &string)
 
static double unformatA_unnorm (const OdString &string, bool refuseDots=false)
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

This class defines the interface for a Units Formatter.

<group Other_Classes>

Definition at line 41 of file OdUnitsFormatter.h.

Member Enumeration Documentation

◆ AUnits

Enumerator
kDegrees 
kDegMinSec 
kGrads 
kRadians 
kSurveyors 

Definition at line 141 of file OdUnitsFormatter.h.

◆ DimzinValues

Enumerator
kSuppressesZeroFeetAndPreciselyZeroInches 
kIncludesZeroFeetAndPreciselyZeroInches 
kIncludesZeroFeetAndSuppressesZeroInches 
kIncludesZeroInchesAndSuppressesZeroFeet 
kSuppressesLeadingZeros 
kSuppressesTrailingZeros 
kSuppressesBothLeadingAndTrailingZeros 

Definition at line 56 of file OdUnitsFormatter.h.

◆ LUnits

Enumerator
kScientific 
kDecimal 
kEngineering 
kArchitectural 
kFractional 
kWindowsDesktop 

Definition at line 46 of file OdUnitsFormatter.h.

Member Function Documentation

◆ formatA()

static OdString OdUnitsFormatter::formatA ( double  value,
AUnits  aUnits,
int  precision,
int  dimzin,
int  unitMode,
const OdChar decsep = 0 
)
static

Returns the specified angular value as a string.

Parameters
value[in] Value to format.
aUnits[in] Angle units.
precision[in] Number of decimal places.
dimzin[in] A combination of ZeroSuppressionFlags.
unitMode[in] UNITMODE value.
decsep[in] Decimal separator.
Remarks
A zero value for decsep specifies the default separator is to be used.
All angles are expressed as radians.

◆ formatAngle()

virtual OdString OdUnitsFormatter::formatAngle ( double  value) const
pure virtual

Returns the specified angle value as a string.

Parameters
value[in] Value to format.
Remarks
The returned value depends on the ANGBASE, AUNITS, AUPREC, DIMZIN, and UNITMODE system variables.
All angles are expressed in radians.

Implemented in CFxUnitsFormatter, OdDbUnitsFormatterImpl, and OdDbBaseUnitsFormatter.

◆ formatArea()

static OdString OdUnitsFormatter::formatArea ( double  value,
LUnits  lUnits,
int  precision,
int  dimzin,
int  unitMode,
const OdChar decsep = 0,
const OdChar thsep = 0 
)
static

◆ formatCmColor()

virtual OdString OdUnitsFormatter::formatCmColor ( const OdCmColorBase value) const
pure virtual

Returns the specified color value or OdCmColorBase object as a string.

Parameters
value[in] Value to format.

Implemented in CFxUnitsFormatter, OdDbUnitsFormatterImpl, and OdDbBaseUnitsFormatter.

◆ formatL()

static OdString OdUnitsFormatter::formatL ( double  value,
LUnits  lUnits,
int  precision,
int  dimzin,
int  unitMode,
const OdChar decsep = 0,
const OdChar thsep = 0 
)
static

Returns the specified distance value as a string.

Parameters
value[in] Value to format.
lUnits[in] Length units.
precision[in] Number of decimal places.
dimzin[in] A combination of ZeroSuppressionFlags.
unitMode[in] UNITMODE value.
decsep[in] Decimal separator.
thsep[in] Thousands separator.
Remarks
A zero value for decsep specifies the default seoarator is to be used. A zero value for thsep specifies that no separator is to be used.

◆ formatLinear()

virtual OdString OdUnitsFormatter::formatLinear ( double  value) const
pure virtual

Returns the specified distance value as a string.

Parameters
value[in] Value to format.
Remarks
The returned value depends on the DIMZIN, LUNITS, LUPREC, and UNITMODE system variables.

Implemented in CFxUnitsFormatter, OdDbUnitsFormatterImpl, and OdDbBaseUnitsFormatter.

◆ isZeroFeetSuppressed()

static bool OdUnitsFormatter::isZeroFeetSuppressed ( int  dimzin)
static

◆ isZeroInchesSuppressed()

static bool OdUnitsFormatter::isZeroInchesSuppressed ( int  dimzin)
static

◆ ODRX_DECLARE_MEMBERS()

OdUnitsFormatter::ODRX_DECLARE_MEMBERS ( OdUnitsFormatter  )

◆ unformatA()

static double OdUnitsFormatter::unformatA ( const OdString string)
static

Returns the specified string as an angular value.

Parameters
string[in] String to unformat.
Remarks
All angles are expressed as radians.

◆ unformatA_unnorm()

static double OdUnitsFormatter::unformatA_unnorm ( const OdString string,
bool  refuseDots = false 
)
static

◆ unformatAngle()

virtual double OdUnitsFormatter::unformatAngle ( const OdString string) const
pure virtual

Returns the specified string as an angle value.

Parameters
string[in] String to unformat.
Remarks
The returned value depends on the ANGBASE system variable.
All angles are expressed in radians.

Implemented in CFxUnitsFormatter, OdDbUnitsFormatterImpl, and OdDbBaseUnitsFormatter.

◆ unformatCmColor()

virtual OdSharedPtr<OdCmColorBase> OdUnitsFormatter::unformatCmColor ( const OdString string) const
pure virtual

Returns the specified string as an wrapped OdCmColorBase object.

Parameters
string[in] String to unformat.

Implemented in CFxUnitsFormatter, OdDbUnitsFormatterImpl, and OdDbBaseUnitsFormatter.

◆ unformatL()

static double OdUnitsFormatter::unformatL ( const OdString string)
static

Returns the specified length string as a length value.

Parameters
string[in] String to unformat.

◆ unformatLinear()

virtual double OdUnitsFormatter::unformatLinear ( const OdString string) const
pure virtual

Returns the specified string as a distance value.

Parameters
string[in] String to unformat.
Remarks
The returned value depends on the UNITMODE system variable.

Implemented in CFxUnitsFormatter, OdDbUnitsFormatterImpl, and OdDbBaseUnitsFormatter.


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