fbxsdk/scene/geometry/fbxsubdiv.h Source File

fbxsubdiv.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_SCENE_GEOMETRY_SUB_DIV_H_
14 #define _FBXSDK_SCENE_GEOMETRY_SUB_DIV_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 class FbxMesh;
24 
25 /*****************************************************************************************************************************
26 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
27 *****************************************************************************************************************************/
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 
30 class FBXSDK_DLL FbxSubDiv : public FbxGeometry
31 {
33 
34 public:
35  enum EScheme
36  {
37  eCatmullClark, //Catmull CClark subdivision surface
38  eDooCSabin, //Doo CSabin subdivision surface
39  eLoop, //Loop subdivision surface
40  eLinear, //Linear subdivision surface
41  };
42 
43  enum ETesselationPattern
44  {
45  eOddFractional,
46  eEvenFractional,
47  eInteger,
48  ePower2, //Max, Maya use this one
49  };
50 
51  enum EDisplaySmoothness
52  {
53  eHull,
54  eRough,
55  eMedium,
56  eFine,
57  };
58 
64  void InitSubdivLevel(int pLevelCount,
65  EScheme pScheme = eCatmullClark,
66  ETesselationPattern pPattern = ePower2);
67 
69 
70 
71  //max subdivision level number
72  static const int MAX_SUBDIV_LEVEL = 16;
73 
74  //subdiv levels in subdivision, including the base mesh and each subdiv levels
75  FbxArray<FbxMesh*> mSubDivLevel;
76 
77  //Get the base mesh
78  FbxMesh* GetBaseMesh() const;
79 
80  //Get the mesh from finest level
81  FbxMesh* GetFinestMesh() const;
82 
83  //Set the finest mesh
84  bool SetFinestMesh(FbxMesh* pMesh);
85 
86  //Set the finest mesh
87  bool SetBaseMesh(FbxMesh* pMesh);
88 
89  //Get the mesh from specific level
90  FbxMesh* GetMesh(int pLevel) const;
91 
97  void SetSubdivLevelMesh(int pLevel, FbxMesh* pMesh);
98 
99  int GetLevelCount() const;
100  void SetLevelCount(int pLevelCount);
101 
102  int GetCurrentLevel() const;
103  void SetCurrentLevel(int pCurrentLevel);
104 
105  FbxMesh* GetCurrentMesh() const;
106 
107  FbxSubDiv::EScheme GetSubdivScheme() const;
108 
109  FbxSubDiv::ETesselationPattern GetTessPattern() const;
110 
111  void SetSubdivScheme(FbxSubDiv::EScheme pScheme);
112 
113  void SetTessPattern(FbxSubDiv::ETesselationPattern pPattern);
114 
115  FbxSubDiv::EDisplaySmoothness GetDisplaySmoothness() const;
116 
117  void SetDisplaySmoothness(FbxSubDiv::EDisplaySmoothness pSmoothness);
118 
119 private:
120 
121  //base geometry mesh for subdivision
122  FbxMesh* mBaseMesh;
123 
124  //finest geometry mesh for subdivision
125  FbxMesh* mFinestMesh;
126 
127  //current operating subdivision level
128  int mCurrLevel;
129 
130  //number of subdiv level
131  int mLevelCount;
132 
133  //scheme of subdiv
134  EScheme mScheme;
135 
136  //pattern of subdiv
137  ETesselationPattern mPattern;
138 
139  //display smoothness of subdiv
140  EDisplaySmoothness mSmoothness;
141 };
142 
143 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
144 
145 #include <fbxsdk/fbxsdk_nsend.h>
146 
147 #endif /* _FBXSDK_SCENE_GEOMETRY_SUB_DIV_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FBX SDK environment definition.
EType
Node attribute types.
virtual FbxNodeAttribute::EType GetAttributeType() const
Returns the node attribute type.
#define FBXSDK_DLL
Definition: fbxarch.h:173
The base class of geometric objects that support control point deformations (e.g. ...
Definition: fbxgeometry.h:45
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23
A mesh is a geometry made of polygons.
Definition: fbxmesh.h:32