FBX C++ API Reference
fbxsystemunit.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_SYSTEM_UNIT_H_
14 #define _FBXSDK_CORE_SYSTEM_UNIT_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 class FbxAMatrix;
24 class FbxScene;
25 class FbxNode;
26 class FbxAnimCurveNode;
27 
32 {
33 public:
34 
48  {
51 
54 
57 
60 
63 
66  };
67 
68  FbxSystemUnit();
69 
75  FbxSystemUnit(double pScaleFactor, double pMultiplier = 1.0);
76 
79  ~FbxSystemUnit();
80 
82  static const FbxSystemUnit mm;
83 
85  static const FbxSystemUnit dm;
86 
88  static const FbxSystemUnit cm;
89 
91  static const FbxSystemUnit m;
92 
94  static const FbxSystemUnit km;
95 
97  static const FbxSystemUnit Inch;
98 
100  static const FbxSystemUnit Foot;
101 
103  static const FbxSystemUnit Mile;
104 
106  static const FbxSystemUnit Yard;
107 
108  #define FBXSDK_SYSTEM_UNIT_PREDEF_COUNT 9
109 
112 
115 
120  void ConvertScene( FbxScene* pScene, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
121 
130  void ConvertChildren( FbxNode* pRoot, const FbxSystemUnit& pSrcUnit, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
131 
139  void ConvertScene( FbxScene* pScene, FbxNode* pFbxRoot, const ConversionOptions& pOptions = DefaultConversionOptions ) const;
140 
146  double GetScaleFactor() const;
147 
152  FbxString GetScaleFactorAsString(bool pAbbreviated = true) const;
153 
158  FbxString GetScaleFactorAsString_Plurial() const;
159 
162  double GetMultiplier() const;
163 
168  bool operator==(const FbxSystemUnit& pOther) const;
169 
174  bool operator!=(const FbxSystemUnit& pOther) const;
175 
179  FbxSystemUnit& operator=(const FbxSystemUnit& pSystemUnit);
180 
184  double GetConversionFactorTo( const FbxSystemUnit& pTarget ) const;
185 
189  double GetConversionFactorFrom( const FbxSystemUnit& pSource ) const;
190 
191 /*****************************************************************************************************************************
192 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
193 *****************************************************************************************************************************/
194 #ifndef DOXYGEN_SHOULD_SKIP_THIS
195 private:
196  void ApplyMultiplier(FbxNode* pRoot, bool pSubChildrenOnly) const;
197  void ConvertSTProperties(FbxArray<FbxNode*>& pNodes, double pConversionFactor) const;
198  void ConvertSProperty(FbxArray<FbxNode*>& pNodes, double pConversionFactor) const;
199  void ConvertAnimCurveNode(FbxArray<FbxAnimCurveNode*>& pFCurves, double pConversionFactor) const;
200  double GetConversionFactor(double pTargetScaleFactor, double pSourceScaleFactor) const;
201  void AdjustPivots(FbxNode* pNode, double pConversionFactor, FbxAMatrix& pOriginalGlobalM ) const;
202  void AdjustLimits(FbxNode* pNode, double pConversionFactor) const;
203  void AdjustPoses(FbxScene* pScene, double pConversionFactor) const;
204  void AdjustCluster(FbxNode* pNode, double pConversionFactor) const;
205  void AdjustLightIntensity(FbxNode* pNode, const double pConversionFactor) const;
206  void AdjustPhotometricLightProperties(FbxNode* pNode, const double pConversionFactor) const;
207  void AdjustCameraClipPlanes(FbxNode* pNode, const double pConversionFactor) const;
208  void ConvertChildren(FbxNode* pRoot, const FbxSystemUnit& pSrcUnit, bool pSubChildrenOnly, const ConversionOptions& pOptions) const;
209 
210  double mScaleFactor;
211  double mMultiplier;
212 
213  friend class FbxGlobalSettings;
214 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
215 };
216 
217 #include <fbxsdk/fbxsdk_nsend.h>
218 
219 #endif /* _FBXSDK_CORE_SYSTEM_UNIT_H_ */
FBX SDK environment definition.
This class is an composite of animation curves and is called as animation curve node.
static const FbxSystemUnit cm
Predefined system unit for centimeters.
Definition: fbxsystemunit.h:88
Utility class to manipulate strings.
Definition: fbxstring.h:66
bool mConvertLightIntensity
This flag indicates whether or not to convert the light intensity property.
Definition: fbxsystemunit.h:59
bool mConvertClusters
This flag indicates whether or not to convert clusters.
Definition: fbxsystemunit.h:56
static const FbxSystemUnit Inch
Predefined system unit for inches.
Definition: fbxsystemunit.h:97
Struct to define various options that you can use to convert the system unit of a scene...
Definition: fbxsystemunit.h:47
static const FbxSystemUnit Yard
Predefined system unit for yards.
static const FbxSystemUnit mm
Predefined system unit for millimeters.
Definition: fbxsystemunit.h:82
This class contains functions for accessing global settings.
static const FbxSystemUnit Mile
Predefined system unit for miles.
static const FbxSystemUnit km
Predefined system unit for kilometers.
Definition: fbxsystemunit.h:94
bool mConvertPhotometricLProperties
This flag indicates whether or not to convert photometric lights properties.
Definition: fbxsystemunit.h:62
Represents an element in the scene graph.
Definition: fbxnode.h:72
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
static const FbxSystemUnit dm
Predefined system unit for decimeters.
Definition: fbxsystemunit.h:85
bool mConvertRrsNodes
This flag indicates whether or not to convert the nodes that do not inherit their parent&#39;s scale...
Definition: fbxsystemunit.h:50
static const FbxSystemUnit * sPredefinedUnits
Points to a FbxSystemUnit array to store the predefined system units. The array size is FBXSDK_SYSTEM...
static const FbxSystemUnit m
Predefined system unit for meters.
Definition: fbxsystemunit.h:91
static const ConversionOptions DefaultConversionOptions
Stores the default conversion options.
bool mConvertLimits
This flag indicates whether or not to convert limits.
Definition: fbxsystemunit.h:53
FBX SDK affine matrix class.
This class describes the units of measurement used within a particular scene.
Definition: fbxsystemunit.h:31
#define FBXSDK_DLL
Definition: fbxarch.h:173
bool mConvertCameraClipPlanes
This flag indicates whether or not to convert the cameras clip planes.
Definition: fbxsystemunit.h:65
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23
static const FbxSystemUnit Foot
Predefined system unit for feet.