00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00044 #ifndef __vtkIdentColoredPainter_h
00045 #define __vtkIdentColoredPainter_h
00046
00047 #include "vtkPolyDataPainter.h"
00048
00049 class vtkCellArray;
00050 class vtkIdTypeArray;
00051 class vtkProp;
00052
00053 class VTK_RENDERING_EXPORT vtkIdentColoredPainter : public vtkPolyDataPainter
00054 {
00055 public:
00056 vtkTypeRevisionMacro(vtkIdentColoredPainter, vtkPolyDataPainter);
00057 virtual void PrintSelf(ostream &os, vtkIndent indent);
00058 static vtkIdentColoredPainter *New();
00059
00061 void ResetCurrentId();
00062
00064 void ColorByConstant(unsigned int constant);
00065
00069 void ColorByIncreasingIdent(unsigned int plane);
00070
00072 void ColorByActorId(vtkProp *ActorId);
00073
00075 void ColorByVertex();
00076
00078 void MakeActorLookupTable(vtkProp **Props, vtkIdTypeArray *IdsForProps);
00079
00081 vtkProp* GetActorFromId(vtkIdType id);
00082
00083 protected:
00084 vtkIdentColoredPainter();
00085 ~vtkIdentColoredPainter();
00086
00087 virtual void RenderInternal(vtkRenderer* renderer, vtkActor* actor,
00088 unsigned long typeflags);
00089
00090 void DrawCells(int mode, vtkCellArray *connectivity,
00091 vtkIdType startCellId, vtkRenderer *renderer);
00092
00093 vtkIdType TotalCells;
00094
00095
00096 enum {COLORBYIDENT=0, COLORBYCONST, COLORBYVERTEX};
00097
00098 int ColorMode;
00099
00100
00101 unsigned int Plane;
00102 unsigned int CurrentIdPlane0;
00103 unsigned int CurrentIdPlane1;
00104 unsigned int CurrentIdPlane2;
00105
00106 void IncrementCurrentId();
00107 void GetCurrentColor(unsigned char *RGB);
00108
00109 vtkIdTypeArray *ActorIds;
00110 vtkProp **PropAddrs;
00111
00112 private:
00113 vtkIdentColoredPainter(const vtkIdentColoredPainter&);
00114 void operator=(const vtkIdentColoredPainter&);
00115 };
00116
00117 #endif //__vtkIdentColoredPainter_h