VTK
vtkCompositePolyDataMapper2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompositePolyDataMapper2.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 =========================================================================*/
28 #ifndef vtkCompositePolyDataMapper2_h
29 #define vtkCompositePolyDataMapper2_h
30 
31 #include "vtkRenderingOpenGL2Module.h" // For export macro
33 
34 class VTKRENDERINGOPENGL2_EXPORT vtkCompositePolyDataMapper2 : public vtkGenericCompositePolyDataMapper2
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
42  virtual void Render(vtkRenderer *ren, vtkActor *act);
43 
44  virtual void RenderPiece(vtkRenderer *ren, vtkActor *act);
45  virtual void RenderPieceDraw(vtkRenderer *ren, vtkActor *act);
46  virtual void RenderEdges(vtkRenderer *ren, vtkActor *act);
47 
48 protected:
51 
53 
55  virtual void ReplaceShaderColor(
56  std::map<vtkShader::Type, vtkShader *> shaders,
57  vtkRenderer *ren, vtkActor *act);
59 
61 
62  virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act);
63  virtual void AppendOneBufferObject(vtkRenderer *ren,
64  vtkActor *act, vtkPolyData *pd, unsigned int flat_index,
65  std::vector<unsigned char> &colors,
66  std::vector<float> &norms);
68 
69  std::vector<unsigned int> VertexOffsets;
70  std::vector<unsigned int> IndexOffsets;
71  std::vector<unsigned int> IndexArray;
72  std::vector<unsigned int> EdgeIndexArray;
73  std::vector<unsigned int> EdgeIndexOffsets;
74  unsigned int MaximumFlatIndex;
75 
77  {
78  public:
79  unsigned int StartVertex;
80  unsigned int StartIndex;
81  unsigned int StartEdgeIndex;
82  unsigned int EndVertex;
83  unsigned int EndIndex;
84  unsigned int EndEdgeIndex;
85  double Opacity;
87  bool Visibility;
89  unsigned int PickId;
90  };
91 
92  std::vector<RenderValue> RenderValues;
94 
95  bool UseGeneric; // use the generic render
97 
98  // free up memory
99  void FreeStructures();
100 
101  void BuildRenderValues(vtkRenderer *renderer,
102  vtkActor *actor,
103  vtkDataObject *dobj,
104  unsigned int &flat_index,
105  unsigned int &lastVertex,
106  unsigned int &lastIndex,
107  unsigned int &lastEdgeIndex);
108 
110 
116  virtual int CanUseTextureMapForColoring(vtkDataObject* input);
120 
121 private:
123  const vtkCompositePolyDataMapper2&); // Not implemented.
124  void operator=(const vtkCompositePolyDataMapper2&); // Not implemented.
125 };
126 
127 #endif
virtual void RenderPieceDraw(vtkRenderer *ren, vtkActor *act)
std::vector< unsigned int > VertexOffsets
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
virtual void ReplaceShaderColor(std::map< vtkShader::Type, vtkShader *> shaders, vtkRenderer *ren, vtkActor *act)
virtual void RenderEdges(vtkRenderer *ren, vtkActor *act)
std::vector< unsigned int > IndexOffsets
mapper for composite dataset consisting of polygonal data.
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
mapper for composite dataset consisting of polygonal data.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
abstract specification for renderers
Definition: vtkRenderer.h:63
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
std::vector< RenderValue > RenderValues
std::vector< unsigned int > EdgeIndexArray
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
const GLuint * shaders
Definition: vtkgl.h:14179
std::vector< unsigned int > EdgeIndexOffsets
a simple class to control print indentation
Definition: vtkIndent.h:38
std::vector< unsigned int > IndexArray
void PrintSelf(ostream &os, vtkIndent indent)
virtual void RenderPiece(vtkRenderer *ren, vtkActor *a)
virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act)
virtual void Render(vtkRenderer *ren, vtkActor *act)
general representation of visualization data
Definition: vtkDataObject.h:64
static vtkGenericCompositePolyDataMapper2 * New()