VTK
vtkOpenGLSphereMapper.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 =========================================================================*/
22 #ifndef vtkOpenGLSphereMapper_h
23 #define vtkOpenGLSphereMapper_h
24 
25 #include "vtkRenderingOpenGL2Module.h" // For export macro
27 
28 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLSphereMapper : public vtkOpenGLPolyDataMapper
29 {
30 public:
31  static vtkOpenGLSphereMapper* New();
33  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
34 
36 
39  vtkSetStringMacro(ScaleArray);
41 
43 
47  vtkSetMacro(Radius, float);
48  vtkGetMacro(Radius, float);
49 
53  void Render(vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
54 
55 protected:
57  ~vtkOpenGLSphereMapper() VTK_OVERRIDE;
58 
62  void GetShaderTemplate(
63  std::map<vtkShader::Type, vtkShader *> shaders,
64  vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
65 
69  void ReplaceShaderValues(
70  std::map<vtkShader::Type, vtkShader *> shaders,
71  vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
72 
76  void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
77 
81  void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
82 
83  const char *ScaleArray;
84 
88  bool GetNeedToRebuildBufferObjects(vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
89 
93  void BuildBufferObjects(vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
94 
95  void RenderPieceDraw(vtkRenderer *ren, vtkActor *act) VTK_OVERRIDE;
96 
97  virtual void CreateVBO(
98  float * points, vtkIdType numPts,
99  unsigned char *colors, int colorComponents,
100  vtkIdType nc,
101  float *sizes, vtkIdType ns, vtkRenderer *ren);
102 
103  // used for transparency
104  bool Invert;
105  float Radius;
106 
107 private:
108  vtkOpenGLSphereMapper(const vtkOpenGLSphereMapper&) VTK_DELETE_FUNCTION;
109  void operator=(const vtkOpenGLSphereMapper&) VTK_DELETE_FUNCTION;
110 };
111 
112 #endif
a PolyDataMapper for the OpenGL library
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
static vtkOpenGLPolyDataMapper * New()
abstract specification for renderers
Definition: vtkRenderer.h:57
int vtkIdType
Definition: vtkType.h:345
a simple class to control print indentation
Definition: vtkIndent.h:33
void Render(vtkRenderer *ren, vtkActor *act) override
This calls RenderPiece (in a for loop if streaming is necessary).
draw spheres using imposters
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Vertex or Fragment shader, combined into a ShaderProgram.
Definition: vtkShader.h:37
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.