ImFusion SDK 4.3
LabelingManipulator Class Reference

#include <ImFusion/Seg/LabelingManipulator.h>

Manipulator for circle-based annotations. More...

+ Inheritance diagram for LabelingManipulator:

Detailed Description

Manipulator for circle-based annotations.

Public Types

enum class  Mode { Draw , FloodFill }
 
using MouseWheelCallback = std::function<GUI::EventResult(bool, Flags<GUI::InputEvent::KeyboardModifier>)>
 

Public Member Functions

 LabelingManipulator (SharedImageSet &inputImage, SharedImageSet &labelMap, GlCircle *circle, Mode mode=Mode::Draw)
 
void setLabel (int label)
 
void clear ()
 
bool active () const
 returns whether the manipulator is currently active (i.e. a mouse button is pressed)
 
GUI::EventResult handleInputEvent (const GUI::InputEvent &event, const GUI::View &view) override
 This function is called by sources of input events in order to dispatch them to the handlers.
 
void setMouseWheelCallback (MouseWheelCallback m)
 
void setModified (bool b)
 
bool isModified () const
 
bool undo ()
 
bool hasUndo () const
 
void recordUndo ()
 
bool clearUndo ()
 
void performFloodFill (vec3 world)
 
Seg::LabelPainterpainter ()
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Public Attributes

Signal< bool > undoStateChanged
 
Signal labelModified
 
Signal< int > pressed
 
Signal< int > released
 

Protected Member Functions

bool sceneEventDraw (const vec3 &world, int label)
 
bool sceneEventFloodFill (const vec3 &world)
 
void updateIndicator (const GlView &view)
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Protected Attributes

SharedImageSetm_inputImage
 
SharedImageSetm_labelMap
 
int m_label = 1
 
Seg::LabelPainter m_painter
 
bool m_modified = false
 
int m_indexOfPreviousLabel = 0
 
bool m_previousLabelValid = false
 index within the SharedImageSet that the undo label applies to
 
std::unique_ptr< SharedImagem_previousLabelData
 
bool m_active = false
 
GlCirclem_circle = nullptr
 
Mode m_mode = Mode::Draw
 
std::optional< vec3 > m_storedPoint
 
MouseWheelCallback m_wheelCallback
 to avoid gaps when painting and moving the cursor across a long distance
 

Member Function Documentation

◆ handleInputEvent()

GUI::EventResult handleInputEvent ( const GUI::InputEvent & event,
const GUI::View & view )
overridevirtual

This function is called by sources of input events in order to dispatch them to the handlers.

In case there are more than one InputEventHandlers dispatchers are intended call this function consecutively until the first handler indicates to stop by returning a result where EventResult::stopPropagation() is true.

Implements ViewObject::EventHandler.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close