- Main Page
- Classes
- Files
- Directories

- File List
- File Members

# fbxsubdiv.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_SUB_DIV_H_
    00014 #define _FBXSDK_SCENE_GEOMETRY_SUB_DIV_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/base/fbxarray.h>
    00019 #include <fbxsdk/scene/geometry/fbxgeometry.h>
    00020
    00021 #include <fbxsdk/fbxsdk_nsbegin.h>
    00022
    00023 class FbxMesh;
    00024
    00025 /*****************************************************************************************************************************
    00026 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
    00027 *****************************************************************************************************************************/
    00028 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00029
    00030 class FBXSDK_DLL FbxSubDiv : public FbxGeometry
    00031 {
    00032     FBXSDK_OBJECT_DECLARE(FbxSubDiv, FbxGeometry);
    00033
    00034 public:
    00035     enum EScheme
    00036     {
    00037         eCatmullClark,  //Catmull CClark subdivision surface
    00038         eDooCSabin,      //Doo CSabin subdivision surface
    00039         eLoop,           //Loop subdivision surface
    00040         eLinear,         //Linear subdivision surface
    00041     };
    00042
    00043     enum ETesselationPattern
    00044     {
    00045         eOddFractional,
    00046         eEvenFractional,
    00047         eInteger,
    00048         ePower2,      //Max, Maya use this one
    00049     };
    00050
    00051     enum EDisplaySmoothness
    00052     {
    00053         eHull,
    00054         eRough,
    00055         eMedium,
    00056         eFine,
    00057     };
    00058
    00064     void InitSubdivLevel(int pLevelCount,
    00065         EScheme pScheme = eCatmullClark,
    00066         ETesselationPattern pPattern = ePower2);
    00067
    00068     virtual FbxNodeAttribute::EType GetAttributeType() const;
    00069
    00070
    00071     //max subdivision level number
    00072     static const int MAX_SUBDIV_LEVEL = 16;
    00073
    00074     //subdiv levels in subdivision, including the base mesh and each subdiv levels
    00075     FbxArray<FbxMesh*> mSubDivLevel;
    00076
    00077     //Get the base mesh
    00078     FbxMesh* GetBaseMesh() const;
    00079
    00080     //Get the mesh from finest level
    00081     FbxMesh* GetFinestMesh() const;
    00082
    00083     //Set the finest mesh
    00084     bool SetFinestMesh(FbxMesh* pMesh);
    00085
    00086     //Set the finest mesh
    00087     bool SetBaseMesh(FbxMesh* pMesh);
    00088
    00089     //Get the mesh from specific level
    00090     FbxMesh* GetMesh(int pLevel) const;
    00091
    00097     void SetSubdivLevelMesh(int pLevel, FbxMesh* pMesh);
    00098
    00099     int GetLevelCount() const;
    00100     void SetLevelCount(int pLevelCount);
    00101
    00102     int GetCurrentLevel() const;
    00103     void SetCurrentLevel(int pCurrentLevel);
    00104
    00105     FbxMesh* GetCurrentMesh() const;
    00106
    00107     FbxSubDiv::EScheme GetSubdivScheme() const;
    00108
    00109     FbxSubDiv::ETesselationPattern GetTessPattern() const;
    00110
    00111     void SetSubdivScheme(FbxSubDiv::EScheme pScheme);
    00112
    00113     void SetTessPattern(FbxSubDiv::ETesselationPattern pPattern);
    00114
    00115     FbxSubDiv::EDisplaySmoothness GetDisplaySmoothness() const;
    00116
    00117     void SetDisplaySmoothness(FbxSubDiv::EDisplaySmoothness pSmoothness);
    00118
    00119 private:
    00120
    00121     //base geometry mesh for subdivision
    00122     FbxMesh* mBaseMesh;
    00123
    00124     //finest geometry mesh for subdivision
    00125     FbxMesh* mFinestMesh;
    00126
    00127     //current operating subdivision level
    00128     int mCurrLevel;
    00129
    00130     //number of subdiv level
    00131     int mLevelCount;
    00132
    00133     //scheme of subdiv
    00134     EScheme mScheme;
    00135
    00136     //pattern of subdiv
    00137     ETesselationPattern mPattern;
    00138
    00139     //display smoothness of subdiv
    00140     EDisplaySmoothness mSmoothness;
    00141 };
    00142
    00143 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
    00144
    00145 #include <fbxsdk/fbxsdk_nsend.h>
    00146
    00147 #endif /* _FBXSDK_SCENE_GEOMETRY_SUB_DIV_H_ */