Inviwo  0.9.10.1
Inviwo documentation
inviwo::PickingAction Class Reference

#include <pickingaction.h>

Public Types

using Callback = std::function< void(PickingEvent *)>
 

Public Member Functions

 PickingAction (size_t start, size_t size=1)
 
size_t getPickingId (size_t id=0) const
 
bool isIndex (size_t globalId) const
 
size_t getLocalPickingId (size_t globalId=0) const
 
vec3 getColor (size_t id=0) const
 
size_t getSize () const
 
void setEnabled (bool enabled)
 
bool isEnabled () const
 
void setAction (Callback action)
 
void setProcessor (Processor *processor)
 
ProcessorgetProcessor () const
 
void operator() (PickingEvent *) const
 

Friends

class PickingManager
 

Detailed Description

Associate a range of picking colors / indices to a callback function. Created and handled by the PickingManger. Use a PickingMapper to ask the PickingManager for a PickingAction.

Member Function Documentation

◆ getColor()

vec3 inviwo::PickingAction::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

◆ getLocalPickingId()

size_t inviwo::PickingAction::getLocalPickingId ( size_t  globalId = 0) const

Returns the local picking index, the local index converted from the global index by subtracting the start id making it range from 0 to size-1

Parameters
globalIdthe global picking index

◆ getPickingId()

size_t inviwo::PickingAction::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::PickingAction::getSize ( ) const

The number of picking indices in this picking object.

◆ isIndex()

bool inviwo::PickingAction::isIndex ( size_t  globalId) const

Check if a global picking index belongs to this picking action.

◆ setAction()

void inviwo::PickingAction::setAction ( Callback  action)

Set the callback action

◆ setEnabled()

void inviwo::PickingAction::setEnabled ( bool  enabled)

Enable or disable calling of the callback action.

◆ setProcessor()

void inviwo::PickingAction::setProcessor ( Processor processor)

Set the processor where the picking colors is drawn.


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