FBX C++ API Reference
fbxtrimnurbssurface.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_TRIM_NURBS_SURFACE_H_
14 #define _FBXSDK_SCENE_GEOMETRY_TRIM_NURBS_SURFACE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
21 
22 #include <fbxsdk/fbxsdk_nsbegin.h>
23 
31 {
33 
34 public:
35 
37  static const char* sOuterFlag;
38 
44 
48  void AddCurve( FbxNurbsCurve* pCurve );
49 
53  int GetCurveCount() const;
54 
61  FbxNurbsCurve* GetCurve( int pIndex );
62 
69  const FbxNurbsCurve* GetCurve( int pIndex ) const;
70 
71 
74 
79  bool IsPointInControlHull(const FbxVector4& pPoint );
80 
84  FbxVector4 ComputePointInBoundary();
85 
86 /*****************************************************************************************************************************
87 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
88 *****************************************************************************************************************************/
89 #ifndef DOXYGEN_SHOULD_SKIP_THIS
90  virtual FbxObject& Copy(const FbxObject& pObject);
91 
92  void ClearCurves();
93  void CopyCurves( FbxBoundary const& pOther );
94  bool IsValid(bool mustClosed = true);
95  bool IsCounterClockwise();
96 
97 protected:
98  virtual void ConstructProperties(bool pForceSet);
99 
100  void Reset();
101  bool LineSegmentIntersect(const FbxVector4 & pStart1, const FbxVector4 & pEnd1, const FbxVector4 & pStart2, const FbxVector4 & pEnd2 ) const;
102 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
103 };
104 
105 
110 {
112 public:
115 
116 
121  int GetTrimRegionCount() const;
122 
126  void BeginTrimRegion();
127 
132  void EndTrimRegion();
133 
143  bool AddBoundary( FbxBoundary* pBoundary );
144 
152  FbxBoundary* GetBoundary( int pIndex, int pRegionIndex = 0 );
153 
161  const FbxBoundary* GetBoundary( int pIndex, int pRegionIndex = 0 ) const;
162 
167  int GetBoundaryCount(int pRegionIndex = 0) const;
168 
172  void SetNurbsSurface( const FbxNurbsSurface* pNurbs );
173 
177  FbxNurbsSurface* GetNurbsSurface();
178 
182  const FbxNurbsSurface* GetNurbsSurface() const;
183 
188  inline void SetFlipNormals( bool pFlip ) { mFlipNormals = pFlip; }
189 
193  inline bool GetFlipNormals() const { return mFlipNormals; }
194 
195  virtual int GetControlPointsCount() const;
196 
203  virtual void SetControlPointAt(const FbxVector4 &pCtrlPoint, const FbxVector4 &pNormal , int pIndex, bool pI2DSearch = false);
204 
209  virtual void SetControlPointAt(const FbxVector4 &pCtrlPoint, int pIndex) { ParentClass::SetControlPointAt(pCtrlPoint, pIndex); }
210 
214  virtual FbxVector4* GetControlPoints(FbxStatus* pStatus = NULL) const;
215 
216 /*****************************************************************************************************************************
217 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
218 *****************************************************************************************************************************/
219 #ifndef DOXYGEN_SHOULD_SKIP_THIS
220  virtual FbxObject& Copy(const FbxObject& pObject);
221 
222  bool IsValid(bool mustClosed = true);
223  void ClearBoundaries();
224  void CopyBoundaries( FbxTrimNurbsSurface const& pOther );
225  bool IsValid(int pRegion, bool mustClosed = true);
226  void RebuildRegions();
227 
228 protected:
229  virtual void Construct(const FbxObject* pFrom);
230 
231 private:
232  bool mFlipNormals;
233  FbxArray<int> mRegionIndices;
234  bool mNewRegion;
235 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
236 };
237 
238 #include <fbxsdk/fbxsdk_nsend.h>
239 
240 #endif /* _FBXSDK_SCENE_GEOMETRY_TRIM_NURBS_SURFACE_H_ */
#define FBXSDK_OBJECT_DECLARE(Class, Parent)
Macro used to declare a new class derived from FbxObject.
Definition: fbxobject.h:61
FbxPropertyT< FbxBool > OuterFlag
This property handles outer flag.
FBX SDK environment definition.
virtual FbxNodeAttribute::EType GetAttributeType() const
Returns the node attribute type.
#define NULL
Definition: fbxarch.h:210
virtual FbxObject & Copy(const FbxObject &pObject)
Copy an object content into this object.
void SetFlipNormals(bool pFlip)
Sets the flag which indicates whether the surface normals are flipped.
bool GetFlipNormals() const
Checks if the normals are flipped.
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
EType
Node attribute types.
The base class of most FBX objects.
Definition: fbxobject.h:157
FbxTrimNurbsSurface describes a NURBS surface with regions trimmed or cut away with trimming boundari...
A NURBS surface is a type of parametric geometry.
virtual void Construct(const FbxObject *pFrom)
Optional constructor override, automatically called by default constructor.
FbxBoundary describes a trimming boundary for a trimmed NURBS object.
virtual void SetControlPointAt(const FbxVector4 &pCtrlPoint, int pIndex)
Sets the control point for a specified index.
A four double mathematic vector class.
Definition: fbxvector4.h:25
virtual int GetControlPointsCount() const
Returns the number of control points.
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
virtual void ConstructProperties(bool pForceSet)
Optional property constructor override, automatically called by default constructor.
virtual FbxVector4 * GetControlPoints(FbxStatus *pStatus=((void *) 0)) const
Returns a pointer to the array of control points.