00001 
00004 #ifndef FBXFILESDK_KFBXPLUGINS_KFBXTEXTURE_H
00005 #define FBXFILESDK_KFBXPLUGINS_KFBXTEXTURE_H
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 #include <fbxfilesdk/fbxfilesdk_def.h>
00042 
00043 
00044 #include <fbxfilesdk/kfbxplugins/kfbxobject.h>
00045 #include <fbxfilesdk/kfbxmath/kfbxvector2.h>
00046 
00047 
00048 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00049 
00050 
00051 class KFbxVector4;
00052 class KFbxLayerContainer;
00053 
00054 
00067 class KFBX_DLL KFbxTexture : public KFbxObject
00068 {
00069     KFBXOBJECT_DECLARE(KFbxTexture,KFbxObject);
00070 
00071     public:
00076 
00090         typedef enum
00091         { 
00092             eUMT_UV, 
00093             eUMT_XY, 
00094             eUMT_YZ, 
00095             eUMT_XZ, 
00096             eUMT_SPHERICAL,
00097             eUMT_CYLINDRICAL,
00098             eUMT_ENVIRONMENT,
00099             eUMT_PROJECTION,
00100             eUMT_BOX, 
00101             eUMT_FACE, 
00102             eUMT_NO_MAPPING,
00103         } EUnifiedMappingType;
00104 
00105 
00114         typedef enum 
00115         {
00116             eTEXTURE_USE_6_STANDARD,
00117             eTEXTURE_USE_6_SPHERICAL_REFLEXION_MAP,
00118             eTEXTURE_USE_6_SPHERE_REFLEXION_MAP,
00119             eTEXTURE_USE_6_SHADOW_MAP,
00120             eTEXTURE_USE_6_LIGHT_MAP,
00121             eTEXTURE_USE_6_BUMP_NORMAL_MAP
00122         } ETextureUse6;
00123 
00128         typedef enum 
00129         {
00130             eREPEAT,
00131             eCLAMP
00132         } EWrapMode;
00133 
00141         typedef enum 
00142         {
00143             eTRANSLUCENT,
00144             eADDITIVE,
00145             eMODULATE,
00146             eMODULATE2,
00147             eOVER
00148         } EBlendMode;
00149 
00156         typedef enum  
00157         {
00158             eLEFT = 0,
00159             eRIGHT,
00160             eTOP,
00161             eBOTTOM
00162         } EAlignMode;
00163 
00169         typedef enum 
00170         {
00171             eU = 0,
00172             eV,
00173             eW
00174         } ECoordinates;
00175 
00176         
00177 
00181         KFbxTypedProperty<ETextureUse6>         TextureTypeUse;
00182 
00186         KFbxTypedProperty<fbxDouble1>           Alpha;
00187 
00188 
00189         
00190 
00194         KFbxTypedProperty<EUnifiedMappingType>  CurrentMappingType;
00195 
00199         KFbxTypedProperty<EWrapMode>            WrapModeU;
00200 
00204         KFbxTypedProperty<EWrapMode>            WrapModeV;
00205 
00210         KFbxTypedProperty<fbxBool1>             UVSwap;
00211 
00212         
00213 
00217         KFbxTypedProperty<fbxDouble3>           Translation;
00218 
00222         KFbxTypedProperty<fbxDouble3>           Rotation;
00223 
00227         KFbxTypedProperty<fbxDouble3>           Scaling;
00228 
00232         KFbxTypedProperty<fbxDouble3>           RotationPivot;
00233 
00237         KFbxTypedProperty<fbxDouble3>           ScalingPivot;
00238 
00239         
00240 
00244         KFbxTypedProperty<fbxBool1>             UseMaterial;
00245 
00249         KFbxTypedProperty<fbxBool1>             UseMipMap;
00250 
00251         
00255         KFbxTypedProperty<EBlendMode>   CurrentTextureBlendMode;
00256 
00257         
00261         KFbxTypedProperty<fbxString>            UVSet;
00262 
00266     void Reset();
00267 
00273     bool SetFileName(char const* pName);
00274 
00280     bool SetRelativeFileName(char const* pName);
00281 
00286     char const* GetFileName () const;
00287 
00292     char const* GetRelativeFileName() const;
00293 
00294 
00299     void SetSwapUV(bool pSwapUV);
00300 
00305     bool GetSwapUV() const;
00306 
00312     typedef enum    
00313     { 
00314         eNONE, 
00315         eRGB_INTENSITY, 
00316         eBLACK 
00317     } EAlphaSource;
00318 
00322     void SetAlphaSource(EAlphaSource pAlphaSource);
00323 
00327     EAlphaSource GetAlphaSource() const;
00328 
00338     void SetCropping(int pLeft, int pTop, int pRight, int pBottom);
00339 
00343     int GetCroppingLeft() const;
00344 
00348     int GetCroppingTop() const;
00349 
00353     int GetCroppingRight() const;
00354 
00358     int GetCroppingBottom() const;
00359     
00370     typedef enum    
00371     { 
00372         eNULL, 
00373         ePLANAR, 
00374         eSPHERICAL, 
00375         eCYLINDRICAL, 
00376         eBOX, 
00377         eFACE,
00378         eUV,
00379         eENVIRONMENT
00380     } EMappingType;
00381 
00385     void SetMappingType(EMappingType pMappingType);
00386 
00390     EMappingType GetMappingType() const;
00391 
00397     typedef enum   
00398     { 
00399         ePLANAR_NORMAL_X, 
00400         ePLANAR_NORMAL_Y, 
00401         ePLANAR_NORMAL_Z 
00402     } EPlanarMappingNormal;
00403 
00407     void SetPlanarMappingNormal(EPlanarMappingNormal pPlanarMappingNormal);
00408 
00412     EPlanarMappingNormal GetPlanarMappingNormal() const;
00413 
00418     typedef enum 
00419     {
00420         eMODEL_MATERIAL,
00421         eDEFAULT_MATERIAL
00422     } EMaterialUse;
00423 
00427     void SetMaterialUse(EMaterialUse pMaterialUse);
00428 
00432     EMaterialUse GetMaterialUse() const;
00433 
00442     typedef enum 
00443     {
00444         eSTANDARD,
00445         eSHADOW_MAP,
00446         eLIGHT_MAP,
00447         eSPHERICAL_REFLEXION_MAP,
00448         eSPHERE_REFLEXION_MAP,
00449         eBUMP_NORMAL_MAP
00450     } ETextureUse;
00451 
00455     void SetTextureUse(ETextureUse pTextureUse);
00456 
00460     ETextureUse GetTextureUse() const;
00461 
00462 
00467     void SetWrapMode(EWrapMode pWrapU, EWrapMode pWrapV);
00468 
00472     EWrapMode GetWrapModeU() const;
00473 
00477     EWrapMode GetWrapModeV() const;
00478 
00479 
00483     void SetBlendMode(EBlendMode pBlendMode);
00484 
00488     EBlendMode GetBlendMode() const;
00489 
00491 
00497 
00507     inline void SetDefaultT(const KFbxVector4& pT) { Translation.Set( pT ); }
00508 
00519     KFbxVector4& GetDefaultT(KFbxVector4& pT) const;
00520 
00529     inline void SetDefaultR(const KFbxVector4& pR) { Rotation.Set( fbxDouble3(pR[0],pR[1],pR[2]) ); }
00530 
00540     KFbxVector4& GetDefaultR(KFbxVector4& pR) const;
00541 
00549     inline void SetDefaultS(const KFbxVector4& pS) { Scaling.Set( fbxDouble3(pS[0],pS[1],pS[2]) ); }
00550 
00558     KFbxVector4& GetDefaultS(KFbxVector4& pS) const;
00559 
00563     void SetDefaultAlpha(double pAlpha);
00564 
00568     double GetDefaultAlpha() const;
00569 
00571 
00579 
00586     void SetTranslation(double pU,double pV);
00587 
00592     double GetTranslationU() const;
00593 
00598     double GetTranslationV() const;
00599 
00607     void SetRotation(double pU, double pV, double pW = 0.0);
00608 
00610     double GetRotationU() const;
00611 
00613     double GetRotationV() const;
00614 
00616     double GetRotationW() const;
00617 
00624     void SetScale(double pU,double pV);
00625 
00630     double GetScaleU() const;
00631 
00636     double GetScaleV() const;
00637 
00639 
00640 
00641 
00642 
00643 
00644 
00646 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00647 
00648     virtual KFbxObject& Copy(const KFbxObject& pObject);
00649     virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00650 
00651     bool operator==(KFbxTexture const& pTexture) const;
00652 
00653     KString& GetMediaName();
00654     void SetMediaName(char const* pMediaName);
00655 
00656     void SetUVTranslation(KFbxVector2& pT);
00657     KFbxVector2& GetUVTranslation();
00658     void SetUVScaling(KFbxVector2& pS);
00659     KFbxVector2& GetUVScaling();
00660 
00661     KString GetTextureType();
00662 
00663 protected:
00664     KFbxTexture(KFbxSdkManager& pManager, char const* pName);  
00665 
00666     virtual void Construct(const KFbxTexture* pFrom);
00667     virtual bool ConstructProperties(bool pForceSet);
00668 
00669     void Init();
00670     void SyncVideoFileName(char const* pFileName);
00671     void SyncVideoRelativeFileName(char const* pFileName);
00672 
00673     int mTillingUV[2]; 
00674     int mCropping[4]; 
00675 
00676     EAlphaSource mAlphaSource; 
00677     EMappingType mMappingType; 
00678     EPlanarMappingNormal mPlanarMappingNormal; 
00679 
00680     KString mFileName;
00681     KString mRelativeFileName;
00682     KString mMediaName; 
00683 
00684     static KError smError;
00685 
00686     
00687     
00688 
00689     KFbxVector2 mUVScaling; 
00690     KFbxVector2 mUVTranslation; 
00691 
00692     friend class KFbxLayerContainer;
00693 
00694 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00695 
00696 };
00697 
00698 inline EFbxType FbxTypeOf( KFbxTexture::EUnifiedMappingType const &pItem )      { return eENUM; }
00699 inline EFbxType FbxTypeOf( KFbxTexture::ETextureUse6 const &pItem )             { return eENUM; }
00700 inline EFbxType FbxTypeOf( KFbxTexture::EWrapMode const &pItem )                { return eENUM; }
00701 inline EFbxType FbxTypeOf( KFbxTexture::EBlendMode const &pItem )               { return eENUM; }
00702 
00703 typedef KFbxTexture* HKFbxTexture;
00704 
00705 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00706 
00707 #endif // FBXFILESDK_KFBXPLUGINS_KFBXTEXTURE_H
00708