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
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
abstract base class for most VTK objects
Definition: vtkObject.h:60
abstract specification for renderers
Definition: vtkRenderer.h:69
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:43
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:255
DEPRECATED A vtkPolyDataPainter that colors each polygon with a color coded integer.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:42
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkIdentColoredPainter * IdentPainter
#define VTK_RENDERING_EXPORT
A helper that orchestrates color buffer visible cell selection. This is deprecated. Refer to vtkHardwareSelector instead.
static vtkObject * New()