64 #ifndef vtkHardwareSelector_h 65 #define vtkHardwareSelector_h 67 #include "vtkRenderingCoreModule.h" 106 void PrintSelf(ostream& os,
vtkIndent indent)
override;
120 vtkSetVector4Macro(Area,
unsigned int);
121 vtkGetVector4Macro(Area,
unsigned int);
136 vtkGetMacro(FieldAssociation,
int);
146 vtkGetMacro(UseProcessIdFromData,
bool);
169 virtual bool CaptureBuffers();
171 {
return this->GetPixelInformation(display_position, 0); }
173 {
unsigned int temp[2];
return this->GetPixelInformation(display_position, maxDist, temp); }
174 PixelInformation GetPixelInformation(
const unsigned int display_position[2],
175 int maxDist,
unsigned int selected_position[2]);
177 { this->ReleasePixBuffers(); }
184 virtual void RenderCompositeIndex(
unsigned int index);
189 virtual void RenderAttributeId(
vtkIdType attribid);
195 virtual void RenderProcessId(
unsigned int processid);
208 virtual void BeginRenderProp();
209 virtual void EndRenderProp();
218 vtkGetMacro(ProcessID,
int);
225 vtkGetVector3Macro(PropColorValue,
float);
226 vtkSetVector3Macro(PropColorValue,
float);
233 vtkGetMacro(CurrentPass,
int);
245 {
return GenerateSelection(this->Area); }
247 {
return GenerateSelection(r[0], r[1], r[2], r[3]); }
249 unsigned int x1,
unsigned int y1,
250 unsigned int x2,
unsigned int y2);
265 vtkProp* GetPropFromID(
int id);
275 MAX_KNOWN_PASS = ID_HIGH16,
276 MIN_KNOWN_PASS = PROCESS_PASS
286 tcoord[0] =
static_cast<float>((
id & 0xff)/255.0);
287 tcoord[1] =
static_cast<float>(((
id & 0xff00) >> 8)/255.0);
288 tcoord[2] =
static_cast<float>(((
id & 0xff0000) >> 16)/255.0);
311 unsigned char rgb[3];
313 rgb[1] = pb[offset+1];
314 rgb[2] = pb[offset+2];
328 int Convert(
unsigned int pos[2],
unsigned char* pb)
329 {
return this->
Convert(pos[0], pos[1], pb); }
330 int Convert(
int xx,
int yy,
unsigned char* pb)
336 int offset = (yy *
static_cast<int>(this->Area[2]-this->Area[0]+1) + xx) * 3;
337 unsigned char rgb[3];
339 rgb[1] = pb[offset+1];
340 rgb[2] = pb[offset+2];
365 virtual bool PassRequired(
int pass);
372 bool IsPropHit(
int propid);
380 virtual void BeginSelection();
381 virtual void EndSelection();
383 virtual void SavePixelBuffer(
int passNo);
384 void BuildPropHitList(
unsigned char* rgbData);
390 void ReleasePixBuffers();
392 unsigned int Area[4];
399 unsigned char* PixBuffer[10];
404 float PropColorValue[3];
411 vtkInternals* Internals;
abstract superclass for all actors, volumes and annotations
virtual void PostCapturePass(int pass)
abstract base class for most VTK objects
virtual void PreCapturePass(int pass)
vtkIdType MaxAttributeId
Clears all pixel buffers.
PixelInformation GetPixelInformation(const unsigned int display_position[2], int maxDist)
It is possible to use the vtkHardwareSelector for a custom picking.
abstract specification for renderers
virtual vtkSelection * GenerateSelection(unsigned int r[4])
A node in a selection tree.
bool UseProcessIdFromData
Clears all pixel buffers.
int FieldAssociation
Clears all pixel buffers.
a simple class to control print indentation
virtual int GetPropID(int idx, vtkProp *vtkNotUsed(prop))
Return a unique ID for the prop.
static void Convert(int id, float tcoord[3])
void ClearBuffers()
It is possible to use the vtkHardwareSelector for a custom picking.
int Convert(int xx, int yy, unsigned char *pb)
pos must be relative to the lower-left corner of this->Area.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
abstracts an OpenGL texture object.
vtkIdType GetID(int low24, int mid24, int high16)
create a window for renderers to draw into
vtkRenderer * Renderer
Clears all pixel buffers.
PixelInformation GetPixelInformation(const unsigned int display_position[2])
It is possible to use the vtkHardwareSelector for a custom picking.
virtual vtkSelection * GenerateSelection()
Generates the vtkSelection from pixel buffers.
manager for OpenGL-based selection.
int Convert(unsigned long offset, unsigned char *pb)
int Convert(unsigned int pos[2], unsigned char *pb)
pos must be relative to the lower-left corner of this->Area.
VTKACCELERATORSVTKM_EXPORT vtkm::cont::Field Convert(vtkDataArray *input, int association)