VTK
vtkShaderDeviceAdapter2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkShaderDeviceAdapter2.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 =========================================================================*/
26 #ifndef vtkShaderDeviceAdapter2_h
27 #define vtkShaderDeviceAdapter2_h
28 
29 #include "vtkRenderingCoreModule.h" // For export macro
30 #include "vtkObject.h"
31 
32 class vtkShaderProgram2;
33 
34 class VTKRENDERINGCORE_EXPORT vtkShaderDeviceAdapter2 : public vtkObject
35 {
36 public:
38  void PrintSelf(ostream &os, vtkIndent indent) override;
39 
53  virtual void SendAttribute(const char* attrname, int components, int type,
54  const void* attribute,
55  unsigned long offset = 0) = 0;
56 
61  void SetShaderProgram(vtkShaderProgram2* program)
62  { this->ShaderProgram = program; }
63  vtkGetObjectMacro(ShaderProgram, vtkShaderProgram2)
64 
65  // Description:
66  // This method is called before rendering. This gives the shader device
67  // adapter an opportunity to collect information, such as attribute indices
68  // that it will need while rendering.
69  virtual void PrepareForRender() = 0;
70 
71 protected:
73  ~vtkShaderDeviceAdapter2() override;
74 
75  vtkShaderProgram2* ShaderProgram;
76 
77 private:
79  void operator=(const vtkShaderDeviceAdapter2&) = delete;
80 
81 };
82 
83 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
void SetShaderProgram(vtkShaderProgram2 *program)
Set the shader program which is being updated by this device adapter.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkShaderProgram2 * ShaderProgram
an adapter to pass generic vertex attributes to the rendering pipeline.