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 
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;
90  unsigned int PickId;
91  };
92 
93  std::vector<RenderValue> RenderValues;
95 
96  bool UseGeneric; // use the generic render
98 
99  // free up memory
100  void FreeStructures();
101 
102  void BuildRenderValues(vtkRenderer *renderer,
103  vtkActor *actor,
104  vtkDataObject *dobj,
105  unsigned int &flat_index,
106  unsigned int &lastVertex,
107  unsigned int &lastIndex,
108  unsigned int &lastEdgeIndex);
109 
111 
117  virtual int CanUseTextureMapForColoring(vtkDataObject* input);
121 
122 private:
124  const vtkCompositePolyDataMapper2&); // Not implemented.
125  void operator=(const vtkCompositePolyDataMapper2&); // Not implemented.
126 };
127 
128 #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 RenderEdges(vtkRenderer *ren, vtkActor *act)
std::vector< unsigned int > IndexOffsets
mapper for composite dataset consisting of polygonal data.
mapper for composite dataset consisting of polygonal data.
#define VTKRENDERINGOPENGL2_EXPORT
record modification and/or execution time
Definition: vtkTimeStamp.h:34
abstract specification for renderers
Definition: vtkRenderer.h:62
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
std::vector< RenderValue > RenderValues
std::vector< unsigned int > EdgeIndexArray
virtual int CanUseTextureMapForColoring(vtkDataObject *input)
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 ReplaceShaderColor(std::map< vtkShader::Type, vtkShader * > shaders, vtkRenderer *ren, vtkActor *act)
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()