119#ifndef vtkHardwareSelector_h
120#define vtkHardwareSelector_h
123#include "vtkRenderingCoreModule.h"
127VTK_ABI_NAMESPACE_BEGIN
159 , CellGridCellTypeID(-1)
160 , CellGridSourceSpecID(-1)
161 , CellGridTupleID(-1)
183 vtkSetVector4Macro(Area,
unsigned int);
184 vtkGetVector4Macro(Area,
unsigned int);
198 vtkSetMacro(FieldAssociation,
int);
199 vtkGetMacro(FieldAssociation,
int);
208 vtkSetMacro(UseProcessIdFromData,
bool);
209 vtkGetMacro(UseProcessIdFromData,
bool);
235 return this->GetPixelInformation(display_position, 0);
239 unsigned int temp[2];
240 return this->GetPixelInformation(display_position, maxDist, temp);
243 const unsigned int display_position[2],
int maxDist,
unsigned int selected_position[2]);
285 vtkGetMacro(ActorPassOnly,
bool);
286 vtkSetMacro(ActorPassOnly,
bool);
296 vtkGetMacro(CaptureZValues,
bool);
297 vtkSetMacro(CaptureZValues,
bool);
313 vtkSetMacro(ProcessID,
int);
314 vtkGetMacro(ProcessID,
int);
321 vtkGetVector3Macro(PropColorValue,
float);
322 vtkSetVector3Macro(PropColorValue,
float);
330 vtkGetMacro(CurrentPass,
int);
344 return GenerateSelection(r[0], r[1], r[2], r[3]);
347 unsigned int x1,
unsigned int y1,
unsigned int x2,
unsigned int y2);
394 MAX_KNOWN_PASS = CELLGRID_TUPLE_ID_HIGH24,
395 MIN_KNOWN_PASS = ACTOR_PASS
405 tcoord[0] =
static_cast<float>((
id & 0xff) / 255.0);
406 tcoord[1] =
static_cast<float>(((
id & 0xff00) >> 8) / 255.0);
407 tcoord[2] =
static_cast<float>(((
id & 0xff0000) >> 16) / 255.0);
441 int Convert(
unsigned long offset,
unsigned char* pb)
448 unsigned char rgb[3];
450 rgb[1] = pb[offset + 1];
451 rgb[2] = pb[offset + 2];
465 int Convert(
unsigned int pos[2],
unsigned char* pb) {
return this->
Convert(pos[0], pos[1], pb); }
466 int Convert(
int xx,
int yy,
unsigned char* pb)
472 int offset = (yy *
static_cast<int>(this->Area[2] - this->Area[0] + 1) + xx) * 3;
473 unsigned char rgb[3];
475 rgb[1] = pb[offset + 1];
476 rgb[2] = pb[offset + 2];
527 unsigned int Area[4];
536 unsigned char* PixBuffer[11];
537 unsigned char* RawPixBuffer[11];
543 float PropColorValue[3];
554 vtkInternals* Internals;
int Convert(unsigned long offset, unsigned char *pb)
vtkIdType MaximumCellId
Clears all pixel buffers.
virtual void BeginRenderProp()
Called by the mapper before and after rendering each prop.
virtual vtkSelection * GenerateSelection(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2)
virtual void UpdateMaximumPointId(vtkIdType attribid)
Called by any vtkMapper or vtkProp subclass to indicate the maximum cell or point attribute ID it use...
virtual void SavePixelBuffer(int passNo)
virtual void EndRenderProp(vtkRenderWindow *)=0
vtkRenderer * Renderer
Clears all pixel buffers.
virtual void EndRenderProp()
Called by the mapper before and after rendering each prop.
unsigned char * GetRawPixelBuffer(int passNo)
It is possible to use the vtkHardwareSelector for a custom picking.
virtual void SetRenderer(vtkRenderer *)
Get/Set the renderer to perform the selection on.
PixelInformation GetPixelInformation(const unsigned int display_position[2], int maxDist)
It is possible to use the vtkHardwareSelector for a custom picking.
vtkIdType GetID(int low24, int mid24, int high16)
virtual PixelInformation GetPixelInformation(const unsigned int display_position[2], int maxDist, unsigned int selected_position[2])
It is possible to use the vtkHardwareSelector for a custom picking.
virtual void UpdateMaximumCellGridTupleId(vtkIdType attribid)
Called by any vtkMapper or vtkProp subclass to indicate the maximum cell or point attribute ID it use...
virtual void ProcessPixelBuffers()
vtkSelection * Select()
Perform the selection.
virtual vtkSelection * GenerateSelection()
Generates the vtkSelection from pixel buffers.
virtual vtkSelection * GenerateSelection(unsigned int r[4])
vtkIdType MaximumPointId
Clears all pixel buffers.
int FieldAssociation
Clears all pixel buffers.
static vtkHardwareSelector * New()
@ CELLGRID_SOURCE_INDEX_PASS
@ CELLGRID_TUPLE_ID_LOW24
@ CELLGRID_TUPLE_ID_HIGH24
@ CELLGRID_CELL_TYPE_INDEX_PASS
~vtkHardwareSelector() override
void ReleasePixBuffers()
Clears all pixel buffers.
virtual vtkSelection * GeneratePolygonSelection(int *polygonPoints, vtkIdType count)
Generates the vtkSelection from pixel buffers.
virtual void BeginSelection()
vtkIdType MaximumCellGridTupleId
Clears all pixel buffers.
virtual void UpdateMaximumCellId(vtkIdType attribid)
Called by any vtkMapper or vtkProp subclass to indicate the maximum cell or point attribute ID it use...
virtual void PreCapturePass(int pass)
virtual bool PassRequired(int pass)
Returns is the pass indicated is needed.
bool HasHighCellGridTupleIds()
int Convert(int xx, int yy, unsigned char *pb)
pos must be relative to the lower-left corner of this->Area.
virtual void PostCapturePass(int pass)
bool UseProcessIdFromData
Clears all pixel buffers.
bool IsPropHit(int propid)
After the ACTOR_PASS this return true or false depending upon whether the prop was hit in the ACTOR_P...
void SetPropColorValue(vtkIdType val)
Get/Set the color to be used by the prop when drawing.
std::string PassTypeToString(PassTypes type)
Convert a PassTypes enum value to a human readable string.
virtual int GetPropID(int idx, vtkProp *vtkNotUsed(prop))
Return a unique ID for the prop.
int Render(vtkRenderer *renderer, vtkProp **propArray, int propArrayCount)
Called by vtkRenderer to render the selection pass.
void BuildPropHitList(unsigned char *rgbData)
static void Convert(vtkIdType id, float tcoord[3])
int Convert(unsigned int pos[2], unsigned char *pb)
pos must be relative to the lower-left corner of this->Area.
PixelInformation GetPixelInformation(const unsigned int display_position[2])
It is possible to use the vtkHardwareSelector for a custom picking.
virtual void RenderCompositeIndex(unsigned int index)
Called by any vtkMapper or vtkProp subclass to render a composite-index.
virtual void EndSelection()
virtual void BeginRenderProp(vtkRenderWindow *)=0
double GetZValue(int propid)
void ClearBuffers()
It is possible to use the vtkHardwareSelector for a custom picking.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned char * GetPixelBuffer(int passNo)
It is possible to use the vtkHardwareSelector for a custom picking.
vtkProp * GetPropFromID(int id)
returns the prop associated with a ID.
virtual bool CaptureBuffers()
It is possible to use the vtkHardwareSelector for a custom picking.
virtual void RenderProcessId(unsigned int processid)
Called by any vtkMapper or subclass to render process id.
a simple class to control print indentation
abstract base class for most VTK objects
abstract superclass for all actors, volumes and annotations
create a window for renderers to draw into
abstract specification for renderers
data object that represents a "selection" in VTK.
abstracts an OpenGL texture object.