VTK
vtkOpenGLProperty.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLProperty.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 =========================================================================*/
22 #ifndef __vtkOpenGLProperty_h
23 #define __vtkOpenGLProperty_h
24 
25 #include "vtkProperty.h"
26 
27 class vtkOpenGLRenderer;
28 class vtkShader2;
30 class vtkShaderProgram2;
32 
34 {
35 public:
36  static vtkOpenGLProperty *New();
38  virtual void PrintSelf(ostream& os, vtkIndent indent);
39 
41  void Render(vtkActor *a, vtkRenderer *ren);
42 
44  void BackfaceRender(vtkActor *a, vtkRenderer *ren);
45 
46  //BTX
48 
50  virtual void PostRender(vtkActor *a,
51  vtkRenderer *r);
53 
57  virtual void ReleaseGraphicsResources(vtkWindow *win);
58 
60 
62  vtkGetObjectMacro(PropProgram,vtkShaderProgram2);
63  void SetPropProgram(vtkShaderProgram2 *);
65 
67 
68  vtkGetObjectMacro(ShaderDeviceAdapter2,vtkGLSLShaderDeviceAdapter2);
70 
72 
73  vtkGetObjectMacro(CurrentShaderProgram2,vtkShaderProgram2);
74  //ETX
76 
78 
82  virtual void AddShaderVariable(const char *name,int numVars,int *x);
83  virtual void AddShaderVariable(const char *name,int numVars,float *x);
84  virtual void AddShaderVariable(const char *name,int numVars,double *x);
86 
87 protected:
90 
92  void LoadMultiTexturingExtensions(vtkRenderer* ren);
93 
95  virtual void ReadFrameworkMaterial();
96 
97  // Owned. Result of merging the shader program of the renderer and the
98  // PropProgram.
100 
104 
105  // Point to CachedShaderProgram2 if Shading is on and the context supports
106  // it.
108 
118 
119 
120 private:
121  vtkOpenGLProperty(const vtkOpenGLProperty&); // Not implemented.
122  void operator=(const vtkOpenGLProperty&); // Not implemented.
123 };
124 
125 #endif
virtual void ReadFrameworkMaterial()
GLSL Shader.
Definition: vtkShader2.h:59
vtkShaderProgram2 * LastPropProgram
virtual void Render(vtkActor *, vtkRenderer *)
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
static vtkProperty * New()
vtkGLSLShaderDeviceAdapter2 * ShaderDeviceAdapter2
vtkShader2 * DefaultPropFS
vtkShader2 * DefaultMainVS
represent surface properties of a geometric object
Definition: vtkProperty.h:61
virtual void AddShaderVariable(const char *name, int numVars, int *x)
vtkShader2 * DefaultPropVS
abstract specification for renderers
Definition: vtkRenderer.h:69
OpenGL property.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
a list of Shader2 objects.
void PrintSelf(ostream &os, vtkIndent indent)
GLSL Program.
vtkShaderProgram2 * PropProgram
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkShader2 * DefaultMainFS
vtkShaderProgram2 * CachedShaderProgram2
vtkShaderProgram2 * LastRendererShaderProgram2
virtual void PostRender(vtkActor *, vtkRenderer *)
#define VTK_RENDERING_EXPORT
vtkShaderProgram2 * CurrentShaderProgram2
virtual void BackfaceRender(vtkActor *, vtkRenderer *)
Definition: vtkProperty.h:89
adapter to pass generic vertex attributes to the rendering pipeline to be used in a vtkShaderProgram2...
virtual void ReleaseGraphicsResources(vtkWindow *win)
OpenGL renderer.