fbmodel.h

Go to the documentation of this file.
00001 #ifndef __FBMODEL_H__
00002 #define __FBMODEL_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL 
00045 
00048     #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050 
00051 #include <fbsdk/fbcore.h>
00052 #include <fbsdk/fbcomponent.h>
00053 #include <fbsdk/fbshader.h>    // FBPropertyListShader
00054 #include <fbsdk/fbtexture.h>
00055 #include <fbsdk/fbhud.h>
00056 
00057 // somebody at SGI defined this in their include files
00058 // until we find which one, we remove it
00059 #undef Status
00060 
00061 #ifdef FBSDKUseNamespace
00062     namespace FBSDKNamespace {
00063 #endif
00064 
00068 #define FBStorableCustomModelImplementation(ClassName, Type)\
00069     const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
00070     HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
00071         ClassName* Class = new ClassName(pName);\
00072         Class->mAllocated = true;\
00073         Class->EnableObjectFlags(kFBFlagCustomObject);\
00074         if( Class->FBCreate() ){\
00075             __FBRemoveModelFromScene( Class->GetHIObject() ); /* Hack in MoBu2013, we shouldn't add object to the scene/entity automatically*/\
00076             return Class->GetHIObject();\
00077         } else {\
00078             delete Class;\
00079             return NULL;}}\
00080     FBLibraryModule(ClassName##Storable){\
00081         FBString lGroup = "FbxStorable/";\
00082         lGroup += #Type;\
00083         FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);\
00084         FBSetStoreableCustomModelRegistered();}\
00085 
00086 
00089 #define FBStorableCustomMaterialImplementation(ClassName, Type)\
00090     const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
00091     HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
00092         ClassName* Class = new ClassName(pName);\
00093         Class->mAllocated = true;\
00094         Class->EnableObjectFlags(kFBFlagCustomObject);\
00095         if( Class->FBCreate() ){\
00096             return Class->GetHIObject();\
00097         } else {\
00098             delete Class;\
00099             return NULL;}}\
00100     FBLibraryModule(ClassName##Storable){\
00101         FBString lGroup = "FbxStorable/";\
00102         lGroup += #Type;\
00103         FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);\
00104         FBSetStoreableCustomMaterialRegistered();}\
00105 
00106 
00107 typedef class FBSDK_DLL FBArrayTemplate<HFBModel> FBModelList;
00108 
00109 FB_DEFINE_COMPONENT( FBSDK_DLL, Camera           );
00110 FB_DEFINE_COMPONENT( FBSDK_DLL, CameraStereo     );
00111 FB_DEFINE_COMPONENT( FBSDK_DLL, Light            );
00112 FB_DEFINE_COMPONENT( FBSDK_DLL, Material         );
00113 FB_DEFINE_COMPONENT( FBSDK_DLL, Model            );
00114 FB_DEFINE_COMPONENT( FBSDK_DLL, Cluster          );
00115 FB_DEFINE_COMPONENT( FBSDK_DLL, Geometry         );
00116 FB_DEFINE_COMPONENT( FBSDK_DLL, Mesh             );
00117 FB_DEFINE_COMPONENT( FBSDK_DLL, ModelVertexData  );
00118 FB_DEFINE_COMPONENT( FBSDK_DLL, Video            );
00119 FB_DEFINE_COMPONENT( FBSDK_DLL, PointCacheFile   );
00120 FB_DEFINE_COMPONENT( FBSDK_DLL, AnimationNode    );
00121 
00125 FBSDK_DLL void FBModelTransactionBegin();
00126 
00130 FBSDK_DLL void FBModelTransactionEnd();
00131 
00133 // FBPropertyListModel
00135 __FB_FORWARD( FBModel ); 
00136 __FB_FORWARD( FBPropertyListModel );
00137 FB_DEFINE_LIST( FBSDK_DLL, Model );
00138 
00140 class FBSDK_DLL FBPropertyListModel : public FBPropertyListComponentBase
00141 {
00142 public:
00147     int     Add    ( HFBModel pItem );
00148 
00153     int  Remove    ( HFBModel pItem );
00154 
00158     virtual void RemoveAt( int pIndex );
00159 
00164     FBModel* operator[](int pIndex);
00165 
00169     virtual int  GetCount();
00170 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00171     inline virtual FBComponent* GetAt(int pIndex) { return (FBComponent*)operator[](pIndex); }
00172 private:
00173     inline virtual int Add    ( FBComponent* pItem ) { return Add((FBModel*)pItem); }
00174     inline virtual int Remove    ( FBComponent* pItem ) { return Remove((FBModel*)pItem); }
00175 #endif
00176 };
00177 
00179 // FBPropertyListMaterial
00182 __FB_FORWARD( FBMaterial );
00183 
00184 class FBSDK_DLL FBPropertyListMaterial : public FBPropertyListComponent
00185 {
00186 public:
00187     FBPropertyListMaterial();
00192     FBMaterial* operator[](int pIndex);
00193 };
00194 
00196 // FBPropertyListDeformer
00199 __FB_FORWARD( FBDeformer );
00200 
00201 class FBSDK_DLL FBPropertyListDeformer : public FBPropertyListComponent
00202 {
00203 public:
00204     FBPropertyListDeformer();
00211     virtual int Add( FBDeformer* pItem );
00216     FBDeformer* operator[](int pIndex);
00217 
00218 private:
00219     inline virtual int Add    ( FBComponent* pItem ) { return Add((FBDeformer*)pItem); }
00220 };
00221 
00223 // FBModel
00225 __FB_FORWARD( FBModel        );
00226 
00228 enum FBModelTransformationType {   
00229     kModelTransformation,                   
00230     kModelRotation,                         
00231     kModelTranslation,                      
00232     kModelScaling,                          
00233     kModelTransformation_Geometry,          
00234     kModelInverse_Transformation,           
00235     kModelInverse_Rotation,                 
00236     kModelInverse_Translation,              
00237     kModelInverse_Scaling,                  
00238     kModelInverse_Transformation_Geometry   
00239 };
00240 
00242 enum FBModelShadingMode {    
00243     kFBModelShadingDefault,         
00244     kFBModelShadingWire,            
00245     kFBModelShadingFlat,            
00246     kFBModelShadingLight,           
00247     kFBModelShadingHard,            
00248     kFBModelShadingTexture,         
00249     kFBModelShadingAll,             
00250 };
00251 
00253 enum FBModelRenderPass {    
00254     kFBModelRenderPassStandard,     
00255     kFBModelRenderPassPick,         
00256 };
00257 
00259 enum FBModelRotationOrder {    
00260     kFBEulerXYZ = 0,    
00261     kFBEulerXZY,        
00262     kFBEulerYZX,        
00263     kFBEulerYXZ,        
00264     kFBEulerZXY,        
00265     kFBEulerZYX,        
00266     kFBSphericXYZ        
00267 };
00268 
00270 enum FBModelCullingMode {
00271     kFBCullingOff,      
00272     kFBCullingOnCCW,    
00273     kFBCullingOnCW      
00274 };
00275 
00276 FB_DEFINE_ENUM( FBSDK_DLL, ModelShadingMode       ); 
00277 FB_DEFINE_ENUM( FBSDK_DLL, ModelTransformationType    );
00278 FB_DEFINE_ENUM( FBSDK_DLL, ModelRotationOrder     ); 
00279 
00310 class FBSDK_DLL FBModel : public FBBox 
00311 {
00312     __FBClassDeclareGroup( FBModel,FBBox );
00313 public:
00318     FBModel(const char* pName, HIObject pObject=NULL);
00319     virtual void    FBDelete();
00320 
00321     IQuery_Declare        (Implementation);            // Interface to IObject.
00322     ICallback_Declare    (Implementation);            // Interface to ICallback.
00323 
00324     FBPropertyListModel             Children;        
00325 
00326     FBPropertyListShader            Shaders;        
00327     FBPropertyListMaterial          Materials;        
00328     FBPropertyListTexture           Textures;        
00329     FBPropertyListDeformer          Deformers;      
00330     FBPropertyBool                  Icon3D;            
00331     FBPropertyBool                  SoftSelected;    
00332     FBPropertyBool                  IsDeformable;    
00333     FBPropertyBool                  IsConstrained;    
00334     FBPropertyBool                    SkeletonDeformable;        
00335     FBPropertyBool                    BlendShapeDeformable;    
00336     FBPropertyBool                    ConstrainDeformable;    
00337     FBPropertyBool                    PointCacheDeformable;    
00338     FBPropertyBool                    PointCacheRecord;        
00339     FBPropertyModel                    Parent;            
00340     FBPropertyModel                    LookAt;            
00341     FBPropertyModel                    UpVector;        
00342     FBPropertyGeometry                Geometry;        
00343     FBPropertyInt                    GeometryUpdateId;        
00344     FBPropertyMesh                    TessellatedMesh;
00345     FBPropertyModelVertexData        ModelVertexData;
00346     FBPropertyCluster                Cluster;        
00347     FBPropertyScene                    Scene;            
00348     FBPropertyModelShadingMode        ShadingMode;    
00349     FBPropertyAnimationNode            AnimationNode;    
00350 
00351     FBPropertyModelRotationOrder    RotationOrder;    
00352 
00353     // Limits
00354     FBPropertyBool                  RotationSpaceForLimitOnly; 
00355     FBPropertyBool                    RotationActive; 
00356     FBPropertyVector3d                PreRotation;    
00357     FBPropertyVector3d                PostRotation;    
00358     FBPropertyVector3d                RotationMin;    
00359     FBPropertyVector3d                RotationMax;    
00360     FBPropertyBool                    RotationMinX;    
00361     FBPropertyBool                    RotationMinY;    
00362     FBPropertyBool                    RotationMinZ;    
00363     FBPropertyBool                    RotationMaxX;    
00364     FBPropertyBool                    RotationMaxY;    
00365     FBPropertyBool                    RotationMaxZ;    
00366 
00367     // Animatable
00368     FBPropertyAnimatableBool        Visibility;        
00369     FBPropertyBool                  VisibilityInheritance;    
00370     FBPropertyAnimatableVector3d    Translation;    
00371     FBPropertyAnimatableVector3d    Rotation;        
00372     FBPropertyAnimatableVector3d    Scaling;        
00373 
00374     FBPropertyVector3d              GeometricTranslation;    
00375     FBPropertyVector3d              GeometricRotation;        
00376     FBPropertyVector3d              GeometricScaling;        
00377 
00378     FBPropertyBool                  QuaternionInterpolate;    
00379 
00380     FBPropertyBool                  Show;           
00381     FBPropertyBool                  Pickable;       
00382     FBPropertyColor                 UniqueColorId;  
00383 
00384 
00385 
00390     virtual HFBModel Clone();
00391 
00399     void SetMatrix(FBMatrix pMatrix, FBModelTransformationType pWhat=kModelTransformation,    bool pGlobalInfo=true, bool pPushUndo = false, HFBEvaluateInfo pEvaluateInfo=NULL);
00400 
00407     void GetMatrix(FBMatrix &pMatrix, FBModelTransformationType pWhat=kModelTransformation,    bool pGlobalInfo=true, HFBEvaluateInfo pEvaluateInfo=NULL);
00408 
00416     void SetVector(FBVector3d pVector, FBModelTransformationType pWhat=kModelTranslation,    bool pGlobalInfo=true, bool pPushUndo = false, HFBEvaluateInfo pEvaluateInfo=NULL);
00417 
00424     void GetVector(FBVector3d &pVector,    FBModelTransformationType pWhat=kModelTranslation,    bool pGlobalInfo=true, HFBEvaluateInfo pEvaluateInfo=NULL);
00425 
00430     void SetSchematicPosition(int pX,int pY);
00431 
00435     void SetSchematicPosition(FBVector2d pVector2d);
00436 
00440     FBVector2d GetSchematicPosition();
00441 
00446     void GetBoundingBox( FBVector3d& pMin, FBVector3d& pMax );
00447 
00453     bool IsVisible(HFBEvaluateInfo pEvaluateInfo = NULL);
00454 
00458     FBModelCullingMode GetCullingMode() const;
00459 
00463     void SetCullingMode(FBModelCullingMode pCullingMode);
00464 
00469     void ForceAlwaysEvaluate();
00470 
00473     bool IsForceAlwaysEvaluate();
00474 
00478     int NoFrustumCullingRequire();
00479 
00483     int NoFrustumCullingRelease();
00484     
00488     bool UseFrustumCulling();
00489 
00493     virtual bool HasCustomDisplay() { return false; }
00494 
00502     virtual void CustomModelDisplay( FBCamera* pCamera, FBModelShadingMode pShadingMode, FBModelRenderPass pRenderPass, float pPickingAreaWidth, float pPickingAreaHeight) {}
00503 
00517     virtual bool CustomModelPicking(    int pNbHits, unsigned int *pSelectBuffer, FBCamera* pCamera, 
00518                                         int pMouseX,int pMouseY,
00519                                         FBTVector* pLocalRaySrc, FBTVector* pLocalRayDir,
00520                                         FBTVector* pWorldRaySrc, FBTVector* pWorldRayDir,
00521                                         FBMatrix* pGlobalInverseMatrix,
00522                                         FBTVector* pOutPickedPoint)    { return false; }
00523 
00527     unsigned char* GetSelectedPoints();
00528 
00532     int GetSelectedPointsCount();
00533 
00538     virtual bool FbxStore(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00539     virtual bool FbxRetrieve(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00540 
00548     void SetupPropertiesForShapes();
00549 
00552     virtual const char*    FbxGetObjectType() override;
00553 
00556     virtual const char*    FbxGetObjectSubType() override;
00557 
00558 };
00559 
00561 // FBModelNull
00563 __FB_FORWARD( FBModelNull);
00564 
00566 class FBSDK_DLL FBModelNull : public FBModel {
00567     __FBClassDeclare( FBModelNull,FBModel );
00568 public:
00573     FBModelNull(const char* pName, HIObject pObject=NULL);
00574 
00575     FBPropertyDouble    Size;    
00576     
00581     virtual bool FbxStore(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00582     virtual bool FbxRetrieve(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00583 
00586     virtual const char* FbxGetObjectType() override;
00587     
00590     virtual const char* FbxGetObjectSubType() override;
00591 };
00592 
00594 // FBModelRoot
00596 __FB_FORWARD( FBModelRoot);
00597 
00599 class FBSDK_DLL FBModelRoot : public FBModel {
00600     __FBClassDeclare( FBModelRoot,FBModel );
00601 public:
00606     FBModelRoot(const char* pName, HIObject pObject=NULL);
00607 
00608     FBPropertyDouble    Size;    
00609 };
00610 
00612 // FBModelMarker
00614 __FB_FORWARD( FBModelMarker);
00615 
00617 enum FBMarkerResolutionLevel
00618 {
00619     kFBMarkerLowResolution,        
00620     kFBMarkerMediumResolution,    
00621     kFBMarkerHighResolution        
00622 };
00623 
00625 enum FBMarkerLook
00626 {
00627     kFBMarkerLookCube,            
00628     kFBMarkerLookHardCross,        
00629     kFBMarkerLookLightCross,    
00630     kFBMarkerLookSphere,        
00631     kFBMarkerLookCapsule,        
00632     kFBMarkerLookSquare,        
00633     kFBMarkerLookCircle,        
00634     kFBMarkerLookBone,            
00635     kFBMarkerLookStick,            
00636     kFBMarkerLookBox,            
00637     kFBMarkerLookNone            
00638 };
00639 
00641 enum FBMarkerType
00642 {
00643     kFBMarkerTypeStandard,        
00644     kFBMarkerTypeOptical,        
00645     kFBMarkerTypeFKEffector,    
00646     kFBMarkerTypeIKEffector        
00647 };
00648 
00649 FB_DEFINE_ENUM( FBSDK_DLL, MarkerResolutionLevel );
00650 FB_DEFINE_ENUM( FBSDK_DLL, MarkerLook );
00651 FB_DEFINE_ENUM( FBSDK_DLL, MarkerType );
00652 
00654 class FBSDK_DLL FBModelMarker : public FBModel {
00655     __FBClassDeclare( FBModelMarker,FBModel );
00656 public:
00661     FBModelMarker(const char* pName, HIObject pObject=NULL);
00662 
00663     FBPropertyDouble    Size;    
00664     FBPropertyDouble    Length;    
00665     FBPropertyMarkerResolutionLevel ResLevel; 
00666     FBPropertyMarkerLook Look;    
00667     FBPropertyMarkerType Type;    
00668     FBPropertyColor        Color;    
00669     FBPropertyVector3d  IKPivot;   
00670     FBPropertyBool      IKSync;    
00671 
00675     void SetFKOpacity(double pValue);
00676 
00681     virtual bool FbxStore(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00682     virtual bool FbxRetrieve(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00683 
00686     virtual const char* FbxGetObjectType() override;
00687     
00690     virtual const char* FbxGetObjectSubType() override;
00691 };
00692 
00693 
00695 // FBModelSkeleton
00697 __FB_FORWARD( FBModelSkeleton);
00698 
00700 class FBSDK_DLL FBModelSkeleton : public FBModel {
00701     __FBClassDeclare( FBModelSkeleton,FBModel );
00702 public:
00707     FBModelSkeleton(const char* pName, HIObject pObject=NULL);
00708 
00709     FBPropertyDouble    Size;    
00710     FBPropertyColor        Color;    
00711 
00716     void GetSkinModelList(FBModelList& pSkinModelList); 
00717 };
00718 
00720 // FBModelCube
00722 __FB_FORWARD( FBModelCube );
00723 
00725 class FBSDK_DLL FBModelCube : public FBModel {
00726     __FBClassDeclare( FBModelCube, FBModel );
00727 public:
00732     FBModelCube(const char* pName, HIObject pObject=NULL);
00733 };
00734 
00736 // FBModelPlane
00738 __FB_FORWARD( FBModelPlane );
00739 
00741 class FBSDK_DLL FBModelPlane : public FBModel {
00742     __FBClassDeclare( FBModelPlane, FBModel );
00743 public:
00748     FBModelPlane(const char* pName, HIObject pObject=NULL);
00749 };
00750 
00752 // FBMaterial
00755 enum FBMaterialTextureType {        
00756     kFBMaterialTextureEmissive,
00757     kFBMaterialTextureEmissiveFactor,
00758     kFBMaterialTextureAmbient,
00759     kFBMaterialTextureAmbientFactor,
00760     kFBMaterialTextureDiffuse,
00761     kFBMaterialTextureDiffuseFactor,
00762     kFBMaterialTextureSpecular,
00763     kFBMaterialTextureSpecularFactor,
00764     kFBMaterialTextureShiness,
00765     kFBMaterialTextureBump,
00766     kFBMaterialTextureNormalMap,
00767     kFBMaterialTextureTransparent,
00768     kFBMaterialTextureTransparentFactor,
00769     kFBMaterialTextureReflection,
00770     kFBMaterialTextureReflectionFactor,
00771     kFBMaterialTextureDisplacementColor
00772 };
00773 
00774 //FB_DEFINE_ENUM( FBSDK_DLL, MaterialTextureType    ); 
00775 
00777 class FBSDK_DLL FBMaterial : public FBBox {
00778     __FBClassDeclare( FBMaterial,FBBox );
00779 public:
00784     FBMaterial(const char* pName, HIObject pObject=NULL);
00785 
00790     FBMaterial* Clone();
00791 
00792     FBPropertyAnimatableColor    Ambient;            
00793     FBPropertyAnimatableDouble    AmbientFactor;        
00794     
00795     FBPropertyAnimatableColor    Emissive;            
00796     FBPropertyAnimatableDouble    EmissiveFactor;        
00797     
00798     FBPropertyAnimatableColor    Diffuse;            
00799     FBPropertyAnimatableDouble    DiffuseFactor;      
00800     
00801     FBPropertyAnimatableColor    TransparentColor;   
00802     FBPropertyAnimatableDouble    TransparencyFactor; 
00803     
00804     FBPropertyAnimatableColor    Bump;                
00805     FBPropertyAnimatableColor    NormalMap;            
00806     FBPropertyAnimatableDouble    BumpFactor;            
00807 
00808     FBPropertyAnimatableColor    Specular;            
00809     FBPropertyAnimatableDouble    SpecularFactor;        
00810     FBPropertyAnimatableDouble    Shininess;            
00811     
00812     FBPropertyAnimatableColor    Reflection;            
00813     FBPropertyAnimatableDouble    ReflectionFactor;    
00814 
00815     FBPropertyAnimatableColor    DisplacementColor;    
00816     FBPropertyAnimatableDouble    DisplacementFactor;    
00817 
00821     HFBTexture GetTexture(FBMaterialTextureType = kFBMaterialTextureDiffuse);
00822 
00827     void SetTexture(FBTexture* pTexture, FBMaterialTextureType pType = kFBMaterialTextureDiffuse);
00828 
00830     void OGLInit();
00831 
00833     virtual const char* GetMaterialName() const;
00834 
00836     virtual const char* GetMaterialDesc() const;
00837 
00842     virtual bool FbxStore(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00843     virtual bool FbxRetrieve(HFBFbxObject pFbxObject, kFbxObjectStore pStoreWhat);
00844 
00847     virtual const char*    FbxGetObjectType() override;
00848 
00851     virtual const char*    FbxGetObjectSubType() override;
00852 
00853 protected:
00862     HFBProperty CreateTextureConnectableUserProperty(const char* pName, FBPropertyType pType, const char* pDataType, bool pAnimatable);
00863 };
00864 
00866 // FBCluster
00869 enum FBClusterMode    {
00870     kFBClusterNormalize,        
00871     kFBClusterAdditive,            
00872     kFBClusterTotal100            
00873 };
00874 FB_DEFINE_ENUM( FBSDK_DLL, ClusterMode );
00875 
00876 __FB_FORWARD( FBCluster );
00877 
00881 class FBSDK_DLL FBCluster : public FBComponent {
00882     __FBClassDeclare( FBCluster,FBComponent );
00883 
00884 protected:
00888     FBCluster(HFBModel pModel);
00889     friend class DataFBModel;
00890 
00891 public:
00892 
00893     //--- Cluster-level operations
00898     int ClusterBegin(int pIndex = -1);
00899 
00903     int ClusterEnd();
00904 
00905     //--- Link-level operations
00910     void        LinkSetName(const char *pName, int pLinkNumber);
00915     const char* LinkGetName(int pLinkNumber);
00919     void        LinkRemove(int pLinkNumber);
00923     int         LinkGetCount();
00927     void        LinkSetModel(HFBModel pModel);
00932     HFBModel    LinkGetModel(int pLinkNumber);
00937     HFBModel    LinkGetAssociateModel(int pLinkNumber);
00941     void        LinkClearUnused( double pThreshold = -1.0 );
00946     void        LinkSetCurrentVertex(int pLinkIndex,int pPointIndex);
00951     int            LinkGetVertexIndex(int pIndex);
00952 
00953     //--- Vertex level operations.
00959     void        VertexSetTransform(FBVector3d pPosition,FBVector3d pRotation, FBVector3d pScaling);
00965     void        VertexGetTransform(FBVector3d& pPosition,FBVector3d& pRotation, FBVector3d& pScaling);
00970     void        VertexAdd(int pVertexIndex,double pWeight);
00974     void        VertexRemove(int pVertexIndex);
00978     int            VertexGetCount();
00983     int            VertexGetNumber(int pIndex);
00988     double        VertexGetWeight(int pIndex);
00993     void        VertexSetWeight(double pWeight,int pIndex);
00996     void        VertexClear();
00997 
00998     FBPropertyClusterMode    ClusterMode;        
00999     FBPropertyDouble        ClusterAccuracy;    
01000 };
01001 
01003 // FBCamera
01005 __FB_FORWARD( FBCamera );
01006 
01008 enum FBCameraFrameSizeMode { 
01009     kFBFrameSizeWindow,                    
01010     kFBFrameSizeFixedRatio,                
01011     kFBFrameSizeFixedResolution,        
01012     kFBFrameSizeFixedWidthResolution,    
01013     kFBFrameSizeFixedHeightResolution    
01014 };
01016 
01017 enum FBCameraResolutionMode { 
01018     kFBResolutionCustom,                
01019     kFBResolutionD1NTSC,                
01020     kFBResolutionNTSC,                    
01021     kFBResolutionPAL,                    
01022     kFBResolutionD1PAL,                    
01023     kFBResolutionHD,                    
01024     kFBResolution640x480,                
01025     kFBResolution320x200,                
01026     kFBResolution320x240,                
01027     kFBResolution128x128,                
01028     kFBResolutionFullScreen                
01029 };
01031 
01032 enum FBCameraApertureMode { 
01033     kFBApertureVertical,                
01034     kFBApertureHorizontal,                
01035     kFBApertureVertHoriz,                
01036     kFBApertureFocalLength                
01037 };
01039 
01040 enum FBCameraFilmBackType { 
01041     kFBFilmBackCustom,                    
01042     kFBFilmBack16mmTheatrical,            
01043     kFBFilmBackSuper16mm,                
01044     kFBFilmBack35mmAcademy,                
01045     kFBFilmBack35mmTVProjection,        
01046     kFBFilmBack35mmFullAperture,        
01047     kFBFilmBack35mm185Projection,        
01048     kFBFilmBack35mmAnamorphic,            
01049     kFBFilmBack70mmProjection,            
01050     kFBFilmBackVistaVision,                
01051     kFBFilmBackDynavision,                
01052     kFBFilmBackIMAX                        
01053 };
01055 
01056 enum FBCameraViewPlaneMode { 
01057     kFBViewPlaneDisabled,                
01058     kFBViewPlaneAlways,                    
01059     kFBViewPlaneWhenMedia                
01060 };
01062 
01063 enum FBCameraDistanceMode { 
01064     kFBDistModeRelativeToInterest,        
01065     kFBDistModeAbsoluteFromCamera        
01066 };
01068 
01069 enum FBCameraSafeAreaMode { 
01070     kFBSafeAreaSquare,                    
01071     kFBSafeAreaRound                    
01072 };
01074 
01075 enum FBCameraAntiAliasingMethod    { 
01076     kFBAntiAliasingSoftware,            
01077     kFBAntialiasingMultiSamplingOnyx    
01078 };
01080 
01081 enum FBCameraSamplingType { 
01082     kFBSamplingUniform,                    
01083     kFBSamplingStochastic                
01084 };
01086 
01087 enum FBCameraFocusDistanceSource { 
01088     kFBFocusDistanceCameraInterest,        
01089     kFBFocusDistanceSpecificDistance    
01090 };
01091 
01093 
01094 enum FBCameraType { 
01095     kFBCameraTypePerspective,            
01096     kFBCameraTypeOrthogonal                
01097 };
01098 
01100 
01101 enum FBCameraMatrixType { 
01102     kFBProjection,                        
01103     kFBModelView                        
01104 };
01105 
01106 FB_DEFINE_ENUM( FBSDK_DLL, CameraType                    ); 
01107 FB_DEFINE_ENUM( FBSDK_DLL, CameraApertureMode            ); 
01108 FB_DEFINE_ENUM( FBSDK_DLL, CameraFilmBackType            ); 
01109 FB_DEFINE_ENUM( FBSDK_DLL, CameraFrameSizeMode            ); 
01110 FB_DEFINE_ENUM( FBSDK_DLL, CameraResolutionMode            ); 
01111 FB_DEFINE_ENUM( FBSDK_DLL, CameraViewPlaneMode            ); 
01112 FB_DEFINE_ENUM( FBSDK_DLL, CameraDistanceMode            ); 
01113 FB_DEFINE_ENUM( FBSDK_DLL, CameraSafeAreaMode            ); 
01114 FB_DEFINE_ENUM( FBSDK_DLL, CameraAntiAliasingMethod        ); 
01115 FB_DEFINE_ENUM( FBSDK_DLL, CameraSamplingType            );
01116 FB_DEFINE_ENUM( FBSDK_DLL, CameraFocusDistanceSource    ); 
01117 FB_DEFINE_ENUM( FBSDK_DLL, CameraMatrixType                ); 
01118 
01135 class FBSDK_DLL FBCamera : public FBModel {
01136     __FBClassDeclare( FBCamera,FBModel );
01137 public:
01142     FBCamera(const char * pName, HIObject pObject=NULL);
01143 
01144     FBPropertyBool                        SystemCamera;           
01145 
01146     // Camera Format
01147     FBPropertyCameraFrameSizeMode        FrameSizeMode;          
01148     FBPropertyCameraResolutionMode        ResolutionMode;         
01149     FBPropertyDouble                    ResolutionWidth;        
01150     FBPropertyDouble                    ResolutionHeight;       
01151     FBPropertyDouble                    WindowHeight;           
01152     FBPropertyDouble                    PixelAspectRatio;       
01153     FBPropertyDouble                    NearPlaneDistance;      
01154     FBPropertyDouble                    FarPlaneDistance;       
01155     FBPropertyBool                        MouseLockCamera;        
01156     FBPropertyCameraType                Type;                   
01157     FBPropertyCameraApertureMode        ApertureMode;           
01158     FBPropertyAnimatableDouble            FieldOfView;            
01159 
01160     FBPropertyAnimatableDouble            FieldOfViewX;           
01161     FBPropertyAnimatableDouble            FieldOfViewY;           
01162     FBPropertyAnimatableDouble            OpticalCenterX;         
01163     FBPropertyAnimatableDouble            OpticalCenterY;         
01164     FBPropertyAnimatableDouble            FocalLength;            
01165 
01166     FBPropertyCameraFilmBackType        FilmBackType;           
01167     FBPropertyDouble                    FilmSizeWidth;          
01168     FBPropertyDouble                    FilmSizeHeight;         
01169     FBPropertyDouble                    FilmAspectRatio;        
01170     FBPropertyDouble                    SqueezeRatio;           
01171     
01172     static const double OrthoFactor;    
01173     
01202     FBPropertyDouble OrthoZoom;
01203     
01204 
01205     // Camera Background options
01206     FBPropertyVideo                        BackGroundMedia;                
01207     FBPropertyCameraViewPlaneMode        ViewBackGroundPlaneMode;        
01208     FBPropertyBool                        BackGroundImageCenter;            
01209     FBPropertyBool                        BackGroundImageFit;                
01210     FBPropertyBool                        BackGroundImageKeepRatio;        
01211     FBPropertyBool                        BackGroundImageCrop;            
01212     FBPropertyDouble                    BackGroundPlaneDistance;        
01213     FBPropertyCameraDistanceMode        BackGroundPlaneDistanceMode;    
01214 
01215     // Camera Foreground options
01216     FBPropertyAnimatableDouble            ForeGroundAlpha;                
01217     FBPropertyDouble                    ForeGroundMaterialThreshold;    
01218     FBPropertyBool                        ForeGroundTransparent;            
01219     FBPropertyVideo                        ForeGroundMedia;                
01220     FBPropertyCameraViewPlaneMode        ViewForeGroundPlaneMode;        
01221     FBPropertyBool                        ForeGroundImageCenter;            
01222     FBPropertyBool                        ForeGroundImageFit;                
01223     FBPropertyBool                        ForeGroundImageKeepRatio;        
01224     FBPropertyBool                        ForeGroundImageCrop;            
01225     FBPropertyDouble                    ForeGroundPlaneDistance;        
01226     FBPropertyCameraDistanceMode        ForeGroundPlaneDistanceMode;    
01227 
01228     // Camera View Options
01229     FBPropertyBool                        ViewCameraInterest;        
01230     FBPropertyBool                        ViewNearFarPlane;        
01231     FBPropertyBool                        ViewShowGrid;            
01232     FBPropertyBool                        ViewShowAxis;            
01233     FBPropertyBool                        ViewShowTimeCode;        
01234     FBPropertyBool                        ViewDisplaySafeArea;    
01235     FBPropertyBool                        ViewOpticalCenter;        
01236     FBPropertyCameraSafeAreaMode        SafeAreaMode;            
01237 
01238     FBPropertyAnimatableColor            BackGroundColor;        
01239     FBPropertyBool                        UseFrameColor;            
01240     FBPropertyColor                        FrameColor;                
01241 
01242     // Camera Render Options
01243         // Rendering Options
01244     FBPropertyBool                        UseAntiAliasing;        
01245     FBPropertyBool                        UseDepthOfField;        
01246     FBPropertyBool                        InteractiveMode;        
01247 
01248         // Antialiasing Options
01249     FBPropertyDouble                    AntiAliasingIntensity;    
01250     FBPropertyCameraAntiAliasingMethod    AntiAliasingMethod;        
01251     FBPropertyInt                        NumberOfSamples;        
01252     FBPropertyCameraSamplingType        SamplingType;            
01253     FBPropertyBool                        UseAccumulationBuffer;    
01254     
01255         // Depth of Field Options
01256     FBPropertyCameraFocusDistanceSource    FocusDistanceSource;    
01257     FBPropertyDouble                    FocusSpecificDistance;    
01258     FBPropertyDouble                    FocusAngle;                
01259 
01260         // 2D Magnifier
01261     FBPropertyBool                        Use2DMagnifier;            
01262     FBPropertyBool                        Display2DMagnifierFrame;
01263     FBPropertyAnimatableDouble            MagnifierZoom;            
01264     FBPropertyAnimatableDouble            MagnifierPosX;            
01265     FBPropertyAnimatableDouble            MagnifierPosY;            
01266 
01267     // Other Attributes
01268     FBPropertyModel                        Interest;                
01269     FBPropertyAnimatableDouble            Roll;                    
01270     FBPropertyAnimatableDouble            TurnTable;                
01271     FBPropertyBool                        DisplayTurnTableIcon;    
01272 
01273     // MotionBlur
01274     FBPropertyAnimatableDouble            MotionBlurIntensity;    
01275     FBPropertyBool                        UseMotionBlur;            
01276     FBPropertyBool                        UseRealTimeMotionBlur;    
01277 
01278     // Viewport dimension (those property values are only updated & valid during custom renderer callback
01279     FBPropertyInt                        CameraViewportX;        
01280     FBPropertyInt                        CameraViewportY;        
01281     FBPropertyInt                        CameraViewportWidth;    
01282     FBPropertyInt                        CameraViewportHeight;   
01283 
01284 #ifndef K_NO_HUD
01285     FBPropertyListHUD                    HUDs;                   
01286 #endif
01287 
01292     double*    GetMatrix( FBCameraMatrixType pType );
01293 };
01294 
01296 // FBCameraStereo
01298 __FB_FORWARD( FBCameraStereo );
01299 
01301 /* Stereo Type */
01302 enum FBCameraStereoType 
01303 { 
01304     kFBCameraStereoNone,
01305     kFBCameraStereoConverged,
01306     kFBCameraStereoOff_Axis,
01307     kFBCameraStereoParallel
01308 }; 
01309 
01310 FB_DEFINE_ENUM( FBSDK_DLL, CameraStereoType); 
01311 
01312 class FBSDK_DLL FBCameraStereo : public FBCamera
01313 {
01314     __FBClassDeclare(FBCameraStereo, FBCamera);
01315 public:
01320     FBCameraStereo(const char * pName, HIObject pObject=NULL);
01321 
01322     FBPropertyCameraStereoType      Stereo;                         
01323     FBPropertyAnimatableDouble      InteraxialSeparation;           
01324     FBPropertyAnimatableDouble      ZeroParallax;                   
01325     FBPropertyAnimatableDouble      ToeInAdjust;                    
01326     FBPropertyAnimatableDouble      FilmOffsetRightCam;             
01327     FBPropertyAnimatableDouble      FilmOffsetLeftCam;              
01328    
01329     FBPropertyCamera                RightCamera;                    
01330     FBPropertyCamera                LeftCamera;                     
01331     FBPropertyCamera                CenterCamera;                   
01332 
01333     FBPropertyString                PrecompFileName;                
01334     FBPropertyString                RelativePrecompFileName;        
01335 
01336     FBPropertyBool                  DisplayZeroParallaxPlane;       
01337     FBPropertyDouble                ZeroParallaxPlaneTransparency;  
01338     FBPropertyColor                 ZeroParallaxPlaneColor;         
01339 };
01340 
01342 // FBPropertyListCamera
01345 class FBSDK_DLL FBPropertyListCamera : public FBPropertyListComponent
01346 {
01347 public:
01348     FBPropertyListCamera();
01353     FBCamera* operator[](int pIndex);
01354 };
01355 
01357 // FBCameraSwitcher
01359 __FB_FORWARD( FBCameraSwitcher );
01360 
01366 class FBSDK_DLL FBCameraSwitcher : public FBModel
01367 {
01368     __FBClassDeclare( FBCameraSwitcher, FBBox );
01369 public:
01372     FBCameraSwitcher();
01373 
01374     FBPropertyCamera    CurrentCamera;        
01375     FBPropertyInt       CurrentCameraIndex; 
01376 };
01377 
01378 
01380 // FBGlobalLight
01382 __FB_FORWARD( FBGlobalLight );
01383 
01385 enum FBFogMode    { 
01386     kFBFogModeLinear,                
01387     kFBFogModeExponential,            
01388     kFBFogModeSquareExponential        
01389 };
01390 
01391 FB_DEFINE_ENUM( FBSDK_DLL, FogMode );
01392 
01394 class FBSDK_DLL FBGlobalLight : public FBBox
01395 {
01396     __FBClassDeclare( FBGlobalLight, FBBox );
01397 
01399     FBGlobalLight();
01400 
01401 public:
01402 
01403     FBPropertyAnimatableColor    AmbientColor;        
01404 
01405     // Fog
01406     FBPropertyBool                FogEnable;            
01407 
01408     FBPropertyAnimatableColor    FogColor;            
01409     FBPropertyAnimatableDouble    FogBegin;            
01410     FBPropertyAnimatableDouble    FogEnd;                
01411     FBPropertyAnimatableDouble    FogDensity;            
01412 
01413     FBPropertyFogMode            FogMode;            
01414 
01418     static FBGlobalLight& TheOne();
01419 };
01420 
01422 // FBLight
01424 __FB_FORWARD( FBLight );
01425 
01427 enum FBLightType    { 
01428     kFBLightTypePoint,        
01429     kFBLightTypeInfinite,    
01430     kFBLightTypeSpot,        
01431 };
01432 
01433 FB_DEFINE_ENUM( FBSDK_DLL, LightType    );
01434 
01436 enum FBAttenuationType    { 
01437     kFBAttenuationNone = 0,            
01438     kFBAttenuationLinear,        
01439     kFBAttenuationQuadratic,    
01440     kFBAttenuationCubic         
01441 };
01442 
01443 FB_DEFINE_ENUM( FBSDK_DLL, AttenuationType    );
01444 
01446 class FBSDK_DLL FBLight : public FBModel 
01447 {
01448     __FBClassDeclare( FBLight,FBModel );
01449 public:
01454     FBLight(const char* pName, HIObject pObject=NULL);
01455 
01456 
01457     // Light parameters
01458     FBPropertyLightType            LightType;                    
01459     FBPropertyAttenuationType    AttenuationType;            
01460     FBPropertyAnimatableDouble    Intensity;                    
01461     FBPropertyAnimatableDouble    ConeAngle;                    
01462 
01463     FBPropertyAnimatableDouble    FogIntensity;                
01464     FBPropertyAnimatableColor    DiffuseColor;                
01465     FBPropertyBool                CastLightOnObject;            
01466     FBPropertyBool               CastShadows;                   
01467 
01468     // Effects and Gobos
01469     FBPropertyBool                DrawGroundProjection;        
01470     FBPropertyBool                DrawVolumetricLight;        
01471     FBPropertyBool                DrawFrontFacingVolumetric;    
01472     FBPropertyVideo                GoboMedia;                    
01473 
01474 };
01475 
01477 // FBPropertyListLight
01480 class FBSDK_DLL FBPropertyListLight : public FBPropertyListComponent
01481 {
01482 public:
01483     FBPropertyListLight();
01488     FBLight* operator[](int pIndex);
01489 };
01490 
01492 // FBModelVertexData
01494 __FB_FORWARD( FBModelVertexData );
01495 
01496 enum FBGeometryPrimitiveType
01497 {
01498     kFBGeometry_POINTS            = 0x0000, //GL_POINTS,
01499     kFBGeometry_LINES            = 0x0001, //GL_LINES,
01500     kFBGeometry_LINE_LOOP       = 0x0002, //GL_LINE_LOOP,
01501     kFBGeometry_LINE_STRIP        = 0x0003, //GL_LINE_STRIP,
01502     kFBGeometry_TRIANGLES        = 0x0004, //GL_TRIANGLES,
01503     kFBGeometry_TRIANGLE_STRIP    = 0x0005, //GL_TRIANGLE_STRIP,
01504     kFBGeometry_TRIANGLE_FAN    = 0x0006, //GL_TRIANGLE_FAN,
01505     kFBGeometry_QUADS            = 0x0007, //GL_QUADS,
01506     kFBGeometry_QUADS_STRIP        = 0x0008, //GL_QUAD_STRIP,
01507     kFBGeometry_POLYGON            = 0x0009, //GL_POLYGON,
01508 };
01509 
01511 enum FBGeometryArrayID 
01512 { 
01513     kFBGeometryArrayID_Point          =  1 << 0,    
01514     kFBGeometryArrayID_NormalByPoint  =  1 << 1,    
01515     kFBGeometryArrayID_Tangent        =  1 << 2,    
01516     kFBGeometryArrayID_Binormal       =  1 << 3,    
01517     kFBGeometryArrayID_VertexColor    =  1 << 4     
01518 };
01519 
01521 enum FBGeometryArrayElementType {
01522     kFBGeometryArrayElementType_Unknown,
01523     kFBGeometryArrayElementType_Integer, 
01524     kFBGeometryArrayElementType_Float,
01525     kFBGeometryArrayElementType_Float2,
01526     kFBGeometryArrayElementType_Float3,     
01527     kFBGeometryArrayElementType_Float4,      
01528     kFBGeometryArrayElementType_FloatMatrix4x4,
01529     kFBGeometryArrayElementType_IntegerArrayPointer
01530 };
01531 
01532 class FBSDK_DLL FBModelVertexData : public FBComponent {
01533     __FBClassDeclare( FBModelVertexData,FBComponent );
01534 
01535 protected:
01536     FBModelVertexData(HFBModel pModel);
01537     friend class DataFBModel;
01538 
01539 public:
01540 
01542     bool IsDeformable();        
01543 
01545     bool IsDrawable();
01546 
01548     int GetVertexCount();
01549 
01554 
01556     int GetSubPatchCount();
01557     
01559     int GetSubPatchMaterialId(int pSubPatchIndex);
01560 
01562     FBMaterial* GetSubPatchMaterial(int pSubPatchIndex);
01563 
01570     FBGeometryPrimitiveType GetSubPatchPrimitiveType(int pSubPatchIndex, bool* pIsOptimized = NULL);
01571 
01573     int GetSubPatchIndexOffset(int pSubPatchIndex);
01574 
01576     int GetSubPatchIndexSize(int pSubPatchIndex);
01577 
01582     void DrawSubPatch(int pSubPatchIndex, bool pWireFrame = false);
01583 
01585 
01591 
01593     int GetSubRegionCount();
01594 
01598     FBMaterial* GetSubRegionMaterial(int pSubRegionIndex);
01599 
01604     void DrawSubRegion(int pSubRegionIndex, bool pWireFrame = false);
01605 
01607 
01614     void EnableOGLVertexData(bool pAfterdeform = true);
01615 
01617     void DisableOGLVertexData();
01618 
01624     void VertexArrayMappingRequest();
01625 
01635     const int* GetVertexArrayDuplicationMap(unsigned int& pDuplicatedVertexCound);
01636 
01638     void VertexArrayMappingRelease();
01639 
01641     int* GetIndexArray();
01642 
01644     unsigned int GetIndexArrayVBOId();
01645 
01651     FBGeometryArrayElementType GetVertexArrayType(FBGeometryArrayID pArrayId, bool pAfterDeform = true);
01652 
01658     void* GetVertexArray(FBGeometryArrayID pArrayId, bool pAfterDeform = true);
01659 
01665     unsigned int GetVertexArrayVBOId(FBGeometryArrayID pArrayId, bool pAfterDeform = true);
01666 
01672     void* GetVertexArrayVBOOffset(FBGeometryArrayID pArrayId, bool pAfterDeform = true);
01673 
01675 
01682     void EnableOGLUVSet(FBTextureMapping pTextureMapping = kFBTextureMappingUV, const char* pUVSet = NULL);
01683 
01685     void DisableOGLUVSet();
01686 
01692     FBGeometryArrayElementType GetUVSetArrayFormat(FBTextureMapping pTextureMapping = kFBTextureMappingUV, const char* pUVSet = NULL);
01693 
01699     void* GetUVSetArray(FBTextureMapping pTextureMapping = kFBTextureMappingUV, const char* pUVSet = NULL);
01700 
01706     unsigned int GetUVSetVBOId(FBTextureMapping pTextureMapping = kFBTextureMappingUV, const char* pUVSet = NULL);
01707 
01713     void* GetUVSetVBOOffset(FBTextureMapping pTextureMapping = kFBTextureMappingUV, const char* pUVSet = NULL);
01714 
01716 };
01717 
01718 
01720 // FBGeometry
01722 __FB_FORWARD( FBGeometry );
01723 
01724 
01735 enum FBGeometryMappingMode
01736 {
01737     kFBGeometryMapping_NONE,
01738     kFBGeometryMapping_BY_CONTROL_POINT,
01739     kFBGeometryMapping_BY_POLYGON_VERTEX,
01740     kFBGeometryMapping_BY_POLYGON,
01741     kFBGeometryMapping_BY_EDGE,
01742     kFBGeometryMapping_ALL_SAME
01743 } ;
01744 
01756 enum FBGeometryReferenceMode
01757 {
01758     kFBGeometryReference_DIRECT,
01759     kFBGeometryReference_INDEX,
01760     kFBGeometryReference_INDEX_TO_DIRECT    
01761 };
01762 
01763 FB_DEFINE_ENUM( FBSDK_DLL, GeometryMappingMode ); 
01764 FB_DEFINE_ENUM( FBSDK_DLL, GeometryReferenceMode ); 
01765 
01766 enum kFBGeometryUpdateFlags
01767 {
01768     kFBGeometryUpdateNone                = 0,        
01769     kFBGeometryUpdateAll                = 1 << 0,    
01770     kFBGeometryUpdatePositionAndNormal  = 1 << 1,   
01771     kFBGeometryUpdateSkinWeight            = 1 << 2,   
01772     kFBGeometryUpdateInverseNormal        = 1 << 3,    
01773     kFBGeometryUpdateMappingMode        = 1 << 4,    
01774 };
01775 
01792 class FBSDK_DLL FBGeometry : public FBComponent {
01793     __FBClassDeclare( FBGeometry,FBComponent );
01794 
01795 protected:
01800     FBGeometry(const char* pName, HIObject pObject=NULL);
01801 
01802 public:
01811 
01815     bool        GeometryBegin();
01816     bool        GeometryEnd();
01818 
01828     void        VertexInit    (int pSize, bool pResize, bool pInitUV = true, bool pInitVertexColor = false);
01829 
01834     bool        VertexClear    ();
01835 
01841     int            VertexAdd    (FBVertex pVertex);
01842 
01848     int            VertexAdd    (FBVertex pVertex, FBNormal pNormal);
01849 
01856     int            VertexAdd    (FBVertex pVertex, FBNormal pNormal, FBUV pUV);
01857 
01865     int            VertexAdd    (FBVertex pVertex, FBNormal pNormal, FBUV pUV, FBColorF pVertexColor);
01866 
01874     int            VertexAdd    (double px, double py, double pz);
01875 
01876     int            VertexAdd    (double px, double py, double pz, double nx, double ny, double nz);
01877     int            VertexAdd    (double px, double py, double pz, double nx, double ny, double nz, double UVu, double UVv);
01878     int            VertexAdd    (double px, double py, double pz, double nx, double ny, double nz, double UVu, double UVv, double pRed, double pGreen, double pBlue, double pAlpha);
01879 
01885     bool        VertexSet    (FBVertex pVertex,int pIndex=-1);
01886 
01894     bool        VertexSet    (double px, double py, double pz,int pIndex=-1);
01895 
01901     bool        VertexNormalSet(FBNormal pVertex,int pIndex=-1);
01902 
01910     bool        VertexNormalSet(double px, double py, double pz,int pIndex=-1);
01911 
01912 
01918     bool        VertexUVSet(FBUV pUV, int pIndex=-1);
01919 
01926     bool        VertexUVSet(float pU, float pV, int pIndex=-1);
01927 
01933     bool        VertexColorSet(FBColorF pColor, int pIndex=-1);
01934 
01943     bool        VertexColorSet(float pRed, float pGreen, float pBlue, float pAlpha, int pIndex=-1);
01944 
01946 
01951 
01955     int            VertexCount    () const;
01956 
01961     FBVertex    VertexGet    (int pIndex) const;
01962 
01966     FBVertex*    GetVertexes() const;
01967 
01972     FBNormal    VertexNormalGet(int pIndex=-1) const;
01973 
01978     FBUV        VertexUVGet(int pIndex=-1) const;
01979 
01984     FBColorF    VertexColorGet(int pIndex=-1) const;
01985 
01987 
01988 
01993 
01994     FBPropertyGeometryMappingMode    NormalMappingMode;        
01995     FBPropertyGeometryReferenceMode    NormalReferenceMode;    
01996 
02001     int*        GetNormalsIndexArray(int& pOutArrayCount) const;
02002 
02007     FBNormal*    GetNormalsDirectArray(int& pOutArrayCount) const;
02008 
02009     FBPropertyGeometryMappingMode    VertexColorMappingMode;        
02010     FBPropertyGeometryReferenceMode    VertexColorReferenceMode;    
02011 
02016     int*        GetVertexColorsIndexArray(int& pOutArrayCount) const;
02017 
02022     FBColorF*    GetVertexColorsDirectArray(int& pOutArrayCount) const;
02023 
02027     FBStringList GetUVSets() const;
02028 
02033     FBGeometryMappingMode    GetUVSetMappingMode(const char* pUVSetName) const;
02034 
02039     FBGeometryReferenceMode GetUVSetReferenceMode(const char* pUVSetName) const;
02040 
02046     int*        GetVUVSetIndexArray(int& pOutArrayCount, const char* pUVSetName) const;
02047     
02053     FBUV*        GetUVSetDirectArray(int& pOutArrayCount, const char* pUVsetName = NULL) const;
02054 
02055     FBPropertyGeometryMappingMode    MaterialMappingMode;    
02056 
02061     int*        GetMaterialIndexArray(int& pOutArrayCount, const char* pUVSetName) const;
02062 
02064 
02065 
02070 
02075     bool VertexGetSelected(int pIndex);
02081     bool VertexSetSelected(int pIndex,bool pState);
02082 
02087     bool VertexGetVisible(int pIndex);
02093     bool VertexSetVisible(int pIndex,bool pState);
02094 
02099     bool VertexGetTransformable(int pIndex);
02101 
02106 
02108     int ShapeGetCount() const;
02109 
02111     const char* ShapeGetName(int pShapeIdx) const;
02112 
02117     int ShapeAdd(const char* pName);
02118 
02120     void ShapeClearAll();
02121 
02127     void ShapeInit(int pShapeIdx, int pDiffSize, bool pWithNormal = false);
02128 
02132     int ShapeGetDiffPointCount(int pShapeIdx) const;
02133 
02141     bool ShapeSetDiffPoint(int pShapeIdx, int pDiffIndex, int pOriIndex, const FBVertex& pPosDiff);
02142     bool ShapeSetDiffPoint(int pShapeIdx, int pDiffIndex, int pOriIndex, const FBVertex& pPosDiff, const FBNormal& pNormalDiff);
02143 
02151     bool ShapeGetDiffPoint(int pShapeIdx, int pDiffIndex, int& pOriIndex, FBVertex& pPosDiff) const;
02152     bool ShapeGetDiffPoint(int pShapeIdx, int pDiffIndex, int& pOriIndex, FBVertex& pPosDiff, FBNormal& pNormalDiff) const;
02153 
02155 
02160 
02166     void ModifyNotify( kFBGeometryUpdateFlags pFlags=kFBGeometryUpdateAll, int pFirstIndex=-1, int pLastIndex=-1 );
02167 
02169 };
02170 
02172 // FBMesh
02174 __FB_FORWARD( FBMesh );
02175 
02177 class FBSDK_DLL FBMesh : public FBGeometry {
02178     __FBClassDeclare( FBMesh,FBGeometry );
02179 
02180 public:
02185     FBMesh(const char* pName, HIObject pObject=NULL);
02186 
02191     int        PolygonBegin(int pMaterialId=0);
02192 
02197     bool    PolygonVertexAdd(int pVertex);
02198 
02203     int        PolygonMaterialIdGet(int pIndex=-1);
02204 
02209     int        PolygonEnd();
02210 
02215     int        PolygonVertexCount(int pPolygonIndex);
02216 
02222     int        PolygonVertexIndex(int pPolygonIndex, int pVertexPolygonIndex);
02223 
02227     int        PolygonCount();
02228 
02232     void ComputeVertexNormals(bool pCW = false);
02233 
02235     void InverseNormal();
02236 };
02237 
02239 // FBSurface
02241 __FB_FORWARD( FBSurface );
02242 
02244 enum FBSurfaceMode
02245 {
02246     kFBSurfaceModeRaw,               
02247     kFBSurfaceModeLowNoNormals,      
02248     kFBSurfaceModeLow,               
02249     kFBSurfaceModeHighNoNormals,     
02250     kFBSurfaceModeHigh               
02251 };
02252 FB_DEFINE_ENUM( FBSDK_DLL, SurfaceMode );
02253 
02255 enum FBSurfaceType
02256 {
02257     kFBSurfaceTypeBezier,            
02258     kFBSurfaceTypeBezierQuadric,     
02259     kFBSurfaceTypeCardinal,          
02260     kFBSurfaceTypeBspline,           
02261     kFBSurfaceTypeLinear,            
02262 };
02263 FB_DEFINE_ENUM( FBSDK_DLL, SurfaceType );
02264 
02265 
02267 class FBSDK_DLL FBSurface : public FBGeometry
02268 {
02269     __FBClassDeclare( FBSurface, FBGeometry );
02270     
02271 public:
02276     FBSurface(const char* pName, HIObject pObject=NULL);
02277 
02278     virtual void    SurfaceBegin();
02279     virtual void    SurfaceEnd();
02280     virtual void    SurfaceEditBegin();
02281     virtual void    SurfaceEditEnd();
02282     virtual bool    GetSurfaceCapped( int pUorV, int pDirection );
02283     virtual int     GetVertexCount( int pUorVorGlobal = -1 );
02284     virtual void    ControlPointsBegin() = 0;
02285     virtual void    SetControlPoint( int pIndex, double pX, double pY, double pZ, double pW );
02286     virtual void    GetControlPoint( int pIndex, double &pX, double &pY, double &pZ, double &pW );
02287     virtual void    ControlPointsEnd();
02288 
02294     bool VertexGetSelected(int pU,int pV);
02301     bool VertexSetSelected(int pU,int pV,bool pState);
02302         
02308     bool VertexGetVisible(int pU,int pV);
02309 
02316     bool VertexSetVisible(int pU,int pV,bool pState);
02317     
02323     bool VertexGetTransformable(int pU,int pV);
02324 
02325 
02326     FBPropertyInt            USize;        
02327     FBPropertyInt            VSize;        
02328     FBPropertyInt            UStep;        
02329     FBPropertyInt            VStep;        
02330     FBPropertyBool           UClosed;      
02331     FBPropertyBool           VClosed;      
02332     FBPropertySurfaceMode    SurfaceMode;  
02333 
02334 private:
02335     void FBSurfaceInitProperties();
02336 };
02337 
02339 enum FBNurbType
02340 {
02341     kFBNurbTypePeriodic,    
02342     kFBNurbTypeClosed,      
02343     kFBNurbTypeOpen,        
02344 };
02345 FB_DEFINE_ENUM( FBSDK_DLL, NurbType );
02346 
02347 
02349 // FBNurbs
02351 __FB_FORWARD( FBNurbs );
02352 
02354 class FBSDK_DLL FBNurbs : public FBSurface
02355 {
02356     __FBClassDeclare( FBNurbs, FBSurface );
02357 
02358 public:
02363     FBNurbs(const char* pName, HIObject pObject=NULL);
02364 
02367     virtual void    SurfaceBegin();
02368 
02371     virtual void    SurfaceEnd();
02372 
02375     virtual void    SurfaceEditBegin();
02378     virtual void    SurfaceEditEnd();
02381     virtual void    ControlPointsBegin();
02384     virtual void    ControlPointsEnd();
02389     virtual void    SetControlWeight( int pIndex, double pWeight );
02394     virtual double    GetControlWeight( int pIndex );
02400     virtual void    SetControlMultiplicity( int pUorV, int pIndex, int    pMultiplicity    );
02405     virtual int        GetControlMultiplicity( int pUorV, int pIndex );
02411     virtual void    SetControlKnotValue( int pUorV, int pIndex, double    pKnotValue        );
02416     virtual double    GetControlKnotValue( int pUorV, int pIndex );
02421     virtual int        GetKnotCount( int pUorV );
02422 
02423     FBPropertyInt            UOrder;            
02424     FBPropertyInt            VOrder;            
02425     FBPropertyNurbType       UNurbType;        
02426     FBPropertyNurbType       VNurbType;        
02427 
02428 private:
02429     void FBNurbsInitProperties();
02430 };
02431 
02433 // FBPatch
02435 __FB_FORWARD( FBPatch );
02436 
02438 class FBSDK_DLL FBPatch : public FBSurface
02439 {
02440     __FBClassDeclare( FBPatch, FBSurface );
02441 
02442 public:
02447     FBPatch(const char* pName, HIObject pObject=NULL);
02448     
02451     virtual void SurfaceBegin();
02452 
02455     virtual void SurfaceEnd();
02456 
02459     virtual void SurfaceEditBegin();
02460 
02463     virtual void SurfaceEditEnd();
02464 
02467     virtual void ControlPointsBegin();
02470     virtual void ControlPointsEnd();
02471 
02472 
02473     FBPropertySurfaceType    USurfaceType;        
02474     FBPropertySurfaceType    VSurfaceType;        
02475 
02476 private:
02477     void FBPatchInitProperties();
02478 
02479 };
02480 
02482 // FBDeformer
02484 
02495 enum FBDeformerType    
02496 {
02497     kFBDeformerUnkown,
02498     kFBDeformerSkeleton,
02499     kFBDeformerPointCache
02500 };
02501 
02502 FB_DEFINE_ENUM( FBSDK_DLL, DeformerType                ); 
02503 
02504 __FB_FORWARD( FBDeformer );
02505 
02507 class FBSDK_DLL FBDeformer : public FBComponent {
02508     __FBClassDeclare( FBDeformer,FBComponent );
02509 
02510 public:
02515     FBDeformer(const char* pName, HIObject pObject=NULL);
02516    
02517     FBPropertyDeformerType DeformerType;    
02518 };
02519 
02521 // FBDeformerPointCache
02523 __FB_FORWARD( FBDeformerPointCache );
02524 
02526 class FBSDK_DLL FBDeformerPointCache : public FBDeformer {
02527     __FBClassDeclare( FBDeformerPointCache,FBDeformer );
02528 
02529 public:
02534     FBDeformerPointCache(const char* pName, HIObject pObject=NULL);
02535 
02536     FBPropertyPointCacheFile   PointCacheFile;  
02537 
02538     FBPropertyBool      Active;                  
02539 
02540     FBPropertyInt       ChannelIndex;            
02541     FBPropertyString    ChannelName;             
02542 
02543     FBPropertyInt       ChannelCount;            
02544     FBPropertyTime      ChannelStart;            
02545     FBPropertyTime      ChannelEnd;              
02546     FBPropertyBool      ChannelSampleRegular;    
02547     FBPropertyDouble    ChannelFrameRate;        
02548     FBPropertyInt       ChannelPointCount;       
02549 };
02550 
02552 // FBPointCacheFile
02554 __FB_FORWARD( FBPointCacheFile );
02555 
02557 class FBSDK_DLL FBPointCacheFile : public FBComponent {
02558     __FBClassDeclare( FBPointCacheFile,FBComponent );
02559 
02560 public:
02565     FBPointCacheFile(const char* pName, HIObject pObject=NULL);
02566     
02567     FBPropertyString    CacheFileName;           
02568     FBPropertyInt       ChannelCount;            
02569 
02570     FBPropertyTime      StartTime;               
02571     FBPropertyTime      StopTime;                
02572     FBPropertyDouble    PlaySpeed;               
02573     FBPropertyTime      Offset;                  
02574     FBPropertyBool      FreeRunning;             
02575     FBPropertyBool      Loop;                    
02576 };
02577 
02578 #ifdef FBSDKUseNamespace
02579     }
02580 #endif
02581 #endif