50 #ifndef vtkHardwareSelector_h 51 #define vtkHardwareSelector_h 53 #include "vtkRenderingCoreModule.h" 106 vtkSetVector4Macro(Area,
unsigned int);
107 vtkGetVector4Macro(Area,
unsigned int);
121 vtkSetMacro(FieldAssociation,
int);
122 vtkGetMacro(FieldAssociation,
int);
131 vtkSetMacro(UseProcessIdFromData,
bool);
132 vtkGetMacro(UseProcessIdFromData,
bool);
155 virtual bool CaptureBuffers();
157 {
return this->GetPixelInformation(display_position, 0); }
159 {
unsigned int temp[2];
return this->GetPixelInformation(display_position, maxDist, temp); }
160 PixelInformation GetPixelInformation(
const unsigned int display_position[2],
161 int maxDist,
unsigned int selected_position[2]);
163 { this->ReleasePixBuffers(); }
170 virtual void RenderCompositeIndex(
unsigned int index);
175 virtual void RenderAttributeId(
vtkIdType attribid);
181 virtual void RenderProcessId(
unsigned int processid);
194 virtual void BeginRenderProp();
195 virtual void EndRenderProp();
203 vtkSetMacro(ProcessID,
int);
204 vtkGetMacro(ProcessID,
int);
211 vtkGetVector3Macro(PropColorValue,
float);
212 vtkSetVector3Macro(PropColorValue,
float);
219 vtkGetMacro(CurrentPass,
int);
231 {
return GenerateSelection(this->Area); }
233 {
return GenerateSelection(r[0], r[1], r[2], r[3]); }
235 unsigned int x1,
unsigned int y1,
236 unsigned int x2,
unsigned int y2);
251 vtkProp* GetPropFromID(
int id);
261 MAX_KNOWN_PASS = ID_HIGH16,
262 MIN_KNOWN_PASS = PROCESS_PASS
272 tcoord[0] =
static_cast<float>((
id & 0xff)/255.0);
273 tcoord[1] =
static_cast<float>(((
id & 0xff00) >> 8)/255.0);
274 tcoord[2] =
static_cast<float>(((
id & 0xff0000) >> 16)/255.0);
297 unsigned char rgb[3];
314 int Convert(
unsigned int pos[2],
unsigned char* pb)
315 {
return this->
Convert(pos[0], pos[1], pb); }
316 int Convert(
int xx,
int yy,
unsigned char* pb)
322 int offset = (yy *
static_cast<int>(this->Area[2]-this->Area[0]+1) + xx) * 3;
323 unsigned char rgb[3];
351 virtual bool PassRequired(
int pass);
358 bool IsPropHit(
int propid);
366 virtual void BeginSelection();
367 virtual void EndSelection();
369 virtual void SavePixelBuffer(
int passNo);
370 void BuildPropHitList(
unsigned char* rgbData);
376 void ReleasePixBuffers();
378 unsigned int Area[4];
385 unsigned char* PixBuffer[10];
390 float PropColorValue[3];
397 vtkInternals* Internals;
abstract superclass for all actors, volumes and annotations
virtual void PostCapturePass(int pass)
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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.
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.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
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)