64 #ifndef vtkHardwareSelector_h
65 #define vtkHardwareSelector_h
67 #include "vtkRenderingCoreModule.h"
119 vtkSetVector4Macro(Area,
unsigned int);
120 vtkGetVector4Macro(Area,
unsigned int);
135 vtkGetMacro(FieldAssociation,
int);
145 vtkGetMacro(UseProcessIdFromData,
bool);
168 virtual bool CaptureBuffers();
170 {
return this->GetPixelInformation(display_position, 0); }
172 {
unsigned int temp[2];
return this->GetPixelInformation(display_position, maxDist, temp); }
173 PixelInformation GetPixelInformation(
const unsigned int display_position[2],
174 int maxDist,
unsigned int selected_position[2]);
176 { this->ReleasePixBuffers(); }
183 virtual void RenderCompositeIndex(
unsigned int index);
188 virtual void RenderAttributeId(
vtkIdType attribid);
194 virtual void RenderProcessId(
unsigned int processid);
207 virtual void BeginRenderProp();
208 virtual void EndRenderProp();
217 vtkGetMacro(ProcessID,
int);
224 vtkGetVector3Macro(PropColorValue,
float);
225 vtkSetVector3Macro(PropColorValue,
float);
232 vtkGetMacro(CurrentPass,
int);
244 {
return GenerateSelection(this->Area); }
246 {
return GenerateSelection(r[0], r[1], r[2], r[3]); }
248 unsigned int x1,
unsigned int y1,
249 unsigned int x2,
unsigned int y2);
264 vtkProp* GetPropFromID(
int id);
274 MAX_KNOWN_PASS = ID_HIGH16,
275 MIN_KNOWN_PASS = PROCESS_PASS
285 tcoord[0] = static_cast<float>((
id & 0xff)/255.0);
286 tcoord[1] = static_cast<float>(((
id & 0xff00) >> 8)/255.0);
287 tcoord[2] = static_cast<float>(((
id & 0xff0000) >> 16)/255.0);
310 unsigned char rgb[3];
327 int Convert(
unsigned int pos[2],
unsigned char* pb)
328 {
return this->Convert(pos[0], pos[1], pb); }
329 int Convert(
int xx,
int yy,
unsigned char* pb)
335 int offset = (yy * static_cast<int>(this->Area[2]-this->Area[0]+1) + xx) * 3;
336 unsigned char rgb[3];
364 virtual bool PassRequired(
int pass);
371 bool IsPropHit(
int propid);
379 virtual void BeginSelection();
380 virtual void EndSelection();
382 virtual void SavePixelBuffer(
int passNo);
383 void BuildPropHitList(
unsigned char* rgbData);
389 void ReleasePixBuffers();
391 unsigned int Area[4];
398 unsigned char* PixBuffer[10];
403 float PropColorValue[3];
410 vtkInternals* Internals;