VTK
vtkVisibleCellSelector.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVisibleCellSelector.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 =========================================================================*/
55 #ifndef __vtkVisibleCellSelector_h
56 #define __vtkVisibleCellSelector_h
57 
58 #include "vtkObject.h"
59 
60 class vtkRenderer;
61 class vtkIdTypeArray;
62 class vtkIntArray;
63 class vtkSelection;
64 class vtkProp;
66 
68 {
69 public:
71  void PrintSelf(ostream& os, vtkIndent indent);
72  static vtkVisibleCellSelector *New();
73 
75  virtual void SetRenderer(vtkRenderer *);
76 
78 
80  void SetArea(unsigned int x0, unsigned int y0,
81  unsigned int x1, unsigned int y1);
83 
85 
86  void GetArea(unsigned int &x0, unsigned int &y0,
87  unsigned int &x1, unsigned int &y1);
89 
91 
94  virtual void SetProcessorId(unsigned int pid);
95  vtkGetMacro(ProcessorId, unsigned int);
97 
99 
105  void SetRenderPasses(int DoProcessor, int DoActor,
106  int DoCellIdHi, int DoCellIdMid, int DoCellIdLo,
107  int DoVertexId=0);
109 
111  void Select();
112 
117  void GetSelectedIds(vtkIdTypeArray *ToCopyInto);
118 
120  void GetSelectedIds(vtkSelection *ToCopyInto);
121 
123 
132  void GetSelectedVertices(vtkIdTypeArray *VertexPointers,
133  vtkIdTypeArray *VertexIds);
135 
138  vtkProp* GetActorFromId(vtkIdType id);
139 
141  void PrintSelectedIds(vtkIdTypeArray *IdsToPrint);
142 
144 
147  void GetPixelSelection( int displayPos[2],
148  vtkIdType & procId,
149  vtkIdType & cellId,
150  vtkIdType & vertId,
151  vtkProp *& actorPtr );
153 
154 protected:
157 
160  void SavePixelBuffer(int pass, unsigned char *src);
161 
164  void ComputeSelectedIds();
165 
167  void SetSelectMode(int mode);
168 
169  // Simply calls this->Renderer's method of the same name.
170  void SetSelectConst(unsigned int constant);
171 
172  void SetIdentPainter(vtkIdentColoredPainter *);
173 
175 
177  int DoActor;
182 
183  unsigned int ProcessorId;
184 
185  unsigned int X0;
186  unsigned int Y0;
187  unsigned int X1;
188  unsigned int Y1;
189 
190  //buffer for id colored pixels
191  unsigned char *PixBuffer[6];
192 
194 
200 
202 private:
203  vtkVisibleCellSelector(const vtkVisibleCellSelector&); //Not implemented
204  void operator=(const vtkVisibleCellSelector&); //Not implemented
205 };
206 
207 #endif