kfbxgeometrybase.h

Go to the documentation of this file.
00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRYBASE_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRYBASE_H
00006 
00007 /**************************************************************************************
00008 
00009  Copyright (C) 2001 - 2010 Autodesk, Inc. and/or its licensors.
00010  All Rights Reserved.
00011 
00012  The coded instructions, statements, computer programs, and/or related material 
00013  (collectively the "Data") in these files contain unpublished information 
00014  proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
00015  Canada and United States of America federal copyright law and by international 
00016  treaties. 
00017  
00018  The Data may not be disclosed or distributed to third parties, in whole or in
00019  part, without the prior written consent of Autodesk, Inc. ("Autodesk").
00020 
00021  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00022  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
00023  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
00024  BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
00025  NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
00026  WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
00027  OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
00028  
00029  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
00030  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
00031  OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
00032  SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
00033  OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
00034  HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
00035  FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
00036  ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
00037  WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
00038  OR DAMAGE. 
00039 
00040 **************************************************************************************/
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 #include <fbxfilesdk/components/kbaselib/klib/karrayul.h>
00044 
00045 #include <fbxfilesdk/kfbxmath/kfbxvector4.h>
00046 
00047 #include <fbxfilesdk/kfbxplugins/kfbxlayercontainer.h>
00048 
00049 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00050 
00051 class KFbxSdkManager;
00052 
00070 class KFBX_DLL KFbxGeometryBase : public KFbxLayerContainer
00071 {
00072     KFBXOBJECT_DECLARE(KFbxGeometryBase,KFbxLayerContainer);
00073 public:
00074 
00079 
00084     virtual void InitControlPoints(int pCount);
00085 
00093     void InitNormals(int pCount = 0 );
00094 
00100     void InitNormals(KFbxGeometryBase* pSrc);
00101 
00110     void InitTangents(int pCount = 0, const int pLayerIndex = 0, const char* pName = "" );
00111 
00117     void InitTangents(KFbxGeometryBase* pSrc, const int pLayerIndex = 0);
00118 
00127     void InitBinormals(int pCount = 0, const int pLayerIndex = 0, const char* pName = "" );
00128 
00134     void InitBinormals(KFbxGeometryBase* pSrc, const int pLayerIndex = 0);
00135 
00147     virtual void SetControlPointAt(const KFbxVector4 &pCtrlPoint , const KFbxVector4 &pNormal , int pIndex, bool pI2DSearch = false);
00148 
00149 
00157     virtual void SetControlPointAt(const KFbxVector4 &pCtrlPoint , int pIndex);
00158 
00165     virtual KFbxVector4 GetControlPointAt(int pIndex) const;
00166 
00177     virtual void SetControlPointNormalAt(const KFbxVector4 &pNormal, int pIndex, bool pI2DSearch=false);
00178 
00182     virtual int GetControlPointsCount() const;
00183 
00184 
00189     virtual KFbxVector4* GetControlPoints() const;
00190 
00195     virtual void SetControlPointCount(int pCount);
00196 
00198 
00199 
00204 
00205         KFbxTypedProperty<fbxDouble3>               BBoxMin;
00206 
00208         KFbxTypedProperty<fbxDouble3>               BBoxMax;
00209 
00212         void ComputeBBox();
00214 
00215 
00224 
00229     KFbxGeometryElementNormal* CreateElementNormal();
00230 
00235     bool RemoveElementNormal(KFbxGeometryElementNormal* pElementNormal);
00236 
00241     KFbxGeometryElementNormal* GetElementNormal(int pIndex = 0);
00242 
00247     const KFbxGeometryElementNormal* GetElementNormal(int pIndex = 0) const;
00248 
00252     int GetElementNormalCount() const;
00253 
00258     KFbxGeometryElementBinormal* CreateElementBinormal();
00259 
00264     bool RemoveElementBinormal(KFbxGeometryElementBinormal* pElementBinormal);
00265 
00270     KFbxGeometryElementBinormal* GetElementBinormal(int pIndex = 0);
00271 
00276     const KFbxGeometryElementBinormal* GetElementBinormal(int pIndex = 0) const;
00277 
00281     int GetElementBinormalCount() const;
00282 
00287     KFbxGeometryElementTangent* CreateElementTangent();
00288 
00293     bool RemoveElementTangent(KFbxGeometryElementTangent* pElementTangent);
00294 
00299     KFbxGeometryElementTangent* GetElementTangent(int pIndex = 0);
00300 
00305     const KFbxGeometryElementTangent* GetElementTangent(int pIndex = 0) const;
00306 
00310     int GetElementTangentCount() const;
00311 
00316     KFbxGeometryElementMaterial* CreateElementMaterial();
00317 
00322     bool RemoveElementMaterial(KFbxGeometryElementMaterial* pElementMaterial);
00323 
00328     KFbxGeometryElementMaterial* GetElementMaterial(int pIndex = 0);
00329 
00334     const KFbxGeometryElementMaterial* GetElementMaterial(int pIndex = 0) const;
00335 
00339     int GetElementMaterialCount() const;
00340 
00345     KFbxGeometryElementPolygonGroup* CreateElementPolygonGroup();
00346 
00351     bool RemoveElementPolygonGroup(KFbxGeometryElementPolygonGroup* pElementPolygonGroup);
00352 
00357     KFbxGeometryElementPolygonGroup* GetElementPolygonGroup(int pIndex = 0);
00358 
00363     const KFbxGeometryElementPolygonGroup* GetElementPolygonGroup(int pIndex = 0) const;
00364 
00368     int GetElementPolygonGroupCount() const;
00369 
00374     KFbxGeometryElementVertexColor* CreateElementVertexColor();
00375 
00380     bool RemoveElementVertexColor(KFbxGeometryElementVertexColor* pElementVertexColor);
00381 
00386     KFbxGeometryElementVertexColor* GetElementVertexColor(int pIndex = 0);
00387 
00392     const KFbxGeometryElementVertexColor* GetElementVertexColor(int pIndex = 0) const;
00393 
00397     int GetElementVertexColorCount() const;
00398 
00403     KFbxGeometryElementSmoothing* CreateElementSmoothing();
00404 
00409     bool RemoveElementSmoothing(KFbxGeometryElementSmoothing* pElementSmoothing);
00410 
00415     KFbxGeometryElementSmoothing* GetElementSmoothing(int pIndex = 0);
00416 
00421     const KFbxGeometryElementSmoothing* GetElementSmoothing(int pIndex = 0) const;
00422 
00426     int GetElementSmoothingCount() const;
00427 
00432     KFbxGeometryElementCrease* CreateElementVertexCrease();
00433 
00438     bool RemoveElementVertexCrease(KFbxGeometryElementCrease* pElementCrease);
00439 
00444     KFbxGeometryElementCrease* GetElementVertexCrease(int pIndex = 0);
00445 
00450     const KFbxGeometryElementCrease* GetElementVertexCrease(int pIndex = 0) const;
00451 
00455     int GetElementVertexCreaseCount() const;
00456 
00461     KFbxGeometryElementCrease* CreateElementEdgeCrease();
00462 
00467     bool RemoveElementEdgeCrease(KFbxGeometryElementCrease* pElementCrease);
00468 
00473     KFbxGeometryElementCrease* GetElementEdgeCrease(int pIndex = 0);
00474 
00479     const KFbxGeometryElementCrease* GetElementEdgeCrease(int pIndex = 0) const;
00480 
00484     int GetElementEdgeCreaseCount() const;
00485 
00490     KFbxGeometryElementHole* CreateElementHole();
00491 
00496     bool RemoveElementHole(KFbxGeometryElementHole* pElementHole);
00497 
00502     KFbxGeometryElementHole* GetElementHole(int pIndex = 0);
00503 
00508     const KFbxGeometryElementHole* GetElementHole(int pIndex = 0) const;
00509 
00513     int GetElementHoleCount() const;
00514 
00519     KFbxGeometryElementUserData* CreateElementUserData();
00520 
00525     bool RemoveElementUserData(KFbxGeometryElementUserData* pElementUserData);
00526 
00531     KFbxGeometryElementUserData* GetElementUserData(int pIndex = 0);
00532 
00537     const KFbxGeometryElementUserData* GetElementUserData(int pIndex = 0) const;
00538 
00542     int GetElementUserDataCount() const;
00543 
00548     KFbxGeometryElementVisibility* CreateElementVisibility();
00549 
00554     bool RemoveElementVisibility(KFbxGeometryElementVisibility* pElementVisibility);
00555 
00560     KFbxGeometryElementVisibility* GetElementVisibility(int pIndex = 0);
00561 
00566     const KFbxGeometryElementVisibility* GetElementVisibility(int pIndex = 0) const;
00567 
00571     int GetElementVisibilityCount() const;
00572 
00577     KFbxGeometryElementUV* CreateElementUV(const char* pUVSetName);
00578 
00583     bool RemoveElementUV(KFbxGeometryElementUV* pElementUV);
00584 
00589     KFbxGeometryElementUV* GetElementUV(int pIndex = 0);
00590 
00595     const KFbxGeometryElementUV* GetElementUV(int pIndex = 0) const;
00596 
00600     int GetElementUVCount() const;
00601 
00606     KFbxGeometryElementUV* GetElementUV(const char* pUVSetName);
00607 
00612     const KFbxGeometryElementUV* GetElementUV(const char* pUVSetName) const;
00613 
00617     void GetUVSetNames(KStringList& pUVSetNameList) const;
00618 
00620 
00621 
00636         virtual bool ContentWriteTo(KFbxStream& pStream) const;
00637 
00643         virtual bool ContentReadFrom(const KFbxStream& pStream);
00645 
00649         virtual int MemoryUsage() const;
00650 
00651 
00653 //
00654 //  WARNING!
00655 //
00656 //  Anything beyond these lines may not be documented accurately and is
00657 //  subject to change without notice.
00658 //
00660 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00661 
00662     virtual KFbxObject& Copy(const KFbxObject& pObject);
00663 
00681 
00682     bool GetNormals(KFbxLayerElementArrayTemplate<KFbxVector4>** pLockableArray) const;
00684     bool GetNormalsIndices(KFbxLayerElementArrayTemplate<int>** pLockableArray) const;
00686     bool GetTangents(KFbxLayerElementArrayTemplate<KFbxVector4>** pLockableArray, const int pLayerIndex = 0) const;
00688     bool GetTangentsIndices(KFbxLayerElementArrayTemplate<int>** pLockableArray, const int pLayerIndex = 0) const;
00690     bool GetBinormals(KFbxLayerElementArrayTemplate<KFbxVector4>** pLockableArray, const int pLayerIndex = 0) const;
00692     bool GetBinormalsIndices(KFbxLayerElementArrayTemplate<int>** pLockableArray, const int pLayerIndex = 0) const;
00694 
00695 protected:
00696     KFbxGeometryBase(KFbxSdkManager& pManager, char const* pName);
00697 
00698     virtual bool ConstructProperties(bool pForceSet);
00700     virtual void ContentClear();
00701 
00702 public:
00703     KArrayTemplate<KFbxVector4> mControlPoints;
00704 
00705 protected:
00706     friend class KFbxGeometryConverter;
00707 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00708 
00709 };
00710 
00711 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00712 
00713 #endif // FBXFILESDK_KFBXPLUGINS_KFBXGEOMETRYBASE_H
00714