18 #ifndef PRTX_MATERIAL_H_ 19 #define PRTX_MATERIAL_H_ 21 #include "prtx/prtx.h" 22 #include "prtx/Types.h" 23 #include "prtx/Attributable.h" 24 #include "prtx/Builder.h" 25 #include "prtx/Content.h" 26 #include "prtx/Shader.h" 27 #include "prtx/Texture.h" 28 #include "prtx/generated/BuiltinMaterialAttributes.h" 34 # pragma warning(push) 35 # pragma warning(disable : 4275) 207 static constexpr PrimitiveType PT_TEXTURE = PT_BLIND_DATA_ARRAY + 1;
208 static constexpr PrimitiveType PT_TEXTURE_ARRAY = PT_TEXTURE + 1;
209 static constexpr PrimitiveType PT_COUNT = prtx::Attributable::PT_COUNT + 2;
217 virtual bool hasKey (
const std::wstring& key)
const = 0;
218 virtual PrimitiveType getType (
const std::wstring& key)
const = 0;
219 virtual Bool getBool (
const std::wstring& key)
const = 0;
220 virtual int32_t getInt (
const std::wstring& key)
const = 0;
221 virtual double getFloat (
const std::wstring& key)
const = 0;
222 virtual const std::wstring& getString (
const std::wstring& key)
const = 0;
223 virtual const BoolVector& getBoolArray (
const std::wstring& key)
const = 0;
224 virtual const Int32Vector& getIntArray (
const std::wstring& key)
const = 0;
225 virtual const DoubleVector& getFloatArray (
const std::wstring& key)
const = 0;
226 virtual const WStringVector& getStringArray (
const std::wstring& key)
const = 0;
227 virtual void* getBlindData (
const std::wstring& key)
const = 0;
243 virtual TexturePtr getTexture(
const std::wstring& key)
const = 0;
254 virtual const TexturePtrVector& getTextureArray(
const std::wstring& key)
const = 0;
269 virtual TexturePtr getTextureArrayItem(
const std::wstring& key,
size_t index)
const = 0;
286 static std::pair<std::wstring, size_t> getShaderTextureArrayKeyAndIndexFromCGAMapName(
const std::wstring& cgaMapName);
296 typedef std::shared_ptr<MaterialBuilder> MaterialBuilderPtr;
328 virtual MaterialPtr createSharedAndReset(std::wstring* warnings = 0);
329 virtual MaterialPtr createShared(std::wstring* warnings = 0)
const;
335 virtual void setBool (
const std::wstring& key,
Bool val);
336 virtual void setInt (
const std::wstring& key, int32_t val);
337 virtual void setFloat (
const std::wstring& key,
double val);
338 virtual void setString (
const std::wstring& key,
const std::wstring& val);
339 virtual void setBoolArray (
const std::wstring& key,
const BoolVector& val);
340 virtual void setIntArray (
const std::wstring& key,
const Int32Vector& val);
341 virtual void setFloatArray (
const std::wstring& key,
const DoubleVector& val);
342 virtual void setStringArray (
const std::wstring& key,
const WStringVector& val);
343 virtual void setBlindData (
const std::wstring& key,
void* val);
355 virtual void setTexture(
const std::wstring& key,
const TexturePtr& val,
const std::wstring& resolveMapKey);
381 virtual void setTextureArrayItem(
const std::wstring& key,
size_t index,
const TexturePtr& val,
const std::wstring& resolveMapKey);
384 #include "prtx/generated/BuiltinMaterialAttributesBuilder_impl_decl.h" 387 MaterialImpl* mMaterial;
395 # pragma warning(pop) Definition: BuiltinMaterialAttributes.h:161
uint8_t Bool
uint8_t based Bool type
Definition: Types.h:30
std::shared_ptr< Texture > TexturePtr
shared Texture pointer
Definition: Texture.h:37
std::vector< prtx::Bool > BoolVector
vector of uint8_t based Bool type
Definition: Types.h:31
std::shared_ptr< Shader > ShaderPtr
shared Shader pointer
Definition: Shader.h:40
Definition: /Attributable.h:37
std::vector< double > DoubleVector
vector of double
Definition: Types.h:32
std::vector< TexturePtr > TexturePtrVector
vector of shared Texture pointers
Definition: Texture.h:39
std::shared_ptr< Material > MaterialPtr
shared Material pointer
Definition: DataBackend.h:45
Definition: /Attributable.h:139
Definition: Material.h:202
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
Definition: BuiltinMaterialAttributes.h:39
std::vector< MaterialPtr > MaterialPtrVector
vector of shared Material pointers
Definition: DataBackend.h:46
std::vector< int32_t > Int32Vector
vector of int32_t
Definition: Types.h:33
std::vector< std::wstring > WStringVector
vector of std::wstring
Definition: Types.h:35
Definition: Material.h:306