109 #ifndef vtkHardwareSelector_h 110 #define vtkHardwareSelector_h 112 #include "vtkRenderingCoreModule.h" 151 void PrintSelf(ostream& os,
vtkIndent indent)
override;
165 vtkSetVector4Macro(Area,
unsigned int);
166 vtkGetVector4Macro(Area,
unsigned int);
180 vtkSetMacro(FieldAssociation,
int);
181 vtkGetMacro(FieldAssociation,
int);
190 vtkSetMacro(UseProcessIdFromData,
bool);
191 vtkGetMacro(UseProcessIdFromData,
bool);
214 virtual bool CaptureBuffers();
216 {
return this->GetPixelInformation(display_position, 0); }
218 {
unsigned int temp[2];
return this->GetPixelInformation(display_position, maxDist, temp); }
219 PixelInformation GetPixelInformation(
const unsigned int display_position[2],
220 int maxDist,
unsigned int selected_position[2]);
222 { this->ReleasePixBuffers(); }
232 virtual void RenderCompositeIndex(
unsigned int index);
241 virtual void UpdateMaximumCellId(
vtkIdType attribid);
242 virtual void UpdateMaximumPointId(
vtkIdType attribid);
249 virtual void RenderProcessId(
unsigned int processid);
262 vtkGetMacro(ActorPassOnly,
bool);
263 vtkSetMacro(ActorPassOnly,
bool);
273 vtkGetMacro(CaptureZValues,
bool);
274 vtkSetMacro(CaptureZValues,
bool);
281 virtual void BeginRenderProp();
282 virtual void EndRenderProp();
290 vtkSetMacro(ProcessID,
int);
291 vtkGetMacro(ProcessID,
int);
298 vtkGetVector3Macro(PropColorValue,
float);
299 vtkSetVector3Macro(PropColorValue,
float);
307 vtkGetMacro(CurrentPass,
int);
319 {
return GenerateSelection(this->Area); }
321 {
return GenerateSelection(r[0], r[1], r[2], r[3]); }
323 unsigned int x1,
unsigned int y1,
324 unsigned int x2,
unsigned int y2);
339 vtkProp* GetPropFromID(
int id);
367 MAX_KNOWN_PASS = CELL_ID_HIGH24,
368 MIN_KNOWN_PASS = ACTOR_PASS
378 tcoord[0] =
static_cast<float>((
id & 0xff)/255.0);
379 tcoord[1] =
static_cast<float>(((
id & 0xff00) >> 8)/255.0);
380 tcoord[2] =
static_cast<float>(((
id & 0xff0000) >> 16)/255.0);
385 virtual void SavePixelBuffer(
int passNo);
400 double GetZValue(
int propid);
409 unsigned char rgb[3];
411 rgb[1] = pb[offset+1];
412 rgb[2] = pb[offset+2];
426 int Convert(
unsigned int pos[2],
unsigned char* pb)
427 {
return this->
Convert(pos[0], pos[1], pb); }
428 int Convert(
int xx,
int yy,
unsigned char* pb)
434 int offset = (yy *
static_cast<int>(this->Area[2]-this->Area[0]+1) + xx) * 3;
435 unsigned char rgb[3];
437 rgb[1] = pb[offset+1];
438 rgb[2] = pb[offset+2];
463 virtual bool PassRequired(
int pass);
470 bool IsPropHit(
int propid);
478 virtual void BeginSelection();
479 virtual void EndSelection();
481 virtual void ProcessPixelBuffers();
482 void BuildPropHitList(
unsigned char* rgbData);
488 void ReleasePixBuffers();
490 unsigned int Area[4];
498 unsigned char* PixBuffer[10];
499 unsigned char* RawPixBuffer[10];
505 float PropColorValue[3];
516 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)
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])
data object that represents a "selection" in VTK.
bool UseProcessIdFromData
Clears all pixel buffers.
int FieldAssociation
Clears all pixel buffers.
vtkIdType MaximumCellId
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.
unsigned char * GetPixelBuffer(int passNo)
It is possible to use the vtkHardwareSelector for a custom picking.
abstracts an OpenGL texture object.
vtkIdType GetID(int low24, int mid24, int high16)
create a window for renderers to draw into
vtkIdType MaximumPointId
Clears all pixel buffers.
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.
unsigned char * GetRawPixelBuffer(int passNo)
It is possible to use the vtkHardwareSelector for a custom picking.
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)