VTK
vtkShader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4 
5  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
23 #ifndef vtkShader_h
24 #define vtkShader_h
25 
26 #include "vtkRenderingOpenGL2Module.h" // for export macro
27 #include "vtkObject.h"
28 
29 #include <string> // For member variables.
30 #include <vector> // For member variables.
31 
40 {
41 public:
42  static vtkShader *New();
43  vtkTypeMacro(vtkShader, vtkObject);
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
46 
48  enum Type {
52  Unknown
53  };
54 
56  void SetType(Type type);
57 
59  Type GetType() const { return this->ShaderType; }
60 
62  void SetSource(const std::string &source);
63 
65  std::string GetSource() const { return this->Source; }
66 
68  std::string GetError() const { return this->Error; }
69 
71  int GetHandle() const { return this->Handle; }
72 
76  bool Compile();
77 
82  void Cleanup();
83 
84 protected:
85  vtkShader();
86  ~vtkShader();
87 
89  int Handle;
90  bool Dirty;
91 
94 
95 private:
96  vtkShader(const vtkShader&); // Not implemented.
97  void operator=(const vtkShader&); // Not implemented.
98 };
99 
100 
101 #endif
Type GetType() const
Get the shader type, typically Vertex or Fragment.
Definition: vtkShader.h:59
abstract base class for most VTK objects
Definition: vtkObject.h:61
Geometry shader.
Definition: vtkShader.h:51
Type
Available shader types.
Definition: vtkShader.h:48
#define VTKRENDERINGOPENGL2_EXPORT
std::string Error
Definition: vtkShader.h:93
Fragment shader.
Definition: vtkShader.h:50
bool Dirty
Definition: vtkShader.h:90
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
int GetHandle() const
Get the handle of the shader.
Definition: vtkShader.h:71
std::string Source
Definition: vtkShader.h:92
std::string GetError() const
Get the error message (empty if none) for the shader.
Definition: vtkShader.h:68
int Handle
Definition: vtkShader.h:89
Type ShaderType
Definition: vtkShader.h:88
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Vertex or Fragment shader, combined into a ShaderProgram.
Definition: vtkShader.h:39
std::string GetSource() const
Get the source for the shader.
Definition: vtkShader.h:65
static vtkObject * New()
Vertex shader.
Definition: vtkShader.h:49