ImFusion C++ SDK 4.4.0
ImFusion::PointBasedAnnotationManipulator Class Reference

#include <ImFusion/GUI/PointBasedAnnotationManipulator.h>

Manipulator for point-based annotations. More...

Inheritance diagram for ImFusion::PointBasedAnnotationManipulator:

Detailed Description

Manipulator for point-based annotations.

Classes

struct  MouseEvent
 Mouse event structure. More...
class  InteractionModeWrapper

Public Types

enum  InteractionMode {
  InteractionNone = 0 , InteractionCreate = 1 , InteractionMove = 2 , InteractionAdd = 4 ,
  InteractionRemove = 8 , InteractionEdit = 16 , InteractionScale = 32 , InteractionRotate = 64
}
enum class  VolumeViewPickingMode { On , Off , Automatic }
 Enumeration to describe when PointBasedAnnotationManipulator should perform 3D position picking in GlVolumeViews. More...

Public Member Functions

 PointBasedAnnotationManipulator (GlPointBasedAnnotation &annotation)
bool sceneEvent (QEvent *event, const GlView &view) override
virtual bool sceneEvent3D (const MouseEvent &ev, const GlVolumeView &view)
bool get3dPos (const MouseEvent &ev, const GlVolumeView &view, vec3 &result)
virtual void setInteractionMode (PointBasedAnnotationManipulator::InteractionMode mode, bool finalize=true)
 Sets the interaction mode.
InteractionMode interactionMode () const
 Returns the interactions mode.
void setAllowedInteractions (Flags< PointBasedAnnotationManipulator::InteractionMode > allowedInteractions)
 Sets allowed interactions.
Flags< PointBasedAnnotationManipulator::InteractionMode > allowedInteractions () const
 Returns the allowed interactions.
