VTK
vtkOSPRayMaterialLibrary.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOSPRayMaterialLibrary.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef vtkOSPRayMaterialLibrary_h
26 #define vtkOSPRayMaterialLibrary_h
27 
28 #include "vtkRenderingOSPRayModule.h" // For export macro
29 #include "vtkObject.h"
30 
31 #include <set> //for set
32 #include <vector> //for set
33 
34 class vtkOSPRayMaterialLibraryInternals;
35 class vtkTexture;
36 
37 class VTKRENDERINGOSPRAY_EXPORT vtkOSPRayMaterialLibrary : public vtkObject
38 {
39 public:
40  static vtkOSPRayMaterialLibrary *New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void Fire();
48 
54  bool ReadFile(const char*FileName);
55 
59  const char *WriteBuffer();
60 
66  bool ReadBuffer(const char*Buffer);
67 
71  std::set<std::string> GetMaterialNames();
72 
76  std::string LookupImplName(const std::string& nickname);
77 
81  std::vector<double> GetDoubleShaderVariable(const std::string& nickname, const std::string& varname);
82 
86  vtkTexture* GetTexture(const std::string& nickname, const std::string& varname);
87 
93  void AddMaterial(const std::string& nickname, const std::string& implname);
94 
99  void AddTexture(const std::string& nickname, const std::string& texturename, vtkTexture* tex);
100 
105  void AddShaderVariable(const std::string& nickname, const std::string& variablename, int numVars, double *x);
106 
107 
108 protected:
110  virtual ~vtkOSPRayMaterialLibrary();
111 
112  bool InternalParse(const char *name, bool IsFile);
113  bool InternalParseJSON(const char *name, bool IsFile, std::istream *doc);
114  bool InternalParseMTL(const char *name, bool IsFile, std::istream *doc);
115 
116 private:
118  void operator=(const vtkOSPRayMaterialLibrary&) = delete;
119 
120  vtkOSPRayMaterialLibraryInternals *Internal;
121 };
122 
123 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:53
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a collection of materials for vtk apps to draw from
a simple class to control print indentation
Definition: vtkIndent.h:33
handles properties associated with a texture map
Definition: vtkTexture.h:65
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...