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 =========================================================================*/
20 #ifndef vtkShader_h
21 #define vtkShader_h
22 
23 #include "vtkRenderingOpenGL2Module.h" // for export macro
24 #include "vtkObject.h"
25 
26 #include <string> // For member variables.
27 #include <vector> // For member variables.
28 
36 class VTKRENDERINGOPENGL2_EXPORT vtkShader : public vtkObject
37 {
38 public:
39  static vtkShader *New();
40  vtkTypeMacro(vtkShader, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent);
42 
43 
45  enum Type {
49  Unknown
50  };
51 
53  void SetType(Type type);
54 
56  Type GetType() const { return this->ShaderType; }
57 
59  void SetSource(const std::string &source);
60 
62  std::string GetSource() const { return this->Source; }
63 
65  std::string GetError() const { return this->Error; }
66 
68  int GetHandle() const { return this->Handle; }
69 
73  bool Compile();
74 
79  void Cleanup();
80 
81 protected:
82  vtkShader();
83  ~vtkShader();
84 
86  int Handle;
87  bool Dirty;
88 
91 
92 private:
93  vtkShader(const vtkShader&); // Not implemented.
94  void operator=(const vtkShader&); // Not implemented.
95 };
96 
97 
98 #endif
Type GetType() const
Get the shader type, typically Vertex or Fragment.
Definition: vtkShader.h:56
abstract base class for most VTK objects
Definition: vtkObject.h:61
Geometry shader.
Definition: vtkShader.h:48
Type
Available shader types.
Definition: vtkShader.h:45
std::string Error
Definition: vtkShader.h:90
Fragment shader.
Definition: vtkShader.h:47
bool Dirty
Definition: vtkShader.h:87
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:68
std::string Source
Definition: vtkShader.h:89
std::string GetError() const
Get the error message (empty if none) for the shader.
Definition: vtkShader.h:65
int Handle
Definition: vtkShader.h:86
Type ShaderType
Definition: vtkShader.h:85
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:36
std::string GetSource() const
Get the source for the shader.
Definition: vtkShader.h:62
static vtkObject * New()
Vertex shader.
Definition: vtkShader.h:46