- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxsystemunit.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2013 Autodesk, Inc.
    00004    All rights reserved.
    00005
    00006    Use of this software is subject to the terms of the Autodesk license agreement
    00007    provided at the time of installation or download, or which otherwise accompanies
    00008    this software in either electronic or hard copy form.
    00009
    00010 ****************************************************************************************/
    00011
    00013 #ifndef _FBXSDK_CORE_SYSTEM_UNIT_H_
    00014 #define _FBXSDK_CORE_SYSTEM_UNIT_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/base/fbxstring.h>
    00019 #include <fbxsdk/core/base/fbxarray.h>
    00020
    00021 #include <fbxsdk/fbxsdk_nsbegin.h>
    00022
    00023 class FbxAMatrix;
    00024 class FbxScene;
    00025 class FbxNode;
    00026 class FbxAnimCurveNode;
    00027
    00031 class FBXSDK_DLL FbxSystemUnit
    00032 {
    00033 public:
    00034
    00047     struct ConversionOptions
    00048     {
    00050         bool mConvertRrsNodes;
    00051
    00053         bool mConvertLimits;
    00054
    00056         bool mConvertClusters;
    00057
    00059         bool mConvertLightIntensity;
    00060
    00062         bool mConvertPhotometricLProperties;
    00063
    00065         bool mConvertCameraClipPlanes;
    00066     };
    00067
    00068     FbxSystemUnit();
    00069
    00075     FbxSystemUnit(double pScaleFactor, double pMultiplier = 1.0);
    00076
    00079     ~FbxSystemUnit();
    00080
    00082     static const FbxSystemUnit mm;
    00083
    00085     static const FbxSystemUnit dm;
    00086
    00088     static const FbxSystemUnit cm;
    00089
    00091     static const FbxSystemUnit m;
    00092
    00094     static const FbxSystemUnit km;
    00095
    00097     static const FbxSystemUnit Inch;
    00098
    00100     static const FbxSystemUnit Foot;
    00101
    00103     static const FbxSystemUnit Mile;
    00104
    00106     static const FbxSystemUnit Yard;
    00107
    00108     #define FBXSDK_SYSTEM_UNIT_PREDEF_COUNT 9
    00109
    00111     static const FbxSystemUnit *sPredefinedUnits;
    00112
    00114     static const ConversionOptions DefaultConversionOptions;
    00115
    00120     void ConvertScene( FbxScene* pScene, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
    00121
    00130     void ConvertChildren( FbxNode* pRoot, const FbxSystemUnit& pSrcUnit, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
    00131
    00139     void ConvertScene( FbxScene* pScene, FbxNode* pFbxRoot, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
    00140
    00146     double GetScaleFactor() const;
    00147
    00152     FbxString GetScaleFactorAsString(bool pAbbreviated = true) const;
    00153
    00158     FbxString GetScaleFactorAsString_Plurial() const;
    00159
    00162     double GetMultiplier() const;
    00163
    00168     bool operator==(const FbxSystemUnit& pOther) const;
    00169
    00174     bool operator!=(const FbxSystemUnit& pOther) const;
    00175
    00179     FbxSystemUnit& operator=(const FbxSystemUnit& pSystemUnit);
    00180
    00184     double GetConversionFactorTo( const FbxSystemUnit& pTarget ) const;
    00185
    00189     double GetConversionFactorFrom( const FbxSystemUnit& pSource ) const;
    00190
    00191 /*****************************************************************************************************************************
    00192 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00193 *****************************************************************************************************************************/
    00194 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00195 private:
    00196     void ApplyMultiplier(FbxNode* pRoot, bool pSubChildrenOnly) const;
    00197     void ConvertSTProperties(FbxArray<FbxNode*>& pNodes, double pConversionFactor) const;
    00198     void ConvertSProperty(FbxArray<FbxNode*>& pNodes, double pConversionFactor) const;
    00199     void ConvertAnimCurveNode(FbxArray<FbxAnimCurveNode*>& pFCurves, double pConversionFactor) const;
    00200     double GetConversionFactor(double pTargetScaleFactor, double pSourceScaleFactor) const;
    00201     void AdjustPivots(FbxNode* pNode, double pConversionFactor, FbxAMatrix& pOriginalGlobalM ) const;
    00202     void AdjustLimits(FbxNode* pNode, double pConversionFactor) const;
    00203     void AdjustPoses(FbxScene* pScene, double pConversionFactor) const;
    00204     void AdjustCluster(FbxNode* pNode, double pConversionFactor) const;
    00205     void AdjustLightIntensity(FbxNode* pNode, const double pConversionFactor) const;
    00206     void AdjustPhotometricLightProperties(FbxNode* pNode, const double pConversionFactor) const;
    00207     void AdjustCameraClipPlanes(FbxNode* pNode, const double pConversionFactor) const;
    00208     void ConvertChildren(FbxNode* pRoot, const FbxSystemUnit& pSrcUnit, bool pSubChildrenOnly, const ConversionOptions& pOptions) const;
    00209
    00210     double mScaleFactor;
    00211     double mMultiplier;
    00212
    00213     friend class FbxGlobalSettings;
    00214 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00215 };
    00216
    00217 #include <fbxsdk/fbxsdk_nsend.h>
    00218
    00219 #endif /* _FBXSDK_CORE_SYSTEM_UNIT_H_ */