CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
CFxUnitsFormatter Class Reference

#include <FxUnitsFormatter.h>

Inheritance diagram for CFxUnitsFormatter:
OdDbUnitsFormatter OdDbBaseUnitsFormatter OdUnitsFormatter OdRxObject

Public Types

enum  _Flags { eNone = 0 , eRelativeUnit = 0x0001 }
 
typedef enum CFxUnitsFormatter::_Flags Flags
 
- Public Types inherited from OdUnitsFormatter
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

 CFxUnitsFormatter ()
 
 ~CFxUnitsFormatter (void) override
 
void SetFxDatabase (const CFxDatabase *)
 
Flags GetFlags () const
 
const CFxDatabaseGetFxDatabase () const
 
virtual int IntToString (CFxString &strResult, int iValue) const
 
virtual int StringToInt (int *iResult, const CFxString &strValue) const
 
virtual int RealToString (CFxString &strResult, double dValue, int iUnit=-1, int iPrecision=-1, int dimzin=-1) const
 
virtual int StringToReal (double *pResult, const CFxString &strValue, bool bNoDistance=false, bool bAllowArchitectural=true) const
 
virtual int PointToString (CFxString &strResult, const OdGePoint3d &ptValue, bool toPolar=false, int iUnit=kDecimal, int iPrecision=-1, OdChar seperator=',') const
 
virtual int PointToString (CFxString &strResult, const OdGePoint2d &ptValue, bool toPolar=false, int iUnit=kDecimal, int iPrecision=-1, OdChar seperator=',') const
 
virtual int StringToPoint (OdGePoint3d &geResultWCS, const CFxString &strValueUCS, Flags *pUnitFlags=0, const OdGePoint3d *pLastPointWCS=0) const
 
virtual int AngleToString (CFxString &strResult, double dValue, int iUnit=-1, int iPrecision=-1, int dimzin=-1, bool ignoreANGBASE=false) const
 
virtual int AngleToString (CFxString &strResult, double dValue, int iUNITMODE, int iAUPREC, int iDIMZIN, int iAUNITS, int iANGDIR, double dANGBASE) const
 
virtual int StringToAngle (double *pResult, const CFxString &strValue, int iUnit=-1, bool *isNegative=0, bool ignoreANGBASE=false) const
 
virtual int StringToAngle (double *pResult, const CFxString &strValue, int iAUNITS, bool *isNegative, int iANGDIR, double dANGBASE) const
 
virtual int PointToUCS (OdGePoint3d &ptResultUCS, const OdGePoint3d &ptValueWCS) const
 
virtual int PointFromUCS (OdGePoint3d &ptResultWCS, const OdGePoint3d &ptValueUCS) const
 
virtual int OrientToString (CFxString &strResult, double dValue, int iUnit=-1, int iPrecision=-1, int dimzin=-1) const
 
virtual int OrientToString (CFxString &strResult, double dValue, int iUNITMODE, int iAUPREC, int iDIMZIN, int iAUNITS, int iANGDIR, double dANGBASE) const
 
virtual int StringToOrient (double *pResult, const CFxString &strValue, int iUnit=-1) const
 
virtual int StringToOrient (double *pResult, const CFxString &strValue, int iAUNITS, int iANGDIR, double dANGBASE) const
 
virtual int StringToColor (OdCmColor *iResult, const CFxString &strValue) const
 
virtual int ResBufToString (CFxString &strResult, const OdResBuf *pRb) const
 
virtual int ReadDouble (double *pResult, const CFxString &value, CFxString *remainingString=0) const
 
virtual int GetUCS2WCS (OdGeMatrix3d &ucs2wcs) const
 
- Public Member Functions inherited from OdDbUnitsFormatter
 ODRX_DECLARE_MEMBERS (OdDbUnitsFormatter)
 
virtual double toUserAngle (double wcsAngle) const =0
 
virtual double fromUserAngle (double ucsAngle) const =0
 
virtual OdString formatPoint (const OdGePoint3d &value) const =0
 
virtual OdGePoint3d unformatPoint (const OdString &string) const =0
 
virtual OdGePoint3d toUCS (const OdGePoint3d &wcsPt) const =0
 
virtual OdGePoint3d fromUCS (const OdGePoint3d &ucsPt) const =0
 
- Public Member Functions inherited from OdDbBaseUnitsFormatter
 ODRX_DECLARE_MEMBERS (OdDbBaseUnitsFormatter)
 
virtual OdString formatCmColor (const OdCmColorBase &value) const
 
virtual OdSharedPtr< OdCmColorBaseunformatCmColor (const OdString &string) const
 
virtual OdString formatLinear (double value) const
 
virtual double unformatLinear (const OdString &string) const
 
virtual OdString formatAngle (double value) const
 
virtual double unformatAngle (const OdString &string) const
 
- Public Member Functions inherited from OdUnitsFormatter
 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 int NameToString (CFxString &strResult, const fdt_name pRb)
 
static int StringToName (fdt_name *pResult, const CFxString &strValue)
 
- Static Public Member Functions inherited from OdDbUnitsFormatter
static OdString formatColor (const OdCmColor &value)
 
static OdCmColor unformatColor (const OdString &string)
 
- Static Public Member Functions inherited from OdUnitsFormatter
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 OdString formatA_unnorm (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 ()
 

Protected Member Functions

OdString formatLinear (double value) const override
 
double unformatLinear (const OdString &string) const override
 
OdString formatAngle (double value) const override
 
double unformatAngle (const OdString &string) const override
 
double toUserAngle (double value) const override
 
double fromUserAngle (double value) const override
 
virtual CFxString additionalRealFormatting (const CFxString &strValue) const
 
OdString formatPoint (const OdGePoint3d &value) const override
 
OdGePoint3d unformatPoint (const OdString &string) const override
 
OdGePoint3d toUCS (const OdGePoint3d &wcsPt) const override
 
OdGePoint3d fromUCS (const OdGePoint3d &ucsPt) const override
 
void UCS2WCS (OdGeMatrix3d &ucs2wcs) const
 
OdString formatCmColor (const OdCmColorBase &value) const override
 
OdSharedPtr< OdCmColorBaseunformatCmColor (const OdString &string) const override
 
- Protected Member Functions inherited from OdDbBaseUnitsFormatter
 OdDbBaseUnitsFormatter ()
 

Static Protected Member Functions

static int unformatL (const CFxString &string, double &resVal, bool bAllowArchitectural)
 
static int unformatScale (const CFxString &string, double &resVal)
 
static int unformatA (const CFxString &string, double &resVal, bool *isNegative=0)
 
static OdString formatL (double v, LUnits units, int precision, int dimzin, int mode, OdChar decsep=0, OdChar thsep=0)
 
- Static Protected Member Functions inherited from OdDbBaseUnitsFormatter
static bool unformatTo (const OdString &string, OdCmColorBase &color, enum OdCmEntityColor::ColorMethod withMethodOnly=(enum OdCmEntityColor::ColorMethod) 0)
 

Protected Attributes

const CFxDatabasem_pDatabase
 

Detailed Description

Description: Represents the units formatting. Library: DDKERNEL

Definition at line 41 of file FxUnitsFormatter.h.

Member Typedef Documentation

◆ Flags

Member Enumeration Documentation

◆ _Flags

Enumerator
eNone 
eRelativeUnit 

Definition at line 45 of file FxUnitsFormatter.h.

Constructor & Destructor Documentation

◆ CFxUnitsFormatter()

CFxUnitsFormatter::CFxUnitsFormatter ( )

◆ ~CFxUnitsFormatter()

CFxUnitsFormatter::~CFxUnitsFormatter ( void  )
override

Member Function Documentation

◆ additionalRealFormatting()

virtual CFxString CFxUnitsFormatter::additionalRealFormatting ( const CFxString strValue) const
protectedvirtual

Description:

◆ AngleToString() [1/2]

virtual int CFxUnitsFormatter::AngleToString ( CFxString strResult,
double  dValue,
int  iUnit = -1,
int  iPrecision = -1,
int  dimzin = -1,
bool  ignoreANGBASE = false 
) const
virtual

◆ AngleToString() [2/2]

virtual int CFxUnitsFormatter::AngleToString ( CFxString strResult,
double  dValue,
int  iUNITMODE,
int  iAUPREC,
int  iDIMZIN,
int  iAUNITS,
int  iANGDIR,
double  dANGBASE 
) const
virtual

◆ formatAngle()

OdString CFxUnitsFormatter::formatAngle ( double  value) const
overrideprotectedvirtual

Description: Returns the specified angle value as a string. Arguments: value (I) Value to format. Remarks: The returned value depends on the ANGBASE, AUNITS, AUPREC, DIMZIN, and UNITMODE system variables. Note: All angles are expressed in radians.

Reimplemented from OdDbBaseUnitsFormatter.

◆ formatCmColor()

OdString CFxUnitsFormatter::formatCmColor ( const OdCmColorBase value) const
overrideprotectedvirtual

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

Parameters
value[in] Value to format.

Reimplemented from OdDbBaseUnitsFormatter.

◆ formatL()

static OdString CFxUnitsFormatter::formatL ( double  v,
LUnits  units,
int  precision,
int  dimzin,
int  mode,
OdChar  decsep = 0,
OdChar  thsep = 0 
)
staticprotected

Description: Format l. Arguments:

Parameters
vThe v.
unitsThe units.
precisionThe precision.
dimzinThe dimzin.
modeThe mode.
decsep(optional) the decsep.
thsep(optional) the thsep.

Return Value: The formatted l.

◆ formatLinear()

OdString CFxUnitsFormatter::formatLinear ( double  value) const
overrideprotectedvirtual

Description: Returns the specified distance value as a string. Arguments: value (I) Value to format. Remarks: The returned value depends on the DIMZIN, LUNITS, LUPREC, and UNITMODE system variables.

Reimplemented from OdDbBaseUnitsFormatter.

◆ formatPoint()

OdString CFxUnitsFormatter::formatPoint ( const OdGePoint3d value) const
overrideprotectedvirtual

Description: Returns the specified 3D point value as a string. Arguments: value (I) Value to format. Remarks: The returned value depends on the DIMZIN, LUNITS, LUPREC, and UNITMODE system variables.

Implements OdDbUnitsFormatter.

◆ fromUCS()

OdGePoint3d CFxUnitsFormatter::fromUCS ( const OdGePoint3d ucsPt) const
overrideprotectedvirtual

Description:

Implements OdDbUnitsFormatter.

◆ fromUserAngle()

double CFxUnitsFormatter::fromUserAngle ( double  value) const
overrideprotectedvirtual

Description:

Implements OdDbUnitsFormatter.

◆ GetFlags()

Flags CFxUnitsFormatter::GetFlags ( ) const

◆ GetFxDatabase()

const CFxDatabase * CFxUnitsFormatter::GetFxDatabase ( ) const

◆ GetUCS2WCS()

virtual int CFxUnitsFormatter::GetUCS2WCS ( OdGeMatrix3d ucs2wcs) const
virtual

◆ IntToString()

virtual int CFxUnitsFormatter::IntToString ( CFxString strResult,
int  iValue 
) const
virtual

◆ NameToString()

static int CFxUnitsFormatter::NameToString ( CFxString strResult,
const fdt_name  pRb 
)
static

◆ OrientToString() [1/2]

virtual int CFxUnitsFormatter::OrientToString ( CFxString strResult,
double  dValue,
int  iUnit = -1,
int  iPrecision = -1,
int  dimzin = -1 
) const
virtual

◆ OrientToString() [2/2]

virtual int CFxUnitsFormatter::OrientToString ( CFxString strResult,
double  dValue,
int  iUNITMODE,
int  iAUPREC,
int  iDIMZIN,
int  iAUNITS,
int  iANGDIR,
double  dANGBASE 
) const
virtual

◆ PointFromUCS()

virtual int CFxUnitsFormatter::PointFromUCS ( OdGePoint3d ptResultWCS,
const OdGePoint3d ptValueUCS 
) const
virtual

◆ PointToString() [1/2]

virtual int CFxUnitsFormatter::PointToString ( CFxString strResult,
const OdGePoint2d ptValue,
bool  toPolar = false,
int  iUnit = kDecimal,
int  iPrecision = -1,
OdChar  seperator = ',' 
) const
virtual

◆ PointToString() [2/2]

virtual int CFxUnitsFormatter::PointToString ( CFxString strResult,
const OdGePoint3d ptValue,
bool  toPolar = false,
int  iUnit = kDecimal,
int  iPrecision = -1,
OdChar  seperator = ',' 
) const
virtual

◆ PointToUCS()

virtual int CFxUnitsFormatter::PointToUCS ( OdGePoint3d ptResultUCS,
const OdGePoint3d ptValueWCS 
) const
virtual

◆ ReadDouble()

virtual int CFxUnitsFormatter::ReadDouble ( double *  pResult,
const CFxString value,
CFxString remainingString = 0 
) const
virtual

◆ RealToString()

virtual int CFxUnitsFormatter::RealToString ( CFxString strResult,
double  dValue,
int  iUnit = -1,
int  iPrecision = -1,
int  dimzin = -1 
) const
virtual

◆ ResBufToString()

virtual int CFxUnitsFormatter::ResBufToString ( CFxString strResult,
const OdResBuf pRb 
) const
virtual

◆ SetFxDatabase()

void CFxUnitsFormatter::SetFxDatabase ( const CFxDatabase )

◆ StringToAngle() [1/2]

virtual int CFxUnitsFormatter::StringToAngle ( double *  pResult,
const CFxString strValue,
int  iAUNITS,
bool *  isNegative,
int  iANGDIR,
double  dANGBASE 
) const
virtual

◆ StringToAngle() [2/2]

virtual int CFxUnitsFormatter::StringToAngle ( double *  pResult,
const CFxString strValue,
int  iUnit = -1,
bool *  isNegative = 0,
bool  ignoreANGBASE = false 
) const
virtual

◆ StringToColor()

virtual int CFxUnitsFormatter::StringToColor ( OdCmColor iResult,
const CFxString strValue 
) const
virtual

◆ StringToInt()

virtual int CFxUnitsFormatter::StringToInt ( int *  iResult,
const CFxString strValue 
) const
virtual

◆ StringToName()

static int CFxUnitsFormatter::StringToName ( fdt_name pResult,
const CFxString strValue 
)
static

◆ StringToOrient() [1/2]

virtual int CFxUnitsFormatter::StringToOrient ( double *  pResult,
const CFxString strValue,
int  iAUNITS,
int  iANGDIR,
double  dANGBASE 
) const
virtual

◆ StringToOrient() [2/2]

virtual int CFxUnitsFormatter::StringToOrient ( double *  pResult,
const CFxString strValue,
int  iUnit = -1 
) const
virtual

◆ StringToPoint()

virtual int CFxUnitsFormatter::StringToPoint ( OdGePoint3d geResultWCS,
const CFxString strValueUCS,
Flags pUnitFlags = 0,
const OdGePoint3d pLastPointWCS = 0 
) const
virtual

◆ StringToReal()

virtual int CFxUnitsFormatter::StringToReal ( double *  pResult,
const CFxString strValue,
bool  bNoDistance = false,
bool  bAllowArchitectural = true 
) const
virtual

◆ toUCS()

OdGePoint3d CFxUnitsFormatter::toUCS ( const OdGePoint3d wcsPt) const
overrideprotectedvirtual

Description:

Implements OdDbUnitsFormatter.

◆ toUserAngle()

double CFxUnitsFormatter::toUserAngle ( double  value) const
overrideprotectedvirtual

Description:

Implements OdDbUnitsFormatter.

◆ UCS2WCS()

void CFxUnitsFormatter::UCS2WCS ( OdGeMatrix3d ucs2wcs) const
protected

Description:

◆ unformatA()

static int CFxUnitsFormatter::unformatA ( const CFxString string,
double &  resVal,
bool *  isNegative = 0 
)
staticprotected

Description: Unformat a. Arguments:

Parameters
stringThe string.
[in,out]resValThe resource value.
isNegative(optional) [in,out] If non-null, the is negative.

Return Value: .

◆ unformatAngle()

double CFxUnitsFormatter::unformatAngle ( const OdString string) const
overrideprotectedvirtual

Description: Returns the specified string as an angle value. Arguments: string (I) String to unformat. Remarks: The returned value depends on the ANGBASE system variable. Note: All angles are expressed in radians.

Reimplemented from OdDbBaseUnitsFormatter.

◆ unformatCmColor()

OdSharedPtr< OdCmColorBase > CFxUnitsFormatter::unformatCmColor ( const OdString string) const
overrideprotectedvirtual

Returns the specified string as an wrapped OdCmColorBase object.

Parameters
string[in] String to unformat.

Reimplemented from OdDbBaseUnitsFormatter.

◆ unformatL()

static int CFxUnitsFormatter::unformatL ( const CFxString string,
double &  resVal,
bool  bAllowArchitectural 
)
staticprotected

Description:

◆ unformatLinear()

double CFxUnitsFormatter::unformatLinear ( const OdString string) const
overrideprotectedvirtual

Description: Returns the specified string as a distance value. Arguments: string (I) String to unformat. Remarks: The returned value depends on the UNITMODE system variable.

Reimplemented from OdDbBaseUnitsFormatter.

◆ unformatPoint()

OdGePoint3d CFxUnitsFormatter::unformatPoint ( const OdString string) const
overrideprotectedvirtual

Description: Returns the specified string as a point value. Arguments: string (I) String to unformat.

Implements OdDbUnitsFormatter.

◆ unformatScale()

static int CFxUnitsFormatter::unformatScale ( const CFxString string,
double &  resVal 
)
staticprotected

Description: Unformat scale. Arguments:

Parameters
stringThe string.
[in,out]resValThe resource value.

Return Value: .

Member Data Documentation

◆ m_pDatabase

const CFxDatabase* CFxUnitsFormatter::m_pDatabase
protected

Definition at line 239 of file FxUnitsFormatter.h.


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