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
00042 #include <fbxfilesdk/components/kbaselib/kaydaradef_h.h>
00043 #ifdef KARCH_DEV_MACOSX_CFM
00044 #include <CFURL.h>
00045 #include <Files.h>
00046 #endif
00047
00048
00049 #include <fbxfilesdk/kfbxmath/kfbxvector2.h>
00050 #include <fbxfilesdk/kfbxplugins/kfbxshadingnode.h>
00051
00052
00053 #include <fbxfilesdk/fbxfilesdk_nsbegin.h>
00054
00055
00056 class KFbxVector4;
00057 class KFbxLayerContainer;
00058
00059
00063 class KFBX_DLL KFbxTexture : public KFbxShadingNode
00064 {
00065 KFBXOBJECT_DECLARE(KFbxTexture,KFbxShadingNode);
00066
00067 public:
00072 typedef enum
00073 {
00074 eUMT_UV,
00075 eUMT_XY,
00076 eUMT_YZ,
00077 eUMT_XZ,
00078 eUMT_SPHERICAL,
00079 eUMT_CYLINDRICAL,
00080 eUMT_ENVIRONMENT,
00081 eUMT_PROJECTION,
00082 eUMT_BOX,
00083 eUMT_FACE,
00084 eUMT_NO_MAPPING,
00085 } EUnifiedMappingType;
00086
00087 typedef enum
00088 {
00089 eTEXTURE_USE_6_STANDARD,
00090 eTEXTURE_USE_6_SPHERICAL_REFLEXION_MAP,
00091 eTEXTURE_USE_6_SPHERE_REFLEXION_MAP,
00092 eTEXTURE_USE_6_SHADOW_MAP,
00093 eTEXTURE_USE_6_LIGHT_MAP,
00094 eTEXTURE_USE_6_BUMP_NORMAL_MAP
00095 } ETextureUse6;
00096
00101 typedef enum
00102 {
00103 eREPEAT,
00104 eCLAMP
00105 } EWrapMode;
00106
00113 typedef enum
00114 {
00115 eTRANSLUCENT,
00116 eADDITIVE,
00117 eMODULATE,
00118 eMODULATE2
00119 } EBlendMode;
00120
00127 typedef enum
00128 {
00129 eLEFT = 0,
00130 eRIGHT,
00131 eTOP,
00132 eBOTTOM
00133 } EAlignMode;
00134
00140 typedef enum
00141 {
00142 eU = 0,
00143 eV,
00144 eW
00145 } ECoordinates;
00146
00147
00148 KFbxTypedProperty<ETextureUse6> TextureTypeUse;
00149 KFbxTypedProperty<fbxDouble1> Alpha;
00150
00151
00152 KFbxTypedProperty<EUnifiedMappingType> CurrentMappingType;
00153 KFbxTypedProperty<EWrapMode> WrapModeU;
00154 KFbxTypedProperty<EWrapMode> WrapModeV;
00155 KFbxTypedProperty<fbxBool1> UVSwap;
00156
00157
00158 KFbxTypedProperty<fbxDouble3> Translation;
00159 KFbxTypedProperty<fbxDouble3> Rotation;
00160 KFbxTypedProperty<fbxDouble3> Scaling;
00161 KFbxTypedProperty<fbxDouble3> RotationPivot;
00162 KFbxTypedProperty<fbxDouble3> ScalingPivot;
00163
00164
00165 KFbxTypedProperty<fbxBool1> UseMaterial;
00166 KFbxTypedProperty<fbxBool1> UseMipMap;
00167
00168
00169 KFbxTypedProperty<EBlendMode> CurrentTextureBlendMode;
00170
00171
00172 KFbxTypedProperty<fbxString> UVSet;
00173
00177 void Reset();
00178
00184 bool SetFileName(char const* pName);
00185
00191 bool SetRelativeFileName(char const* pName);
00192
00193 #ifdef KARCH_DEV_MACOSX_CFM
00194 bool SetFile(const FSSpec &pMacFileSpec);
00195 bool SetFile(const FSRef &pMacFileRef);
00196 bool SetFile(const CFURLRef &pMacURL);
00197 #endif
00198
00203 char const* GetFileName () const;
00204
00209 char const* GetRelativeFileName() const;
00210
00211 #ifdef KARCH_DEV_MACOSX_CFM
00212 bool GetFile(FSSpec &pMacFileSpec) const;
00213 bool GetFile(FSRef &pMacFileRef) const;
00214 bool GetFile(CFURLRef &pMacURL) const;
00215 #endif
00216
00221 void SetSwapUV(bool pSwapUV);
00222
00227 bool GetSwapUV() const;
00228
00234 typedef enum
00235 {
00236 eNONE,
00237 eRGB_INTENSITY,
00238 eBLACK
00239 } EAlphaSource;
00240
00244 void SetAlphaSource(EAlphaSource pAlphaSource);
00245
00249 EAlphaSource GetAlphaSource() const;
00250
00260 void SetCropping(int pLeft, int pTop, int pRight, int pBottom);
00261
00265 int GetCroppingLeft() const;
00266
00270 int GetCroppingTop() const;
00271
00275 int GetCroppingRight() const;
00276
00280 int GetCroppingBottom() const;
00281
00292 typedef enum
00293 {
00294 eNULL,
00295 ePLANAR,
00296 eSPHERICAL,
00297 eCYLINDRICAL,
00298 eBOX,
00299 eFACE,
00300 eUV,
00301 eENVIRONMENT
00302 } EMappingType;
00303
00307 void SetMappingType(EMappingType pMappingType);
00308
00312 EMappingType GetMappingType() const;
00313
00319 typedef enum
00320 {
00321 ePLANAR_NORMAL_X,
00322 ePLANAR_NORMAL_Y,
00323 ePLANAR_NORMAL_Z
00324 } EPlanarMappingNormal;
00325
00329 void SetPlanarMappingNormal(EPlanarMappingNormal pPlanarMappingNormal);
00330
00334 EPlanarMappingNormal GetPlanarMappingNormal() const;
00335
00340 typedef enum
00341 {
00342 eMODEL_MATERIAL,
00343 eDEFAULT_MATERIAL
00344 } EMaterialUse;
00345
00349 void SetMaterialUse(EMaterialUse pMaterialUse);
00350
00354 EMaterialUse GetMaterialUse() const;
00355
00364 typedef enum
00365 {
00366 eSTANDARD,
00367 eSHADOW_MAP,
00368 eLIGHT_MAP,
00369 eSPHERICAL_REFLEXION_MAP,
00370 eSPHERE_REFLEXION_MAP,
00371 eBUMP_NORMAL_MAP
00372 } ETextureUse;
00373
00377 void SetTextureUse(ETextureUse pTextureUse);
00378
00382 ETextureUse GetTextureUse() const;
00383
00384
00389 void SetWrapMode(EWrapMode pWrapU, EWrapMode pWrapV);
00390
00394 EWrapMode GetWrapModeU() const;
00395
00399 EWrapMode GetWrapModeV() const;
00400
00401
00405 void SetBlendMode(EBlendMode pBlendMode);
00406
00410 EBlendMode GetBlendMode() const;
00411
00413
00420
00430 inline void SetDefaultT(const KFbxVector4& pT) { Translation.Set( pT ); }
00431
00442 KFbxVector4& GetDefaultT(KFbxVector4& pT) const;
00443
00452 inline void SetDefaultR(const KFbxVector4& pR) { Rotation.Set( fbxDouble3(pR[0],pR[1],pR[2]) ); }
00453
00463 KFbxVector4& GetDefaultR(KFbxVector4& pR) const;
00464
00472 inline void SetDefaultS(const KFbxVector4& pS) { Scaling.Set( fbxDouble3(pS[0],pS[1],pS[2]) ); }
00473
00482 KFbxVector4& GetDefaultS(KFbxVector4& pS) const;
00483
00487 void SetDefaultAlpha(double pAlpha);
00488
00492 double GetDefaultAlpha() const;
00493
00495
00504
00513 void SetTranslation(double pU,double pV);
00514
00519 double GetTranslationU() const;
00520
00525 double GetTranslationV() const;
00526
00534 void SetRotation(double pU, double pV, double pW = 0.0);
00535
00537 double GetRotationU() const;
00538
00540 double GetRotationV() const;
00541
00543 double GetRotationW() const;
00544
00551 void SetScale(double pU,double pV);
00552
00557 double GetScaleU() const;
00558
00563 double GetScaleV() const;
00564
00566
00567
00568
00569
00570
00571
00573
00574 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00575
00576 bool operator==(KFbxTexture const& pTexture) const;
00577
00578 KString& GetMediaName();
00579 void SetMediaName(char const* pMediaName);
00580
00581 void SetUVTranslation(KFbxVector2& pT);
00582 KFbxVector2& GetUVTranslation();
00583 void SetUVScaling(KFbxVector2& pS);
00584 KFbxVector2& GetUVScaling();
00585
00586 KString GetTextureType();
00587
00588
00589
00590 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00591
00592 protected:
00593 KFbxTexture(KFbxSdkManager& pManager, char const* pName);
00594 virtual ~KFbxTexture();
00595
00596 virtual void Construct(const KFbxTexture* pFrom);
00597 virtual bool ConstructProperties(bool pForceSet);
00598 virtual void Destruct(bool pRecursive, bool pDependents);
00599
00601 KFbxTexture& operator=(KFbxTexture const& pTexture);
00602
00603 virtual KStringList GetTypeFlags() const;
00604
00605 void Init();
00606 void SyncVideoFileName(char const* pFileName);
00607 void SyncVideoRelativeFileName(char const* pFileName);
00608
00609 int mTillingUV[2];
00610 int mCropping[4];
00611
00612 EAlphaSource mAlphaSource;
00613 EMappingType mMappingType;
00614 EPlanarMappingNormal mPlanarMappingNormal;
00615
00616 KString mFileName;
00617 KString mRelativeFileName;
00618 KString mMediaName;
00619
00620 static KError smError;
00621
00622
00623
00624
00625 KFbxVector2 mUVScaling;
00626 KFbxVector2 mUVTranslation;
00627
00628 friend class KFbxLayerContainer;
00629
00630 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
00631
00632 };
00633
00634 inline EFbxType FbxTypeOf( KFbxTexture::EUnifiedMappingType const &pItem ) { return eENUM; }
00635 inline EFbxType FbxTypeOf( KFbxTexture::ETextureUse6 const &pItem ) { return eENUM; }
00636 inline EFbxType FbxTypeOf( KFbxTexture::EWrapMode const &pItem ) { return eENUM; }
00637 inline EFbxType FbxTypeOf( KFbxTexture::EBlendMode const &pItem ) { return eENUM; }
00638
00639 typedef KFbxTexture* HKFbxTexture;
00640
00641 #include <fbxfilesdk/fbxfilesdk_nsend.h>
00642
00643 #endif // FBXFILESDK_KFBXPLUGINS_KFBXTEXTURE_H
00644