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
00114 typedef enum
00115 {
00116 eTRANSLUCENT,
00117 eADDITIVE,
00118 eMODULATE,
00119 eMODULATE2,
00120 eOVER
00121 } EBlendMode;
00122
00129 typedef enum
00130 {
00131 eLEFT = 0,
00132 eRIGHT,
00133 eTOP,
00134 eBOTTOM
00135 } EAlignMode;
00136
00142 typedef enum
00143 {
00144 eU = 0,
00145 eV,
00146 eW
00147 } ECoordinates;
00148
00149
00150 KFbxTypedProperty<ETextureUse6> TextureTypeUse;
00151 KFbxTypedProperty<fbxDouble1> Alpha;
00152
00153
00154 KFbxTypedProperty<EUnifiedMappingType> CurrentMappingType;
00155 KFbxTypedProperty<EWrapMode> WrapModeU;
00156 KFbxTypedProperty<EWrapMode> WrapModeV;
00157 KFbxTypedProperty<fbxBool1> UVSwap;
00158
00159
00160 KFbxTypedProperty<fbxDouble3> Translation;
00161 KFbxTypedProperty<fbxDouble3> Rotation;
00162 KFbxTypedProperty<fbxDouble3> Scaling;
00163 KFbxTypedProperty<fbxDouble3> RotationPivot;
00164 KFbxTypedProperty<fbxDouble3> ScalingPivot;
00165
00166
00167 KFbxTypedProperty<fbxBool1> UseMaterial;
00168 KFbxTypedProperty<fbxBool1> UseMipMap;
00169
00170
00171 KFbxTypedProperty<EBlendMode> CurrentTextureBlendMode;
00172
00173
00174 KFbxTypedProperty<fbxString> UVSet;
00175
00179 void Reset();
00180
00186 bool SetFileName(char const* pName);
00187
00193 bool SetRelativeFileName(char const* pName);
00194
00195 #ifdef KARCH_DEV_MACOSX_CFM
00196 bool SetFile(const FSSpec &pMacFileSpec);
00197 bool SetFile(const FSRef &pMacFileRef);
00198 bool SetFile(const CFURLRef &pMacURL);
00199 #endif
00200
00205 char const* GetFileName () const;
00206
00211 char const* GetRelativeFileName() const;
00212
00213 #ifdef KARCH_DEV_MACOSX_CFM
00214 bool GetFile(FSSpec &pMacFileSpec) const;
00215 bool GetFile(FSRef &pMacFileRef) const;
00216 bool GetFile(CFURLRef &pMacURL) const;
00217 #endif
00218
00223 void SetSwapUV(bool pSwapUV);
00224
00229 bool GetSwapUV() const;
00230
00236 typedef enum
00237 {
00238 eNONE,
00239 eRGB_INTENSITY,
00240 eBLACK
00241 } EAlphaSource;
00242
00246 void SetAlphaSource(EAlphaSource pAlphaSource);
00247
00251 EAlphaSource GetAlphaSource() const;
00252
00262 void SetCropping(int pLeft, int pTop, int pRight, int pBottom);
00263
00267 int GetCroppingLeft() const;
00268
00272 int GetCroppingTop() const;
00273
00277 int GetCroppingRight() const;
00278
00282 int GetCroppingBottom() const;
00283
00294 typedef enum
00295 {
00296 eNULL,
00297 ePLANAR,
00298 eSPHERICAL,
00299 eCYLINDRICAL,
00300 eBOX,
00301 eFACE,
00302 eUV,
00303 eENVIRONMENT
00304 } EMappingType;
00305
00309 void SetMappingType(EMappingType pMappingType);
00310
00314 EMappingType GetMappingType() const;
00315
00321 typedef enum
00322 {
00323 ePLANAR_NORMAL_X,
00324 ePLANAR_NORMAL_Y,
00325 ePLANAR_NORMAL_Z
00326 } EPlanarMappingNormal;
00327
00331 void SetPlanarMappingNormal(EPlanarMappingNormal pPlanarMappingNormal);
00332
00336 EPlanarMappingNormal GetPlanarMappingNormal() const;
00337
00342 typedef enum
00343 {
00344 eMODEL_MATERIAL,
00345 eDEFAULT_MATERIAL
00346 } EMaterialUse;
00347
00351 void SetMaterialUse(EMaterialUse pMaterialUse);
00352
00356 EMaterialUse GetMaterialUse() const;
00357
00366 typedef enum
00367 {
00368 eSTANDARD,
00369 eSHADOW_MAP,
00370 eLIGHT_MAP,
00371 eSPHERICAL_REFLEXION_MAP,
00372 eSPHERE_REFLEXION_MAP,
00373 eBUMP_NORMAL_MAP
00374 } ETextureUse;
00375
00379 void SetTextureUse(ETextureUse pTextureUse);
00380
00384 ETextureUse GetTextureUse() const;
00385
00386
00391 void SetWrapMode(EWrapMode pWrapU, EWrapMode pWrapV);
00392
00396 EWrapMode GetWrapModeU() const;
00397
00401 EWrapMode GetWrapModeV() const;
00402
00403
00407 void SetBlendMode(EBlendMode pBlendMode);
00408
00412 EBlendMode GetBlendMode() const;
00413
00415
00422
00432 inline void SetDefaultT(const KFbxVector4& pT) { Translation.Set( pT ); }
00433
00444 KFbxVector4& GetDefaultT(KFbxVector4& pT) const;
00445
00454 inline void SetDefaultR(const KFbxVector4& pR) { Rotation.Set( fbxDouble3(pR[0],pR[1],pR[2]) ); }
00455
00465 KFbxVector4& GetDefaultR(KFbxVector4& pR) const;
00466
00474 inline void SetDefaultS(const KFbxVector4& pS) { Scaling.Set( fbxDouble3(pS[0],pS[1],pS[2]) ); }
00475
00484 KFbxVector4& GetDefaultS(KFbxVector4& pS) const;
00485
00489 void SetDefaultAlpha(double pAlpha);
00490
00494 double GetDefaultAlpha() const;
00495
00497
00506
00515 void SetTranslation(double pU,double pV);
00516
00521 double GetTranslationU() const;
00522
00527 double GetTranslationV() const;
00528
00536 void SetRotation(double pU, double pV, double pW = 0.0);
00537
00539 double GetRotationU() const;
00540
00542 double GetRotationV() const;
00543
00545 double GetRotationW() const;
00546
00553 void SetScale(double pU,double pV);
00554
00559 double GetScaleU() const;
00560
00565 double GetScaleV() const;
00566
00568
00569
00570
00571
00572
00573
00575
00576 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00577
00578 bool operator==(KFbxTexture const& pTexture) const;
00579
00580 KString& GetMediaName();
00581 void SetMediaName(char const* pMediaName);
00582
00583 void SetUVTranslation(KFbxVector2& pT);
00584 KFbxVector2& GetUVTranslation();
00585 void SetUVScaling(KFbxVector2& pS);
00586 KFbxVector2& GetUVScaling();
00587
00588 KString GetTextureType();
00589
00590
00591
00592 virtual KFbxObject* Clone(KFbxObject* pContainer, KFbxObject::ECloneType pCloneType) const;
00593
00594 protected:
00595 KFbxTexture(KFbxSdkManager& pManager, char const* pName);
00596
00597 virtual void Construct(const KFbxTexture* pFrom);
00598 virtual bool ConstructProperties(bool pForceSet);
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