VTK
vtkValuePassHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkValuePassHelper.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 =========================================================================*/
37 #ifndef vtkValuePassHelper_h
38 #define vtkValuePassHelper_h
39 
40 #include "vtkRenderingOpenGL2Module.h" // For export macro
41 #include "vtkObject.h"
42 
43 
44 class vtkActor;
45 class vtkDataSet;
46 class vtkMapper;
47 class vtkOpenGLHelper;
48 class vtkRenderer;
49 class vtkWindow;
50 class vtkPolyData;
51 
52 class VTKRENDERINGOPENGL2_EXPORT vtkValuePassHelper : public vtkObject
53 {
55 
56 public:
57 
58  static vtkValuePassHelper* New();
59  vtkTypeMacro(vtkValuePassHelper, vtkObject);
60  void PrintSelf(ostream& os, vtkIndent indent);
61 
62 protected:
63 
66 
67  vtkGetMacro(RenderingMode, int);
68 
73  void UpdateConfiguration(vtkRenderer* ren, vtkActor* act, vtkMapper* mapper,
74  vtkPolyData* input);
75 
79  void RenderPieceStart(vtkActor* actor, vtkDataSet* input);
80 
84  void UpdateShaders(std::string & VSSource, std::string & FSSource,
85  std::string & required);
86 
88 
91  void BindAttributes(vtkOpenGLHelper& cellBO);
92  void BindUniforms(vtkOpenGLHelper& cellBO);
94 
98  void RenderPieceFinish();
99 
103  bool RequiresShaderRebuild();
104 
106 
107 private:
108 
109  void AllocateGraphicsResources(vtkRenderer* ren);
110 
111  vtkValuePassHelper(const vtkValuePassHelper &) VTK_DELETE_FUNCTION;
112  void operator=(const vtkValuePassHelper &) VTK_DELETE_FUNCTION;
113 
114 
115  class vtkInternals;
116  vtkInternals* Impl;
117  int RenderingMode;
118 };
119 #endif // vtkValuePassHelper_h
a PolyDataMapper for the OpenGL library
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
virtual void RenderPieceFinish(vtkRenderer *ren, vtkActor *act)
Implemented by sub classes.
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual void UpdateShaders(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Make sure appropriate shaders are defined, compiled and bound.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
Implementation of both rendering modes of vtkValuePass for the vtkOpenGLPolyDataMapper.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:91
virtual void RenderPieceStart(vtkRenderer *ren, vtkActor *act)
Implemented by sub classes.
void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...