Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::PickingMapper Class Reference

RAII tool for PickingActions. More...

#include <pickingmapper.h>

Public Member Functions

 PickingMapper (Processor *p, size_t size, std::function< void(PickingEvent *)> callback, PickingManager *manager=PickingManager::getPtr())
 
 PickingMapper (const PickingMapper &rhs)=delete
 
PickingMapperoperator= (const PickingMapper &that)=delete
 
 PickingMapper (PickingMapper &&rhs)
 
PickingMapperoperator= (PickingMapper &&that)
 
void resize (size_t newSize)
 
bool isEnabled () const
 
void setEnabled (bool enabled)
 
size_t getPickingId (size_t id=0) const
 
vec3 getColor (size_t id=0) const
 
size_t getSize () const
 
const PickingActiongetPickingAction () const
 

Detailed Description

RAII tool for PickingActions.

Constructor & Destructor Documentation

◆ PickingMapper()

inviwo::PickingMapper::PickingMapper ( Processor * p,
size_t size,
std::function< void(PickingEvent *)> callback,
PickingManager * manager = PickingManager::getPtr() )

Construct a picking mapper. This will register a range of colors in the PickingMangaer and create a PickingAction to associate those indices the the supplied action. The processor argument should be the processor where the picking colors are drawn.

Member Function Documentation

◆ getColor()

vec3 inviwo::PickingMapper::getColor ( size_t id = 0) const

The picking color to use for the object with local index id. This is eqvivalent to PickingManager::indexToColor(getPickingId(id))/255.0

Parameters
idthe local picking index

◆ getPickingAction()

const PickingAction * inviwo::PickingMapper::getPickingAction ( ) const

Retrieve the underlaying picking action.

◆ getPickingId()

size_t inviwo::PickingMapper::getPickingId ( size_t id = 0) const

Returns the global picking index, the global index can be used with the PickingManager::indexToColor(size_t index) function to get a picking color.

Parameters
idthe local picking index

◆ getSize()

size_t inviwo::PickingMapper::getSize ( ) const

The number of picking indices in this picking object.

◆ isEnabled()

bool inviwo::PickingMapper::isEnabled ( ) const

Enable or disable calling of the callback action.

◆ resize()

void inviwo::PickingMapper::resize ( size_t newSize)

Resize the underlaying PickingAction. This will invalidate all old indices/colors


The documentation for this class was generated from the following file: