FBX C++ API Reference
FbxSystemUnit Class Reference

#include <fbxsystemunit.h>

Class Description

This class describes the units of measurement used within a particular scene.

Examples:
ViewScene/SceneContext.cxx.

Definition at line 31 of file fbxsystemunit.h.

Classes

struct  ConversionOptions
 Struct to define various options that you can use to convert the system unit of a scene. More...
 

Public Member Functions

 FbxSystemUnit ()
 
 FbxSystemUnit (double pScaleFactor, double pMultiplier=1.0)
 Constructor. More...
 
 ~FbxSystemUnit ()
 Destructor. More...
 
void ConvertScene (FbxScene *pScene, const ConversionOptions &pOptions=DefaultConversionOptions) const
 Converts a scene from its system units to this system unit. More...
 
void ConvertChildren (FbxNode *pRoot, const FbxSystemUnit &pSrcUnit, const ConversionOptions &pOptions=DefaultConversionOptions) const
 Converts the child (or children) of the given node from the system unit to this system unit. More...
 
void ConvertScene (FbxScene *pScene, FbxNode *pFbxRoot, const ConversionOptions &pOptions=DefaultConversionOptions) const
 Converts a scene from its system unit to this system unit, using the specified Fbx_Root node. More...
 
double GetScaleFactor () const
 Returns the system unit's scale factor, relative to centimeters. More...
 
FbxString GetScaleFactorAsString (bool pAbbreviated=true) const
 Returns a unit label for the current scale factor. More...
 
FbxString GetScaleFactorAsString_Plurial () const
 Returns a unit label for the current scale factor. More...
 
double GetMultiplier () const
 Returns the multiplier factor of the system unit. More...
 
bool operator== (const FbxSystemUnit &pOther) const
 Equivalence operator. More...
 
bool operator!= (const FbxSystemUnit &pOther) const
 Non-equivalence operator. More...
 
FbxSystemUnitoperator= (const FbxSystemUnit &pSystemUnit)
 Assignment operation. More...
 
double GetConversionFactorTo (const FbxSystemUnit &pTarget) const
 Returns the conversion factor from this system unit to the target system unit, excluding the multiplier factor. More...
 
double GetConversionFactorFrom (const FbxSystemUnit &pSource) const
 Returns the conversion factor from the source system unit to this system unit, excluding the multiplier factor. More...
 

Static Public Attributes

static const FbxSystemUnit mm
 Predefined system unit for millimeters. More...
 
static const FbxSystemUnit dm
 Predefined system unit for decimeters. More...
 
static const FbxSystemUnit cm
 Predefined system unit for centimeters. More...
 
static const FbxSystemUnit m
 Predefined system unit for meters. More...
 
static const FbxSystemUnit km
 Predefined system unit for kilometers. More...
 
static const FbxSystemUnit Inch
 Predefined system unit for inches. More...
 
static const FbxSystemUnit Foot
 Predefined system unit for feet. More...
 
static const FbxSystemUnit Mile
 Predefined system unit for miles. More...
 
static const FbxSystemUnit Yard
 Predefined system unit for yards. More...
 
static const FbxSystemUnitsPredefinedUnits
 Points to a FbxSystemUnit array to store the predefined system units. The array size is FBXSDK_SYSTEM_UNIT_PREDEF_COUNT. More...
 
static const ConversionOptions DefaultConversionOptions
 Stores the default conversion options. More...
 

Constructor & Destructor Documentation

◆ FbxSystemUnit() [1/2]

◆ FbxSystemUnit() [2/2]

FbxSystemUnit ( double  pScaleFactor,
double  pMultiplier = 1.0 
)

Constructor.

Parameters
pScaleFactorThe equivalent number of centimeters in the new system unit. For example, an inch unit uses a scale factor of 2.54.
pMultiplierA multiplier factor of pScaleFactor.

◆ ~FbxSystemUnit()

Destructor.

Member Function Documentation

◆ ConvertScene() [1/2]

void ConvertScene ( FbxScene pScene,
const ConversionOptions pOptions = DefaultConversionOptions 
) const

Converts a scene from its system units to this system unit.

Parameters
pSceneThe scene to convert.
pOptionsConversion options, see:FbxSystemUnit::ConversionOptions.
Examples:
ViewScene/SceneContext.cxx.

◆ ConvertChildren()

void ConvertChildren ( FbxNode pRoot,
const FbxSystemUnit pSrcUnit,
const ConversionOptions pOptions = DefaultConversionOptions 
) const

Converts the child (or children) of the given node from the system unit to this system unit.

Unlike the ConvertScene() method, this method does not set the axis system of the scene to which the pRoot node belongs. It also does not adjust FbxPose as they are not stored under the scene, and not under a particular node.

