fbxfiletexture.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /****************************************************************************************
  2. Copyright (C) 2015 Autodesk, Inc.
  3. All rights reserved.
  4. Use of this software is subject to the terms of the Autodesk license agreement
  5. provided at the time of installation or download, or which otherwise accompanies
  6. this software in either electronic or hard copy form.
  7. ****************************************************************************************/
  8. //! \file fbxfiletexture.h
  9. #ifndef _FBXSDK_SCENE_SHADING_TEXTURE_FILE_H_
  10. #define _FBXSDK_SCENE_SHADING_TEXTURE_FILE_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/scene/shading/fbxtexture.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. /** This class describes image mapping on top of geometry.
  15. * \note To apply a texture to geometry, first connect the
  16. * geometry to a FbxSurfaceMaterial object (e.g. FbxSurfaceLambert)
  17. * and then connect one of its properties (e.g. Diffuse) to the
  18. * FbxFileTexture object.
  19. * \see FbxSurfaceLambert
  20. * \see FbxSurfacePhong
  21. * \see FbxSurfaceMaterial
  22. * \note For some example code, see also the CreateTexture() function
  23. * in the ExportScene03 of FBX SDK examples.
  24. * \nosubgrouping
  25. */
  26. class FBXSDK_DLL FbxFileTexture : public FbxTexture
  27. {
  28. FBXSDK_OBJECT_DECLARE(FbxFileTexture, FbxTexture);
  29. public:
  30. /**
  31. * \name Texture Properties
  32. */
  33. //@{
  34. /** This property handles the material use.
  35. * Default value is false.
  36. */
  37. FbxPropertyT<FbxBool> UseMaterial;
  38. /** This property handles the Mipmap use.
  39. * Default value is false.
  40. */
  41. FbxPropertyT<FbxBool> UseMipMap;
  42. /** Resets the default texture values.
  43. * \remarks The texture file name is not reset.
  44. */
  45. void Reset();
  46. /** Sets the associated texture file.
  47. * \param pName The absolute path of the texture file.
  48. * \return \c True if successful, returns \c false otherwise.
  49. * \remarks The texture file name must be valid, you cannot leave the name empty.
  50. */
  51. bool SetFileName(const char* pName);
  52. /** Sets the associated texture file.
  53. * \param pName The relative path of the texture file.
  54. * \return \c True if successful, returns \c false otherwise.
  55. * \remarks The texture file name must be valid.
  56. */
  57. bool SetRelativeFileName(const char* pName);
  58. /** Returns the absolute texture file path.
  59. * \return The absolute texture file path.
  60. * \remarks An empty string is returned if FbxFileTexture::SetFileName() has not been called before.
  61. */
  62. const char* GetFileName () const;
  63. /** Returns the relative texture file path.
  64. * \return The relative texture file path.
  65. * \remarks An empty string is returned if FbxFileTexture::SetRelativeFileName() has not been called before.
  66. */
  67. const char* GetRelativeFileName() const;
  68. /** \enum EMaterialUse Specify if texture uses model material.
  69. */
  70. enum EMaterialUse
  71. {
  72. eModelMaterial, //! Texture uses model material.
  73. eDefaultMaterial //! Texture does not use model material.
  74. };
  75. /** Sets the material use.
  76. * \param pMaterialUse Specify how texture uses model material.
  77. */
  78. void SetMaterialUse(EMaterialUse pMaterialUse);
  79. /** Returns the material use.
  80. * \return How the texture uses model material.
  81. */
  82. EMaterialUse GetMaterialUse() const;
  83. //@}
  84. /*****************************************************************************************************************************
  85. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  86. *****************************************************************************************************************************/
  87. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  88. virtual FbxObject& Copy(const FbxObject& pObject);
  89. bool operator==(FbxFileTexture const& pTexture) const;
  90. FbxString& GetMediaName();
  91. void SetMediaName(const char* pMediaName);
  92. protected:
  93. virtual void Construct(const FbxObject* pFrom);
  94. virtual void ConstructProperties(bool pForceSet);
  95. void Init();
  96. void SyncVideoFileName(const char* pFileName);
  97. void SyncVideoRelativeFileName(const char* pFileName);
  98. FbxString mFileName;
  99. FbxString mRelativeFileName;
  100. FbxString mMediaName; // not a prop
  101. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  102. };
  103. #include <fbxsdk/fbxsdk_nsend.h>
  104. #endif /* _FBXSDK_SCENE_SHADING_TEXTURE_FILE_H_ */