HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GLTF_OGLMaterialCodec.h
Go to the documentation of this file.
1 #ifndef __GLTF_OGLMaterialCodec_h__
2 #define __GLTF_OGLMaterialCodec_h__
3 
4 #include "GLTFZ_API.h"
5 #include "GLTF_Codec.h"
6 #include "GLTF_ImportOptions.h"
7 #include "GLTF_Types.h"
8 
9 #include <UT/UT_Set.h>
10 #include <UT/UT_StringHolder.h>
11 
12 class GLTF_ErrorManager;
13 class GLTF_Reader;
14 class GU_Detail;
15 
17 {
18 public:
19  explicit GLTF_OGLMaterialCodec(const GLTF_ImportOptions& options)
20  : GLTF_Codec(options)
21  {
22 
23  }
24  virtual ~GLTF_OGLMaterialCodec() override {}
25 
26  static bool isExtensionSupported(const char* ext_name)
27  {
28  static const UT_Set<UT_StringHolder> theSupportedExtensions{
29  "KHR_materials_emissive_strength"
30  };
31  return theSupportedExtensions.contains(ext_name);
32  }
33 
35  GU_Detail& gdp,
36  const GLTF_Index mesh_idx,
37  const GLTF_Index prim_idx,
38  const GLTF_MeshInfo& mesh_info,
39  GLTF_Reader& reader,
40  GLTF_ErrorManager& errors) override
41  {
42  return false;
43  }
44 
45  bool importMaterial(
46  GU_Detail& gdp,
47  const GLTF_Index mat_idx,
48  GLTF_Reader& reader,
49  GLTF_ErrorManager& errors,
50  GA_AttributeOwner mat_attribs_owner=GA_ATTRIB_PRIMITIVE) override;
51 
52 };
53 
54 #endif // __GLTF_OGLMaterialCodec_h__
virtual ~GLTF_OGLMaterialCodec() override
bool importMeshPrimitive(GU_Detail &gdp, const GLTF_Index mesh_idx, const GLTF_Index prim_idx, const GLTF_MeshInfo &mesh_info, GLTF_Reader &reader, GLTF_ErrorManager &errors) override
std::size_t GLTF_Index
Definition: GLTF_Types.h:13
static bool isExtensionSupported(const char *ext_name)
GA_AttributeOwner
Definition: GA_Types.h:35
virtual bool importMaterial(GU_Detail &gdp, const GLTF_Index mat_idx, GLTF_Reader &reader, GLTF_ErrorManager &errors, GA_AttributeOwner mat_attribs_owner=GA_ATTRIB_PRIMITIVE)=0
#define GLTFZ_API
Definition: GLTFZ_API.h:37
bool contains(const K &key) const
Definition: UT_Set.h:108
GLTF_OGLMaterialCodec(const GLTF_ImportOptions &options)