void setHovering (bool hovering)
 Sets the hovering behavior (i.e.
bool hovering () const
 Returns whether hovering support is enabled.
void reset ()
 Resets all parameters to their default value.
void setPoints (const std::vector< vec3 > &points)
void setAxisManip (int axis)
 Set axis along which points can be moved. Point coordinates will be fixed on other axes. Only applies to move and edit interactions.
void clearAxisManip ()
 Make point movable along all axes.
void setBounds (double x0, double x1, double y0, double y1, double z0, double z1)
 Set bounds for allowed point coordinates.
void clearBounds ()
 Clear bounds.
MouseEvent::Button lastButton () const
 Return button with which last interaction was performed.
virtual void setHoverCursor ()
 Sets cursor to open hand.
virtual void setInteractionCursor ()
 Sets cursor to closed (grabbing) hand.
void resetCursor ()
 Resets cursor to default.
void setInteractiveAnnotation (InteractiveAnnotation *annot)
bool requiresFocus () override
 Derived classes that need priority scene events can override this.
void setVolumeViewPickingMode (VolumeViewPickingMode pickingMode)
void setChangeCursorOnEdit (bool change)
Qt::Key finishCreationKey () const
void setFinishCreationKey (Qt::Key key)
Qt::Key abortCreationKey () const
void setAbortCreationKey (Qt::Key key)
Public Member Functions inherited from ImFusion::Manipulator
void addListener (ManipulatorListener *listener)
void removeListener (const ManipulatorListener *listener)
virtual void openContextMenu (QPoint pos, QPoint globalPos, Qt::KeyboardModifiers modifiers)
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.

Public Attributes

Signal< const PointBasedAnnotationManipulator * > signalCreatingFinished
 Emitted when the manipulator leaves the InteractionCreate mode.

Protected Member Functions

virtual InteractionMode selectInteraction (const MouseEvent &ev, bool hitLine)
 Selects the next interaction given the mouse event and hitLine.
virtual bool onCreate (const MouseEvent &event, vec3 &X, bool &update, const GlView &view)
 Handler for mouse events in the InteractionCreate mode.
virtual bool onMove (const MouseEvent &event, vec3 &X, bool &update)
 Handler for mouse events in the InteractionMove mode.
virtual bool onAdd (const MouseEvent &event, vec3 &X, bool &update)
 Handler for mouse events in the InteractionAdd mode.
virtual bool onRemove (const MouseEvent &event, vec3 &X, bool &update)
 Handler for mouse events in the InteractionRemove mode.
virtual bool onEdit (const MouseEvent &event, vec3 &X, bool &update, const GlView &view)
 Handler for mouse events in the InteractionEdit mode.
virtual bool onScale (const MouseEvent &event, vec3 &X, bool &update)
 Handler for mouse events in the InteractionScale mode.
virtual bool onRotate (const MouseEvent &event, vec3 &X, bool &update, const GlView &view)
 Handler for mouse events in the InteractionRotate mode.
void finalizeInteraction ()
virtual bool pickingNeeded ()
bool computeCursorMeshIntersection (const MouseEvent &event, const GlVolumeView &view, const GlMesh *mesh, vec3 &result)
void enablePicking (GlVolumeView &view)
void disablePicking ()
Protected Member Functions inherited from ImFusion::Manipulator
void notifyListeners (void *eventData)

Protected Attributes

GlPointBasedAnnotationm_annotation
GlObject::RenderingOrderGroup m_originalAnnotationRenderingOrder = GlObject::RenderingGroupRest
vec3 m_pos0
int m_selectedPoint
InteractionModeWrapper m_interactionMode
Flags< InteractionMode > m_allowedInteractions
bool m_hovering
std::vector< vec3 > m_points0
int m_axisManip
bool m_useBounds
double m_bounds [6]
bool m_changeCursorOnEdit = false
bool m_interactionCursor = false
bool m_hoverCursor = false
bool m_wantsFocus
bool m_suppressNextContextMenuEvent
 If true, the context menu is not shown after right mouse release (usually set after a move).
bool m_isPressed = false
VolumeViewPickingMode m_3dPickingMode = VolumeViewPickingMode::On
InteractiveAnnotationm_interactiveAnnotation
vec3 m_center
vec2i m_mouse0
vec2i m_mouse
vec3 m_depthAxis
vec3 m_xAxis
vec3 m_yAxis
std::unique_ptr< GlVolumeView::PickingTokenm_pickingToken
std::map< GlMesh *, int > m_originalMeshPickingModes
MouseEvent::Button m_lastButton
Qt::Key m_abortCreationKey
Qt::Key m_finishCreationKey

Member Enumeration Documentation

◆ VolumeViewPickingMode

Enumeration to describe when PointBasedAnnotationManipulator should perform 3D position picking in GlVolumeViews.

Enumerator
On 

Always on.

Off 

Always off.

Automatic 

Automatic based on annotation type, and presence of meshes in the AnnotationModel.

Member Function Documentation

◆ sceneEvent()

bool ImFusion::PointBasedAnnotationManipulator::sceneEvent ( QEvent * event,
const GlView & view )
overridevirtual

Implements ImFusion::Manipulator.

◆ setInteractionMode()

virtual void ImFusion::PointBasedAnnotationManipulator::setInteractionMode ( PointBasedAnnotationManipulator::InteractionMode mode,
bool finalize = true )
virtual

Sets the interaction mode.

Parameters
modeinteraction mode

◆ interactionMode()

InteractionMode ImFusion::PointBasedAnnotationManipulator::interactionMode ( ) const
inline

Returns the interactions mode.

Returns
interaction mode

◆ setAllowedInteractions()

void ImFusion::PointBasedAnnotationManipulator::setAllowedInteractions ( Flags< PointBasedAnnotationManipulator::InteractionMode > allowedInteractions)
inline

Sets allowed interactions.

Parameters
allowedInteractionsallowed interactions

◆ allowedInteractions()

Flags< PointBasedAnnotationManipulator::InteractionMode > ImFusion::PointBasedAnnotationManipulator::allowedInteractions ( ) const
inline

Returns the allowed interactions.

Returns
allowed interactions

◆ setHovering()

void ImFusion::PointBasedAnnotationManipulator::setHovering ( bool hovering)
inline

Sets the hovering behavior (i.e.

whether to update the point set on mouse hovering events)

Parameters
hoveringtrue to enable hovering support

◆ hovering()

bool ImFusion::PointBasedAnnotationManipulator::hovering ( ) const
inline

Returns whether hovering support is enabled.

Returns
true if hovering support is enabled

◆ setHoverCursor()

virtual void ImFusion::PointBasedAnnotationManipulator::setHoverCursor ( )
virtual

Sets cursor to open hand.

Reimplemented in ImFusion::FreeformAnnotationManipulator.

◆ setInteractionCursor()

virtual void ImFusion::PointBasedAnnotationManipulator::setInteractionCursor ( )
virtual

Sets cursor to closed (grabbing) hand.

Reimplemented in ImFusion::FreeformAnnotationManipulator.

◆ requiresFocus()

bool ImFusion::PointBasedAnnotationManipulator::requiresFocus ( )
inlineoverridevirtual

Derived classes that need priority scene events can override this.

By definition only one manipulator can get served first, so use with care.

Reimplemented from ImFusion::Manipulator.

◆ onCreate()

virtual bool ImFusion::PointBasedAnnotationManipulator::onCreate ( const MouseEvent & event,
vec3 & X,
bool & update,
const GlView & view )
protectedvirtual

Handler for mouse events in the InteractionCreate mode.

Parameters
eventmouse event
updatetrue if the point set was changed (output parameter)

Reimplemented in ImFusion::LoopManipulator, and ImFusion::SmartSplineManipulator.

◆ onMove()

virtual bool ImFusion::PointBasedAnnotationManipulator::onMove ( const MouseEvent & event,
vec3 & X,
bool & update )
protectedvirtual

Handler for mouse events in the InteractionMove mode.

Parameters
eventmouse event
updatetrue if the point set was changed (output parameter)

Reimplemented in ImFusion::CurveEditorManipulator, and ImFusion::LoopManipulator.

◆ onAdd()

virtual bool ImFusion::PointBasedAnnotationManipulator::onAdd ( const MouseEvent & event,
vec3 & X,
bool & update )
protectedvirtual

Handler for mouse events in the InteractionAdd mode.

Parameters
eventmouse event
updatetrue if the point set was changed (output parameter)

Reimplemented in ImFusion::CurveEditorManipulator.

◆ onRemove()

virtual bool ImFusion::PointBasedAnnotationManipulator::onRemove ( const MouseEvent & event,
vec3 & X,
bool & update )
protectedvirtual

Handler for mouse events in the InteractionRemove mode.

Parameters
eventmouse event
updatetrue if the point set was changed (output parameter)

Reimplemented in ImFusion::CurveEditorManipulator.

◆ onEdit()

virtual bool ImFusion::PointBasedAnnotationManipulator::onEdit ( const MouseEvent & event,
vec3 & X,
bool & update,
const GlView & view )
protectedvirtual

Handler for mouse events in the InteractionEdit mode.

Parameters
eventmouse event
updatetrue if the point set was changed (output parameter)

Reimplemented in ImFusion::CurveEditorManipulator, and ImFusion::LoopManipulator.

◆ onScale()

virtual bool ImFusion::PointBasedAnnotationManipulator::onScale ( const MouseEvent & event,
vec3 & X,
bool & update )
protectedvirtual

Handler for mouse events in the InteractionScale mode.

Parameters
eventmouse event
updatetrue if the point set was changed (output parameter)

◆ onRotate()

virtual bool ImFusion::PointBasedAnnotationManipulator::onRotate ( const MouseEvent & event,
vec3 & X,
bool & update,
const GlView & view )
protectedvirtual

Handler for mouse events in the InteractionRotate mode.

Parameters
eventmouse event
updatetrue if the point set was changed (output parameter)

The documentation for this class was generated from the following file:
  • ImFusion/GUI/PointBasedAnnotationManipulator.h
Search Tab / S to search, Esc to close