fbxsdk/scene/geometry/fbxnurbscurve.h Source File

fbxnurbscurve.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_NURBS_CURVE_H_
14 #define _FBXSDK_SCENE_GEOMETRY_NURBS_CURVE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
61 {
63 
64 public:
67 
73  {
74  e2D = 2,
75  e3D
76  };
77 
83  enum EType
84  {
87  ePeriodic
88  };
89 
96  void InitControlPoints( int pCount, EType pVType );
97 
101  inline double* GetKnotVector() const { return mKnotVector; }
102 
106  int GetKnotCount() const;
107 
112  inline void SetOrder( int pOrder ) { mOrder = pOrder; }
113 
117  inline int GetOrder() const { return mOrder; }
118 
123  inline void SetStep( int pStep ) { mStep = pStep; }
124 
129  inline int GetStep() const { return mStep; }
130 
136  inline void SetDimension( EDimension pDimension ) { mDimension = pDimension; }
137 
141  inline EDimension GetDimension() const { return mDimension; }
142 
146  bool IsRational();
147 
160  int GetSpanCount() const;
161 
165  inline EType GetType() const { return mNurbsType; }
166 
172  inline bool IsPolyline() const { return ( GetOrder() == 2 ); }
173 
178  bool IsBezier() const;
179 
185  int TessellateCurve(FbxArray<FbxVector4>& pPointArray, int pStep = 16);
186 
191  FbxLine* TessellateCurve(int pStep = 16);
192 
193 /*****************************************************************************************************************************
194 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
195 *****************************************************************************************************************************/
196 #ifndef DOXYGEN_SHOULD_SKIP_THIS
197  virtual FbxObject& Copy(const FbxObject& pObject);
198 
199  bool FullMultiplicity() const;
200 
201  // Error identifiers, these are only used internally.
202  enum EErrorCode
203  {
204  eNurbsCurveTypeUnknown,
205  eWeightTooSmall,
206  eKnotVectorError,
207  eWrongNumberOfControlPoint,
208  eErrorCount
209  };
210 
211  bool mIsRational;
212 
213  virtual void SetControlPointAt(const FbxVector4 &pCtrlPoint , int pIndex) { ParentClass::SetControlPointAt(pCtrlPoint, pIndex); }
214  virtual void InitControlPoints(int pCount) { ParentClass::InitControlPoints(pCount); }
215 
216 protected:
217  virtual void Construct(const FbxObject* pFrom);
218  virtual void Destruct(bool pRecursive);
219 
220  void Reset();
221 
222 private:
223  double* mKnotVector;
224  EType mNurbsType;
225  int mOrder;
226  EDimension mDimension;
227  int mStep;
228 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
229 };
230 
231 #include <fbxsdk/fbxsdk_nsend.h>
232 
233 #endif /* _FBXSDK_SCENE_GEOMETRY_NURBS_CURVE_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.
virtual void InitControlPoints(int pCount)
Allocates memory space for the array of control points.
void SetDimension(EDimension pDimension)
Sets the dimension of the CVs.
virtual FbxObject & Copy(const FbxObject &pObject)
Copy an object content into this object.
void SetStep(int pStep)
Sets the step of the curve.
EType GetType() const
Returns NURBS type.
void SetOrder(int pOrder)
Sets the order of the curve.
EType
Node attribute types.
virtual FbxNodeAttribute::EType GetAttributeType() const
Returns the node attribute type.
The base class of most FBX objects.
Definition: fbxobject.h:157
EDimension GetDimension() const
Returns the control points dimension.
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
int GetOrder() const
Returns the NURBS curve order.
A four double mathematic vector class.
Definition: fbxvector4.h:25
virtual void SetControlPointAt(const FbxVector4 &pCtrlPoint, const FbxVector4 &pNormal, int pIndex, bool pI2DSearch=false)
Sets the control point and the normal values at the specified index.
#define FBXSDK_DLL
Definition: fbxarch.h:173
A Non-Uniform Rational B-Spline (NURBS) curve is a type of parametric geometry.
Definition: fbxnurbscurve.h:60
The base class of geometric objects that support control point deformations (e.g. ...
Definition: fbxgeometry.h:45
double * GetKnotVector() const
Returns the knot vector.
virtual void Destruct(bool pRecursive)
Optional destructor override, automatically called by default destructor.
EDimension
The dimension of the CVs.
Definition: fbxnurbscurve.h:72
bool IsPolyline() const
Checks if the curve is a poly line.
Class for array of basic elements such as pointers and basic types.
Definition: fbxarray.h:23
A line is a geometry made of points.
Definition: fbxline.h:34
int GetStep() const
Returns the NURBS curve step.