Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
Basic interaction methods for mitk::GeometryData. More...
#include <mitkBoundingShapeInteractor.h>
Public Member Functions | |
mitkClassMacro (BoundingShapeInteractor, DataInteractor) | |
Pointer | Clone () const |
void | SetDataNode (DataNode *dataNode) override |
void | SetRotationEnabled (bool rotationEnabled) |
![]() | |
virtual std::vector< std::string > | GetClassHierarchy () const override |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
DataNode * | GetDataNode () const |
int | GetLayer () const |
ProcessEventMode | GetMode () const |
![]() | |
bool | LoadStateMachine (const std::string &filename, const us::Module *module=nullptr) |
Loads XML resource. More... | |
bool | HandleEvent (InteractionEvent *event, DataNode *dataNode) |
void | EnableUndo (bool enable) |
Enables or disabled Undo. More... | |
void | EnableInteraction (bool enable) |
Enables/disables the state machine. In un-enabled state it won't react to any events. More... | |
![]() | |
bool | SetEventConfig (const std::string &filename, const us::Module *module=nullptr) |
Loads a configuration from an XML resource. More... | |
bool | SetEventConfig (const EventConfig &config) |
Loads a configuration from an EventConfig object. More... | |
EventConfig | GetEventConfig () const |
Returns the current configuration. More... | |
bool | AddEventConfig (const std::string &filename, const us::Module *module=nullptr) |
This method extends the configuration. More... | |
bool | AddEventConfig (const EventConfig &config) |
This method extends the configuration. The configuration from the EventConfig object is loaded and only the ones conflicting are replaced by the new one. This way several configurations can be combined. More... | |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
![]() | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
BoundingShapeInteractor () | |
~BoundingShapeInteractor () override | |
void | ConnectActionsAndFunctions () override |
void | DataNodeChanged () override |
Called when a DataNode has been set/changed. More... | |
void | HandlePositionChanged (const InteractionEvent *interactionEvent, Point3D ¢er) |
virtual bool | CheckOverObject (const InteractionEvent *) |
Checks if the mouse pointer is over the object. More... | |
virtual bool | CheckOverHandles (const InteractionEvent *interactionEvent) |
Checks if the mouse pointer is over one of the assigned handles. More... | |
virtual void | SelectObject (StateMachineAction *, InteractionEvent *) |
Called if the mouse pointer is over the object indicated by a color change. More... | |
virtual void | DeselectObject (StateMachineAction *, InteractionEvent *) |
Called if the mouse pointer leaves the area of the object. More... | |
virtual void | SelectHandle (StateMachineAction *, InteractionEvent *) |
Called if the mouse pointer is over one of the handles indicated by a color change. More... | |
virtual void | TranslateObject (StateMachineAction *, InteractionEvent *) |
Performs a translation of the object relative to the mouse movement. More... | |
virtual void | ScaleObject (StateMachineAction *, InteractionEvent *) |
Performs a object shape change by influencing the scaling of the initial bounding box. More... | |
virtual void | InitInteraction (StateMachineAction *, InteractionEvent *interactionEvent) |
Initializes the movement, stores starting position. More... | |
virtual void | DeselectHandles (StateMachineAction *, InteractionEvent *interactionEvent) |
Deselects all Handles at the end of interaction. More... | |
virtual void | RestoreNodeProperties () |
Restore default properties of bounding box and handles. More... | |
bool | InitMembers (InteractionEvent *interactionEvent) |
Initializes member variables. More... | |
![]() | |
DataInteractor () | |
~DataInteractor () override | |
void | ConnectActionsAndFunctions () override |
Overwrite this function to connect actions from StateMachine description with functions. More... | |
virtual void | NotifyStart () |
Sends StartInteraction event via the mitk::DataNode. More... | |
virtual void | NotifyResultReady () |
NotifyResultReady Sends ResultReady event via the mitk::DataNode. More... | |
![]() | |
EventStateMachine () | |
~EventStateMachine () override | |
void | AddActionFunction (const std::string &action, TActionFunctor *functor) |
void | AddActionFunction (const std::string &action, const ActionFunctionDelegate &delegate) |
void | AddConditionFunction (const std::string &condition, const ConditionFunctionDelegate &delegate) |
StateMachineState * | GetCurrentState () const |
void | ResetToStartState () |
ResetToStartState Reset state machine to it initial starting state. More... | |
virtual bool | CheckCondition (const StateMachineCondition &condition, const InteractionEvent *interactionEvent) |
virtual void | ExecuteAction (StateMachineAction *action, InteractionEvent *interactionEvent) |
virtual bool | FilterEvents (InteractionEvent *interactionEvent, DataNode *dataNode) |
void | SetMouseCursor (const char *xpm[], int hotspotX, int hotspotY) |
Sets the specified mouse cursor. More... | |
void | ResetMouseCursor () |
Resets the mouse cursor (if modified by the SlicesCoordinator) to its original state. More... | |
StateMachineTransition * | GetExecutableTransition (InteractionEvent *event) |
Returns the executable transition for the given event. More... | |
![]() | |
InteractionEventHandler () | |
~InteractionEventHandler () override | |
PropertyList::Pointer | GetAttributes () const |
std::string | MapToEventVariant (InteractionEvent *interactionEvent) |
virtual void | ConfigurationChanged () |
Basic interaction methods for mitk::GeometryData.
Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
Definition at line 38 of file mitkBoundingShapeInteractor.h.
|
protected |
Definition at line 65 of file mitkBoundingShapeInteractor.cpp.
|
overrideprotected |
Definition at line 69 of file mitkBoundingShapeInteractor.cpp.
References RestoreNodeProperties().
|
protectedvirtual |
Checks if the mouse pointer is over one of the assigned handles.
Definition at line 242 of file mitkBoundingShapeInteractor.cpp.
References activeHandleIdPropertyName, mitk::GetCornerPoints(), mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::BaseRenderer::GetDisplaySizeInMM(), mitk::RenderingManager::GetInstance(), mitk::DataNode::GetProperty(), mitk::DataNode::GetPropertyList(), mitk::BaseRenderer::GetScaleFactorMMPerDisplayUnit(), mitk::InteractionEvent::GetSender(), HandlePositionChanged(), mitk::IntProperty::New(), mitk::RenderingManager::RequestUpdateAll(), mitk::PropertyList::SetProperty(), and mitk::BaseRenderer::WorldToDisplay().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Checks if the mouse pointer is over the object.
Definition at line 195 of file mitkBoundingShapeInteractor.cpp.
References mitk::BaseRenderer::DisplayToWorld(), mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::InteractionEvent::GetSender(), and mitk::BaseRenderer::GetTimeStep().
Referenced by ConnectActionsAndFunctions().
Pointer mitk::BoundingShapeInteractor::Clone | ( | ) | const |
|
overrideprotectedvirtual |
Here actions strings from the loaded state machine pattern are mapped to functions of the DataInteractor. These functions are called when an action from the state machine pattern is executed.
Reimplemented from mitk::EventStateMachine.
Definition at line 75 of file mitkBoundingShapeInteractor.cpp.
References CheckOverHandles(), CheckOverObject(), CONNECT_CONDITION, CONNECT_FUNCTION, DeselectHandles(), DeselectObject(), InitInteraction(), ScaleObject(), SelectHandle(), SelectObject(), and TranslateObject().
|
overrideprotectedvirtual |
Called when a DataNode has been set/changed.
Reimplemented from mitk::DataInteractor.
Definition at line 121 of file mitkBoundingShapeInteractor.cpp.
References activeHandleIdPropertyName, boundingShapePropertyName, deselectedColorPropertyName, mitk::DataInteractor::GetDataNode(), mitk::RenderingManager::GetInstance(), mitk::BoolProperty::New(), mitk::IntProperty::New(), mitk::ColorProperty::New(), mitk::RenderingManager::RequestUpdateAll(), selectedColor, and selectedColorPropertyName.
Referenced by SetDataNode().
|
protectedvirtual |
Deselects all Handles at the end of interaction.
Definition at line 321 of file mitkBoundingShapeInteractor.cpp.
References activeHandleIdPropertyName, mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::RenderingManager::GetInstance(), mitk::DataNode::GetPropertyList(), mitk::IntProperty::New(), mitk::RenderingManager::RequestUpdateAll(), mitk::PropertyList::SetProperty(), and mitk::BaseData::UpdateOutputInformation().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Called if the mouse pointer leaves the area of the object.
Definition at line 357 of file mitkBoundingShapeInteractor.cpp.
References deselectedColorPropertyName, mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::RenderingManager::GetInstance(), mitk::RenderingManager::RequestUpdateAll(), and mitk::BaseData::UpdateOutputInformation().
Referenced by ConnectActionsAndFunctions().
|
protected |
Definition at line 156 of file mitkBoundingShapeInteractor.cpp.
References mitk::CalcAvgPoint(), mitk::GetCornerPoints(), mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::InteractionEvent::GetSender(), and mitk::BaseRenderer::GetTimeStep().
Referenced by CheckOverHandles().
|
protectedvirtual |
Initializes the movement, stores starting position.
Definition at line 379 of file mitkBoundingShapeInteractor.cpp.
References InitMembers().
Referenced by ConnectActionsAndFunctions().
|
protected |
Initializes member variables.
Definition at line 384 of file mitkBoundingShapeInteractor.cpp.
Referenced by InitInteraction().
mitk::BoundingShapeInteractor::mitkClassMacro | ( | BoundingShapeInteractor | , |
DataInteractor | |||
) |
|
static |
|
protectedvirtual |
Restore default properties of bounding box and handles.
Definition at line 534 of file mitkBoundingShapeInteractor.cpp.
References activeHandleIdPropertyName, boundingShapePropertyName, mitk::DataInteractor::GetDataNode(), mitk::RenderingManager::GetInstance(), us::GetModuleContext(), ModuleContext::GetService(), ModuleContext::GetServiceReferences(), mitk::BoolProperty::New(), mitk::IntProperty::New(), mitk::ColorProperty::New(), mitk::RenderingManager::RequestUpdateAll(), and mitk::InteractionEventHandler::SetEventConfig().
Referenced by SetDataNode(), and ~BoundingShapeInteractor().
|
protectedvirtual |
Performs a object shape change by influencing the scaling of the initial bounding box.
Definition at line 431 of file mitkBoundingShapeInteractor.cpp.
References mitk::CalcAvgPoint(), mitk::BaseRenderer::DisplayToWorld(), mitk::GetCornerPoints(), mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::RenderingManager::GetInstance(), mitk::InteractionEvent::GetSender(), mitk::BaseRenderer::GetTimeStep(), mitk::RenderingManager::RequestUpdateAll(), and mitk::BaseData::UpdateOutputInformation().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Called if the mouse pointer is over one of the handles indicated by a color change.
Definition at line 301 of file mitkBoundingShapeInteractor.cpp.
References deselectedColorPropertyName, mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::RenderingManager::GetInstance(), mitk::DataNode::GetPropertyList(), mitk::RenderingManager::RequestUpdateAll(), selectedColor, mitk::PropertyList::SetProperty(), and mitk::BaseData::UpdateOutputInformation().
Referenced by ConnectActionsAndFunctions().
|
protectedvirtual |
Called if the mouse pointer is over the object indicated by a color change.
Definition at line 337 of file mitkBoundingShapeInteractor.cpp.
References mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::RenderingManager::GetInstance(), mitk::RenderingManager::RequestUpdateAll(), selectedColor, selectedColorPropertyName, and mitk::BaseData::UpdateOutputInformation().
Referenced by ConnectActionsAndFunctions().
|
overridevirtual |
Reimplemented from mitk::DataInteractor.
Definition at line 185 of file mitkBoundingShapeInteractor.cpp.
References DataNodeChanged(), RestoreNodeProperties(), and mitk::DataInteractor::SetDataNode().
void mitk::BoundingShapeInteractor::SetRotationEnabled | ( | bool | rotationEnabled | ) |
Definition at line 116 of file mitkBoundingShapeInteractor.cpp.
|
protectedvirtual |
Performs a translation of the object relative to the mouse movement.
Definition at line 398 of file mitkBoundingShapeInteractor.cpp.
References mitk::BaseRenderer::DisplayToWorld(), mitk::DataNode::GetData(), mitk::DataInteractor::GetDataNode(), mitk::TimeGeometry::GetGeometryForTimeStep(), mitk::RenderingManager::GetInstance(), mitk::InteractionEvent::GetSender(), mitk::BaseRenderer::GetTimeStep(), mitk::BaseData::GetUpdatedTimeGeometry(), mitk::RenderingManager::RequestUpdateAll(), and mitk::BaseData::UpdateOutputInformation().
Referenced by ConnectActionsAndFunctions().