VTK  9.6.20260626
vtkANARIMaterialLibrary.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
20
21#ifndef vtkANARIMaterialLibrary_h
22#define vtkANARIMaterialLibrary_h
23
25#include "vtkRenderingAnariModule.h" // For export macro
26#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
27
28VTK_ABI_NAMESPACE_BEGIN
29
30class VTKRENDERINGANARI_EXPORT VTK_MARSHALAUTO vtkANARIMaterialLibrary
32{
33public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
44 void AddMaterial(const std::string& nickname, const std::string& implname) override;
45
54 void AddTexture(const std::string& nickname, const std::string& varname, vtkTexture* tex,
55 const std::string& texturename = "unnamedTexture", const std::string& filename = "") override;
56
62 void AddShaderVariable(const std::string& nickname, const std::string& variablename, int numVars,
63 const double* x) override;
64
68 const std::map<std::string, ParametersMap>& GetParametersDictionary() const override;
69
70protected:
75 bool ReadTextureFileOrData(const std::string& texFilenameOrData, bool fromfile,
76 const std::string& parentDir, vtkTexture* textr, std::string& textureName,
77 std::string& textureFilename) override;
80
81 const char* GetFamilyName() const override { return "ANARI"; }
82 const char* GetAcceptedFamilyName() const override { return "ANARI"; }
83
84private:
86 void operator=(const vtkANARIMaterialLibrary&) = delete;
87};
88
89VTK_ABI_NAMESPACE_END
90#endif
a collection of materials for ANARI-based rendering
static vtkANARIMaterialLibrary * New()
const std::map< std::string, ParametersMap > & GetParametersDictionary() const override
Get the dictionary of all possible materials based on ANARI documentation.
bool ReadTextureFileOrData(const std::string &texFilenameOrData, bool fromfile, const std::string &parentDir, vtkTexture *textr, std::string &textureName, std::string &textureFilename) override
Load texture from file or inline XML data.
void AddMaterial(const std::string &nickname, const std::string &implname) override
Add Material Adds a new material nickname to the set of known materials.
const char * GetFamilyName() const override
void AddTexture(const std::string &nickname, const std::string &varname, vtkTexture *tex, const std::string &texturename="unnamedTexture", const std::string &filename="") override
Add Texture Given a material nickname and a shader variable varname, set its data to a specific textu...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetAcceptedFamilyName() const override
void AddShaderVariable(const std::string &nickname, const std::string &variablename, int numVars, const double *x) override
Add control variable Adds a new control variable validated against the ANARI parameter dictionary.
~vtkANARIMaterialLibrary() override
a simple class to control print indentation
Definition vtkIndent.h:108
handles properties associated with a texture map
Definition vtkTexture.h:168
#define VTK_MARSHALAUTO