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) override;
34 
36 
39  vtkSetStringMacro(ScaleArray);
41 
43 
47  vtkSetMacro(Radius, float);
48  vtkGetMacro(Radius, float);
49 
53  void Render(vtkRenderer *ren, vtkActor *act) override;
54 
59  // void ProcessSelectorPixelBuffers(vtkHardwareSelector *sel,
60  // int propid, vtkProp *prop) override;
61 
62 protected:
64  ~vtkOpenGLSphereMapper() override;
65 
69  void GetShaderTemplate(
70  std::map<vtkShader::Type, vtkShader *> shaders,
71  vtkRenderer *ren, vtkActor *act) override;
72 
76  void ReplaceShaderValues(
77  std::map<vtkShader::Type, vtkShader *> shaders,
78  vtkRenderer *ren, vtkActor *act) override;
79 
83  void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) override;
84 
88  void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act) override;
89 
90  const char *ScaleArray;
91 
95  void BuildBufferObjects(vtkRenderer *ren, vtkActor *act) override;
96 
97  void RenderPieceDraw(vtkRenderer *ren, vtkActor *act) override;
98 
99  virtual void CreateVBO(
100  vtkPolyData *poly, vtkIdType numPts,
101  unsigned char *colors, int colorComponents,
102  vtkIdType nc,
103  float *sizes, vtkIdType ns, vtkRenderer *ren);
104 
105  // used for transparency
106  bool Invert;
107  float Radius;
108 
109 private:
110  vtkOpenGLSphereMapper(const vtkOpenGLSphereMapper&) = delete;
111  void operator=(const vtkOpenGLSphereMapper&) = delete;
112 };
113 
114 #endif
PolyDataMapper using OpenGL to render.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
static vtkOpenGLPolyDataMapper * New()
abstract specification for renderers
Definition: vtkRenderer.h:63
int vtkIdType
Definition: vtkType.h:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
a simple class to control print indentation
Definition: vtkIndent.h:39
draw spheres using imposters
Vertex or Fragment shader, combined into a ShaderProgram.
Definition: vtkShader.h:40