Parameters
pRootThe given node.
pSrcUnitThe source system unit.
pOptionsConversion options, see:FbxSystemUnit::ConversionOptions.

◆ ConvertScene() [2/2]

void ConvertScene ( FbxScene pScene,
FbxNode pFbxRoot,
const ConversionOptions pOptions = DefaultConversionOptions 
) const

Converts a scene from its system unit to this system unit, using the specified Fbx_Root node.

This method is provided for backwards compatibility only and instead you should use ConvertScene( FbxScene* , const ConversionOptions& ) whenever possible.

Parameters
pSceneThe scene to convert.
pFbxRootThe Fbx_Root node to use for conversion.
pOptionsConversion options, see:FbxSystemUnit::ConversionOptions

◆ GetScaleFactor()

double GetScaleFactor ( ) const

Returns the system unit's scale factor, relative to centimeters.

This factor scales system unit values to centimeters. If you want to scale values to centimeters, use this value. Ignore the "multiplier" (returned by GetMultiplier()) value.

Returns
The the system unit's scale factor, relative to centimeters.
Examples:
ViewScene/SceneContext.cxx.

◆ GetScaleFactorAsString()

FbxString GetScaleFactorAsString ( bool  pAbbreviated = true) const

Returns a unit label for the current scale factor.

Parameters
pAbbreviatedIf true, returns abbreviated string.
Returns
The unit label for the current scale factor.

◆ GetScaleFactorAsString_Plurial()

FbxString GetScaleFactorAsString_Plurial ( ) const

Returns a unit label for the current scale factor.

The first letter of the label is in upper case and the label should be pluralized.

Returns
The unit label for the current scale factor.

◆ GetMultiplier()

double GetMultiplier ( ) const

Returns the multiplier factor of the system unit.

◆ operator==()

bool operator== ( const FbxSystemUnit pOther) const

Equivalence operator.

Parameters
pOtherAnother system unit compared with this system unit.
Returns
True if equal, false otherwise.

◆ operator!=()

bool operator!= ( const FbxSystemUnit pOther) const

Non-equivalence operator.

Parameters
pOtherAnother system unit compared with this system unit.
Returns
True if unequal, false otherwise.

◆ operator=()

FbxSystemUnit& operator= ( const FbxSystemUnit pSystemUnit)

Assignment operation.

Parameters
pSystemUnitUnit system assigned to this one.

◆ GetConversionFactorTo()

double GetConversionFactorTo ( const FbxSystemUnit pTarget) const

Returns the conversion factor from this system unit to the target system unit, excluding the multiplier factor.

Parameters
pTargetThe target system unit.

◆ GetConversionFactorFrom()

double GetConversionFactorFrom ( const FbxSystemUnit pSource) const

Returns the conversion factor from the source system unit to this system unit, excluding the multiplier factor.

Parameters
pSourceThe source system unit.

Member Data Documentation

◆ mm

const FbxSystemUnit mm
static

Predefined system unit for millimeters.

Definition at line 82 of file fbxsystemunit.h.

◆ dm

const FbxSystemUnit dm
static

Predefined system unit for decimeters.

Definition at line 85 of file fbxsystemunit.h.

◆ cm

const FbxSystemUnit cm
static

Predefined system unit for centimeters.

Examples:
ViewScene/SceneContext.cxx.

Definition at line 88 of file fbxsystemunit.h.

◆ m

const FbxSystemUnit m
static

Predefined system unit for meters.

Definition at line 91 of file fbxsystemunit.h.

◆ km

const FbxSystemUnit km
static

Predefined system unit for kilometers.

Definition at line 94 of file fbxsystemunit.h.

◆ Inch

const FbxSystemUnit Inch
static

Predefined system unit for inches.

Definition at line 97 of file fbxsystemunit.h.

◆ Foot

const FbxSystemUnit Foot
static

Predefined system unit for feet.

Definition at line 100 of file fbxsystemunit.h.

◆ Mile

const FbxSystemUnit Mile
static

Predefined system unit for miles.

Definition at line 103 of file fbxsystemunit.h.

◆ Yard

const FbxSystemUnit Yard
static

Predefined system unit for yards.

Definition at line 106 of file fbxsystemunit.h.

◆ sPredefinedUnits

const FbxSystemUnit* sPredefinedUnits
static

Points to a FbxSystemUnit array to store the predefined system units. The array size is FBXSDK_SYSTEM_UNIT_PREDEF_COUNT.

Definition at line 111 of file fbxsystemunit.h.

◆ DefaultConversionOptions

const ConversionOptions DefaultConversionOptions
static

Stores the default conversion options.

Definition at line 114 of file fbxsystemunit.h.


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