fbximplementation.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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 fbximplementation.h
  9. #ifndef _FBXSDK_SCENE_SHADING_IMPLEMENTATION_H_
  10. #define _FBXSDK_SCENE_SHADING_IMPLEMENTATION_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/core/fbxobject.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. class FbxBindingOperator;
  15. class FbxBindingTable;
  16. /** This object represents the shading node implementation.
  17. * It defines basic information about the shader and the binding table(FbxBindingTable).
  18. * For example, you can create a new FbxImplementation like this:
  19. * \code
  20. * FbxImplementation* lImpl = FbxImplementation::Create( &pMyScene, "MyImplementation" );
  21. * pMyObject.AddImplementation( lImpl );
  22. * pMyObject.SetDefaultImplementation( lImpl );
  23. * lImpl->RenderAPI = FBXSDK_RENDERING_API_DIRECTX; //FBXSDK_RENDERING_API_DIRECTX, FBXSDK_RENDERING_API_OPENGL, FBXSDK_RENDERING_API_MENTALRAY or FBXSDK_RENDERING_API_PREVIEW
  24. * lImpl->RenderAPIVersion = "9.0"; //API Version
  25. *
  26. * lImpl->Language = FBXSDK_SHADING_LANGUAGE_HLSL; //FBXSDK_SHADING_LANGUAGE_HLSL, FBXSDK_SHADING_LANGUAGE_GLSL, FBXSDK_SHADING_LANGUAGE_CGFX or FBXSDK_SHADING_LANGUAGE_MRSL
  27. * lImpl->LanguageVersion = "1.0"; //Language Version
  28. * \endcode
  29. *
  30. * After the new FbxImplementation is created, you can access FbxBindingTable like this:
  31. * \code
  32. * FbxBindingTable* lTable = lImpl->GetTableByTargetName("root");
  33. * \endcode
  34. * Also, you can access the exist FbxImplementation in FbxObject by this:
  35. * \code
  36. * const FbxImplementation* lImpl = GetImplementation( pMyObject, FBXSDK_IMPLEMENTATION_CGFX ); // FBXSDK_IMPLEMENTATION_PREVIEW, FBXSDK_IMPLEMENTATION_MENTALRAY, FBXSDK_IMPLEMENTATION_CGFX, FBXSDK_IMPLEMENTATION_HLSL, FBXSDK_IMPLEMENTATION_OGS or FBXSDK_IMPLEMENTATION_NONE
  37. * \endcode
  38. * \nosubgrouping
  39. * \see FbxImplementationFilter
  40. */
  41. class FBXSDK_DLL FbxImplementation : public FbxObject
  42. {
  43. FBXSDK_OBJECT_DECLARE(FbxImplementation, FbxObject);
  44. public:
  45. /**
  46. * \name Target Name.
  47. */
  48. //@{
  49. FbxString RenderName;
  50. //@}
  51. /**
  52. * \name Shader Language and API descriptions.
  53. */
  54. //@{
  55. /** Shader Language.
  56. * \see FBXSDK_SHADING_LANGUAGE_HLSL, FBXSDK_SHADING_LANGUAGE_GLSL, FBXSDK_SHADING_LANGUAGE_CGFX and FBXSDK_SHADING_LANGUAGE_MRSL in conventions.h
  57. */
  58. FbxPropertyT<FbxString> Language;
  59. //! Shader Language version.
  60. FbxPropertyT<FbxString> LanguageVersion;
  61. /** Render API.
  62. * \see FBXSDK_SHADING_LANGUAGE_HLSL, FBXSDK_SHADING_LANGUAGE_GLSL, FBXSDK_SHADING_LANGUAGE_CGFX and FBXSDK_SHADING_LANGUAGE_MRSL in conventions.h
  63. */
  64. FbxPropertyT<FbxString> RenderAPI;
  65. //! Render API version.
  66. FbxPropertyT<FbxString> RenderAPIVersion;
  67. //@}
  68. /**
  69. * \name Binding description
  70. */
  71. //@{
  72. //! Name of root binding table.
  73. FbxPropertyT<FbxString> RootBindingName;
  74. //! Property to store the shader parameters(constants) values in this implementation.
  75. FbxProperty GetConstants() const;
  76. /** Add a new binding table to the table list.
  77. * \param pTargetName The target name for the binding table.
  78. * \param pTargetType The target type for the binding table.
  79. * \return the new binding table.
  80. */
  81. FbxBindingTable* AddNewTable( const char* pTargetName, const char* pTargetType );
  82. /** Retrieves a handle on the root binding table.
  83. * \return A const pointer to the root table or NULL if it does not exist.
  84. */
  85. const FbxBindingTable* GetRootTable() const;
  86. /** Retrieves a handle on the root binding table.
  87. * \return A pointer to the root table or NULL if it does not exist.
  88. */
  89. FbxBindingTable* GetRootTable();
  90. /** Gets the number of binding tables.
  91. * \return the number of binding tables.
  92. */
  93. int GetTableCount() const;
  94. /** Retrieves a handle on the (pIndex)th binding table.
  95. * \param pIndex The index of the table to retrieve. Valid values are [ 0, GetTableCount() ).
  96. * \return A const pointer to the pIndex-th table or NULL if pIndex is out of range.
  97. */
  98. const FbxBindingTable* GetTable( int pIndex ) const;
  99. /** Retrieves a handle on the (pIndex)th binding table.
  100. * \param pIndex The index of the table to retrieve. Valid values are [ 0, GetTableCount() ).
  101. * \return A const pointer to the pIndex-th table or NULL if pIndex is out of range.
  102. */
  103. FbxBindingTable* GetTable( int pIndex );
  104. /** Returns the binding table that has the given target name.
  105. * \param pName The target name of the table to look for.
  106. * \return A const pointer to the binding table with the given target name, or NULL if there is no such binding table.
  107. */
  108. const FbxBindingTable* GetTableByTargetName( const char* pName ) const;
  109. /** Returns the binding table that has the given target name.
  110. * \param pName The target name of the table to look for.
  111. * \return A pointer to the binding table with the given target name, or NULL if there is no such binding table.
  112. */
  113. FbxBindingTable* GetTableByTargetName( const char* pName );
  114. /** Returns the binding table that has the given target type.
  115. * \param pTargetName The target type to look for.
  116. * \return A const pointer to the binding table with the given target type, or NULL if there is no such binding table.
  117. */
  118. const FbxBindingTable* GetTableByTargetType( const char* pTargetName ) const;
  119. /** Returns the binding table that has the given target type.
  120. * \param pTargetName The target type to look for.
  121. * \return A pointer to the binding table with the given target type, or NULL if there is no such binding table.
  122. */
  123. FbxBindingTable* GetTableByTargetType( const char* pTargetName );
  124. /** Add a new binding operator to the operator list.
  125. * \param pTargetName The target name for the binding operator.
  126. * \param pFunctionName The function name for the binding operator.
  127. * \return The new operator.
  128. */
  129. FbxBindingOperator* AddNewBindingOperator( const char* pTargetName, const char* pFunctionName );
  130. /** Gets the number of binding operators.
  131. * \return the number of binding operators.
  132. */
  133. int GetBindingOperatorCount() const;
  134. /** Returns the binding operator that has the given name.
  135. * \param pTargetName The target name of the binding operator to look for.
  136. * \return A const pointer to the binding operator with the given name, or NULL if there is no such binding table.
  137. */
  138. const FbxBindingOperator* GetOperatorByTargetName( const char* pTargetName ) const;
  139. //@}
  140. /**
  141. * \name Static values
  142. */
  143. //@{
  144. // property names
  145. /** Shader Language name.
  146. * \see Language
  147. */
  148. static const char* sLanguage;
  149. /** Shader Language version.
  150. * \see LanguageVersion
  151. */
  152. static const char* sLanguageVersion;
  153. /** Shader render API.
  154. * \see RenderAPI
  155. */
  156. static const char* sRenderAPI;
  157. /** Shader render API version.
  158. * \see RenderAPIVersion
  159. */
  160. static const char* sRenderAPIVersion;
  161. /** Name of root binding table.
  162. * \see RootBindingName
  163. */
  164. static const char* sRootBindingName;
  165. /** Name of property to store the shader parameters(constants) values in this implementation.
  166. * \see GetConstants
  167. */
  168. static const char* sConstants;
  169. //! default value for implementation type.
  170. static const char* sDefaultType;
  171. //! default value for shader language.
  172. static const char* sDefaultLanguage;
  173. //! default value for shader language version.
  174. static const char* sDefaultLanguageVersion;
  175. //! default value for shader render API.
  176. static const char* sDefaultRenderAPI;
  177. //! default value for shader render API version.
  178. static const char* sDefaultRenderAPIVersion;
  179. //! default value for root binding table name.
  180. static const char* sDefaultRootBindingName;
  181. //@}
  182. /*****************************************************************************************************************************
  183. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  184. *****************************************************************************************************************************/
  185. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  186. protected:
  187. virtual void ConstructProperties(bool pForceSet);
  188. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  189. };
  190. #include <fbxsdk/fbxsdk_nsend.h>
  191. #endif /* _FBXSDK_SCENE_SHADING_IMPLEMENTATION_H_ */