Inviwo
0.9.10.1
Inviwo documentation
|
RAII tool for PickingActions. More...
#include <pickingmapper.h>
Public Member Functions | |
PickingMapper (PickingManager *manager=PickingManager::getPtr()) | |
PickingMapper (Processor *p, size_t size, std::function< void(PickingEvent *)> callback, PickingManager *manager=PickingManager::getPtr()) | |
PickingMapper (const PickingMapper &rhs)=delete | |
PickingMapper & | operator= (const PickingMapper &that)=delete |
PickingMapper (PickingMapper &&rhs) | |
PickingMapper & | operator= (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 PickingAction * | getPickingAction () const |
RAII tool for PickingActions.
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.
inviwo::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
id | the local picking index |
const PickingAction * inviwo::PickingMapper::getPickingAction | ( | ) | const |
Retrieve the underlaying picking action.
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.
id | the local picking index |
size_t inviwo::PickingMapper::getSize | ( | ) | const |
The number of picking indices in this picking object.
bool inviwo::PickingMapper::isEnabled | ( | ) | const |
Enable or disable calling of the callback action.
void inviwo::PickingMapper::resize | ( | size_t | newSize | ) |
Resize the underlaying PickingAction. This will invalidate all old indices/colors