63 #ifndef vtkHardwareSelector_h
64 #define vtkHardwareSelector_h
110 vtkSetVector4Macro(Area,
unsigned int);
111 vtkGetVector4Macro(Area,
unsigned int);
122 vtkSetMacro(FieldAssociation,
int);
123 vtkGetMacro(FieldAssociation,
int);
130 vtkSetMacro(UseProcessIdFromData,
bool);
131 vtkGetMacro(UseProcessIdFromData,
bool);
150 virtual bool CaptureBuffers();
152 {
return this->GetPixelInformation(display_position, 0); }
154 {
unsigned int temp[2];
return this->GetPixelInformation(display_position, maxDist, temp); }
155 PixelInformation GetPixelInformation(
const unsigned int display_position[2],
156 int maxDist,
unsigned int selected_position[2]);
158 { this->ReleasePixBuffers(); }
163 virtual void RenderCompositeIndex(
unsigned int index);
167 virtual void RenderAttributeId(
vtkIdType attribid);
171 virtual void RenderProcessId(
unsigned int processid);
180 virtual void BeginRenderProp();
181 virtual void EndRenderProp();
187 vtkSetMacro(ProcessID,
int);
188 vtkGetMacro(ProcessID,
int);
193 vtkGetVector3Macro(PropColorValue,
float);
194 vtkSetVector3Macro(PropColorValue,
float);
199 vtkGetMacro(CurrentPass,
int);
209 {
return GenerateSelection(this->Area); }
211 {
return GenerateSelection(r[0], r[1], r[2], r[3]); }
213 unsigned int x1,
unsigned int y1,
214 unsigned int x2,
unsigned int y2);
228 vtkProp* GetPropFromID(
int id);
239 MAX_KNOWN_PASS = ID_HIGH16,
240 MIN_KNOWN_PASS = PROCESS_PASS
245 tcoord[0] =
static_cast<float>((
id & 0xff)/255.0);
246 tcoord[1] =
static_cast<float>(((
id & 0xff00) >> 8)/255.0);
247 tcoord[2] =
static_cast<float>(((
id & 0xff0000) >> 16)/255.0);
266 unsigned char rgb[3];
268 rgb[1] = pb[offset+1];
269 rgb[2] = pb[offset+2];
281 int Convert(
unsigned int pos[2],
unsigned char* pb)
282 {
return this->Convert(pos[0], pos[1], pb); }
283 int Convert(
int xx,
int yy,
unsigned char* pb)
289 int offset = (yy *
static_cast<int>(this->Area[2]-this->Area[0]+1) + xx) * 3;
290 unsigned char rgb[3];
292 rgb[1] = pb[offset+1];
293 rgb[2] = pb[offset+2];
316 virtual bool PassRequired(
int pass);
321 bool IsPropHit(
int propid);
329 virtual void BeginSelection();
330 virtual void EndSelection();
332 virtual void SavePixelBuffer(
int passNo);
333 void BuildPropHitList(
unsigned char* rgbData);
337 void ReleasePixBuffers();
339 unsigned int Area[4];
346 unsigned char* PixBuffer[10];
351 float PropColorValue[3];
358 vtkInternals* Internals;
abstract superclass for all actors, volumes and annotations
abstract base class for most VTK objects
PixelInformation GetPixelInformation(const unsigned int display_position[2], int maxDist)
abstract specification for renderers
virtual vtkSelection * GenerateSelection(unsigned int r[4])
A node in a selection tree. Used to store selection results.
bool UseProcessIdFromData
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)
create a window for renderers to draw into
#define VTKRENDERINGCORE_EXPORT
PixelInformation GetPixelInformation(const unsigned int display_position[2])
virtual vtkSelection * GenerateSelection()
manager for OpenGL-based selection.
int Convert(unsigned long offset, unsigned char *pb)
int Convert(unsigned int pos[2], unsigned char *pb)