VTK
vtkIdentColoredPainter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkIdentColoredPainter.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 =========================================================================*/
15 
45 #ifndef __vtkIdentColoredPainter_h
46 #define __vtkIdentColoredPainter_h
47 
48 #include "vtkPolyDataPainter.h"
49 
50 class vtkCellArray;
51 class vtkIdTypeArray;
52 class vtkProp;
53 
55 {
56 public:
58  virtual void PrintSelf(ostream &os, vtkIndent indent);
59  static vtkIdentColoredPainter *New();
60 
62  void ResetCurrentId();
63 
65  void ColorByConstant(unsigned int constant);
66 
70  void ColorByIncreasingIdent(unsigned int plane);
71 
73  void ColorByActorId(vtkProp *ActorId);
74 
76  void ColorByVertex();
77 
79  void MakeActorLookupTable(vtkProp **Props, vtkIdTypeArray *IdsForProps);
80 
82  vtkProp* GetActorFromId(vtkIdType id);
83 
84 protected:
87 
88  virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
89  unsigned long typeflags,bool forceCompileOnly);
90 
91  void DrawCells(int mode, vtkCellArray *connectivity,
92  vtkIdType startCellId, vtkRenderer *renderer);
93 
95 
96 //BTX
97  enum {COLORBYIDENT=0, COLORBYCONST, COLORBYVERTEX};
98 //ETX
99  int ColorMode;
100 
101  //three 24 bit-fields of the 72 bit increment counter.
102  unsigned int Plane;
103  unsigned int CurrentIdPlane0;
104  unsigned int CurrentIdPlane1;
105  unsigned int CurrentIdPlane2;
106 
107  void IncrementCurrentId();
108  void GetCurrentColor(unsigned char *RGB);
109 
112 
113 private:
114  vtkIdentColoredPainter(const vtkIdentColoredPainter&); // Not implemented.
115  void operator=(const vtkIdentColoredPainter&); // Not implemented.
116 };
117 
118 #endif //__vtkIdentColoredPainter_h
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:49
virtual void RenderInternal(vtkRenderer *renderer, vtkActor *actor, unsigned long typeflags, bool forceCompileOnly)
abstract specification for renderers
Definition: vtkRenderer.h:69
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:255
DEPRECATED A vtkPolyDataPainter that colors each polygon with a color coded integer.
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_RENDERING_EXPORT
object to represent cell connectivity
Definition: vtkCellArray.h:48
static vtkObject * New()
Abstract class for drawing poly data.