- Main Page
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# fbxsystemunit.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2012 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 FbxGlobalSettings;
    00024 class FbxAnimCurveNode;
    00025 class FbxAMatrix;
    00026 class FbxNode;
    00027 class FbxScene;
    00028
    00032 class FBXSDK_DLL FbxSystemUnit
    00033 {
    00034 public:
    00035
    00048     struct ConversionOptions
    00049     {
    00051         bool mConvertRrsNodes;
    00052
    00054         bool mConvertLimits;
    00055
    00057         bool mConvertClusters;
    00058
    00060         bool mConvertLightIntensity;
    00061
    00063         bool mConvertPhotometricLProperties;
    00064
    00066         bool mConvertCameraClipPlanes;
    00067     };
    00068
    00074     explicit FbxSystemUnit(double pScaleFactor, double pMultiplier = 1.0);
    00075
    00078     ~FbxSystemUnit();
    00079
    00081     static const FbxSystemUnit mm;
    00082
    00084     static const FbxSystemUnit dm;
    00085
    00087     static const FbxSystemUnit cm;
    00088
    00090     static const FbxSystemUnit m;
    00091
    00093     static const FbxSystemUnit km;
    00094
    00096     static const FbxSystemUnit Inch;
    00097
    00099     static const FbxSystemUnit Foot;
    00100
    00102     static const FbxSystemUnit Mile;
    00103
    00105     static const FbxSystemUnit Yard;
    00106
    00107     #define FBXSDK_SYSTEM_UNIT_PREDEF_COUNT 9
    00108
    00110     static const FbxSystemUnit *sPredefinedUnits;
    00111
    00113     static const ConversionOptions DefaultConversionOptions;
    00114
    00119     void ConvertScene( FbxScene* pScene, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
    00120
    00129     void ConvertChildren( FbxNode* pRoot, const FbxSystemUnit& pSrcUnit, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
    00130
    00138     void ConvertScene( FbxScene* pScene, FbxNode* pFbxRoot, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
    00139
    00145     double GetScaleFactor() const;
    00146
    00151     FbxString GetScaleFactorAsString(bool pAbbreviated = true) const;
    00152
    00157     FbxString GetScaleFactorAsString_Plurial() const;
    00158
    00161     double GetMultiplier() const;
    00162
    00167     bool operator==(const FbxSystemUnit& pOther) const;
    00168
    00173     bool operator!=(const FbxSystemUnit& pOther) const;
    00174
    00178     double GetConversionFactorTo( const FbxSystemUnit& pTarget ) const;
    00179
    00183     double GetConversionFactorFrom( const FbxSystemUnit& pSource ) const;
    00184
    00186 //
    00187 //  WARNING!
    00188 //
    00189 //  Anything beyond these lines may not be documented accurately and is
    00190 //  subject to change without notice.
    00191 //
    00193
    00194 protected:
    00195     double mScaleFactor;
    00196     double mMultiplier;
    00197
    00198     void ApplyMultiplier(FbxNode* pRoot, bool pSubChildrenOnly) const;
    00199     void ConvertSTProperties(FbxArray<FbxNode*>& pNodes, double pConversionFactor) const;
    00200     void ConvertSProperty(FbxArray<FbxNode*>& pNodes, double pConversionFactor) const;
    00201     void ConvertAnimCurveNode(FbxArray<FbxAnimCurveNode*>& pFCurves, double pConversionFactor) const;
    00202     double GetConversionFactor( double pTargetScaleFactor, double pSourceScaleFactor) const;
    00203     void AdjustPivots(FbxNode* pNode, double pConversionFactor, FbxAMatrix& pOriginalGlobalM ) const;
    00204     void AdjustLimits(FbxNode* pNode, double pConversionFactor) const;
    00205     void AdjustPoses(FbxScene* pScene, double pConversionFactor) const;
    00206
    00207     void AdjustCluster(FbxNode* pNode, double pConversionFactor) const;
    00208     void AdjustLightIntensity(FbxNode* pNode, const double pConversionFactor) const;
    00209     void AdjustPhotometricLightProperties(FbxNode* pNode, const double pConversionFactor) const;
    00210     void AdjustCameraClipPlanes(FbxNode* pNode, const double pConversionFactor) const;
    00211
    00212     void ConvertChildren( FbxNode* pRoot, const FbxSystemUnit& pSrcUnit, bool pSubChildrenOnly, const ConversionOptions& pOptions ) const;
    00213
    00214     friend class FbxGlobalSettings;
    00215 };
    00216
    00217 #include <fbxsdk/fbxsdk_nsend.h>
    00218
    00219 #endif /* _FBXSDK_CORE_SYSTEM_UNIT_H_ */