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);
34 
36 
39  vtkSetStringMacro(ScaleArray);
41 
43 
47  vtkSetMacro(Radius, float);
48  vtkGetMacro(Radius, float);
49 
53  virtual void Render(vtkRenderer *ren, vtkActor *act);
54 
55 protected:
58 
62  virtual void GetShaderTemplate(
63  std::map<vtkShader::Type, vtkShader *> shaders,
64  vtkRenderer *ren, vtkActor *act);
65 
69  virtual void ReplaceShaderValues(
70  std::map<vtkShader::Type, vtkShader *> shaders,
71  vtkRenderer *ren, vtkActor *act);
72 
76  virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
77 
81  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
82 
83  const char *ScaleArray;
84 
88  virtual bool GetNeedToRebuildBufferObjects(vtkRenderer *ren, vtkActor *act);
89 
93  virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act);
94 
95  virtual void RenderPieceDraw(vtkRenderer *ren, vtkActor *act);
96 
97  // used for transparency
98  bool Invert;
99  float Radius;
100 
101 private:
102  vtkOpenGLSphereMapper(const vtkOpenGLSphereMapper&) VTK_DELETE_FUNCTION;
103  void operator=(const vtkOpenGLSphereMapper&) VTK_DELETE_FUNCTION;
104 };
105 
106 #endif
virtual void RenderPieceDraw(vtkRenderer *ren, vtkActor *act)
Implemented by sub classes.
a PolyDataMapper for the OpenGL library
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
const char * ScaleArray
This value will be used for the radius is the scale array is not provided.
static vtkOpenGLPolyDataMapper * New()
float Radius
This value will be used for the radius is the scale array is not provided.
virtual void GetShaderTemplate(std::map< vtkShader::Type, vtkShader *> shaders, vtkRenderer *ren, vtkActor *act)
Create the basic shaders before replacement.
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual bool GetNeedToRebuildBufferObjects(vtkRenderer *ren, vtkActor *act)
Does the VBO/IBO need to be rebuilt.
virtual void ReplaceShaderValues(std::map< vtkShader::Type, vtkShader *> shaders, vtkRenderer *ren, vtkActor *act)
Perform string replacments on the shader templates.
a simple class to control print indentation
Definition: vtkIndent.h:39
bool Invert
This value will be used for the radius is the scale array is not provided.
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Set the shader parameters related to the mapper/input data, called by UpdateShader.
draw spheres using imposters
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act)
Build the VBO/IBO, called by UpdateBufferObjects.
virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act)
Set the shader parameteres related to the Camera, called by UpdateShader.
virtual void Render(vtkRenderer *ren, vtkActor *act)
This calls RenderPiece (in a for loop if streaming is necessary).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.