fbxgeometrybase.h

Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2012 Autodesk, Inc.
00004    All rights reserved.
00005  
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009  
00010 ****************************************************************************************/
00011 
00013 #ifndef _FBXSDK_SCENE_GEOMETRY_BASE_H_
00014 #define _FBXSDK_SCENE_GEOMETRY_BASE_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/base/fbxarray.h>
00019 #include <fbxsdk/core/math/fbxvector4.h>
00020 #include <fbxsdk/scene/geometry/fbxlayercontainer.h>
00021 
00022 #include <fbxsdk/fbxsdk_nsbegin.h>
00023 
00024 class FbxManager;
00025 
00043 class FBXSDK_DLL FbxGeometryBase : public FbxLayerContainer
00044 {
00045     FBXSDK_OBJECT_DECLARE(FbxGeometryBase,FbxLayerContainer);
00046 public:
00047 
00052 
00057     virtual void InitControlPoints(int pCount);
00058 
00066     void InitNormals(int pCount = 0 );
00067 
00073     void InitNormals(FbxGeometryBase* pSrc);
00074 
00083     void InitTangents(int pCount = 0, const int pLayerIndex = 0, const char* pName = "" );
00084 
00090     void InitTangents(FbxGeometryBase* pSrc, const int pLayerIndex = 0);
00091 
00100     void InitBinormals(int pCount = 0, const int pLayerIndex = 0, const char* pName = "" );
00101 
00107     void InitBinormals(FbxGeometryBase* pSrc, const int pLayerIndex = 0);
00108 
00120     virtual void SetControlPointAt(const FbxVector4 &pCtrlPoint , const FbxVector4 &pNormal , int pIndex, bool pI2DSearch = false);
00121 
00122 
00130     virtual void SetControlPointAt(const FbxVector4 &pCtrlPoint , int pIndex);
00131 
00138     virtual FbxVector4 GetControlPointAt(int pIndex) const;
00139 
00150     virtual void SetControlPointNormalAt(const FbxVector4 &pNormal, int pIndex, bool pI2DSearch=false);
00151 
00155     virtual int GetControlPointsCount() const;
00156 
00157 
00162     virtual FbxVector4* GetControlPoints() const;
00163 
00168     virtual void SetControlPointCount(int pCount);
00169 
00171 
00172 
00177 
00178         FbxPropertyT<FbxBool> PrimaryVisibility;
00179 
00181         FbxPropertyT<FbxBool> CastShadow;
00182 
00184         FbxPropertyT<FbxBool> ReceiveShadow;
00185 
00187         FbxPropertyT<FbxDouble3> BBoxMin;
00188 
00190         FbxPropertyT<FbxDouble3> BBoxMax;
00191 
00194         void ComputeBBox();
00196 
00197 
00206 
00211     FbxGeometryElementNormal* CreateElementNormal();
00212 
00217     bool RemoveElementNormal(FbxGeometryElementNormal* pElementNormal);
00218 
00223     FbxGeometryElementNormal* GetElementNormal(int pIndex = 0);
00224 
00229     const FbxGeometryElementNormal* GetElementNormal(int pIndex = 0) const;
00230 
00234     int GetElementNormalCount() const;
00235 
00240     FbxGeometryElementBinormal* CreateElementBinormal();
00241 
00246     bool RemoveElementBinormal(FbxGeometryElementBinormal* pElementBinormal);
00247 
00252     FbxGeometryElementBinormal* GetElementBinormal(int pIndex = 0);
00253 
00258     const FbxGeometryElementBinormal* GetElementBinormal(int pIndex = 0) const;
00259 
00263     int GetElementBinormalCount() const;
00264 
00269     FbxGeometryElementTangent* CreateElementTangent();
00270 
00275     bool RemoveElementTangent(FbxGeometryElementTangent* pElementTangent);
00276 
00281     FbxGeometryElementTangent* GetElementTangent(int pIndex = 0);
00282 
00287     const FbxGeometryElementTangent* GetElementTangent(int pIndex = 0) const;
00288 
00292     int GetElementTangentCount() const;
00293 
00298     FbxGeometryElementMaterial* CreateElementMaterial();
00299 
00304     bool RemoveElementMaterial(FbxGeometryElementMaterial* pElementMaterial);
00305 
00310     FbxGeometryElementMaterial* GetElementMaterial(int pIndex = 0);
00311 
00316     const FbxGeometryElementMaterial* GetElementMaterial(int pIndex = 0) const;
00317 
00321     int GetElementMaterialCount() const;
00322 
00327     FbxGeometryElementPolygonGroup* CreateElementPolygonGroup();
00328 
00333     bool RemoveElementPolygonGroup(FbxGeometryElementPolygonGroup* pElementPolygonGroup);
00334 
00339     FbxGeometryElementPolygonGroup* GetElementPolygonGroup(int pIndex = 0);
00340 
00345     const FbxGeometryElementPolygonGroup* GetElementPolygonGroup(int pIndex = 0) const;
00346 
00350     int GetElementPolygonGroupCount() const;
00351 
00356     FbxGeometryElementVertexColor* CreateElementVertexColor();
00357 
00362     bool RemoveElementVertexColor(FbxGeometryElementVertexColor* pElementVertexColor);
00363 
00368     FbxGeometryElementVertexColor* GetElementVertexColor(int pIndex = 0);
00369 
00374     const FbxGeometryElementVertexColor* GetElementVertexColor(int pIndex = 0) const;
00375 
00379     int GetElementVertexColorCount() const;
00380 
00385     FbxGeometryElementSmoothing* CreateElementSmoothing();
00386 
00391     bool RemoveElementSmoothing(FbxGeometryElementSmoothing* pElementSmoothing);
00392 
00397     FbxGeometryElementSmoothing* GetElementSmoothing(int pIndex = 0);
00398 
00403     const FbxGeometryElementSmoothing* GetElementSmoothing(int pIndex = 0) const;
00404 
00408     int GetElementSmoothingCount() const;
00409 
00414     FbxGeometryElementCrease* CreateElementVertexCrease();
00415 
00420     bool RemoveElementVertexCrease(FbxGeometryElementCrease* pElementCrease);
00421 
00426     FbxGeometryElementCrease* GetElementVertexCrease(int pIndex = 0);
00427 
00432     const FbxGeometryElementCrease* GetElementVertexCrease(int pIndex = 0) const;
00433 
00437     int GetElementVertexCreaseCount() const;
00438 
00443     FbxGeometryElementCrease* CreateElementEdgeCrease();
00444 
00449     bool RemoveElementEdgeCrease(FbxGeometryElementCrease* pElementCrease);
00450 
00455     FbxGeometryElementCrease* GetElementEdgeCrease(int pIndex = 0);
00456 
00461     const FbxGeometryElementCrease* GetElementEdgeCrease(int pIndex = 0) const;
00462 
00466     int GetElementEdgeCreaseCount() const;
00467 
00472     FbxGeometryElementHole* CreateElementHole();
00473 
00478     bool RemoveElementHole(FbxGeometryElementHole* pElementHole);
00479 
00484     FbxGeometryElementHole* GetElementHole(int pIndex = 0);
00485 
00490     const FbxGeometryElementHole* GetElementHole(int pIndex = 0) const;
00491 
00495     int GetElementHoleCount() const;
00496 
00501     FbxGeometryElementUserData* CreateElementUserData();
00502 
00507     bool RemoveElementUserData(FbxGeometryElementUserData* pElementUserData);
00508 
00513     FbxGeometryElementUserData* GetElementUserData(int pIndex = 0);
00514 
00519     const FbxGeometryElementUserData* GetElementUserData(int pIndex = 0) const;
00520 
00524     int GetElementUserDataCount() const;
00525 
00530     FbxGeometryElementVisibility* CreateElementVisibility();
00531 
00536     bool RemoveElementVisibility(FbxGeometryElementVisibility* pElementVisibility);
00537 
00542     FbxGeometryElementVisibility* GetElementVisibility(int pIndex = 0);
00543 
00548     const FbxGeometryElementVisibility* GetElementVisibility(int pIndex = 0) const;
00549 
00553     int GetElementVisibilityCount() const;
00554 
00559     FbxGeometryElementUV* CreateElementUV(const char* pUVSetName);
00560 
00565     bool RemoveElementUV(FbxGeometryElementUV* pElementUV);
00566 
00571     FbxGeometryElementUV* GetElementUV(int pIndex = 0);
00572 
00577     const FbxGeometryElementUV* GetElementUV(int pIndex = 0) const;
00578 
00582     int GetElementUVCount() const;
00583 
00588     FbxGeometryElementUV* GetElementUV(const char* pUVSetName);
00589 
00594     const FbxGeometryElementUV* GetElementUV(const char* pUVSetName) const;
00595 
00599     void GetUVSetNames(FbxStringList& pUVSetNameList) const;
00600 
00602 
00603 
00618         virtual bool ContentWriteTo(FbxStream& pStream) const;
00619 
00625         virtual bool ContentReadFrom(const FbxStream& pStream);
00627 
00631         virtual int MemoryUsage() const;
00632 
00633 
00635 //
00636 //  WARNING!
00637 //
00638 //  Anything beyond these lines may not be documented accurately and is
00639 //  subject to change without notice.
00640 //
00642 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00643 
00644     virtual FbxObject& Copy(const FbxObject& pObject);
00645 
00663 
00664     bool GetNormals(FbxLayerElementArrayTemplate<FbxVector4>** pLockableArray) const;
00666     bool GetNormalsIndices(FbxLayerElementArrayTemplate<int>** pLockableArray) const;
00668     bool GetTangents(FbxLayerElementArrayTemplate<FbxVector4>** pLockableArray, const int pLayerIndex = 0) const;
00670     bool GetTangentsIndices(FbxLayerElementArrayTemplate<int>** pLockableArray, const int pLayerIndex = 0) const;
00672     bool GetBinormals(FbxLayerElementArrayTemplate<FbxVector4>** pLockableArray, const int pLayerIndex = 0) const;
00674     bool GetBinormalsIndices(FbxLayerElementArrayTemplate<int>** pLockableArray, const int pLayerIndex = 0) const;
00676 
00677 protected:
00678     FbxGeometryBase(FbxManager& pManager, char const* pName);
00679 
00680     virtual bool ConstructProperties(bool pForceSet);
00682     virtual void ContentClear();
00683 
00684 public:
00685     FbxArray<FbxVector4> mControlPoints;
00686 
00687 protected:
00688     friend class FbxGeometryConverter;
00689 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00690 
00691 };
00692 
00693 #include <fbxsdk/fbxsdk_nsend.h>
00694 
00695 #endif /* _FBXSDK_SCENE_GEOMETRY_BASE_H_ */