62 #ifndef __vtkHardwareSelector_h
63 #define __vtkHardwareSelector_h
107 vtkSetVector4Macro(Area,
unsigned int);
108 vtkGetVector4Macro(Area,
unsigned int);
119 vtkSetMacro(FieldAssociation,
int);
120 vtkGetMacro(FieldAssociation,
int);
135 virtual bool CaptureBuffers();
137 {
return this->GetPixelInformation(display_position, 0); }
138 PixelInformation GetPixelInformation(
unsigned int display_position[2],
141 { this->ReleasePixBuffers(); }
147 bool GetPixelInformation(
unsigned int display_position[2],
154 bool GetPixelInformation(
unsigned int display_position[2],
160 void RenderCompositeIndex(
unsigned int index);
164 void RenderAttributeId(
vtkIdType attribid);
173 void BeginRenderProp();
174 void EndRenderProp();
180 vtkSetMacro(ProcessID,
int);
181 vtkGetMacro(ProcessID,
int);
186 vtkGetMacro(CurrentPass,
int);
196 {
return GenerateSelection(this->Area); }
198 {
return GenerateSelection(r[0], r[1], r[2], r[3]); }
200 unsigned int x1,
unsigned int y1,
201 unsigned int x2,
unsigned int y2);
206 vtkProp* GetPropFromID(
int id);
217 MAX_KNOWN_PASS = ID_HIGH16,
218 MIN_KNOWN_PASS = PROCESS_PASS
226 tcoord[0] =
static_cast<float>((
id & 0xff)/255.0);
227 tcoord[1] =
static_cast<float>(((
id & 0xff00) >> 8)/255.0);
228 tcoord[2] =
static_cast<float>(((
id & 0xff0000) >> 16)/255.0);
239 unsigned char rgb[3];
241 rgb[1] = pb[offset+1];
242 rgb[2] = pb[offset+2];
254 int Convert(
unsigned int pos[2],
unsigned char* pb)
255 {
return this->Convert(pos[0], pos[1], pb); }
256 int Convert(
int xx,
int yy,
unsigned char* pb)
262 int offset = (yy *
static_cast<int>(this->Area[2]-this->Area[0]+1) + xx) * 3;
263 unsigned char rgb[3];
265 rgb[1] = pb[offset+1];
266 rgb[2] = pb[offset+2];
289 virtual bool PassRequired(
int pass);
294 bool IsPropHit(
int propid);
302 virtual void BeginSelection();
303 virtual void EndSelection();
305 void SavePixelBuffer(
int passNo);
306 void BuildPropHitList(
unsigned char* rgbData);
310 void ReleasePixBuffers();
312 unsigned int Area[4];
318 unsigned char* PixBuffer[10];
328 vtkInternals* Internals;
abstract superclass for all actors, volumes and annotations
abstract base class for most VTK objects
abstract specification for renderers
virtual vtkSelection * GenerateSelection(unsigned int r[4])
A node in a selection tree. Used to store selection results.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
virtual int GetPropID(int idx, vtkProp *vtkNotUsed(prop))
static void Convert(int id, float tcoord[3])
int Convert(int xx, int yy, unsigned char *pb)
abstracts an OpenGL texture object.
vtkIdType GetID(int low24, int mid24, int high16)
virtual vtkSelection * GenerateSelection()
manager for OpenGL-based selection.
PixelInformation GetPixelInformation(unsigned int display_position[2])
int Convert(unsigned long offset, unsigned char *pb)
int Convert(unsigned int pos[2], unsigned char *pb)