fbxsdk/scene/geometry/fbxnode.h Source File
 
 
 
fbxsdk/scene/geometry/fbxnode.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_SCENE_GEOMETRY_NODE_H_
00014 #define _FBXSDK_SCENE_GEOMETRY_NODE_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/fbxobject.h>
00019 #include <fbxsdk/core/math/fbxtransforms.h>
00020 
00021 #include <fbxsdk/fbxsdk_nsbegin.h>
00022 
00023 class FbxStatus;
00024 class FbxNodeAttribute;
00025 class FbxCachedEffect;
00026 class FbxLODGroup;
00027 class FbxNull;
00028 class FbxMarker;
00029 class FbxSkeleton;
00030 class FbxGeometry;
00031 class FbxMesh;
00032 class FbxNurbs;
00033 class FbxNurbsCurve;
00034 class FbxLine;
00035 class FbxNurbsSurface;
00036 class FbxTrimNurbsSurface;
00037 class FbxPatch;
00038 class FbxCamera;
00039 class FbxCameraStereo;
00040 class FbxCameraSwitcher;
00041 class FbxLight;
00042 class FbxOpticalReference;
00043 class FbxSubDiv;
00044 class FbxCharacter;
00045 class FbxSurfaceMaterial;
00046 class FbxAnimStack;
00047 class FbxAnimCurveFilterMatrixConverter;
00048 
00072 class FBXSDK_DLL FbxNode : public FbxObject
00073 {
00074         FBXSDK_OBJECT_DECLARE(FbxNode, FbxObject);
00075 
00076 public:
00084                 FbxNode* GetParent();
00085                 const FbxNode* GetParent() const;
00086 
00094                 bool AddChild(FbxNode* pNode);
00095 
00100                 FbxNode* RemoveChild(FbxNode* pNode);
00101 
00106                 int GetChildCount(bool pRecursive = false) const;
00107 
00112                 FbxNode* GetChild(int pIndex);
00113 
00118                 const FbxNode* GetChild(int pIndex) const;
00119 
00127                 FbxNode* FindChild(const char* pName, bool pRecursive=true, bool pInitial=false);
00129 
00157                 void SetTarget(FbxNode* pNode);
00158 
00162                 FbxNode* GetTarget() const;
00163 
00167                 void SetPostTargetRotation(FbxVector4 pVector);
00168 
00172                 FbxVector4 GetPostTargetRotation() const;
00173 
00177                 void SetTargetUp(FbxNode* pNode);
00178 
00182                 FbxNode* GetTargetUp() const;
00183 
00187                 void SetTargetUpVector(FbxVector4 pVector);
00188 
00192                 FbxVector4 GetTargetUpVector() const;
00194 
00212                 void SetVisibility(bool pIsVisible);
00213 
00219                 bool GetVisibility() const;
00220 
00227                 enum EShadingMode
00228                 {
00229                         eHardShading,           
00230                         eWireFrame,                     
00231                         eFlatShading,           
00232                         eLightShading,          
00233                         eTextureShading,        
00234                         eFullShading            
00235                 };
00236 
00240                 void SetShadingMode(EShadingMode pShadingMode);
00241 
00245                 EShadingMode GetShadingMode() const;
00247 
00261                 FbxNodeAttribute* SetNodeAttribute(FbxNodeAttribute* pNodeAttribute);
00262 
00268                 FbxNodeAttribute* GetNodeAttribute();
00269 
00275                 const FbxNodeAttribute* GetNodeAttribute() const;
00276 
00278                 int GetNodeAttributeCount() const;
00279 
00284                 int GetDefaultNodeAttributeIndex() const;
00285 
00292                 bool SetDefaultNodeAttributeIndex(int pIndex, FbxStatus* pStatus = NULL);
00293 
00298                 FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex);
00299 
00304                 const FbxNodeAttribute* GetNodeAttributeByIndex(int pIndex) const;
00305 
00314                 int GetNodeAttributeIndex(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL) const;
00315 
00327                 bool AddNodeAttribute(FbxNodeAttribute* pNodeAttribute, FbxStatus* pStatus = NULL);
00328 
00333                 FbxNodeAttribute* RemoveNodeAttribute(FbxNodeAttribute* pNodeAttribute);
00334 
00343                 FbxNodeAttribute* RemoveNodeAttributeByIndex(int pIndex);
00344 
00350                 FbxCachedEffect* GetCachedEffect();
00351 
00357                 FbxLODGroup* GetLodGroup();
00358 
00364                 FbxNull* GetNull();
00365 
00371                 FbxMarker* GetMarker();
00372 
00378                 FbxSkeleton* GetSkeleton();
00379 
00396                 FbxGeometry* GetGeometry();
00397 
00406                 FbxMesh* GetMesh();
00407 
00416                 FbxNurbs* GetNurbs();
00417 
00426                 FbxNurbsSurface* GetNurbsSurface();
00427 
00436                 FbxNurbsCurve* GetNurbsCurve();
00437 
00446                 FbxLine* GetLine();
00447 
00456                 FbxTrimNurbsSurface* GetTrimNurbsSurface();
00457 
00466                 FbxSubDiv* GetSubdiv();
00467 
00476                 FbxPatch* GetPatch();
00477 
00483                 FbxCamera* GetCamera();
00484                 const FbxCamera* GetCamera() const;
00485 
00491                 FbxCameraStereo* GetCameraStereo();
00492 
00498                 FbxCameraSwitcher* GetCameraSwitcher();
00499 
00505                 FbxLight* GetLight();
00506                 const FbxLight* GetLight() const;
00507 
00513                 FbxOpticalReference* GetOpticalReference();
00515 
00529                 void SetTransformationInheritType(FbxTransform::EInheritType pInheritType);
00530 
00532                 void GetTransformationInheritType(FbxTransform::EInheritType& pInheritType) const;
00534 
00653                 enum EPivotSet
00654                 {
00655                         eSourcePivot,           
00656                         eDestinationPivot       
00657                 };
00658 
00661                 enum EPivotState
00662                 {
00663                         ePivotActive,   
00664                         ePivotReference 
00665                 };
00666 
00671                 void SetPivotState(EPivotSet pPivotSet, EPivotState pPivotState);
00672 
00679                 void GetPivotState(EPivotSet pPivotSet, EPivotState& pPivotState) const;
00680 
00686                 void SetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder pRotationOrder);
00687 
00692                 void GetRotationOrder(EPivotSet pPivotSet, EFbxRotationOrder& pRotationOrder) const;
00693 
00703                 void SetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet, bool pUseForLimitOnly);
00704 
00709                 bool GetUseRotationSpaceForLimitOnly(EPivotSet pPivotSet) const;
00710 
00716                 void SetRotationActive(bool pVal);
00717 
00721                 bool GetRotationActive() const;
00722 
00729                 void SetQuaternionInterpolation(EPivotSet pPivotSet, EFbxQuatInterpMode pQuatIterp);
00730 
00735                 EFbxQuatInterpMode GetQuaternionInterpolation(EPivotSet pPivotSet) const;
00736 
00745                 void SetRotationStiffness(FbxVector4 pRotationStiffness);
00746 
00750                 FbxVector4 GetRotationStiffness() const;
00751 
00760                 void SetMinDampRange(FbxVector4 pMinDampRange);
00761 
00765                 FbxVector4 GetMinDampRange() const;
00766 
00775                 void SetMaxDampRange(FbxVector4 pMaxDampRange);
00776 
00780                 FbxVector4 GetMaxDampRange() const;
00781 
00790                 void SetMinDampStrength(FbxVector4 pMinDampStrength);
00791 
00795                 FbxVector4 GetMinDampStrength() const;
00796 
00805                 void SetMaxDampStrength(FbxVector4 pMaxDampStrength);
00806 
00810                 FbxVector4 GetMaxDampStrength() const;
00811 
00817                 void SetPreferedAngle(FbxVector4 pPreferedAngle);
00818 
00822                 FbxVector4 GetPreferedAngle() const;
00823 
00829                 void SetRotationOffset(EPivotSet pPivotSet, FbxVector4 pVector);
00830 
00836                 const FbxVector4& GetRotationOffset(EPivotSet pPivotSet) const;
00837 
00844                 void SetRotationPivot(EPivotSet pPivotSet, FbxVector4 pVector);
00845 
00852                 const FbxVector4& GetRotationPivot(EPivotSet pPivotSet) const;
00853 
00860                 void SetPreRotation(EPivotSet pPivotSet, FbxVector4 pVector);
00861 
00868                 const FbxVector4& GetPreRotation(EPivotSet pPivotSet) const;
00869 
00876                 void SetPostRotation(EPivotSet pPivotSet, FbxVector4 pVector);
00877 
00884                 const FbxVector4& GetPostRotation(EPivotSet pPivotSet) const;
00885 
00891                 void SetScalingOffset(EPivotSet pPivotSet, FbxVector4 pVector);
00892 
00898                 const FbxVector4& GetScalingOffset(EPivotSet pPivotSet) const;
00899 
00906                 void SetScalingPivot(EPivotSet pPivotSet, FbxVector4 pVector);
00907 
00914                 const FbxVector4& GetScalingPivot(EPivotSet pPivotSet) const;
00915 
00924                 void SetGeometricTranslation(EPivotSet pPivotSet, FbxVector4 pVector);
00925 
00930                 FbxVector4 GetGeometricTranslation(EPivotSet pPivotSet) const;
00931 
00940                 void SetGeometricRotation(EPivotSet pPivotSet, FbxVector4 pVector);
00941 
00946                 FbxVector4 GetGeometricRotation(EPivotSet pPivotSet) const;
00947 
00956                 void SetGeometricScaling(EPivotSet pPivotSet, FbxVector4 pVector);
00957 
00962                 FbxVector4 GetGeometricScaling(EPivotSet pPivotSet) const;
00963 
00970                 void ResetPivotSet( FbxNode::EPivotSet pPivotSet );
00971 
00994                 FBX_DEPRECATED void ConvertPivotAnimation(EPivotSet pConversionTarget, double pFrameRate, bool pKeyReduce=true);
00995             
01026                 void ConvertPivotAnimationRecursive(const char* pAnimStackName, EPivotSet pConversionTarget, double pFrameRate, bool pKeyReduce=true);
01027 
01041                 void ResetPivotSetAndConvertAnimation(double pFrameRate=30.0, bool pKeyReduce=false, bool pToNodeCenter=true, bool pForceResetLimits=false);
01042 
01046                 void SetRotationPivotAsCenterRecursive(FbxVector4 pParentGeometricOffset=FbxVector4());
01048 
01060                 FbxAMatrix& EvaluateGlobalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
01061 
01073                 FbxAMatrix& EvaluateLocalTransform(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
01074 
01084                 FbxVector4& EvaluateLocalTranslation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
01085 
01096                 FbxVector4& EvaluateLocalRotation(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
01097 
01107                 FbxVector4& EvaluateLocalScaling(FbxTime pTime=FBXSDK_TIME_INFINITE, FbxNode::EPivotSet pPivotSet=FbxNode::eSourcePivot, bool pApplyTarget=false, bool pForceEval=false);
01109 
01110 
01118                 int GetCharacterLinkCount() const;
01119 
01132                 bool GetCharacterLink(int pIndex, FbxCharacter** pCharacter, int* pCharacterLinkType, int* pNodeId, int* pNodeSubId);
01133 
01145                 int FindCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId) const;
01147 
01161         bool GetAnimationInterval(FbxTimeSpan& pInterval, FbxAnimStack* pAnimStack=NULL, int pAnimLayerId=0);
01162 
01171                 int AddMaterial(FbxSurfaceMaterial* pMaterial);
01172 
01177                 bool RemoveMaterial(FbxSurfaceMaterial* pMaterial);
01178 
01185                 int GetMaterialCount() const;
01186 
01191                 FbxSurfaceMaterial* GetMaterial(int pIndex) const;
01192 
01195                 void RemoveAllMaterials();
01196 
01202                 int GetMaterialIndex(const char* pName) const;
01204 
01216                 FbxPropertyT<FbxDouble3> LclTranslation;
01217 
01225                 FbxPropertyT<FbxDouble3> LclRotation;
01226 
01234                 FbxPropertyT<FbxDouble3> LclScaling;
01235 
01254                 FbxPropertyT<FbxDouble> Visibility;
01255 
01273                 FbxPropertyT<FbxBool> VisibilityInheritance;
01274 
01275 
01283                 FbxPropertyT<EFbxQuatInterpMode> QuaternionInterpolate;
01284 
01292                 FbxPropertyT<FbxDouble3> RotationOffset;
01293 
01301                 FbxPropertyT<FbxDouble3> RotationPivot;
01302 
01310                 FbxPropertyT<FbxDouble3> ScalingOffset;
01311 
01319                 FbxPropertyT<FbxDouble3> ScalingPivot;
01320 
01333                 FbxPropertyT<FbxBool> TranslationActive;
01334 
01342                 FbxPropertyT<FbxDouble3> TranslationMin;
01343 
01351                 FbxPropertyT<FbxDouble3> TranslationMax;
01352 
01361                 FbxPropertyT<FbxBool> TranslationMinX;
01362 
01371                 FbxPropertyT<FbxBool> TranslationMinY;
01372 
01373                 
01382                 FbxPropertyT<FbxBool> TranslationMinZ;
01383 
01392                 FbxPropertyT<FbxBool> TranslationMaxX;
01393 
01402                 FbxPropertyT<FbxBool> TranslationMaxY;
01403 
01412                 FbxPropertyT<FbxBool> TranslationMaxZ;
01413 
01421                 FbxPropertyT<EFbxRotationOrder> RotationOrder;
01422 
01432                 FbxPropertyT<FbxBool> RotationSpaceForLimitOnly;
01433 
01441                 FbxPropertyT<FbxDouble> RotationStiffnessX;
01442 
01450                 FbxPropertyT<FbxDouble> RotationStiffnessY;
01451 
01459                 FbxPropertyT<FbxDouble> RotationStiffnessZ;
01460 
01468                 FbxPropertyT<FbxDouble> AxisLen;
01469          
01477                 FbxPropertyT<FbxDouble3> PreRotation;
01478 
01486                 FbxPropertyT<FbxDouble3> PostRotation;
01487 
01502                 FbxPropertyT<FbxBool> RotationActive;
01503 
01511                 FbxPropertyT<FbxDouble3> RotationMin;
01512 
01520                 FbxPropertyT<FbxDouble3> RotationMax;
01521 
01530                 FbxPropertyT<FbxBool> RotationMinX;
01531 
01540                 FbxPropertyT<FbxBool> RotationMinY;
01541 
01550                 FbxPropertyT<FbxBool> RotationMinZ;
01551 
01560                 FbxPropertyT<FbxBool> RotationMaxX;
01561 
01570                 FbxPropertyT<FbxBool> RotationMaxY;
01571 
01580                 FbxPropertyT<FbxBool> RotationMaxZ;
01581 
01589                 FbxPropertyT<FbxTransform::EInheritType> InheritType;
01590 
01603                 FbxPropertyT<FbxBool> ScalingActive;
01604 
01612                 FbxPropertyT<FbxDouble3> ScalingMin;
01613 
01621                 FbxPropertyT<FbxDouble3> ScalingMax;
01622 
01631                 FbxPropertyT<FbxBool> ScalingMinX;
01632 
01641                 FbxPropertyT<FbxBool> ScalingMinY;
01642 
01651                 FbxPropertyT<FbxBool> ScalingMinZ;
01652 
01661                 FbxPropertyT<FbxBool> ScalingMaxX;
01662 
01671                 FbxPropertyT<FbxBool> ScalingMaxY;
01672 
01681                 FbxPropertyT<FbxBool> ScalingMaxZ;
01682 
01690                 FbxPropertyT<FbxDouble3> GeometricTranslation;
01691 
01699                 FbxPropertyT<FbxDouble3> GeometricRotation;
01700          
01708                 FbxPropertyT<FbxDouble3> GeometricScaling;
01709 
01710                 // IK Settings
01712 
01720                 FbxPropertyT<FbxDouble> MinDampRangeX;
01721 
01729                 FbxPropertyT<FbxDouble> MinDampRangeY;
01730 
01738                 FbxPropertyT<FbxDouble> MinDampRangeZ;
01739 
01747                 FbxPropertyT<FbxDouble> MaxDampRangeX;
01748 
01756                 FbxPropertyT<FbxDouble> MaxDampRangeY;
01757 
01765                 FbxPropertyT<FbxDouble> MaxDampRangeZ;
01766 
01774                 FbxPropertyT<FbxDouble> MinDampStrengthX;
01775 
01783                 FbxPropertyT<FbxDouble> MinDampStrengthY;
01784 
01792                 FbxPropertyT<FbxDouble> MinDampStrengthZ;
01793 
01801                 FbxPropertyT<FbxDouble> MaxDampStrengthX;
01802 
01810                 FbxPropertyT<FbxDouble> MaxDampStrengthY;
01811 
01819                 FbxPropertyT<FbxDouble> MaxDampStrengthZ;
01820 
01828                 FbxPropertyT<FbxDouble> PreferedAngleX;
01829 
01837                 FbxPropertyT<FbxDouble> PreferedAngleY;
01838 
01846                 FbxPropertyT<FbxDouble> PreferedAngleZ;
01847 
01849 
01856                 FbxPropertyT<FbxReference> LookAtProperty;
01857 
01864                 FbxPropertyT<FbxReference> UpVectorProperty;
01865 
01888                 FbxPropertyT<FbxBool> Show;
01889 
01897                 FbxPropertyT<FbxBool> NegativePercentShapeSupport;
01898 
01906                 FbxPropertyT<FbxInt> DefaultAttributeIndex;
01907 
01915                 FbxPropertyT<FbxBool> Freeze;
01916 
01926                 FbxPropertyT<FbxBool> LODBox;
01928 
01929 /*****************************************************************************************************************************
01930 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
01931 *****************************************************************************************************************************/
01932 #ifndef DOXYGEN_SHOULD_SKIP_THIS
01933         class FBXSDK_DLL Pivot
01934         {
01935         public:
01936                 static const FbxVector4 sZeroVector;
01937                 static const FbxVector4 sOneVector;
01938 
01939                 Pivot()
01940                 {
01941                         mRotationOffset = NULL;
01942                         mRotationPivot = NULL;
01943                         mPreRotation = NULL;
01944                         mPostRotation = NULL;
01945                         mScalingOffset = NULL;
01946                         mScalingPivot = NULL;
01947                         mGeometricTranslation = NULL;
01948                         mGeometricRotation = NULL;
01949                         mGeometricScaling = NULL;
01950                         Reset();
01951                 }
01952                 ~Pivot() { Reset(); }
01953 
01954                 void Reset()
01955                 {
01956                         FBX_SAFE_DELETE(mRotationOffset);
01957                         FBX_SAFE_DELETE(mRotationPivot); 
01958                         FBX_SAFE_DELETE(mPreRotation);
01959                         FBX_SAFE_DELETE(mPostRotation);
01960                         FBX_SAFE_DELETE(mScalingOffset);
01961                         FBX_SAFE_DELETE(mScalingPivot);
01962                         FBX_SAFE_DELETE(mGeometricTranslation);
01963                         FBX_SAFE_DELETE(mGeometricRotation);
01964                         FBX_SAFE_DELETE(mGeometricScaling);
01965                         mRotationOrder = eEulerXYZ;
01966                         mRotationSpaceForLimitOnly = false;
01967                         mPivotState = FbxNode::ePivotReference;
01968                         mQuaternionInterpolate  = eQuatInterpOff;
01969                 }
01970 
01971                 inline const FbxVector4& GetRotationOffset() const { return (mRotationOffset) ? *mRotationOffset : sZeroVector; }
01972                 inline void SetRotationOffset(const FbxVector4& pV)
01973                 {
01974                         if( !mRotationOffset )
01975                         {
01976                         #if( defined(__GNUC__) && __GNUC__ < 4 )
01977                                 mRotationOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
01978                         #else
01979                                 mRotationOffset = FbxNew< FbxVector4 >(pV);
01980                         #endif
01981                         }
01982                         else
01983                         {
01984                                 *mRotationOffset = pV;
01985                         }
01986                 }
01987 
01988                 inline const FbxVector4& GetRotationPivot() const { return (mRotationPivot) ? *mRotationPivot : sZeroVector; }
01989                 inline void SetRotationPivot(const FbxVector4& pV)
01990                 {
01991                         if( !mRotationPivot )
01992                         {
01993                         #if (defined(__GNUC__) && __GNUC__ < 4)
01994                                 mRotationPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
01995                         #else
01996                                 mRotationPivot = FbxNew< FbxVector4 >(pV);
01997                         #endif
01998                         }
01999                         else
02000                         {
02001                                 *mRotationPivot = pV;
02002                         }
02003                 }
02004 
02005                 inline const FbxVector4& GetPreRotation() const { return (mPreRotation) ? *mPreRotation : sZeroVector; }
02006                 inline void SetPreRotation(const FbxVector4& pV)
02007                 {
02008                         if( !mPreRotation )
02009                         {
02010                         #if (defined(__GNUC__) && __GNUC__ < 4)
02011                                 mPreRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
02012                         #else
02013                                 mPreRotation = FbxNew< FbxVector4 >(pV);
02014                         #endif
02015                         }
02016                         else
02017                         {
02018                                 *mPreRotation = pV;
02019                         }
02020                 }
02021 
02022                 inline const FbxVector4& GetPostRotation() const { return (mPostRotation) ? *mPostRotation : sZeroVector; }
02023                 inline void SetPostRotation(const FbxVector4& pV)
02024                 {
02025                         if( !mPostRotation )
02026                         {
02027                         #if (defined(__GNUC__) && __GNUC__ < 4)
02028                                 mPostRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
02029                         #else
02030                                 mPostRotation = FbxNew< FbxVector4 >(pV);
02031                         #endif
02032                         }
02033                         else
02034                         {
02035                                 *mPostRotation = pV;
02036                         }
02037                 }
02038 
02039                 inline const FbxVector4& GetScalingOffset() const { return (mScalingOffset) ? *mScalingOffset : sZeroVector; }
02040                 inline void SetScalingOffset(const FbxVector4& pV)
02041                 {
02042                         if( !mScalingOffset )
02043                         {
02044                         #if (defined(__GNUC__) && __GNUC__ < 4)
02045                                 mScalingOffset = FbxNew< FbxVector4 >((FbxVector4&)pV);
02046                         #else                    
02047                                 mScalingOffset = FbxNew< FbxVector4 >(pV);
02048                         #endif                        
02049                         }
02050                         else
02051                         {
02052                                 *mScalingOffset = pV;
02053                         }
02054                 }
02055 
02056                 inline const FbxVector4& GetScalingPivot() const { return (mScalingPivot) ? *mScalingPivot : sZeroVector; }
02057                 inline void SetScalingPivot(const FbxVector4& pV)
02058                 {
02059                         if( !mScalingPivot )
02060                         {
02061                         #if (defined(__GNUC__) && __GNUC__ < 4)
02062                                 mScalingPivot = FbxNew< FbxVector4 >((FbxVector4&)pV);
02063                         #else                    
02064                                 mScalingPivot = FbxNew< FbxVector4 >(pV);
02065                         #endif                        
02066                         }
02067                         else
02068                         {
02069                                 *mScalingPivot = pV;
02070                         }
02071                 }
02072 
02073                 inline const FbxVector4& GetGeometricTranslation() const { return (mGeometricTranslation) ? *mGeometricTranslation : sZeroVector; }
02074                 inline void SetGeometricTranslation(const FbxVector4& pV)
02075                 {
02076                         if( !mGeometricTranslation )
02077                         {
02078                         #if (defined(__GNUC__) && __GNUC__ < 4)
02079                                 mGeometricTranslation = FbxNew< FbxVector4 >((FbxVector4&)pV);
02080                         #else
02081                                 mGeometricTranslation = FbxNew< FbxVector4 >(pV);
02082                         #endif
02083                         }
02084                         else
02085                         {
02086                                 *mGeometricTranslation = pV;
02087                         }
02088                 }
02089 
02090                 inline const FbxVector4& GetGeometricRotation() const { return (mGeometricRotation) ? *mGeometricRotation : sZeroVector; }
02091                 inline void SetGeometricRotation(const FbxVector4& pV)
02092                 {
02093                         if( !mGeometricRotation )
02094                         {
02095                         #if (defined(__GNUC__) && __GNUC__ < 4)
02096                                 mGeometricRotation = FbxNew< FbxVector4 >((FbxVector4&)pV);
02097                         #else
02098                                 mGeometricRotation = FbxNew< FbxVector4 >(pV);
02099                         #endif
02100                         }
02101                         else
02102                         {
02103                                 *mGeometricRotation = pV;
02104                         }
02105                 }
02106 
02107                 inline const FbxVector4& GetGeometricScaling() const { return (mGeometricScaling) ? *mGeometricScaling : sOneVector; }
02108                 inline void SetGeometricScaling(const FbxVector4& pV)
02109                 {
02110                         if( !mGeometricScaling )
02111                         {
02112                         #if (defined(__GNUC__) && __GNUC__ < 4)
02113                                 mGeometricScaling = FbxNew< FbxVector4 >((FbxVector4&)pV);
02114                         #else
02115                                 mGeometricScaling = FbxNew< FbxVector4 >(pV);
02116                         #endif                        
02117                         }
02118                         else
02119                         {
02120                                 *mGeometricScaling = pV;
02121                         }
02122                 }
02123 
02124                 inline EFbxRotationOrder GetRotationOrder() const { return mRotationOrder; }
02125                 inline void SetRotationOrder(EFbxRotationOrder pROrder) { mRotationOrder = pROrder; }
02126                 inline bool GetRotationSpaceForLimitOnly() const { return mRotationSpaceForLimitOnly; }
02127                 inline void SetRotationSpaceForLimitOnly(bool pVal) { mRotationSpaceForLimitOnly = pVal; }
02128                 inline EFbxQuatInterpMode GetQuaternionInterpolate() const { return mQuaternionInterpolate; }
02129                 inline void SetQuaternionInterpolate(EFbxQuatInterpMode pVal) { mQuaternionInterpolate = pVal;  }
02130                 inline FbxNode::EPivotState GetPivotState() const { return mPivotState; }
02131                 inline void SetPivotState(FbxNode::EPivotState pVal) { mPivotState = pVal; }
02132 
02133         private:
02134                 FbxVector4*                             mRotationOffset;
02135                 FbxVector4*                             mRotationPivot;
02136                 FbxVector4*                             mPreRotation;
02137                 FbxVector4*                             mPostRotation;
02138                 FbxVector4*                             mScalingOffset;
02139                 FbxVector4*                             mScalingPivot;
02140                 FbxVector4*                             mGeometricTranslation;
02141                 FbxVector4*                             mGeometricRotation;
02142                 FbxVector4*                             mGeometricScaling;
02143                 EFbxRotationOrder               mRotationOrder;
02144                 bool                                    mRotationSpaceForLimitOnly;
02145                 EFbxQuatInterpMode              mQuaternionInterpolate;
02146                 FbxNode::EPivotState    mPivotState;
02147         };
02148 
02149         class FBXSDK_DLL Pivots
02150         {
02151         public:
02152                 Pivots()
02153                 {
02154                         for( int i = 0; i < 2; i++ )
02155                         {
02156                                 mIsDefault[i] = true;
02157                                 mPivotState[i] = FbxNode::ePivotReference;
02158                                 mPivot[i] = NULL;
02159                         }
02160                 }
02161 
02162                 ~Pivots()
02163                 {
02164                         FbxDelete(mPivot[0]);
02165                         FbxDelete(mPivot[1]);
02166                 }
02167 
02168                 Pivot& Get(int id)
02169                 {
02170                         FBX_ASSERT(id == 0 || id == 1);
02171                         if (mPivot[id] == NULL && mIsDefault[id])
02172                         {
02173                                 smDefaultPivot.SetPivotState(mPivotState[id]);
02174                                 return smDefaultPivot;
02175                         }
02176 
02177                         if (!mPivot[id])
02178                                 mPivot[id] = FbxNew< Pivot >();
02179 
02180                         FBX_ASSERT(mPivot[id] != NULL);
02181                         if (mPivot[id])
02182                                 mPivot[id]->SetPivotState(mPivotState[id]);
02183 
02184                         return *mPivot[id];
02185                 }
02186 
02187                 #define MACRO_PIVOT_VECTOR_FCTS(name, defVect) \
02188                         inline const FbxVector4& Get##name(int id) const \
02189                         {\
02190                                 FBX_ASSERT(id == 0 || id == 1); \
02191                                 Pivot* p = mPivot[id]; \
02192                                 if (p == NULL) p = &smDefaultPivot; \
02193                                 return p->Get##name(); \
02194                         }\
02195                         inline void Set##name(int id, const FbxVector4& pV) \
02196                         {\
02197                                 FBX_ASSERT(id == 0 || id == 1); \
02198                                 if (mIsDefault[id] && pV[0] == defVect[0] && pV[1] == defVect[1] && pV[2] == defVect[2]) return; \
02199                                 mIsDefault[id] = false; \
02200                                 Get(id).Set##name(pV); \
02201                         }
02202 
02203                 MACRO_PIVOT_VECTOR_FCTS(RotationOffset, Pivot::sZeroVector);
02204                 MACRO_PIVOT_VECTOR_FCTS(RotationPivot, Pivot::sZeroVector);
02205                 MACRO_PIVOT_VECTOR_FCTS(PreRotation, Pivot::sZeroVector);
02206                 MACRO_PIVOT_VECTOR_FCTS(PostRotation, Pivot::sZeroVector);
02207                 MACRO_PIVOT_VECTOR_FCTS(ScalingOffset, Pivot::sZeroVector);
02208                 MACRO_PIVOT_VECTOR_FCTS(ScalingPivot, Pivot::sZeroVector);
02209                 MACRO_PIVOT_VECTOR_FCTS(GeometricTranslation, Pivot::sZeroVector);
02210                 MACRO_PIVOT_VECTOR_FCTS(GeometricRotation, Pivot::sZeroVector);
02211                 MACRO_PIVOT_VECTOR_FCTS(GeometricScaling, Pivot::sOneVector);
02212 
02213                 #define MACRO_PIVOT_BOOL_FCTS(name) \
02214                         inline bool Get##name(int id) const \
02215                         {\
02216                                 FBX_ASSERT(id == 0 || id == 1); \
02217                                 Pivot* p = mPivot[id]; \
02218                                 if (p == NULL) p = &smDefaultPivot; \
02219                                 return p->Get##name(); \
02220                         }\
02221                         inline void Set##name(int id, bool pV) \
02222                         {\
02223                                 FBX_ASSERT(id == 0 || id == 1); \
02224                                 mIsDefault[id] = false; \
02225                                 Get(id).Set##name(pV); \
02226                         }
02227 
02228                 MACRO_PIVOT_BOOL_FCTS(RotationSpaceForLimitOnly);
02229 
02230                 inline EFbxQuatInterpMode GetQuaternionInterpolate(int id) const
02231                 {
02232                         FBX_ASSERT(id == 0 || id == 1);
02233                         Pivot* p = mPivot[id];
02234                         if (p == NULL) p = &smDefaultPivot;
02235                         return p->GetQuaternionInterpolate();
02236                 }
02237 
02238                 inline void SetQuaternionInterpolate(int id, EFbxQuatInterpMode pV)
02239                 {
02240                         FBX_ASSERT(id == 0 || id == 1);
02241                         // If pivot has default values, and we want to set default eQuatInterpOff, 
02242                         // return to avoid allocating memory for the pivot (in Get(id).)
02243                         if (mIsDefault[id] && pV == eQuatInterpOff) return;
02244                         mIsDefault[id] = false;
02245                         Get(id).SetQuaternionInterpolate(pV);
02246                 }
02247 
02248                 inline EFbxRotationOrder GetRotationOrder(int id) const
02249                 {
02250                         FBX_ASSERT(id == 0 || id == 1);
02251                         Pivot* p = mPivot[id];
02252                         if (p == NULL) p = &smDefaultPivot;
02253                         return p->GetRotationOrder();
02254                 }
02255 
02256                 inline void SetRotationOrder(int id, EFbxRotationOrder pROrder)
02257                 {
02258                         FBX_ASSERT(id == 0 || id == 1);
02259                         // If pivot has default values, and we want to set default rotation order eEulerXYZ, 
02260                         // return to avoid allocating memory for the pivot (in Get(id).)
02261                         if (mIsDefault[id] && pROrder == eEulerXYZ) return;
02262                         mIsDefault[id] = false;
02263                         Get(id).SetRotationOrder(pROrder);
02264                 }
02265 
02266                 inline FbxNode::EPivotState GetPivotState(int id) const
02267                 {
02268                         FBX_ASSERT(id == 0 || id == 1);
02269                         return mPivotState[id];
02270                 }
02271 
02272                 inline void SetPivotState(int id, FbxNode::EPivotState pVal)
02273                 {
02274                         FBX_ASSERT(id == 0 || id == 1);
02275                         if (pVal == FbxNode::ePivotReference) return;
02276                         mPivotState[id] = pVal;
02277                         if (mPivot[id])
02278                                 mPivot[id]->SetPivotState(pVal);
02279                 }
02280 
02281                 #undef MACRO_PIVOT_VECTOR_FCTS
02282                 #undef MACRO_PIVOT_BOOL_FCTS
02283 
02284                 void Reset()
02285                 {
02286                         smDefaultPivot.Reset();
02287                         for (int i = 0; i < 2; i++)
02288                         {
02289                                 mIsDefault[i] = true;
02290                                 mPivotState[i] = FbxNode::ePivotReference;
02291                                 if (mPivot[i]) mPivot[i]->Reset();
02292                         }
02293                 }
02294 
02295         private:
02296                 Pivot*                                  mPivot[2];
02297                 FbxNode::EPivotState    mPivotState[2];
02298                 bool                                    mIsDefault[2];
02299                 static Pivot                    smDefaultPivot;
02300         };
02301 
02302         class FBXSDK_DLL LinkToCharacter
02303         {
02304         public:
02305                 bool operator==(LinkToCharacter& pLinkToCharacter)
02306                 {
02307                         if (mCharacter == pLinkToCharacter.mCharacter &&
02308                                 mType == pLinkToCharacter.mType &&
02309                                 mIndex == pLinkToCharacter.mIndex &&
02310                                 mSubIndex == pLinkToCharacter.mSubIndex)
02311                         {
02312                                 return true;
02313                         }
02314                         else return false;
02315                 }
02316 
02317                 FbxCharacter* mCharacter;
02318                 int mType;
02319                 int mIndex;
02320                 int mSubIndex;
02321         };
02322 
02323     void                                        AddChildName(char* pChildName);
02324     char*                                       GetChildName(FbxUInt pIndex) const;
02325     FbxUInt                                     GetChildNameCount() const;
02326 
02327     FbxTransform&                       GetTransform();
02328         FbxLimits&                              GetTranslationLimits();
02329         FbxLimits&                              GetRotationLimits();
02330         FbxLimits&                              GetScalingLimits();
02331         Pivots&                                 GetPivots();
02332 
02333     void                                        UpdatePivotsAndLimitsFromProperties();
02334     void                                        UpdatePropertiesFromPivotsAndLimits();
02335 
02336     void                                        SetRotationActiveProperty(bool pVal);
02337     void                                        PivotSetToMBTransform(EPivotSet pPivotSet);
02338 
02339     int                                         AddCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
02340     int                                         RemoveCharacterLink(FbxCharacter* pCharacter, int pCharacterLinkType, int pNodeId, int pNodeSubId);
02341 
02342     // Duplicate this node as well as all its node attributes and the Target and UpTarget objects.
02343     FbxNode*                DeepCloneWithNodeAttributes();
02344 
02345     virtual FbxObject&          Copy(const FbxObject& pObject);
02346     virtual const char*         GetTypeName() const;
02347     virtual FbxStringList       GetTypeFlags() const;
02348     virtual bool                        PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty);
02349 
02350     enum ECullingType
02351         {
02352                 eCullingOff,
02353                 eCullingOnCCW,
02354                 eCullingOnCW
02355         };
02356 
02357     ECullingType                        mCullingType;
02358     bool                                        mCorrectInheritType;
02359 
02360 protected:
02361         virtual void Construct(const FbxNode* pFrom);
02362         virtual void ConstructProperties(bool pForceSet);
02363         virtual void Destruct(bool pRecursive);
02364 
02365         void                            Reset();
02366         bool                            GetAnimationIntervalRecursive(FbxTimeSpan& pTimeInterval, FbxAnimLayer* pAnimLayer);
02367 
02368 private:
02369         typedef FbxSet2<FbxHandle> GeomInstSet;
02370 
02371         void                            ResetLimitsRecursive(FbxNode* pNode);
02372 
02373         void                            ConvertPivotAnimationRecurseLoop(const char* pAnimStackName, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
02374         void                            ConvertPivotAnimation(const char* pAnimStackName, const EPivotSet pConversionTarget, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
02375         bool                            ConvertPivotAnimation_SetupMatrixConverter(FbxAnimCurveFilterMatrixConverter& pConverter, const EPivotSet& pSrcSet, const EPivotSet& pDstSet, const double pFrameRate, const bool pKeyReduce, GeomInstSet& pGeomInstSet);
02376         void                            ConvertPivotAnimation_ApplyGeometryPivot(const EPivotSet& pSrcSet, const EPivotSet& pDstSet, GeomInstSet& pGeomInstSet);
02377 
02378         FbxTransform                            mTransform;
02379         Pivots                                          mPivots;
02380         FbxObject*                                      mAnimCurveNodeContainer;
02381         FbxArray<FbxString*>            mChildrenNameList;
02382         FbxVector4                                      mPostTargetRotation;
02383         FbxVector4                                      mTargetUpVector;
02384         FbxNode::EShadingMode           mShadingMode;
02385         FbxArray<LinkToCharacter>       mLinkToCharacter;
02386 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
02387 };
02388 
02389 inline EFbxType FbxTypeOf(const EFbxRotationOrder&){ return eFbxEnum; }
02390 inline EFbxType FbxTypeOf(const FbxTransform::EInheritType&){ return eFbxEnum; }
02391 inline EFbxType FbxTypeOf(const EFbxQuatInterpMode&){ return eFbxEnum; }
02392 
02393 #include <fbxsdk/fbxsdk_nsend.h>
02394 
02395 #endif /* _FBXSDK_SCENE_GEOMETRY_NODE_H_ */