| 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 | |
| 12 | //! \file fbxshape.h |
| 13 | #ifndef _FBXSDK_SCENE_GEOMETRY_SHAPE_H_ |
| 14 | #define _FBXSDK_SCENE_GEOMETRY_SHAPE_H_ |
| 15 | |
| 16 | #include <fbxsdk/fbxsdk_def.h> |
| 17 | |
| 18 | #include <fbxsdk/scene/geometry/fbxgeometrybase.h> |
| 19 | |
| 20 | #include <fbxsdk/fbxsdk_nsbegin.h> |
| 21 | |
| 22 | class FbxBlendShapeChannel; |
| 23 | class FbxGeometry; |
| 24 | |
| 25 | /** A shape describes the deformation on a set of control points, which is similar to the cluster deformer in Maya. |
| 26 | * For example, we can add a shape to a created geometry. And the shape and the geometry have the same |
| 27 | * topological information but different position of the control points. |
| 28 | * With varying amounts of influence, the geometry performs a deformation effect. |
| 29 | * \nosubgrouping |
| 30 | * \see FbxGeometry |
| 31 | */ |
| 32 | class FBXSDK_DLL FbxShape : public FbxGeometryBase |
| 33 | { |
| 34 | FBXSDK_OBJECT_DECLARE(FbxShape, FbxGeometryBase); |
| 35 | |
| 36 | public: |
| 37 | /** Set the blend shape channel that contains this target shape. |
| 38 | * \param pBlendShapeChannel Pointer to the blend shape channel to set. |
| 39 | * \return \c true on success, \c false otherwise. |
| 40 | */ |
| 41 | bool SetBlendShapeChannel(FbxBlendShapeChannel* pBlendShapeChannel); |
| 42 | |
| 43 | /** Get the blend shape channel that contains this target shape. |
| 44 | * \return a pointer to the blend shape channel if set or NULL. |
| 45 | */ |
| 46 | FbxBlendShapeChannel* GetBlendShapeChannel() const; |
| 47 | |
| 48 | /** Get the base geometry of this target shape. |
| 49 | * \return a pointer to the base geometry if set or NULL. |
| 50 | * \remarks Since target shape can only connected to its base geometry through |
| 51 | * blend shape channel and blend shape deformer. |
| 52 | * So only when this target shape is connected to a blend shape channel, |
| 53 | * and the blend shape channel is connected to a blend shape deformer, |
| 54 | * and the blend shape deformer is used on a base geometry, then to get |
| 55 | * base geometry will success. |
| 56 | */ |
| 57 | FbxGeometry* GetBaseGeometry(); |
| 58 | |
| 59 | /** Get the length of the arrays of control point indices and weights. |
| 60 | * \return Length of the arrays of control point indices and weights. |
| 61 | * Returns 0 if no control point indices have been added or the arrays have been reset. |
| 62 | */ |
| 63 | int GetControlPointIndicesCount() const; |
| 64 | |
| 65 | /** Get the array of control point indices. |
| 66 | * \return Pointer to the array of control point indices. |
| 67 | * \c NULL if no control point indices have been added or the array has been reset. |
| 68 | */ |
| 69 | int* GetControlPointIndices() const; |
| 70 | |
| 71 | |
| 72 | /** Set the array size for the control point indices |
| 73 | * \param pCount The new count. |
| 74 | */ |
| 75 | void SetControlPointIndicesCount(int pCount); |
| 76 | |
| 77 | /** Add a control point index to the control point indices array |
| 78 | * \param pIndex The control point index to add. |
| 79 | */ |
| 80 | void AddControlPointIndex(int pIndex); |
| 81 | |
| 82 | /** Restore the shape to its initial state. |
| 83 | * Calling this function will clear the following: |
| 84 | * \li Pointer to blend shape channel. |
| 85 | * \li Control point indices. |
| 86 | */ |
| 87 | void Reset(); |
| 88 | |
| 89 | /***************************************************************************************************************************** |
| 90 | ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! ** |
| 91 | *****************************************************************************************************************************/ |
| 92 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 93 | virtual void Compact(); |
| 94 | virtual FbxObject& Copy(const FbxObject& pObject); |
| 95 | virtual FbxObject* Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject* pContainer=NULL, void* pSet = NULL) const; |
| 96 | |
| 97 | protected: |
| 98 | virtual FbxNodeAttribute::EType GetAttributeType() const; |
| 99 | virtual FbxStringList GetTypeFlags() const; |
| 100 | |
| 101 | FbxArray<int> mControlPointIndices; |
| 102 | #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/ |
| 103 | }; |
| 104 | |
| 105 | #include <fbxsdk/fbxsdk_nsend.h> |
| 106 | |
| 107 | #endif /* _FBXSDK_SCENE_GEOMETRY_SHAPE_H_ */ |
| 108 | |