fbxsdk/scene/shading/fbxtexture.h Source File
 
 
 
fbxsdk/scene/shading/fbxtexture.h
Go to the documentation of this file.
00001 /****************************************************************************************
00002  
00003    Copyright (C) 2013 Autodesk, Inc.
00004    All rights reserved.
00005  
00006    Use of this software is subject to the terms of the Autodesk license agreement
00007    provided at the time of installation or download, or which otherwise accompanies
00008    this software in either electronic or hard copy form.
00009  
00010 ****************************************************************************************/
00011 
00013 #ifndef _FBXSDK_SCENE_SHADING_TEXTURE_H_
00014 #define _FBXSDK_SCENE_SHADING_TEXTURE_H_
00015 
00016 #include <fbxsdk/fbxsdk_def.h>
00017 
00018 #include <fbxsdk/core/fbxobject.h>
00019 
00020 #include <fbxsdk/fbxsdk_nsbegin.h>
00021 
00026 class FBXSDK_DLL FbxTexture : public FbxObject
00027 {
00028         FBXSDK_OBJECT_DECLARE(FbxTexture, FbxObject);
00029 
00030 public:
00040                 enum EUnifiedMappingType
00041                 { 
00042                         eUMT_UV,                        
00043                         eUMT_XY,                        
00044                         eUMT_YZ,                        
00045                         eUMT_XZ,                        
00046                         eUMT_SPHERICAL,         
00047                         eUMT_CYLINDRICAL,       
00048                         eUMT_ENVIRONMENT,       
00049                         eUMT_PROJECTION,        
00050                         eUMT_BOX,                       
00051                         eUMT_FACE,                      
00052                         eUMT_NO_MAPPING,        
00053                 };
00054 
00059                 enum ETextureUse6
00060                 {
00061                         eTEXTURE_USE_6_STANDARD,                                
00062                         eTEXTURE_USE_6_SPHERICAL_REFLEXION_MAP, 
00063                         eTEXTURE_USE_6_SPHERE_REFLEXION_MAP,    
00064                         eTEXTURE_USE_6_SHADOW_MAP,                              
00065                         eTEXTURE_USE_6_LIGHT_MAP,                               
00066                         eTEXTURE_USE_6_BUMP_NORMAL_MAP                  
00067                 };
00068 
00072                 enum EWrapMode
00073                 {
00074                         eRepeat,        
00075                         eClamp          
00076                 };
00077 
00080                 enum EBlendMode
00081                 {
00082                         eTranslucent,   
00083                         eAdditive,              
00084                         eModulate,              
00085                         eModulate2,             
00086                         eOver                   
00087         };
00088 
00091         enum EAlignMode
00092         {
00093             eLeft,      
00094             eRight,     
00095             eTop,       
00096             eBottom     
00097         };
00098 
00101         enum ECoordinates
00102         {
00103             eU, 
00104             eV, 
00105             eW  
00106         };
00107 
00108                 // Type description
00109 
00113                 FbxPropertyT<ETextureUse6>                      TextureTypeUse;
00114 
00118                 FbxPropertyT<FbxDouble>                 Alpha;
00119 
00120 
00121                 // Mapping information
00122 
00126                 FbxPropertyT<EUnifiedMappingType>       CurrentMappingType;
00127 
00131                 FbxPropertyT<EWrapMode>                 WrapModeU;
00132 
00136                 FbxPropertyT<EWrapMode>                 WrapModeV;
00137 
00142                 FbxPropertyT<FbxBool>                           UVSwap;
00143 
00148                 FbxPropertyT<FbxBool>                           PremultiplyAlpha;
00149 
00150                 // Texture positioning
00151 
00155                 FbxPropertyT<FbxDouble3>                        Translation;
00156 
00160                 FbxPropertyT<FbxDouble3>                        Rotation;
00161 
00165                 FbxPropertyT<FbxDouble3>                        Scaling;
00166 
00170                 FbxPropertyT<FbxDouble3>                        RotationPivot;
00171 
00175                 FbxPropertyT<FbxDouble3>                        ScalingPivot;
00176 
00177                 // Blend mode
00181                 FbxPropertyT<EBlendMode>        CurrentTextureBlendMode;
00182 
00183                 // UV set to use.
00187                 FbxPropertyT<FbxString>                 UVSet;
00188 
00193         static const char* sVectorSpace        ;
00194         static const char* sVectorSpaceWorld   ;
00195         static const char* sVectorSpaceObject  ;
00196         static const char* sVectorSpaceTangent ;
00197 
00202         static const char* sVectorEncoding     ;
00203         static const char* sVectorEncodingFP   ;
00204         static const char* sVectorEncodingSE   ;
00205 
00206 
00209         virtual void Reset();
00210 
00215     void SetSwapUV(bool pSwapUV);
00216 
00221     bool GetSwapUV() const;
00222 
00227     void SetPremultiplyAlpha(bool pPremultiplyAlpha);
00228 
00233     bool GetPremultiplyAlpha() const;
00234 
00237     enum EAlphaSource
00238     { 
00239         eNone,                  
00240         eRGBIntensity,  
00241         eBlack                  
00242     };
00243 
00247     void SetAlphaSource(EAlphaSource pAlphaSource);
00248 
00252         EAlphaSource GetAlphaSource() const;
00253 
00263     void SetCropping(int pLeft, int pTop, int pRight, int pBottom);
00264 
00268     int GetCroppingLeft() const;
00269 
00273     int GetCroppingTop() const;
00274 
00278     int GetCroppingRight() const;
00279 
00283     int GetCroppingBottom() const;
00284         
00287     enum EMappingType
00288     { 
00289         eNull,                  
00290         ePlanar,                
00291         eSpherical,             
00292         eCylindrical,   
00293         eBox,                   
00294         eFace,                  
00295         eUV,                    
00296                 eEnvironment    
00297     };
00298 
00302     void SetMappingType(EMappingType pMappingType);
00303 
00307     EMappingType GetMappingType() const;
00308 
00311     enum EPlanarMappingNormal
00312     { 
00313         ePlanarNormalX, 
00314         ePlanarNormalY, 
00315         ePlanarNormalZ  
00316     };
00317 
00321     void SetPlanarMappingNormal(EPlanarMappingNormal pPlanarMappingNormal);
00322 
00326     EPlanarMappingNormal GetPlanarMappingNormal() const;
00327 
00330         enum ETextureUse
00331         {
00332                 eStandard,                                      
00333                 eShadowMap,                                     
00334                 eLightMap,                                      
00335                 eSphericalReflectionMap,        
00336                 eSphereReflectionMap,           
00337                 eBumpNormalMap                          
00338         };
00339 
00343     void SetTextureUse(ETextureUse pTextureUse);
00344 
00348     ETextureUse GetTextureUse() const;
00349 
00350 
00355     void SetWrapMode(EWrapMode pWrapU, EWrapMode pWrapV);
00356 
00360     EWrapMode GetWrapModeU() const;
00361 
00365         EWrapMode GetWrapModeV() const;
00366 
00367 
00371         void SetBlendMode(EBlendMode pBlendMode);
00372 
00376         EBlendMode GetBlendMode() const;
00377 
00379 
00385 
00395         inline void SetDefaultT(const FbxVector4& pT) { Translation.Set( pT ); }
00396 
00407         FbxVector4& GetDefaultT(FbxVector4& pT) const;
00408 
00417         inline void SetDefaultR(const FbxVector4& pR) { Rotation.Set( FbxDouble3(pR[0],pR[1],pR[2]) ); }
00418 
00428         FbxVector4& GetDefaultR(FbxVector4& pR) const;
00429 
00437         inline void SetDefaultS(const FbxVector4& pS) { Scaling.Set( FbxDouble3(pS[0],pS[1],pS[2]) ); }
00438 
00446         FbxVector4& GetDefaultS(FbxVector4& pS) const;
00447 
00449 
00454 
00458         void SetDefaultAlpha(double pAlpha);
00459 
00463         double GetDefaultAlpha() const;
00464 
00466 
00474 
00481         void SetTranslation(double pU,double pV);
00482 
00487     double GetTranslationU() const;
00488 
00493     double GetTranslationV() const;
00494 
00502     void SetRotation(double pU, double pV, double pW = 0.0);
00503 
00505     double GetRotationU() const;
00506 
00508     double GetRotationV() const;
00509 
00511     double GetRotationW() const;
00512 
00519         void SetScale(double pU,double pV);
00520 
00525     double GetScaleU() const;
00526 
00531     double GetScaleV() const;
00533 
00534 /*****************************************************************************************************************************
00535 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
00536 *****************************************************************************************************************************/
00537 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00538         virtual FbxObject& Copy(const FbxObject& pObject);
00539 
00540         virtual bool operator==(FbxTexture const& pTexture) const;
00541 
00542         void SetUVTranslation(FbxVector2& pT);
00543         FbxVector2& GetUVTranslation();
00544         void SetUVScaling(FbxVector2& pS);
00545         FbxVector2& GetUVScaling();
00546 
00547         FbxString GetTextureType();
00548 
00549 protected:
00550         virtual void Construct(const FbxTexture* pFrom);
00551         virtual void ConstructProperties(bool pForceSet);
00552 
00553     virtual bool PropertyNotify(EPropertyNotifyType pType, FbxProperty& pProperty);
00554 
00555         void Init();
00556 
00557         int mCropping[4]; // not a prop
00558 
00559     EAlphaSource mAlphaSource; // now unused in MB (always set to None); not a prop
00560         EMappingType mMappingType; // CurrentMappingType
00561         EPlanarMappingNormal mPlanarMappingNormal; // CurrentMappingType
00562 
00563         // Unsupported parameters in the FBX SDK, these are declared but not accessible.
00564         // They are used to keep imported and exported data identical.
00565         FbxVector2 mUVScaling; // not a prop
00566         FbxVector2 mUVTranslation; // not a prop
00567 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
00568 };
00569 
00570 inline EFbxType FbxTypeOf(const FbxTexture::EUnifiedMappingType&){ return eFbxEnum; }
00571 inline EFbxType FbxTypeOf(const FbxTexture::ETextureUse6&){ return eFbxEnum; }
00572 inline EFbxType FbxTypeOf(const FbxTexture::EWrapMode&){ return eFbxEnum; }
00573 inline EFbxType FbxTypeOf(const FbxTexture::EBlendMode&){ return eFbxEnum; }
00574 
00575 #include <fbxsdk/fbxsdk_nsend.h>
00576 
00577 #endif /* _FBXSDK_SCENE_SHADING_TEXTURE_H_ */