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=========================================================================*/
24#ifndef vtkShader_h
25#define vtkShader_h
26
27#include "vtkRenderingOpenGL2Module.h" // for export macro
28#include "vtkObject.h"
29
30#include <string> // For member variables.
31#include <vector> // For member variables.
32
40class VTKRENDERINGOPENGL2_EXPORT vtkShader : public vtkObject
41{
42public:
43 static vtkShader *New();
44 vtkTypeMacro(vtkShader, vtkObject);
45 void PrintSelf(ostream& os, vtkIndent indent);
46
47
49 enum Type {
53 Unknown
54 };
55
58
60 Type GetType() const { return this->ShaderType; }
61
64
66 std::string GetSource() const { return this->Source; }
67
69 std::string GetError() const { return this->Error; }
70
72 int GetHandle() const { return this->Handle; }
73
77 bool Compile();
78
83 void Cleanup();
84
85protected:
88
90 int Handle;
91 bool Dirty;
92
95
96private:
97 vtkShader(const vtkShader&) VTK_DELETE_FUNCTION;
98 void operator=(const vtkShader&) VTK_DELETE_FUNCTION;
99};
100
101
102#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
Vertex or Fragment shader, combined into a ShaderProgram.
Definition: vtkShader.h:41
void Cleanup()
Delete the shader.
Type ShaderType
Definition: vtkShader.h:89
std::string Error
Definition: vtkShader.h:94
Type GetType() const
Get the shader type, typically Vertex or Fragment.
Definition: vtkShader.h:60
int Handle
Definition: vtkShader.h:90
static vtkShader * New()
std::string GetSource() const
Get the source for the shader.
Definition: vtkShader.h:66
std::string GetError() const
Get the error message (empty if none) for the shader.
Definition: vtkShader.h:69
bool Compile()
Compile the shader.
std::string Source
Definition: vtkShader.h:93
int GetHandle() const
Get the handle of the shader.
Definition: vtkShader.h:72
Type
Available shader types.
Definition: vtkShader.h:49
@ Vertex
Vertex shader.
Definition: vtkShader.h:50
@ Geometry
Geometry shader.
Definition: vtkShader.h:52
@ Fragment
Fragment shader.
Definition: vtkShader.h:51
bool Dirty
Definition: vtkShader.h:91
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetSource(const std::string &source)
Set the shader source to the supplied string.
void SetType(Type type)
Set the shader type.
@ type
Definition: vtkX3D.h:516
@ string
Definition: vtkX3D.h:490
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)