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