63 #ifndef __vtkHardwareSelector_h
64 #define __vtkHardwareSelector_h
66 #include "vtkRenderingCoreModule.h"
109 vtkSetVector4Macro(Area,
unsigned int);
110 vtkGetVector4Macro(Area,
unsigned int);
121 vtkSetMacro(FieldAssociation,
int);
122 vtkGetMacro(FieldAssociation,
int);
129 vtkSetMacro(UseProcessIdFromData,
bool);
130 vtkGetMacro(UseProcessIdFromData,
bool);
145 virtual bool CaptureBuffers();
148 PixelInformation GetPixelInformation(
unsigned int display_position[2],
151 { this->ReleasePixBuffers(); }
157 bool GetPixelInformation(
unsigned int display_position[2],
164 bool GetPixelInformation(
unsigned int display_position[2],
170 void RenderCompositeIndex(
unsigned int index);
174 void RenderAttributeId(
vtkIdType attribid);
178 void RenderProcessId(
unsigned int processid);
187 void BeginRenderProp();
188 void EndRenderProp();
194 vtkSetMacro(ProcessID,
int);
195 vtkGetMacro(ProcessID,
int);
200 vtkGetMacro(CurrentPass,
int);
214 unsigned int x1,
unsigned int y1,
215 unsigned int x2,
unsigned int y2);
220 vtkProp* GetPropFromID(
int id);
231 MAX_KNOWN_PASS = ID_HIGH16,
232 MIN_KNOWN_PASS = PROCESS_PASS
238 static void Convert(
int id,
float tcoord[3])
240 tcoord[0] =
static_cast<float>((
id & 0xff)/255.0);
241 tcoord[1] =
static_cast<float>(((
id & 0xff00) >> 8)/255.0);
242 tcoord[2] =
static_cast<float>(((
id & 0xff0000) >> 16)/255.0);
245 int Convert(
unsigned long offset,
unsigned char* pb)
253 unsigned char rgb[3];
255 rgb[1] = pb[offset+1];
256 rgb[2] = pb[offset+2];
268 int Convert(
unsigned int pos[2],
unsigned char* pb)
269 {
return this->
Convert(pos[0], pos[1], pb); }
270 int Convert(
int xx,
int yy,
unsigned char* pb)
276 int offset = (yy *
static_cast<int>(this->Area[2]-this->Area[0]+1) + xx) * 3;
277 unsigned char rgb[3];
279 rgb[1] = pb[offset+1];
280 rgb[2] = pb[offset+2];
303 virtual bool PassRequired(
int pass);
308 bool IsPropHit(
int propid);
312 virtual int GetPropID(
int idx,
vtkProp* vtkNotUsed(prop))
316 virtual void BeginSelection();
317 virtual void EndSelection();
319 void SavePixelBuffer(
int passNo);
320 void BuildPropHitList(
unsigned char* rgbData);
324 void ReleasePixBuffers();
326 unsigned int Area[4];
333 unsigned char* PixBuffer[10];
343 vtkInternals* Internals;