FBX C++ API Reference
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  void Reset() { /* no-op*/ };
119 
120 protected:
121  void Construct(const FbxObject* pFrom) override;
122 
123 private:
124 
125  //base geometry mesh for subdivision
126  FbxMesh* mBaseMesh;
127 
128  //finest geometry mesh for subdivision
129  FbxMesh* mFinestMesh;
130 
131  //current operating subdivision level
132  int mCurrLevel;
133 
134  //number of subdiv level
135  int mLevelCount;
136 
137  //scheme of subdiv
138  EScheme mScheme;
139 
140  //pattern of subdiv
141  ETesselationPattern mPattern;
142 
143  //display smoothness of subdiv
144  EDisplaySmoothness mSmoothness;
145 };
146 
147 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
148 
149 #include <fbxsdk/fbxsdk_nsend.h>
150 
151 #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
FbxNodeAttribute::EType GetAttributeType() const override
Returns the node attribute type.
FBX SDK environment definition.
EType
Node attribute types.
The base class of most FBX objects.
Definition: fbxobject.h:157
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
#define FBXSDK_DLL
Definition: fbxarch.h:176
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:37
A mesh is a geometry made of polygons.
Definition: fbxmesh.h:33