Page MenuHomePhabricator

bug3252.diff

Authored By
xplanes
Jan 22 2010, 9:32 AM
Size
87 KB
Referenced Files
None
Subscribers
None

bug3252.diff

Index: Core/Code/Controllers/mitkSlicesRotatorMovement.cpp
===================================================================
--- Core/Code/Controllers/mitkSlicesRotatorMovement.cpp (revision 0)
+++ Core/Code/Controllers/mitkSlicesRotatorMovement.cpp (revision 0)
@@ -0,0 +1,488 @@
+/*
+* Copyright (c) 2009,
+* Computational Image and Simulation Technologies in Biomedicine (CISTIB),
+* Universitat Pompeu Fabra (UPF), Barcelona, Spain. All rights reserved.
+* See license.txt file for details.
+*/
+
+#include "mitkSlicesRotatorMovement.h"
+#include <mitkSliceNavigationController.h>
+
+#include <mitkStateEvent.h>
+#include <mitkAction.h>
+#include <mitkInteractionConst.h>
+#include <mitkDisplayPositionEvent.h>
+#include <mitkRotationOperation.h>
+#include <mitkBaseRenderer.h>
+#include <mitkRenderingManager.h>
+#include <mitkLine.h>
+#include <mitkGeometry3D.h>
+#include <mitkGeometry2D.h>
+#include <mitkPlaneGeometry.h>
+#include <mitkDisplayGeometry.h>
+#include <mitkSlicedGeometry3D.h>
+#include <mitkTimeSlicedGeometry.h>
+#include <mitkApplicationCursor.h>
+
+#include <vtkLinearTransform.h>
+
+#include <math.h>
+
+#include "rotate_cursor.xpm"
+#include "move_cursor.xpm"
+#include "move_single_plane_cursor.xpm"
+
+using namespace mitk;
+
+//! In pixels
+const double ThreshHoldDistancePixelsMin = 20;
+//! In pixels
+const double ThreshHoldDistancePixelsMax = 80;
+
+
+mitk::SlicesRotatorMovement::SlicesRotatorMovement(const char* machine)
+: mitk::SlicesRotator(machine)
+{
+ m_vtkLastRenderWindow = NULL;
+}
+
+SlicesRotatorMovement::~SlicesRotatorMovement()
+{
+
+}
+
+
+bool mitk::SlicesRotatorMovement::ExecuteAction(Action* action, StateEvent const* stateEvent)
+{
+
+ bool ok = false;
+
+ //std::cout
+ // << "StateEventID: " << stateEvent->GetId() << ", "
+ // << "Action: " << action->GetActionId() << ", "
+ // << "Next State: " << GetCurrentState()->GetName()
+ // << std::endl;
+
+ switch ( action->GetActionId() )
+ {
+ case AcMOVE:
+ {
+ // just reach through
+ for (SNCVector::iterator iter = m_SNCsToBeMoved.begin(); iter != m_SNCsToBeMoved.end(); ++iter)
+ {
+ if ( !(*iter)->GetSliceRotationLocked() )
+ {
+ (*iter)->ExecuteAction(action, stateEvent);
+ }
+ }
+
+ ok = true;
+ break;
+ }
+ case AcROTATE:
+ {
+ const DisplayPositionEvent* posEvent = dynamic_cast<const DisplayPositionEvent*>(stateEvent->GetEvent());
+ if (!posEvent) break;
+
+ Point3D cursor = posEvent->GetWorldPosition();
+
+ Vector3D toProjected = m_LastCursorPosition - m_CenterOfRotation;
+ Vector3D toCursor = cursor - m_CenterOfRotation;
+
+ // cross product: | A x B | = |A| * |B| * sin(angle)
+ Vector3D axisOfRotation;
+ vnl_vector_fixed< ScalarType, 3 > vnlDirection = vnl_cross_3d( toCursor.GetVnlVector(), toProjected.GetVnlVector() );
+ axisOfRotation.SetVnlVector(vnlDirection);
+
+ // scalar product: A * B = |A| * |B| * cos(angle)
+ // tan = sin / cos
+ ScalarType angle = - atan2( (double)(axisOfRotation.GetNorm()), (double)(toCursor * toProjected) );
+ angle *= 180.0 / vnl_math::pi;
+ m_LastCursorPosition = cursor;
+
+ // create RotationOperation and apply to all SNCs that should be rotated
+ RotationOperation op(OpROTATE, m_CenterOfRotation, axisOfRotation, angle);
+
+ // TEST
+ int i = 0;
+
+ for (SNCVector::iterator iter = m_SNCsToBeRotated.begin(); iter != m_SNCsToBeRotated.end(); ++iter)
+ {
+ if ( !(*iter)->GetSliceRotationLocked() )
+ {
+ BaseRenderer *renderer = (*iter)->GetRenderer();
+ if ( renderer == NULL )
+ {
+ break;
+ }
+
+ DisplayGeometry *displayGeometry = renderer->GetDisplayGeometry();
+
+ // std::cout << i << ":" << std::endl;
+
+ Point2D point2DWorld, point2DDisplayPre, point2DDisplayPost;
+ displayGeometry->Map( m_CenterOfRotation, point2DWorld );
+ displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPre );
+
+ // std::cout << " WorldPre: " << point2DWorld << " / DisplayPre: " << point2DDisplayPre << std::endl;
+
+ const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
+ const TimeSlicedGeometry* timeSlicedGeometry = dynamic_cast<const TimeSlicedGeometry*>(geometry3D);
+ if (!timeSlicedGeometry) continue;
+
+ const_cast<TimeSlicedGeometry*>(timeSlicedGeometry)->ExecuteOperation(&op);
+
+ displayGeometry->Map( m_CenterOfRotation, point2DWorld );
+ displayGeometry->WorldToDisplay( point2DWorld, point2DDisplayPost );
+ Vector2D vector2DDisplayDiff = point2DDisplayPost - point2DDisplayPre;
+
+ Vector2D origin = displayGeometry->GetOriginInMM();
+ // std::cout << " WorldPost: " << point2DWorld << " / DisplayPost: " << point2DDisplayPost << std::endl;
+ // std::cout << " Diff - " << vector2DDisplayDiff << std::endl;
+ // std::cout << " Origin - " << origin << std::endl;
+ ++i;
+
+ displayGeometry->MoveBy( vector2DDisplayDiff );
+
+ (*iter)->SendCreatedWorldGeometryUpdate();
+ }
+ }
+ // std::cout << "--------------------------------" << std::endl;
+
+
+
+ // TEST
+ //BaseRenderer* renderer = stateEvent->GetEvent()->GetSender(); // TODO this is NOT SNC-specific! Should be!
+ //
+ //DisplayGeometry* displayGeometry = renderer->GetDisplayGeometry();
+ //if (!displayGeometry) break;
+
+ //Point2D point2DWorld, point2DDisplay;
+ //displayGeometry->Map( m_CenterOfRotation, point2DWorld );
+ //displayGeometry->WorldToDisplay( point2DWorld, point2DDisplay );
+
+ //std::cout << "RotationCenter: " << m_CenterOfRotation << std::endl;
+ //std::cout << "PointWorld: " << point2DWorld << std::endl;
+ //std::cout << "PointDisplay: " << point2DDisplay << std::endl;
+ //std::cout << "--------------------------------------------" << std::endl;
+
+
+
+ RenderingManager::GetInstance()->RequestUpdateAll();
+
+ ok = true;
+ break;
+ }
+ case AcCHECKPOINT:
+ {
+ // decide between moving and rotation
+ // Configure next event
+ EActions action = AcDONOTHING;
+
+
+ // Alle SNCs (Anzahl N) nach dem Abstand von posEvent->GetWorldPosition() zur aktuellen Ebene fragen.
+ // Anzahl der Ebenen zaehlen, die naeher als ein gewisser Schwellwertwert sind -> nNah.
+ // Wenn nNah == N
+ // Generiere ein PointEvent und schicke das an alle SNCs -> bewege den kreuz-mittelpunkt
+ // Wenn nNah == 2
+ // Streiche stateEvent->Sender aus der Liste der nahen Ebenen
+ // fuer die uebrigen generiere eine RotationOperation und fuehre die aus
+ // sonst
+ //
+ bool positionIsSet = false;
+ Point3D cursor;
+
+ const DisplayPositionEvent* posEvent = dynamic_cast<const DisplayPositionEvent*>(stateEvent->GetEvent());
+ if (posEvent)
+ {
+ cursor = posEvent->GetWorldPosition();
+ positionIsSet = true;
+ }
+ const KeyEvent* keyEvent = dynamic_cast<const KeyEvent*>(stateEvent->GetEvent());
+ if ( keyEvent && keyEvent->GetSender() )
+ {
+ keyEvent->GetSender()->PickWorldPoint( keyEvent->GetDisplayPosition(), cursor );
+ positionIsSet = true;
+ }
+
+ if ( positionIsSet )
+ {
+ //m_LastCursorPosition = cursor;
+
+ m_SNCsToBeRotated.clear();
+ m_SNCsToBeMoved.clear();
+ std::vector<mitk::Geometry2D*> geometryArray;
+ geometryArray.resize( GEOMETRY_MAX );
+
+ // TODO this is NOT SNC-specific! Should be!
+ BaseRenderer* renderer = stateEvent->GetEvent()->GetSender();
+ if ( renderer != NULL )
+ {
+ GetGeometries(
+ renderer,
+ cursor,
+ geometryArray );
+ }
+
+ action = ComputeMoveOrRotate(
+ renderer,
+ cursor,
+ geometryArray );
+ }
+
+
+ // question in state machine is: "rotate or move?"
+ StateEvent* newStateEvent(NULL);
+ switch( action )
+ {
+ case AcMOVE:
+ // Move
+ if ( m_SNCsToBeMoved.size() == 2 )
+ {
+ newStateEvent = new StateEvent(EIDAXISCENTERMOVEMENT, stateEvent->GetEvent());
+ }
+ else if ( m_SNCsToBeMoved.size() == 1 )
+ {
+ newStateEvent = new StateEvent(EIDAIXSSINGLEMOVEMENT, stateEvent->GetEvent());
+ }
+ break;
+ case AcROTATE:
+ {
+ // Rotate
+ newStateEvent = new StateEvent(EIDROTATE, stateEvent->GetEvent());
+ }
+ break;
+ default:
+ // Nothing
+ newStateEvent = new StateEvent(EIDNO, stateEvent->GetEvent());
+ break;
+ }
+
+ this->HandleEvent( newStateEvent );
+ delete newStateEvent;
+
+ ok = true;
+ break;
+ }
+ case AcROTATESTART:
+ {
+ BaseRenderer* renderer = stateEvent->GetEvent()->GetSender();
+ m_vtkLastRenderWindow = renderer->GetRenderWindow();
+ ApplicationCursor::GetInstance( )->PushCursor( m_vtkLastRenderWindow, rotate_cursor_xpm, 0, 0);
+ break;
+ }
+ case AcROTATEEND:
+ {
+ ApplicationCursor::GetInstance()->PopCursor( m_vtkLastRenderWindow );
+ break;
+ }
+ case AcSINGLEAXISMOVEMENTSTART:
+ {
+ BaseRenderer* renderer = stateEvent->GetEvent()->GetSender();
+ m_vtkLastRenderWindow = renderer->GetRenderWindow();
+ ApplicationCursor::GetInstance( )->PushCursor(
+ m_vtkLastRenderWindow, move_single_plane_cursor_xpm, 0, 0);
+ break;
+ }
+ case AcSINGLEAXISMOVEMENTEND:
+ {
+ ApplicationCursor::GetInstance()->PopCursor( m_vtkLastRenderWindow );
+ break;
+ }
+ case AcAXISCENTERMOVEMENTSTART:
+ {
+ BaseRenderer* renderer = stateEvent->GetEvent()->GetSender();
+ m_vtkLastRenderWindow = renderer->GetRenderWindow();
+ ApplicationCursor::GetInstance( )->PushCursor(
+ m_vtkLastRenderWindow, move_cursor_xpm, 0, 0);
+ break;
+ }
+ case AcAXISCENTERMOVEMENTEND:
+ {
+ ApplicationCursor::GetInstance()->PopCursor( m_vtkLastRenderWindow );
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+
+ return ok;
+}
+
+
+EActions mitk::SlicesRotatorMovement::ComputeMoveOrRotate(
+ mitk::BaseRenderer *renderer,
+ mitk::Point3D cursor,
+ std::vector<mitk::Geometry2D*> &geometryArray )
+{
+
+ EActions action = AcDONOTHING;
+
+ DisplayGeometry* displayGeometry = renderer->GetDisplayGeometry();
+ if ( displayGeometry == NULL )
+ {
+ return AcDONOTHING;
+ }
+
+ bool isCenterOfRotationComputed = false;
+ ScalarType cursorCenterDistance = 0;
+ isCenterOfRotationComputed = ComputeCursorAndCenterOfRotation(
+ cursor,
+ displayGeometry,
+ geometryArray,
+ cursorCenterDistance );
+
+ if ( !isCenterOfRotationComputed )
+ {
+ return AcDONOTHING;
+ }
+
+ int iMinThresholdDistanceCount = 0;
+ int iMaxThresholdDistanceCount = 0;
+ double planesDistance = 0;
+ for ( size_t i = 0 ; i < geometryArray.size() ; i++ )
+ {
+ ScalarType distanceMM = geometryArray[ 0 ]->Distance( cursor );
+
+ mitk::ScalarType distancePixels;
+ distancePixels =
+ distanceMM / displayGeometry->GetScaleFactorMMPerDisplayUnit();
+
+ planesDistance += pow ( distancePixels, 2 );
+ if ( distancePixels < ThreshHoldDistancePixelsMin )
+ {
+ iMinThresholdDistanceCount++;
+ }
+ else if ( distancePixels > ThreshHoldDistancePixelsMax )
+ {
+ iMaxThresholdDistanceCount++;
+ }
+ }
+
+ planesDistance = sqrt( planesDistance );
+ if ( cursorCenterDistance < ThreshHoldDistancePixelsMin &&
+ iMinThresholdDistanceCount > 2 )
+ {
+ action = AcMOVE;
+ }
+ else if ( cursorCenterDistance > ThreshHoldDistancePixelsMin &&
+ cursorCenterDistance < ThreshHoldDistancePixelsMax &&
+ iMinThresholdDistanceCount > 1 )
+ {
+ action = AcMOVE;
+ }
+ else if ( cursorCenterDistance > ThreshHoldDistancePixelsMax &&
+ iMinThresholdDistanceCount > 1 )
+ {
+ action = AcROTATE;
+ }
+
+
+ return action;
+}
+
+bool mitk::SlicesRotatorMovement::ComputeCursorAndCenterOfRotation(
+ mitk::Point3D cursor,
+ DisplayGeometry* displayGeometry,
+ std::vector<mitk::Geometry2D*> &geometryArray,
+ ScalarType &cursorCenterDistance )
+{
+ cursorCenterDistance = 0;
+
+ // determine center of rotation TODO requires two plane geometries...
+ PlaneGeometry* planeGeometry = dynamic_cast<PlaneGeometry*>(geometryArray[ GEOMETRY_CLICKED ]);
+ PlaneGeometry* planeGeometry1 = dynamic_cast<PlaneGeometry*>(geometryArray[ GEOMETRY_ROTATED ]);
+ PlaneGeometry* planeGeometry2 = dynamic_cast<PlaneGeometry*>(geometryArray[ GEOMETRY_OTHER ]);
+
+ if (!planeGeometry || !planeGeometry1 || !planeGeometry2) return false;
+
+ Line3D intersection;
+ if (!planeGeometry->IntersectionLine( planeGeometry1, intersection )) return false;
+ m_LastCursorPosition = intersection.Project(cursor);
+ if (!planeGeometry2->IntersectionPoint(intersection, m_CenterOfRotation)) return false;
+
+ // Compute distance from the cursor to the center of the three planes
+ cursorCenterDistance = 0;
+ for(int i=0; i<3; i++) cursorCenterDistance += pow(cursor[i] - m_CenterOfRotation[i],2);
+ cursorCenterDistance = sqrt( cursorCenterDistance );
+ cursorCenterDistance /= displayGeometry->GetScaleFactorMMPerDisplayUnit();
+
+ return true;
+}
+
+void mitk::SlicesRotatorMovement::GetGeometries(
+ BaseRenderer* renderer,
+ mitk::Point3D cursor,
+ std::vector<mitk::Geometry2D*> &geometryArray )
+{
+ DisplayGeometry* displayGeometry = renderer->GetDisplayGeometry();
+ if ( displayGeometry == NULL )
+ {
+ return;
+ }
+
+ for (SNCVector::iterator iter = m_RelevantSNCs.begin(); iter != m_RelevantSNCs.end(); ++iter)
+ {
+ unsigned int slice = (*iter)->GetSlice()->GetPos();
+ unsigned int time = (*iter)->GetTime()->GetPos();
+
+ const Geometry3D* geometry3D = (*iter)->GetCreatedWorldGeometry();
+ const TimeSlicedGeometry* timeSlicedGeometry = dynamic_cast<const TimeSlicedGeometry*>( geometry3D );
+ if (!timeSlicedGeometry) continue;
+
+ const SlicedGeometry3D* slicedGeometry = dynamic_cast<const SlicedGeometry3D*>( timeSlicedGeometry->GetGeometry3D(time) );
+ if (!slicedGeometry) continue;
+
+ Geometry2D* geometry2D = slicedGeometry->GetGeometry2D(slice);
+ if (!geometry2D) continue; // this is not necessary?
+
+ ScalarType distanceMM = geometry2D->Distance( cursor );
+
+ mitk::ScalarType distancePixels;
+ distancePixels =
+ distanceMM / displayGeometry->GetScaleFactorMMPerDisplayUnit();
+
+ // don't rotate the one where the user clicked
+ if ( *iter == renderer->GetSliceNavigationController() )
+ {
+ geometryArray[ GEOMETRY_CLICKED ] = geometry2D;
+ }
+ else
+ {
+ // The first plane found close to the cursor
+ if ( distancePixels <= ThreshHoldDistancePixelsMin &&
+ geometryArray[ GEOMETRY_ROTATED ] == NULL )
+ {
+ // this one is behind the clicked "line"
+ m_SNCsToBeRotated.push_back(*iter);
+ m_SNCsToBeMoved.push_back(*iter);
+ geometryArray[ GEOMETRY_ROTATED ] = geometry2D;
+ }
+ else
+ {
+ // This is another plane close to the cursor -> Add to move list
+ if ( distancePixels <= ThreshHoldDistancePixelsMin )
+ {
+ m_SNCsToBeMoved.push_back(*iter);
+ }
+
+ // The other plane far away from the cursor
+ geometryArray[ GEOMETRY_OTHER ] = geometry2D;
+
+ if ( m_LinkPlanes )
+ {
+ // All slices are rotated, i.e. the relative angles between
+ // slices remain fixed
+ m_SNCsToBeRotated.push_back(*iter);
+ }
+ }
+ }
+
+ }
+
+}
+
+
Property changes on: Core\Code\Controllers\mitkSlicesRotatorMovement.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Index: Core/Code/Controllers/mitkSlicesRotatorMovement.h
===================================================================
--- Core/Code/Controllers/mitkSlicesRotatorMovement.h (revision 0)
+++ Core/Code/Controllers/mitkSlicesRotatorMovement.h (revision 0)
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2009,
+* Computational Image and Simulation Technologies in Biomedicine (CISTIB),
+* Universitat Pompeu Fabra (UPF), Barcelona, Spain. All rights reserved.
+* See license.txt file for details.
+*/
+
+#ifndef __mitkSlicesRotatorMovement_H
+#define __mitkSlicesRotatorMovement_H
+
+#include <mitkSlicesRotator.h>
+#include <mitkInteractionConst.h>
+#include <mitkBaseRenderer.h>
+
+namespace mitk{ class Geometry2D; }
+
+class vtkRenderWindow;
+
+namespace mitk {
+
+typedef enum{
+ GEOMETRY_CLICKED,
+ GEOMETRY_ROTATED,
+ GEOMETRY_OTHER,
+ GEOMETRY_MAX
+} GEOMETRY_TYPE;
+
+/**
+ \brief Redefinition of mitk::SlicesRotator, unifying the rotation and
+ translation. The user needs to drag and drop the axis. The cursor
+ icon is automatically changed when the mouse pointer can perform
+ any of the actions.
+
+ There are three states depending on the position of the mouse pointer
+ related to the axis:
+ - Center: Axis can be moved in any direction
+ - Middle: Axis can be translated
+ - Extremes: Axis can be rotated
+
+ \ingroup NavigationControl
+ \date 19 09 08
+ \author Xavi Planes
+ */
+class MITK_CORE_EXPORT SlicesRotatorMovement : public mitk::SlicesRotator
+{
+public:
+
+ mitkClassMacro(SlicesRotatorMovement, mitk::SlicesRotator);
+
+ mitkNewMacro1Param(Self, const char*);
+
+protected:
+
+ //!
+ SlicesRotatorMovement(const char* machine);
+
+ //! Clear list of controllers
+ virtual ~SlicesRotatorMovement();
+
+ //!
+ virtual bool ExecuteAction(mitk::Action * action, mitk::StateEvent const* stateEvent);
+
+ //!
+ mitk::EActions ComputeMoveOrRotate(
+ mitk::BaseRenderer *renderer,
+ mitk::Point3D cursor,
+ std::vector<mitk::Geometry2D*> &geometryArray );
+
+ //!
+ bool ComputeCursorAndCenterOfRotation(
+ mitk::Point3D cursor,
+ mitk::DisplayGeometry* displayGeometry,
+ std::vector<mitk::Geometry2D*> &geometryArray,
+ mitk::ScalarType &cursorCenterDistance );
+
+ //!
+ void GetGeometries(
+ mitk::BaseRenderer* renderer,
+ mitk::Point3D cursor,
+ std::vector<mitk::Geometry2D*> &geometryArray );
+
+protected:
+
+ /**
+ \brief Last accessed vtkRenderWindow
+ We need to restore the cursor of the mouse when this interactor is
+ disabled from the global interactor
+ */
+ vtkRenderWindow *m_vtkLastRenderWindow;
+
+
+ /// all SNCs that will be moved
+ SNCVector m_SNCsToBeMoved;
+
+};
+
+} // namespace
+
+#endif // __mitkSlicesRotatorMovement_H
+
+
Property changes on: Core\Code\Controllers\mitkSlicesRotatorMovement.h
___________________________________________________________________
Added: svn:eol-style
+ native
Index: Core/Code/Controllers/move_cursor.xpm
===================================================================
--- Core/Code/Controllers/move_cursor.xpm (revision 0)
+++ Core/Code/Controllers/move_cursor.xpm (revision 0)
@@ -0,0 +1,41 @@
+/* XPM */
+static const char * move_cursor_xpm[] = {
+"32 32 6 1",
+" c None",
+"! c #000400",
+"# c black",
+"$ c #FFFFF7",
+"% c #F7FFF7",
+"& c white",
+"!# ",
+"!$# ",
+"#%&! ",
+"!&&&# ",
+"!&%&%# ",
+"#$&$&$# ",
+"#&&$&%&! ",
+"!&%&%&%&! ",
+"#$&&&$&&%# ",
+"#%&$&&!##! ",
+"!&&!&$! ",
+"#&! !&&! ",
+"#! #&%# # ",
+" #&&# #&# ",
+" !$&! #&&&# ",
+" #! #&&&&&# ",
+" ##&## ",
+" # #&# # ",
+" #&# #&# #&# ",
+" #&&####&####&&# ",
+" #&&&&&&&&&&&&&&&# ",
+" #&&####&####&&# ",
+" #&# #&# #&# ",
+" # #&# # ",
+" ##&## ",
+" #&&&&&# ",
+" #&&&# ",
+" #&## ",
+" # ",
+" ",
+" ",
+" "};
\ No newline at end of file
Property changes on: Core\Code\Controllers\move_cursor.xpm
___________________________________________________________________
Added: svn:eol-style
+ native
Index: Core/Code/Controllers/move_single_plane_cursor.xpm
===================================================================
--- Core/Code/Controllers/move_single_plane_cursor.xpm (revision 0)
+++ Core/Code/Controllers/move_single_plane_cursor.xpm (revision 0)
@@ -0,0 +1,41 @@
+/* XPM */
+static const char * move_single_plane_cursor_xpm[] = {
+"32 32 6 1",
+" c None",
+"! c #000400",
+"# c black",
+"$ c #FFFFF7",
+"% c #F7FFF7",
+"& c white",
+"!# ",
+"!$# ",
+"#%&! ",
+"!&&&# ",
+"!&%&%# ",
+"#$&$&$# ",
+"#&&$&%&! ",
+"!&%&%&%&! ",
+"#$&&&$&&%# ",
+"#%&$&&!##! ",
+"!&&!&$! ",
+"#&! !&&! ",
+"#! #&%# ",
+" #&&# ",
+" !$&! ",
+" #! #### ",
+" #&&&&# ",
+" #&&&# ",
+" #&#&&# ",
+" #&# #&# ",
+" #&# # ",
+" #&# ",
+" # #&# ",
+" #&#&# ",
+" #&&# ",
+" #&&&# ",
+" #&&&&# ",
+" #### ",
+" ",
+" ",
+" ",
+" "};
\ No newline at end of file
Property changes on: Core\Code\Controllers\move_single_plane_cursor.xpm
___________________________________________________________________
Added: svn:eol-style
+ native
Index: Core/Code/Interactions/mitkGlobalInteraction.cpp
===================================================================
--- Core/Code/Interactions/mitkGlobalInteraction.cpp (revision 21081)
+++ Core/Code/Interactions/mitkGlobalInteraction.cpp (working copy)
@@ -81,6 +81,8 @@
if ( std::find(m_ListenerList.begin(), m_ListenerList.end(),listener) == m_ListenerList.end() )
{
+ // Enable this interactor
+ listener->Enable( true );
m_ListenerList.push_back(listener);
}
}
@@ -111,6 +113,8 @@
StateMachineListIter foundPosition = std::find( m_ListenerList.begin(), m_ListenerList.end(), *it );
if (foundPosition != m_ListenerList.end())
{
+ // Disable this interactor
+ (*foundPosition)->Enable( false );
m_ListenerList.erase( foundPosition );
}
}
@@ -426,3 +430,12 @@
return true;
}
+void mitk::GlobalInteraction::OnTimeStepChanged( mitk::BaseRenderer* render )
+{
+ for (StateMachineListIter it = m_ListenerList.begin(); it != m_ListenerList.end(); it++)
+ {
+ if((*it).IsNotNull())
+ (*it)->OnTimeStepChanged( render );
+ }
+}
+
Index: Core/Code/Interactions/mitkGlobalInteraction.h
===================================================================
--- Core/Code/Interactions/mitkGlobalInteraction.h (revision 21081)
+++ Core/Code/Interactions/mitkGlobalInteraction.h (working copy)
@@ -169,6 +169,9 @@
//so that the interactors can call AddToSelectedInteractors() and RemoveFromSelectedInteractors()
friend class Interactor;
+ //!
+ void OnTimeStepChanged( mitk::BaseRenderer* render );
+
protected:
/**
* @brief Default Constructor with type to load the StateMachinePattern of the StateMachine
Index: Core/Code/Interactions/mitkInteractionConst.h
===================================================================
--- Core/Code/Interactions/mitkInteractionConst.h (revision 21081)
+++ Core/Code/Interactions/mitkInteractionConst.h (working copy)
@@ -58,6 +58,7 @@
EIDLEFTMOUSEBTNANDMOUSEWHEEL = 521,
EIDRIGHTMOUSEBTNANDMOUSEWHEEL = 522,
EIDMIDDLEMOUSEBTNANDMOUSEWHEEL = 523,
+ EIDSHIFTANDMOUSEMOVE = 524,
EIDLEFTMOUSEBTNANDMOUSEMOVE = 530,
EIDRIGHTMOUSEBTNANDMOUSEMOVE = 531,
EIDMIDDLEMOUSEBTNANDMOUSEMOVE = 533,
@@ -80,7 +81,9 @@
EIDSHIFTANDMIDDLEMOUSEPRESS = 2003,
EIDSHIFTANDMIDDLEMOUSEMOVE = 2004,
EIDSHIFTANDMIDDLEMOUSERELEASE = 2005,
- EIDTDMOUSEINPUT = 4001, // 3d Mouse, SpaceNavigator input
+ EIDWHEELMOUSEBUTTONUP = 50, // Wheel MouseButton Up
+ EIDWHEELMOUSEBUTTONDOWN = 51, // Wheel MouseButton Down
+ EIDTDMOUSEINPUT = 4001,
EIDTDMOUSEKEYDOWN = 4002, // 3d Mouse, KeyDown
EIDSTRGANDN = 10,
EIDSTRGANDE = 11,
@@ -105,6 +108,12 @@
EIDSTRGANDALTANDS = 40,
EIDALT = 90,
EIDSTRGANDB = 91,
+ EIDA = 92, // Key A
+ EIDZ = 93, // Key Z
+ EIDSHIFT = 94, // Shit key
+ EIDSHIFTRELEASED = 95, // Shit key released
+ EIDCTRLRELEASED = 96, // Ctrl key released
+ EIDCTRL = 97, // Ctrl key
EIDNEW = 1000,
EIDOLD = 1001,
EIDFINISHED = 1002,
@@ -127,6 +136,16 @@
EIDBODY = 1052,
EIDCLEAR = 1100,
EIDACTIVATETOOL = 1300,
+ EIDENABLE = 1400,
+ EIDDISABLE = 1401,
+ EIDTIMECHANGED = 1402,
+ EIDROTATE = 1014, // Rotation start
+ EIDTRANSLATION = 1015, // Translation start
+ EIDAIXSSINGLEMOVEMENT = 1016, // Single slice movement
+ EIDAXISCENTERMOVEMENT = 1017, // Move the center of the axis
+ EIDPOINTSETEMPTY = 50000, // PointSet is empty
+ EIDPOINTSETFULL = 50001, // PointSet is full
+ EIDPOINTSETSPACELEFT = 50002, // Space left in the pointset
EIDPRINT = 3001,
EV_INIT = 5551001,
EV_PREVIOUS = 5551002,
@@ -239,6 +258,7 @@
AcCHECKOPERATION = 37, // check if the operation is of one spectial type
AcCHECKONESUBINTERACTOR = 38,
AcCHECKSUBINTERACTORS = 39,
+ AcCHECKPOINTSETSIZE = 50000, // Check pointSetSize: empty, full, space left
AcFINISHOBJECT = 40,
AcFINISHGROUP = 41,
AcFINISHMOVEMENT = 42,
@@ -358,6 +378,10 @@
AcACCEPT = 49011,
AcONTDMOUSEINPUT = 4001, // On input of 3D Mouse
AcONTDMOUSEKEYDOWN = 4002, // On input of 3D Mouse
+ AcSINGLEAXISMOVEMENTSTART = 1013, // Single axis movement start
+ AcSINGLEAXISMOVEMENTEND = 1014, // Single axis movement end
+ AcAXISCENTERMOVEMENTSTART = 1015, //
+ AcAXISCENTERMOVEMENTEND = 1016, //
AcCHECKPOSITION = 5000,
AcINITIALIZECONTOUR = 5001,
AcCALCULATENEWSEGMENTATION_SP= 5002,
Index: Core/Code/Interactions/mitkStateMachine.cpp
===================================================================
--- Core/Code/Interactions/mitkStateMachine.cpp (revision 21081)
+++ Core/Code/Interactions/mitkStateMachine.cpp (working copy)
@@ -26,6 +26,7 @@
#include "mitkUndoController.h"
#include <itkMacro.h>
#include "mitkGlobalInteraction.h"
+#include "mitkEventDescription.h"
/**
@@ -286,3 +287,46 @@
this->ExecuteOperation(doOp);
}
+void mitk::StateMachine::Enable( bool bValue )
+{
+ mitk::StateEvent *newStateEvent( NULL );
+ mitk::EventDescription mitkEvent(
+ mitk::Type_None, mitk::BS_NoButton, mitk::BS_NoButton, mitk::Key_unknown, "", -1 );
+
+ // Send event EIDDISABLE
+ if ( bValue )
+ {
+ newStateEvent = new mitk::StateEvent( EIDENABLE, &mitkEvent );
+ }
+ else
+ {
+ newStateEvent = new mitk::StateEvent( EIDDISABLE, &mitkEvent );
+ }
+
+ HandleEvent( newStateEvent );
+ delete newStateEvent;
+}
+
+
+void mitk::StateMachine::OnTimeStepChanged( mitk::BaseRenderer* render )
+{
+ if ( render->GetTimeStep() == m_TimeStep )
+ {
+ return;
+ }
+
+ mitk::StateEvent *newStateEvent( NULL );
+ mitk::Event mitkEvent(
+ render, mitk::Type_None, mitk::BS_NoButton, mitk::BS_NoButton, mitk::Key_unknown );
+
+ // Send event EIDTIMECHANGED
+ newStateEvent = new mitk::StateEvent( EIDTIMECHANGED, &mitkEvent );
+
+ HandleEvent( newStateEvent );
+ delete newStateEvent;
+}
+
+unsigned int mitk::StateMachine::GetTimeStep() const
+{
+ return m_TimeStep;
+}
Index: Core/Code/Interactions/mitkStateMachine.h
===================================================================
--- Core/Code/Interactions/mitkStateMachine.h (revision 21081)
+++ Core/Code/Interactions/mitkStateMachine.h (working copy)
@@ -31,6 +31,7 @@
class Action;
class StateEvent;
class UndoController;
+ class BaseRenderer;
// base class of statem machine functors
class MITK_CORE_EXPORT TStateMachineFunctor
@@ -176,6 +177,25 @@
friend class GlobalInteraction;
+ /**
+ \brief Send the event EIDENABLE or EIDDISABLE to this state machine
+ when this state machine is added or removed from the mitk::GlobalInteraction
+ because some state machines needs to change the mouse cursor to the default
+ */
+ void Enable( bool bValue );
+
+ /**
+ \brief Send the event EIDTIMECHANGED to this state machine to
+ notify that the Time step has changed.
+ This is needed in some state machines like mitk::PointSetInteractor
+ because the state 0 (no points or loaded points) or 4 (set full)
+ depends on the current TimeStep.
+ */
+ void OnTimeStepChanged( mitk::BaseRenderer* render );
+
+ /**
+ */
+ unsigned int GetTimeStep() const;
protected:
/**
Index: Core/Code/Interactions/StateMachine.xml
===================================================================
--- Core/Code/Interactions/StateMachine.xml (revision 21081)
+++ Core/Code/Interactions/StateMachine.xml (working copy)
@@ -68,10 +68,26 @@
<event NAME="Strg+Alt+I" ID="31" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0600" KEY="Key_I" />
<!-- Strg + Alt + S -->
<event NAME="Strg+Alt+S" ID="40" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0600" KEY="Key_S" />
+ <!-- Wheel MouseButton Up-->
+ <event NAME="Wheel MouseButton Up" ID="50" TYPE="Type_Wheel" BUTTON="BS_LeftButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <!-- Wheel MouseButton Down-->
+ <event NAME="Wheel MouseButton Up" ID="51" TYPE="Type_Wheel" BUTTON="BS_RightButton" BUTTONSTATE="0x0000" KEY="Key_none" />
<!-- Alt -->
<event NAME="Alt" ID="90" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0400" KEY="Key_Alt" />
<!-- Strg + B -->
<event NAME="Strg+B" ID="91" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0200" KEY="Key_B" />
+ <!-- A-->
+ <event NAME="A" ID="92" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_A" />
+ <!-- Z-->
+ <event NAME="Z" ID="93" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_Z" />
+ <!-- Shift-->
+ <event NAME="Shift" ID="94" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0100" KEY="Key_Shift" />
+ <!-- Shift released-->
+ <event NAME="ShiftReleased" ID="95" TYPE="Type_KeyRelease" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_Shift" />
+ <!-- Ctrl released-->
+ <event NAME="CtrlReleased" ID="96" TYPE="Type_KeyRelease" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_Control" />
+ <!-- Ctrl-->
+ <event NAME="Ctrl" ID="97" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0200" KEY="Key_Control" />
<!-- leftMouseButtonRelease -->
<event NAME="leftMouseRelease" ID="505" TYPE="Type_MouseButtonRelease" BUTTON="BS_LeftButton" BUTTONSTATE="0x0001" KEY="Key_none" />
<!-- MiddleMouseButtonRelease -->
@@ -88,6 +104,8 @@
<event NAME="rightBN+MouseWheel" ID="522" TYPE="Type_Wheel" BUTTON="BS_RightButton" BUTTONSTATE="0x0002" KEY="Key_none" />
<!-- middle MouseButton and MouseWheel -->
<event NAME="middleBN+MouseWheel" ID="523" TYPE="Type_Wheel" BUTTON="BS_MidButton" BUTTONSTATE="0x0004" KEY="Key_none" />
+ <!-- Shift + MouseMove -->
+ <event NAME="Shift + MouseMove" ID="524" TYPE="Type_MouseMove" BUTTON="BS_NoButton" BUTTONSTATE="0x0100" KEY="Key_none" />
<!-- left MouseButton and MouseMove -->
<event NAME="leftBN+MouseMove" ID="530" TYPE="Type_MouseMove" BUTTON="BS_NoButton" BUTTONSTATE="0x0001" KEY="Key_none" />
<!-- right MouseButton and MouseMove -->
@@ -163,6 +181,11 @@
<event NAME="clear" ID="1100" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
<!-- Puncture Application -->
<event NAME="print" ID="3001" TYPE="Type_Application" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <!-- Enable interactor, adding it to the mitk::GlobalInteraction -->
+ <event NAME="Enable interactor" ID="1400" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <!-- Disable interactor, Removing it from the mitk::GlobalInteraction -->
+ <event NAME="Disable interactor" ID="1401" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <event NAME="TimeChanged" ID="1402" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
</events>
<stateMachine NAME="AffineInteractions click to select">
<state NAME="start" ID="1" START_STATE="TRUE" X_POS="3" Y_POS="40" WIDTH="100" HEIGHT="50">
@@ -385,7 +408,7 @@
</transition>
</state>
</stateMachine>
-<!-- obsolete state machine pattern to be removed in future releases
+ <!-- obsolete state machine pattern to be removed in future releases
<stateMachine NAME="drag">
<state NAME="neutral" ID="1" START_STATE="TRUE" X_POS="232" Y_POS="131" WIDTH="100" HEIGHT="50">
<transition NAME="check picked" NEXT_STATE_ID="1" EVENT_ID="1">
@@ -436,7 +459,7 @@
</action>
</transition>
</state>
-<!-- not reached so removed!
+ <!-- not reached so removed!
<state NAME="picked guard" ID="2" X_POS="141" Y_POS="427" WIDTH="100" HEIGHT="50">
<transition NAME="yes" NEXT_STATE_ID="3" EVENT_ID="1004">
<action ID="0" />
@@ -863,53 +886,52 @@
</transition>
</state>
</stateMachine>
- <!-- state machine for vessel TREE interaction with multiple selection -->
- <stateMachine NAME="YetAnotherVesselTreeInteractorMultipleSelection">
- <state NAME="no-vessel-picked" ID="0" START_STATE="TRUE" X_POS="282" Y_POS="146" WIDTH="100" HEIGHT="50">
- <transition NAME="checkpicked" NEXT_STATE_ID="1" EVENT_ID="5">
- <action ID="30">
+ <!-- state machine for vessel TREE interaction with multiple selection -->
+ <stateMachine NAME="YetAnotherVesselTreeInteractorMultipleSelection">
+ <state NAME="no-vessel-picked" ID="0" START_STATE="TRUE" X_POS="282" Y_POS="146" WIDTH="100" HEIGHT="50">
+ <transition NAME="checkpicked" NEXT_STATE_ID="1" EVENT_ID="5">
+ <action ID="30">
<!--AcCHECKELEMENT-->
- </action>
- </transition>
- <transition NAME="checkpicked" NEXT_STATE_ID="1" EVENT_ID="8">
- <action ID="30">
+ </action>
+ </transition>
+ <transition NAME="checkpicked" NEXT_STATE_ID="1" EVENT_ID="8">
+ <action ID="30">
<!--AcCHECKELEMENT-->
- </action>
- </transition>
- </state>
- <state NAME="CheckPicked-GuardState" ID="1" X_POS="91" Y_POS="347" WIDTH="100" HEIGHT="50">
- <transition NAME="picked-vessel" NEXT_STATE_ID="2" EVENT_ID="1004">
- <action ID="65">
+ </action>
+ </transition>
+ </state>
+ <state NAME="CheckPicked-GuardState" ID="1" X_POS="91" Y_POS="347" WIDTH="100" HEIGHT="50">
+ <transition NAME="picked-vessel" NEXT_STATE_ID="2" EVENT_ID="1004">
+ <action ID="65">
<!--AcSELECT-->
- </action>
- </transition>
- <transition NAME="no-vessel-picked" NEXT_STATE_ID="0" EVENT_ID="1003">
- <action ID="75">
+ </action>
+ </transition>
+ <transition NAME="no-vessel-picked" NEXT_STATE_ID="0" EVENT_ID="1003">
+ <action ID="75">
<!--AcDESELECT-->
- </action>
- </transition>
- </state>
- <state NAME="vessel-selected" ID="2" X_POS="419" Y_POS="340" WIDTH="100" HEIGHT="50">
- <transition NAME="checkpicked" NEXT_STATE_ID="3" EVENT_ID="5">
- <action ID="30">
+ </action>
+ </transition>
+ </state>
+ <state NAME="vessel-selected" ID="2" X_POS="419" Y_POS="340" WIDTH="100" HEIGHT="50">
+ <transition NAME="checkpicked" NEXT_STATE_ID="3" EVENT_ID="5">
+ <action ID="30">
<!--AcCHECKELEMENT-->
- </action>
- </transition>
- <transition NAME="checkpicked" NEXT_STATE_ID="1" EVENT_ID="8">
- <action ID="30">
+ </action>
+ </transition>
+ <transition NAME="checkpicked" NEXT_STATE_ID="1" EVENT_ID="8">
+ <action ID="30">
<!--AcCHECKELEMENT-->
- </action>
- </transition>
- </state>
- <state NAME="guard-add-vessel2selection" ID="3" X_POS="419" Y_POS="340" WIDTH="100" HEIGHT="50">
- <transition NAME="vessel-picked" NEXT_STATE_ID="2" EVENT_ID="1004">
- <action ID="61">
+ </action>
+ </transition>
+ </state>
+ <state NAME="guard-add-vessel2selection" ID="3" X_POS="419" Y_POS="340" WIDTH="100" HEIGHT="50">
+ <transition NAME="vessel-picked" NEXT_STATE_ID="2" EVENT_ID="1004">
+ <action ID="61">
<!--AcSELECTANOTHEROBJECT-->
- </action>
- </transition>
- <transition NAME="no-vessel-picked" NEXT_STATE_ID="2" EVENT_ID="1003">
- </transition>
- </state>
+ </action>
+ </transition>
+ <transition NAME="no-vessel-picked" NEXT_STATE_ID="2" EVENT_ID="1003" />
+ </state>
</stateMachine>
<stateMachine NAME="AriadneAssistent">
<!-- Behaviour of the AriadneAssistent -->
@@ -3064,106 +3086,106 @@
</transition>
</state>
</stateMachine>
- <stateMachine NAME="SeedpointCorrection">
+ <stateMachine NAME="SeedpointCorrection">
<state NAME="position check" ID="0" START_STATE="TRUE" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="nothing found" NEXT_STATE_ID="0" EVENT_ID="1003">
- <action ID="48008"/>
+ <action ID="48008" />
</transition>
<transition NAME="inside" NEXT_STATE_ID="1" EVENT_ID="1004">
- <action ID="31"/>
- <transition NAME="check position" NEXT_STATE_ID="0" EVENT_ID="520">
- <action ID="5000"/>
- </transition>
- <transition NAME="check position 2" NEXT_STATE_ID="0" EVENT_ID="530">
- <action ID="5000"/>
- </transition>
- <transition NAME="change BoundingBox" NEXT_STATE_ID="3" EVENT_ID="1013">
- <action ID="65"/>
- </transition>
+ <action ID="31" />
+ <transition NAME="check position" NEXT_STATE_ID="0" EVENT_ID="520">
+ <action ID="5000" />
+ </transition>
+ <transition NAME="check position 2" NEXT_STATE_ID="0" EVENT_ID="530">
+ <action ID="5000" />
+ </transition>
+ <transition NAME="change BoundingBox" NEXT_STATE_ID="3" EVENT_ID="1013">
+ <action ID="65" />
+ </transition>
</transition>
</state>
<state NAME="edit seedpoints" ID="1" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="back to start" NEXT_STATE_ID="0" EVENT_ID="520">
- <action ID="12"/>
+ <action ID="12" />
</transition>
<transition NAME="initialize correction" NEXT_STATE_ID="2" EVENT_ID="530">
- <action ID="5001"/>
+ <action ID="5001" />
</transition>
</state>
<state NAME="correct segmentation" ID="2" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="draw contour" NEXT_STATE_ID="2" EVENT_ID="530">
- <action ID="92"/>
+ <action ID="92" />
</transition>
<transition NAME="calculate result" NEXT_STATE_ID="0" EVENT_ID="505">
- <action ID="5002"/>
+ <action ID="5002" />
</transition>
</state>
<state NAME="init BoundingBox Resizing" ID="3" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="back to start 2" NEXT_STATE_ID="0" EVENT_ID="520">
- <action ID="5000"/>
+ <action ID="5000" />
</transition>
<transition NAME="add boundingboxinteractor" NEXT_STATE_ID="4" EVENT_ID="1">
- <action ID="5003"/>
+ <action ID="5003" />
</transition>
</state>
<state NAME="BoundingBox Resizing" ID="4" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="calculate result 2" NEXT_STATE_ID="0" EVENT_ID="23">
- <action ID="5004"/>
+ <action ID="5004" />
</transition>
</state>
- </stateMachine>
+ </stateMachine>
<stateMachine NAME="BoundingBox Interaction">
- <state NAME="position check" ID="0" START_STATE="TRUE" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
+ <state NAME="position check" ID="0" START_STATE="TRUE" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="test" NEXT_STATE_ID="1" EVENT_ID="1">
- <action ID="5000"/>
+ <action ID="5000" />
</transition>
<transition NAME="test" NEXT_STATE_ID="3" EVENT_ID="520">
- <action ID="5000"/>
- </transition>
+ <action ID="5000" />
+ </transition>
</state>
<state NAME="boundingbox resizing initialization" ID="1" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="nothing found" NEXT_STATE_ID="0" EVENT_ID="1003">
- <action ID="47"/>
+ <action ID="47" />
</transition>
<transition NAME="something found" NEXT_STATE_ID="2" EVENT_ID="1004">
- <action ID="94"/>
- <action ID="110"/>
+ <action ID="94" />
+ <action ID="110" />
</transition>
</state>
<state NAME="teststate" ID="2" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="test 2" NEXT_STATE_ID="2" EVENT_ID="530">
- <action ID="11"/>
+ <action ID="11" />
</transition>
<transition NAME="test 3" NEXT_STATE_ID="0" EVENT_ID="505">
- <action ID="5"/>
+ <action ID="5" />
</transition>
<transition NAME="test 9" NEXT_STATE_ID="4" EVENT_ID="1003">
- <action ID="0"/>
+ <action ID="0" />
</transition>
</state>
<state NAME="teststate 2" ID="3" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="test 4" NEXT_STATE_ID="3" EVENT_ID="1004">
- <action ID="94"/>
+ <action ID="94" />
</transition>
<transition NAME="test 5" NEXT_STATE_ID="0" EVENT_ID="520">
- <action ID="5000"/>
+ <action ID="5000" />
</transition>
<transition NAME="test 6" NEXT_STATE_ID="0" EVENT_ID="1003">
- <action ID="47"/>
+ <action ID="47" />
</transition>
<transition NAME="test 7" NEXT_STATE_ID="1" EVENT_ID="1">
- <action ID="5000"/>
+ <action ID="5000" />
</transition>
</state>
- <state NAME="teststate 2" ID="4" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
+ <state NAME="teststate 2" ID="4" X_POS="18" Y_POS="336" WIDTH="197" HEIGHT="50">
<transition NAME="test 8" NEXT_STATE_ID="4" EVENT_ID="530">
- <action ID="0"/>
+ <action ID="0" />
</transition>
<transition NAME="test 9" NEXT_STATE_ID="0" EVENT_ID="505">
- <action ID="0"/>
+ <action ID="0" />
</transition>
</state>
- </stateMachine>
+ </stateMachine>
<stateMachine NAME="ToolWithWheelInteraction">
<state NAME="ToolIdle" ID="1" START_STATE="TRUE" X_POS="167" Y_POS="365" WIDTH="100" HEIGHT="50">
<transition NAME="MouseWheel" EVENT_ID="9" NEXT_STATE_ID="1">
@@ -3241,6 +3263,449 @@
</transition>
</state>
</stateMachine>
+ <stateMachine NAME="PlanarFigureInteractor">
+ <!-- Behaviour of a set of Points. a defined number of points can be set/removed/selected/deselectd/moved -->
+ <state NAME="Start" ID="42" START_STATE="TRUE" X_POS="1144" Y_POS="498" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="0" NEXT_STATE_ID="49">
+ <action ID="31" />
+ </transition>
+ </state>
+ <state NAME="FigurePlaced" ID="45" X_POS="1273" Y_POS="109" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="520" NEXT_STATE_ID="45">
+ <action ID="90" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1" NEXT_STATE_ID="48">
+ <action ID="32" />
+ </transition>
+ <transition NAME="name" EVENT_ID="2" NEXT_STATE_ID="54">
+ <action ID="33" />
+ </transition>
+ </state>
+ <state NAME="ControlPointSelected" ID="47" X_POS="394" Y_POS="228" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="530" NEXT_STATE_ID="47">
+ <action ID="90" />
+ </transition>
+ <transition NAME="name" EVENT_ID="505" NEXT_STATE_ID="52">
+ <action ID="76" />
+ </transition>
+ </state>
+ <state NAME="IsLastControlPoint" ID="48" X_POS="1332" Y_POS="326" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1004" NEXT_STATE_ID="42" />
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="45">
+ <action ID="10" />
+ </transition>
+ </state>
+ <state NAME="IsPlaced" ID="49" X_POS="958" Y_POS="328" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="50" />
+ <transition NAME="name" EVENT_ID="1004" NEXT_STATE_ID="51" />
+ </state>
+ <state NAME="PlaceFigure" ID="50" X_POS="1018" Y_POS="106" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1" NEXT_STATE_ID="45">
+ <action ID="11" />
+ </transition>
+ </state>
+ <state NAME="EditFigure" ID="51" X_POS="768" Y_POS="495" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="520" NEXT_STATE_ID="52">
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="IsOverControlPoint" ID="52" X_POS="519" Y_POS="495" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="51" />
+ <transition NAME="name" EVENT_ID="1004" NEXT_STATE_ID="53" />
+ </state>
+ <state NAME="ControlPointHover" ID="53" X_POS="229" Y_POS="495" WIDTH="115" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="520" NEXT_STATE_ID="52">
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1" NEXT_STATE_ID="47">
+ <action ID="66" />
+ </transition>
+ </state>
+ <state NAME="IsMinFigureFinished" ID="54" X_POS="1093" Y_POS="256" WIDTH="110" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1004" NEXT_STATE_ID="42" />
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="45" />
+ </state>
+ </stateMachine>
+ <stateMachine NAME="pointsetinteractorWithTime">
+ <!--Behaviour of a set of Points. a defined number of points can be set/removed/selected/deselectd/moved -->
+ <!-- When the user clicks left mouse button, it will add a point.
+ and when it is added, it will start moving it -->
+ <state NAME="no points or loaded points" ID="1" START_STATE="TRUE" X_POS="1066" Y_POS="281" WIDTH="100" HEIGHT="50">
+ <transition NAME="Select, add or move point Space" NEXT_STATE_ID="10" EVENT_ID="3">
+ <action ID="30" />
+ </transition>
+ <transition NAME="checkn Delete" NEXT_STATE_ID="30" EVENT_ID="12">
+ <action ID="32" />
+ </transition>
+ <transition NAME="SetThisStatemachineOnSelected" NEXT_STATE_ID="1" EVENT_ID="1030">
+ <action ID="1101">
+ <!--AcMODE_SELECT-->
+ </action>
+ </transition>
+ <transition NAME="SetThisStatemachineOnDeselected" NEXT_STATE_ID="1" EVENT_ID="1031">
+ <action ID="1100">
+ <!--AcMODE_DESELECT-->
+ </action>
+ </transition>
+ <transition NAME="TimeStepChanged" NEXT_STATE_ID="50" EVENT_ID="1402">
+ <action ID="50000" />
+ </transition>
+ </state>
+ <state NAME="space left" ID="2" X_POS="660" Y_POS="259" WIDTH="100" HEIGHT="50">
+ <transition NAME="Select, add or move point Space" NEXT_STATE_ID="10" EVENT_ID="3">
+ <action ID="30" />
+ </transition>
+ <transition NAME="checkn Delete" NEXT_STATE_ID="30" EVENT_ID="12">
+ <action ID="33" />
+ </transition>
+ <transition NAME="DeselectAll" NEXT_STATE_ID="2" EVENT_ID="14">
+ <!--Event = ESC-->
+ <action ID="72">
+ <!--AcDESELECTALL-->
+ </action>
+ <action ID="1100">
+ <!--AcMODE_DESELECT-->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="1402" NEXT_STATE_ID="50">
+ <action ID="50000" />
+ </transition>
+ </state>
+ <state NAME="checkedN" ID="3" X_POS="642" Y_POS="-55" WIDTH="100" HEIGHT="50">
+ <transition NAME="n smaller N" NEXT_STATE_ID="40" EVENT_ID="1010">
+ <action ID="37" />
+ </transition>
+ <transition NAME="n greater equals N" NEXT_STATE_ID="41" EVENT_ID="1011">
+ <action ID="37" />
+ </transition>
+ </state>
+ <state NAME="set full" ID="4" X_POS="267" Y_POS="633" WIDTH="100" HEIGHT="50">
+ <transition NAME="Select or move point FULL" NEXT_STATE_ID="20" EVENT_ID="3">
+ <action ID="30">
+ <!--AcCHECKELEMENT-->
+ </action>
+ </transition>
+ <transition NAME="checkn Delete selected Point" NEXT_STATE_ID="30" EVENT_ID="12">
+ <action ID="33">
+ <!--AcCHECKEQUALS1-->
+ </action>
+ </transition>
+ <transition NAME="DeselectAll" NEXT_STATE_ID="2" EVENT_ID="14">
+ <!--Event = ESC-->
+ <action ID="72">
+ <!--AcDESELECTALL-->
+ </action>
+ <action ID="1100">
+ <!--AcMODEDESELECT-->
+ </action>
+ </transition>
+ <transition NAME="TimeStepChanged" NEXT_STATE_ID="50" EVENT_ID="1402">
+ <action ID="50000" />
+ </transition>
+ </state>
+ <state NAME="picked NotFull" ID="10" X_POS="903" Y_POS="38" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="3" EVENT_ID="1003">
+ <action ID="1101">
+ <!--AcMODE_SELECT-->
+ </action>
+ <action ID="32" />
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="11" EVENT_ID="1004">
+ <action ID="34">
+ <!--AcCHECKSELECTED-->
+ </action>
+ <action ID="1101">
+ <!--AcMODESELECT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="already selected Space" ID="11" X_POS="347" Y_POS="179" WIDTH="125" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="60" />
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="12" EVENT_ID="1004">
+ <action ID="8" />
+ </transition>
+ </state>
+ <state NAME="move Point Space" ID="12" X_POS="305" Y_POS="-57" WIDTH="100" HEIGHT="50">
+ <transition NAME="move point" NEXT_STATE_ID="12" EVENT_ID="530">
+ <action ID="91" />
+ </transition>
+ <transition NAME="move point" NEXT_STATE_ID="12" EVENT_ID="541">
+ <action ID="91" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="2" EVENT_ID="505">
+ <action ID="42" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="2" EVENT_ID="508">
+ <action ID="42" />
+ </transition>
+ <transition NAME="Safety init" NEXT_STATE_ID="12" EVENT_ID="3">
+ <action ID="8" />
+ </transition>
+ <transition NAME="name" EVENT_ID="92" NEXT_STATE_ID="51">
+ <action ID="49012">
+ <!--Increase scalar-->
+ </action>
+ </transition>
+ <transition NAME="decrease scalar" EVENT_ID="93" NEXT_STATE_ID="52">
+ <action ID="49013">
+ <!--Decrease scalar-->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="50" NEXT_STATE_ID="51">
+ <action ID="49012" />
+ </transition>
+ <transition NAME="name" EVENT_ID="51" NEXT_STATE_ID="52">
+ <action ID="49013" />
+ </transition>
+ </state>
+ <state NAME="picked Full" ID="20" X_POS="122" Y_POS="766" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNO" NEXT_STATE_ID="4" EVENT_ID="1003">
+ <action ID="72">
+ <!--AcDESELECTALL-->
+ </action>
+ <action ID="1100">
+ <!--AcMODEDESELECT-->
+ </action>
+ </transition>
+ <transition NAME="StYES" NEXT_STATE_ID="21" EVENT_ID="1004">
+ <action ID="34">
+ <!--AcCHECKSELECTED-->
+ </action>
+ <action ID="1101">
+ <!--AcMODESELECT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="selected Full" ID="21" X_POS="23" Y_POS="485" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="4" EVENT_ID="1003">
+ <action ID="60">
+ <!--AcSELECTPICKEDOBJECT-->
+ </action>
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="22" EVENT_ID="1004">
+ <action ID="8">
+ <!--AcINITMOVEMENT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="move Point Full" ID="22" X_POS="67" Y_POS="255" WIDTH="100" HEIGHT="50">
+ <!-- since the MouseMove Event is send by QT we don't have the information about the position of the point in the list. we had it before, when we checked, if it was picked, or if it was selected -->
+ <transition NAME="move point" NEXT_STATE_ID="22" EVENT_ID="530">
+ <action ID="91" />
+ </transition>
+ <transition NAME="move point" NEXT_STATE_ID="22" EVENT_ID="541">
+ <action ID="91" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="4" EVENT_ID="505">
+ <action ID="42" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="4" EVENT_ID="508">
+ <action ID="42" />
+ </transition>
+ <transition NAME="Safety init" NEXT_STATE_ID="22" EVENT_ID="3">
+ <action ID="8" />
+ </transition>
+ </state>
+ <state NAME="checkn Delete" ID="30" X_POS="832" Y_POS="607" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="100" />
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="1" EVENT_ID="1004">
+ <action ID="100" />
+ <action ID="1100">
+ <!--AcMODEDESELECT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="checkedPositionEventSmallerN" ID="40" X_POS="267" Y_POS="301" WIDTH="173" HEIGHT="50">
+ <transition NAME="PositionEvent" NEXT_STATE_ID="11" EVENT_ID="1004">
+ <action ID="10" />
+ </transition>
+ <transition NAME="others" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="0" />
+ </transition>
+ </state>
+ <state NAME="checkedPositionEventGreaterN" ID="41" X_POS="562" Y_POS="424" WIDTH="168" HEIGHT="50">
+ <transition NAME="PositionEvent" NEXT_STATE_ID="4" EVENT_ID="1004">
+ <action ID="10" />
+ </transition>
+ <transition NAME="others" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="0" />
+ </transition>
+ </state>
+ <state NAME="OnTimeChangedCheckedSize" ID="50" X_POS="1033" Y_POS="739" WIDTH="166" HEIGHT="50">
+ <transition NAME="SizeIsNotOk" NEXT_STATE_ID="4" EVENT_ID="50001" />
+ <transition NAME="SizeIsOk" NEXT_STATE_ID="2" EVENT_ID="50002" />
+ <transition NAME="name" EVENT_ID="50000" NEXT_STATE_ID="1">
+ <action ID="1100" />
+ </transition>
+ </state>
+ <state NAME="IncreaseScalar" ID="51" X_POS="56" Y_POS="-154" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="0" NEXT_STATE_ID="12" />
+ </state>
+ <state NAME="DecreaseScalar" ID="52" X_POS="67" Y_POS="91" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="0" NEXT_STATE_ID="12" />
+ </state>
+ </stateMachine>
+ <stateMachine NAME="slices-rotator-and-movement">
+ <state NAME="neutral" ID="1" START_STATE="TRUE" X_POS="479" Y_POS="99" WIDTH="100" HEIGHT="50">
+ <!-- mouse down: jump to decision state -->
+ <transition NAME="mouse move" NEXT_STATE_ID="5" EVENT_ID="520">
+ <action ID="21">
+ <!-- AcCheckPoint -->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="1400" NEXT_STATE_ID="5">
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="rotate" ID="3" X_POS="22" Y_POS="348" WIDTH="100" HEIGHT="50">
+ <!-- send rotate events -->
+ <transition NAME="mouse move" NEXT_STATE_ID="3" EVENT_ID="530">
+ <action ID="1005">
+ <!--AcRotate-->
+ </action>
+ </transition>
+ <transition NAME="mouse release" NEXT_STATE_ID="1" EVENT_ID="505">
+ <action ID="1010">
+ <!--AcRotateEnd-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="single axis movement" ID="4" X_POS="1241" Y_POS="492" WIDTH="133" HEIGHT="50">
+ <!-- send move events -->
+ <transition NAME="mouse move" NEXT_STATE_ID="4" EVENT_ID="530">
+ <action ID="92">
+ <!--AcMove-->
+ </action>
+ </transition>
+ <transition NAME="mouse release" NEXT_STATE_ID="1" EVENT_ID="505">
+ <action ID="1014" />
+ </transition>
+ </state>
+ <state NAME="rotation or movement possible?" ID="5" X_POS="431" Y_POS="354" WIDTH="182" HEIGHT="50">
+ <transition NAME="move" NEXT_STATE_ID="8" EVENT_ID="1016">
+ <action ID="1013" />
+ </transition>
+ <transition NAME="rotate" NEXT_STATE_ID="6" EVENT_ID="1014">
+ <action ID="1004">
+ <!--AcRotateStart-->
+ </action>
+ </transition>
+ <transition NAME="no" NEXT_STATE_ID="1" EVENT_ID="1003" />
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="13">
+ <action ID="1015" />
+ </transition>
+ </state>
+ <state NAME="rotation possible!" ID="6" X_POS="85" Y_POS="499" WIDTH="100" HEIGHT="50">
+ <!-- mouse down: jump to decision state -->
+ <transition NAME="mouse move" NEXT_STATE_ID="7" EVENT_ID="520">
+ <action ID="21">
+ <!-- AcCheckPoint -->
+ </action>
+ </transition>
+ <transition NAME="disable interactor" NEXT_STATE_ID="1" EVENT_ID="1401">
+ <action ID="1010">
+ <!--AcRotateEnd-->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="1401" NEXT_STATE_ID="1">
+ <action ID="1010" />
+ </transition>
+ <transition NAME="mouse down" NEXT_STATE_ID="3" EVENT_ID="1" />
+ <transition NAME="shift pressed" EVENT_ID="94" NEXT_STATE_ID="10">
+ <action ID="1010" />
+ </transition>
+ </state>
+ <state NAME="rotation possible?" ID="7" X_POS="169" Y_POS="355" WIDTH="100" HEIGHT="50">
+ <transition NAME="rotate" NEXT_STATE_ID="6" EVENT_ID="1014" />
+ <transition NAME="no" NEXT_STATE_ID="1" EVENT_ID="1003">
+ <action ID="1010">
+ <!--AcRotateEnd-->
+ </action>
+ </transition>
+ <transition NAME="move" NEXT_STATE_ID="5" EVENT_ID="1016">
+ <action ID="1010" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="5">
+ <action ID="1010" />
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="single axis movement possible!" ID="8" X_POS="1018" Y_POS="549" WIDTH="177" HEIGHT="50">
+ <!-- mouse down: jump to decision state -->
+ <transition NAME="disable interactor" NEXT_STATE_ID="1" EVENT_ID="1401">
+ <action ID="1014" />
+ </transition>
+ <transition NAME="name" EVENT_ID="94" NEXT_STATE_ID="10">
+ <action ID="1014" />
+ </transition>
+ <transition NAME="mouse move" NEXT_STATE_ID="11" EVENT_ID="520">
+ <action ID="21" />
+ </transition>
+ <transition NAME="mouse down" NEXT_STATE_ID="4" EVENT_ID="1" />
+ <transition NAME="name" EVENT_ID="1401" NEXT_STATE_ID="1">
+ <action ID="1014" />
+ </transition>
+ </state>
+ <state NAME="Shift pressed" ID="10" X_POS="442" Y_POS="616" WIDTH="191" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="95" NEXT_STATE_ID="5">
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="single axis movement possible?" ID="11" X_POS="755" Y_POS="550" WIDTH="199" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1016" NEXT_STATE_ID="8" />
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="1">
+ <action ID="1014" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1014" NEXT_STATE_ID="5">
+ <action ID="1014" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="5">
+ <action ID="1014" />
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="Center axis movement" ID="12" X_POS="1142" Y_POS="137" WIDTH="145" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="530" NEXT_STATE_ID="12">
+ <action ID="92" />
+ </transition>
+ <transition NAME="name" EVENT_ID="505" NEXT_STATE_ID="1">
+ <action ID="1016" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1401" NEXT_STATE_ID="1">
+ <action ID="1016" />
+ </transition>
+ </state>
+ <state NAME="Center axis movement possible!" ID="13" X_POS="1146" Y_POS="271" WIDTH="178" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="520" NEXT_STATE_ID="14">
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1" NEXT_STATE_ID="12" />
+ <transition NAME="name" EVENT_ID="94" NEXT_STATE_ID="10">
+ <action ID="1016" />
+ </transition>
+ </state>
+ <state NAME="Center axis movement possible?" ID="14" X_POS="811" Y_POS="194" WIDTH="187" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="13" />
+ <transition NAME="name" EVENT_ID="1016" NEXT_STATE_ID="5">
+ <action ID="1016" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1014" NEXT_STATE_ID="5">
+ <action ID="1016" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="1">
+ <action ID="1016" />
+ </transition>
+ </state>
+ </stateMachine>
+
</mitkInteraktionStates>
<!-- DOCUMENTATION -->
<!-- This is StateMachine.xml. Includes Information about different StateMachines and Events. Used by EventMapper and StateMachineFactory -->
Index: CoreUI/Bundles/org.mitk.gui.qt.common/resources/StateMachine.xml
===================================================================
--- CoreUI/Bundles/org.mitk.gui.qt.common/resources/StateMachine.xml (revision 21081)
+++ CoreUI/Bundles/org.mitk.gui.qt.common/resources/StateMachine.xml (working copy)
@@ -68,10 +68,26 @@
<event NAME="Strg+Alt+I" ID="31" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0600" KEY="Key_I" />
<!-- Strg + Alt + S -->
<event NAME="Strg+Alt+S" ID="40" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0600" KEY="Key_S" />
+ <!-- Wheel MouseButton Up-->
+ <event NAME="Wheel MouseButton Up" ID="50" TYPE="Type_Wheel" BUTTON="BS_LeftButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <!-- Wheel MouseButton Down-->
+ <event NAME="Wheel MouseButton Up" ID="51" TYPE="Type_Wheel" BUTTON="BS_RightButton" BUTTONSTATE="0x0000" KEY="Key_none" />
<!-- Alt -->
<event NAME="Alt" ID="90" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0400" KEY="Key_Alt" />
<!-- Strg + B -->
<event NAME="Strg+B" ID="91" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0200" KEY="Key_B" />
+ <!-- A-->
+ <event NAME="A" ID="92" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_A" />
+ <!-- Z-->
+ <event NAME="Z" ID="93" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_Z" />
+ <!-- Shift-->
+ <event NAME="Shift" ID="94" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0100" KEY="Key_Shift" />
+ <!-- Shift released-->
+ <event NAME="ShiftReleased" ID="95" TYPE="Type_KeyRelease" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_Shift" />
+ <!-- Ctrl released-->
+ <event NAME="CtrlReleased" ID="96" TYPE="Type_KeyRelease" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_Control" />
+ <!-- Ctrl-->
+ <event NAME="Ctrl" ID="97" TYPE="Type_KeyPress" BUTTON="BS_NoButton" BUTTONSTATE="0x0200" KEY="Key_Control" />
<!-- leftMouseButtonRelease -->
<event NAME="leftMouseRelease" ID="505" TYPE="Type_MouseButtonRelease" BUTTON="BS_LeftButton" BUTTONSTATE="0x0001" KEY="Key_none" />
<!-- MiddleMouseButtonRelease -->
@@ -88,6 +104,8 @@
<event NAME="rightBN+MouseWheel" ID="522" TYPE="Type_Wheel" BUTTON="BS_RightButton" BUTTONSTATE="0x0002" KEY="Key_none" />
<!-- middle MouseButton and MouseWheel -->
<event NAME="middleBN+MouseWheel" ID="523" TYPE="Type_Wheel" BUTTON="BS_MidButton" BUTTONSTATE="0x0004" KEY="Key_none" />
+ <!-- Shift + MouseMove -->
+ <event NAME="Shift + MouseMove" ID="524" TYPE="Type_MouseMove" BUTTON="BS_NoButton" BUTTONSTATE="0x0100" KEY="Key_none" />
<!-- left MouseButton and MouseMove -->
<event NAME="leftBN+MouseMove" ID="530" TYPE="Type_MouseMove" BUTTON="BS_NoButton" BUTTONSTATE="0x0001" KEY="Key_none" />
<!-- right MouseButton and MouseMove -->
@@ -163,6 +181,11 @@
<event NAME="clear" ID="1100" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
<!-- Puncture Application -->
<event NAME="print" ID="3001" TYPE="Type_Application" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <!-- Enable interactor, adding it to the mitk::GlobalInteraction -->
+ <event NAME="Enable interactor" ID="1400" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <!-- Disable interactor, Removing it from the mitk::GlobalInteraction -->
+ <event NAME="Disable interactor" ID="1401" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
+ <event NAME="TimeChanged" ID="1402" TYPE="Type_User" BUTTON="BS_NoButton" BUTTONSTATE="0x0000" KEY="Key_none" />
</events>
<stateMachine NAME="AffineInteractions click to select">
<state NAME="start" ID="1" START_STATE="TRUE" X_POS="3" Y_POS="40" WIDTH="100" HEIGHT="50">
@@ -3303,6 +3326,386 @@
<transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="45" />
</state>
</stateMachine>
+ <stateMachine NAME="pointsetinteractorWithTime">
+ <!--Behaviour of a set of Points. a defined number of points can be set/removed/selected/deselectd/moved -->
+ <!-- When the user clicks left mouse button, it will add a point.
+ and when it is added, it will start moving it -->
+ <state NAME="no points or loaded points" ID="1" START_STATE="TRUE" X_POS="1066" Y_POS="281" WIDTH="100" HEIGHT="50">
+ <transition NAME="Select, add or move point Space" NEXT_STATE_ID="10" EVENT_ID="3">
+ <action ID="30" />
+ </transition>
+ <transition NAME="checkn Delete" NEXT_STATE_ID="30" EVENT_ID="12">
+ <action ID="32" />
+ </transition>
+ <transition NAME="SetThisStatemachineOnSelected" NEXT_STATE_ID="1" EVENT_ID="1030">
+ <action ID="1101">
+ <!--AcMODE_SELECT-->
+ </action>
+ </transition>
+ <transition NAME="SetThisStatemachineOnDeselected" NEXT_STATE_ID="1" EVENT_ID="1031">
+ <action ID="1100">
+ <!--AcMODE_DESELECT-->
+ </action>
+ </transition>
+ <transition NAME="TimeStepChanged" NEXT_STATE_ID="50" EVENT_ID="1402">
+ <action ID="50000" />
+ </transition>
+ </state>
+ <state NAME="space left" ID="2" X_POS="660" Y_POS="259" WIDTH="100" HEIGHT="50">
+ <transition NAME="Select, add or move point Space" NEXT_STATE_ID="10" EVENT_ID="3">
+ <action ID="30" />
+ </transition>
+ <transition NAME="checkn Delete" NEXT_STATE_ID="30" EVENT_ID="12">
+ <action ID="33" />
+ </transition>
+ <transition NAME="DeselectAll" NEXT_STATE_ID="2" EVENT_ID="14">
+ <!--Event = ESC-->
+ <action ID="72">
+ <!--AcDESELECTALL-->
+ </action>
+ <action ID="1100">
+ <!--AcMODE_DESELECT-->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="1402" NEXT_STATE_ID="50">
+ <action ID="50000" />
+ </transition>
+ </state>
+ <state NAME="checkedN" ID="3" X_POS="642" Y_POS="-55" WIDTH="100" HEIGHT="50">
+ <transition NAME="n smaller N" NEXT_STATE_ID="40" EVENT_ID="1010">
+ <action ID="37" />
+ </transition>
+ <transition NAME="n greater equals N" NEXT_STATE_ID="41" EVENT_ID="1011">
+ <action ID="37" />
+ </transition>
+ </state>
+ <state NAME="set full" ID="4" X_POS="267" Y_POS="633" WIDTH="100" HEIGHT="50">
+ <transition NAME="Select or move point FULL" NEXT_STATE_ID="20" EVENT_ID="3">
+ <action ID="30">
+ <!--AcCHECKELEMENT-->
+ </action>
+ </transition>
+ <transition NAME="checkn Delete selected Point" NEXT_STATE_ID="30" EVENT_ID="12">
+ <action ID="33">
+ <!--AcCHECKEQUALS1-->
+ </action>
+ </transition>
+ <transition NAME="DeselectAll" NEXT_STATE_ID="2" EVENT_ID="14">
+ <!--Event = ESC-->
+ <action ID="72">
+ <!--AcDESELECTALL-->
+ </action>
+ <action ID="1100">
+ <!--AcMODEDESELECT-->
+ </action>
+ </transition>
+ <transition NAME="TimeStepChanged" NEXT_STATE_ID="50" EVENT_ID="1402">
+ <action ID="50000" />
+ </transition>
+ </state>
+ <state NAME="picked NotFull" ID="10" X_POS="903" Y_POS="38" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="3" EVENT_ID="1003">
+ <action ID="1101">
+ <!--AcMODE_SELECT-->
+ </action>
+ <action ID="32" />
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="11" EVENT_ID="1004">
+ <action ID="34">
+ <!--AcCHECKSELECTED-->
+ </action>
+ <action ID="1101">
+ <!--AcMODESELECT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="already selected Space" ID="11" X_POS="347" Y_POS="179" WIDTH="125" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="60" />
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="12" EVENT_ID="1004">
+ <action ID="8" />
+ </transition>
+ </state>
+ <state NAME="move Point Space" ID="12" X_POS="305" Y_POS="-57" WIDTH="100" HEIGHT="50">
+ <transition NAME="move point" NEXT_STATE_ID="12" EVENT_ID="530">
+ <action ID="91" />
+ </transition>
+ <transition NAME="move point" NEXT_STATE_ID="12" EVENT_ID="541">
+ <action ID="91" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="2" EVENT_ID="505">
+ <action ID="42" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="2" EVENT_ID="508">
+ <action ID="42" />
+ </transition>
+ <transition NAME="Safety init" NEXT_STATE_ID="12" EVENT_ID="3">
+ <action ID="8" />
+ </transition>
+ <transition NAME="name" EVENT_ID="92" NEXT_STATE_ID="51">
+ <action ID="49012">
+ <!--Increase scalar-->
+ </action>
+ </transition>
+ <transition NAME="decrease scalar" EVENT_ID="93" NEXT_STATE_ID="52">
+ <action ID="49013">
+ <!--Decrease scalar-->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="50" NEXT_STATE_ID="51">
+ <action ID="49012" />
+ </transition>
+ <transition NAME="name" EVENT_ID="51" NEXT_STATE_ID="52">
+ <action ID="49013" />
+ </transition>
+ </state>
+ <state NAME="picked Full" ID="20" X_POS="122" Y_POS="766" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNO" NEXT_STATE_ID="4" EVENT_ID="1003">
+ <action ID="72">
+ <!--AcDESELECTALL-->
+ </action>
+ <action ID="1100">
+ <!--AcMODEDESELECT-->
+ </action>
+ </transition>
+ <transition NAME="StYES" NEXT_STATE_ID="21" EVENT_ID="1004">
+ <action ID="34">
+ <!--AcCHECKSELECTED-->
+ </action>
+ <action ID="1101">
+ <!--AcMODESELECT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="selected Full" ID="21" X_POS="23" Y_POS="485" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="4" EVENT_ID="1003">
+ <action ID="60">
+ <!--AcSELECTPICKEDOBJECT-->
+ </action>
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="22" EVENT_ID="1004">
+ <action ID="8">
+ <!--AcINITMOVEMENT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="move Point Full" ID="22" X_POS="67" Y_POS="255" WIDTH="100" HEIGHT="50">
+ <!-- since the MouseMove Event is send by QT we don't have the information about the position of the point in the list. we had it before, when we checked, if it was picked, or if it was selected -->
+ <transition NAME="move point" NEXT_STATE_ID="22" EVENT_ID="530">
+ <action ID="91" />
+ </transition>
+ <transition NAME="move point" NEXT_STATE_ID="22" EVENT_ID="541">
+ <action ID="91" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="4" EVENT_ID="505">
+ <action ID="42" />
+ </transition>
+ <transition NAME="finish move" NEXT_STATE_ID="4" EVENT_ID="508">
+ <action ID="42" />
+ </transition>
+ <transition NAME="Safety init" NEXT_STATE_ID="22" EVENT_ID="3">
+ <action ID="8" />
+ </transition>
+ </state>
+ <state NAME="checkn Delete" ID="30" X_POS="832" Y_POS="607" WIDTH="100" HEIGHT="50">
+ <transition NAME="StNo" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="100" />
+ </transition>
+ <transition NAME="StYes" NEXT_STATE_ID="1" EVENT_ID="1004">
+ <action ID="100" />
+ <action ID="1100">
+ <!--AcMODEDESELECT-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="checkedPositionEventSmallerN" ID="40" X_POS="267" Y_POS="301" WIDTH="173" HEIGHT="50">
+ <transition NAME="PositionEvent" NEXT_STATE_ID="11" EVENT_ID="1004">
+ <action ID="10" />
+ </transition>
+ <transition NAME="others" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="0" />
+ </transition>
+ </state>
+ <state NAME="checkedPositionEventGreaterN" ID="41" X_POS="562" Y_POS="424" WIDTH="168" HEIGHT="50">
+ <transition NAME="PositionEvent" NEXT_STATE_ID="4" EVENT_ID="1004">
+ <action ID="10" />
+ </transition>
+ <transition NAME="others" NEXT_STATE_ID="2" EVENT_ID="1003">
+ <action ID="0" />
+ </transition>
+ </state>
+ <state NAME="OnTimeChangedCheckedSize" ID="50" X_POS="1033" Y_POS="739" WIDTH="166" HEIGHT="50">
+ <transition NAME="SizeIsNotOk" NEXT_STATE_ID="4" EVENT_ID="50001" />
+ <transition NAME="SizeIsOk" NEXT_STATE_ID="2" EVENT_ID="50002" />
+ <transition NAME="name" EVENT_ID="50000" NEXT_STATE_ID="1">
+ <action ID="1100" />
+ </transition>
+ </state>
+ <state NAME="IncreaseScalar" ID="51" X_POS="56" Y_POS="-154" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="0" NEXT_STATE_ID="12" />
+ </state>
+ <state NAME="DecreaseScalar" ID="52" X_POS="67" Y_POS="91" WIDTH="100" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="0" NEXT_STATE_ID="12" />
+ </state>
+ </stateMachine>
+ <stateMachine NAME="slices-rotator-and-movement">
+ <state NAME="neutral" ID="1" START_STATE="TRUE" X_POS="479" Y_POS="99" WIDTH="100" HEIGHT="50">
+ <!-- mouse down: jump to decision state -->
+ <transition NAME="mouse move" NEXT_STATE_ID="5" EVENT_ID="520">
+ <action ID="21">
+ <!-- AcCheckPoint -->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="1400" NEXT_STATE_ID="5">
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="rotate" ID="3" X_POS="22" Y_POS="348" WIDTH="100" HEIGHT="50">
+ <!-- send rotate events -->
+ <transition NAME="mouse move" NEXT_STATE_ID="3" EVENT_ID="530">
+ <action ID="1005">
+ <!--AcRotate-->
+ </action>
+ </transition>
+ <transition NAME="mouse release" NEXT_STATE_ID="1" EVENT_ID="505">
+ <action ID="1010">
+ <!--AcRotateEnd-->
+ </action>
+ </transition>
+ </state>
+ <state NAME="single axis movement" ID="4" X_POS="1241" Y_POS="492" WIDTH="133" HEIGHT="50">
+ <!-- send move events -->
+ <transition NAME="mouse move" NEXT_STATE_ID="4" EVENT_ID="530">
+ <action ID="92">
+ <!--AcMove-->
+ </action>
+ </transition>
+ <transition NAME="mouse release" NEXT_STATE_ID="1" EVENT_ID="505">
+ <action ID="1014" />
+ </transition>
+ </state>
+ <state NAME="rotation or movement possible?" ID="5" X_POS="431" Y_POS="354" WIDTH="182" HEIGHT="50">
+ <transition NAME="move" NEXT_STATE_ID="8" EVENT_ID="1016">
+ <action ID="1013" />
+ </transition>
+ <transition NAME="rotate" NEXT_STATE_ID="6" EVENT_ID="1014">
+ <action ID="1004">
+ <!--AcRotateStart-->
+ </action>
+ </transition>
+ <transition NAME="no" NEXT_STATE_ID="1" EVENT_ID="1003" />
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="13">
+ <action ID="1015" />
+ </transition>
+ </state>
+ <state NAME="rotation possible!" ID="6" X_POS="85" Y_POS="499" WIDTH="100" HEIGHT="50">
+ <!-- mouse down: jump to decision state -->
+ <transition NAME="mouse move" NEXT_STATE_ID="7" EVENT_ID="520">
+ <action ID="21">
+ <!-- AcCheckPoint -->
+ </action>
+ </transition>
+ <transition NAME="disable interactor" NEXT_STATE_ID="1" EVENT_ID="1401">
+ <action ID="1010">
+ <!--AcRotateEnd-->
+ </action>
+ </transition>
+ <transition NAME="name" EVENT_ID="1401" NEXT_STATE_ID="1">
+ <action ID="1010" />
+ </transition>
+ <transition NAME="mouse down" NEXT_STATE_ID="3" EVENT_ID="1" />
+ <transition NAME="shift pressed" EVENT_ID="94" NEXT_STATE_ID="10">
+ <action ID="1010" />
+ </transition>
+ </state>
+ <state NAME="rotation possible?" ID="7" X_POS="169" Y_POS="355" WIDTH="100" HEIGHT="50">
+ <transition NAME="rotate" NEXT_STATE_ID="6" EVENT_ID="1014" />
+ <transition NAME="no" NEXT_STATE_ID="1" EVENT_ID="1003">
+ <action ID="1010">
+ <!--AcRotateEnd-->
+ </action>
+ </transition>
+ <transition NAME="move" NEXT_STATE_ID="5" EVENT_ID="1016">
+ <action ID="1010" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="5">
+ <action ID="1010" />
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="single axis movement possible!" ID="8" X_POS="1018" Y_POS="549" WIDTH="177" HEIGHT="50">
+ <!-- mouse down: jump to decision state -->
+ <transition NAME="disable interactor" NEXT_STATE_ID="1" EVENT_ID="1401">
+ <action ID="1014" />
+ </transition>
+ <transition NAME="name" EVENT_ID="94" NEXT_STATE_ID="10">
+ <action ID="1014" />
+ </transition>
+ <transition NAME="mouse move" NEXT_STATE_ID="11" EVENT_ID="520">
+ <action ID="21" />
+ </transition>
+ <transition NAME="mouse down" NEXT_STATE_ID="4" EVENT_ID="1" />
+ <transition NAME="name" EVENT_ID="1401" NEXT_STATE_ID="1">
+ <action ID="1014" />
+ </transition>
+ </state>
+ <state NAME="Shift pressed" ID="10" X_POS="442" Y_POS="616" WIDTH="191" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="95" NEXT_STATE_ID="5">
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="single axis movement possible?" ID="11" X_POS="755" Y_POS="550" WIDTH="199" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1016" NEXT_STATE_ID="8" />
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="1">
+ <action ID="1014" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1014" NEXT_STATE_ID="5">
+ <action ID="1014" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="5">
+ <action ID="1014" />
+ <action ID="21" />
+ </transition>
+ </state>
+ <state NAME="Center axis movement" ID="12" X_POS="1142" Y_POS="137" WIDTH="145" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="530" NEXT_STATE_ID="12">
+ <action ID="92" />
+ </transition>
+ <transition NAME="name" EVENT_ID="505" NEXT_STATE_ID="1">
+ <action ID="1016" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1401" NEXT_STATE_ID="1">
+ <action ID="1016" />
+ </transition>
+ </state>
+ <state NAME="Center axis movement possible!" ID="13" X_POS="1146" Y_POS="271" WIDTH="178" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="520" NEXT_STATE_ID="14">
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1" NEXT_STATE_ID="12" />
+ <transition NAME="name" EVENT_ID="94" NEXT_STATE_ID="10">
+ <action ID="1016" />
+ </transition>
+ </state>
+ <state NAME="Center axis movement possible?" ID="14" X_POS="811" Y_POS="194" WIDTH="187" HEIGHT="50">
+ <transition NAME="name" EVENT_ID="1017" NEXT_STATE_ID="13" />
+ <transition NAME="name" EVENT_ID="1016" NEXT_STATE_ID="5">
+ <action ID="1016" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1014" NEXT_STATE_ID="5">
+ <action ID="1016" />
+ <action ID="21" />
+ </transition>
+ <transition NAME="name" EVENT_ID="1003" NEXT_STATE_ID="1">
+ <action ID="1016" />
+ </transition>
+ </state>
+ </stateMachine>
+
</mitkInteraktionStates>
<!-- DOCUMENTATION -->
<!-- This is StateMachine.xml. Includes Information about different StateMachines and Events. Used by EventMapper and StateMachineFactory -->
Index: CoreUI/Qmitk/QmitkRenderWindow.cpp
===================================================================
--- CoreUI/Qmitk/QmitkRenderWindow.cpp (revision 21081)
+++ CoreUI/Qmitk/QmitkRenderWindow.cpp (working copy)
@@ -224,6 +224,21 @@
if (m_ResendQtEvents) ke->ignore();
}
+void QmitkRenderWindow::keyReleaseEvent(QKeyEvent *ke)
+{
+ if (m_Renderer.IsNotNull())
+ {
+ QPoint cp = mapFromGlobal(QCursor::pos());
+ mitk::KeyEvent mke(QmitkEventAdapter::AdaptKeyEvent(m_Renderer, ke, cp));
+ m_Renderer->KeyPressEvent(&mke);
+ ke->accept();
+ }
+
+ QVTKWidget::keyReleaseEvent(ke);
+
+ if (m_ResendQtEvents) ke->ignore();
+}
+
void QmitkRenderWindow::enterEvent( QEvent *e )
{
//show Menu Widget
Index: CoreUI/Qmitk/QmitkRenderWindow.h
===================================================================
--- CoreUI/Qmitk/QmitkRenderWindow.h (revision 21081)
+++ CoreUI/Qmitk/QmitkRenderWindow.h (working copy)
@@ -107,6 +107,8 @@
virtual void mouseReleaseEvent(QMouseEvent* event);
// overloaded key press handler
virtual void keyPressEvent(QKeyEvent* event);
+ // overloaded key release handler
+ virtual void keyReleaseEvent(QKeyEvent* event);
// overloaded enter handler
virtual void enterEvent(QEvent*);
Index: CoreUI/Qmitk/QmitkStdMultiWidget.cpp
===================================================================
--- CoreUI/Qmitk/QmitkStdMultiWidget.cpp (revision 21081)
+++ CoreUI/Qmitk/QmitkStdMultiWidget.cpp (working copy)
@@ -36,6 +36,7 @@
#include "mitkLine.h"
#include "mitkInteractionConst.h"
#include "mitkDataStorage.h"
+#include "mitkSlicesRotatorMovement.h"
#include "vtkTextProperty.h"
#include "vtkCornerAnnotation.h"
@@ -291,7 +292,7 @@
// m_SlicesRotator = mitk::SlicesRotator::New();
// @TODO next line causes sure memory leak
// rotator will be created nonetheless (will be switched on and off)
- m_SlicesRotator = mitk::SlicesRotator::New("slices-rotator");
+ m_SlicesRotator = mitk::SlicesRotatorMovement::New("slices-rotator-and-movement");
m_SlicesRotator->AddSliceController(
mitkWidget1->GetSliceNavigationController() );
m_SlicesRotator->AddSliceController(
@@ -336,6 +337,8 @@
mitkWidget4->GetSliceNavigationController()
->ConnectGeometryTimeEvent(m_TimeNavigationController.GetPointer(), false);
+ EnableTimeObserver( true );
+
// instantiate display interactor
m_MoveAndZoomInteractor = mitk::DisplayVectorInteractor::New(
"moveNzoom", new mitk::DisplayInteractor() );
@@ -413,6 +416,8 @@
{
DisablePositionTracking();
DisableNavigationControllerEventListening();
+ EnableTimeObserver( false );
+
}
void QmitkStdMultiWidget::RemovePlanesFromDataStorage()
@@ -1570,12 +1575,12 @@
break;
case PLANE_MODE_ROTATION:
- m_SlicesRotator->ResetMouseCursor();
+ m_SlicesRotator->ResetMouseCursor( NULL );
gi->RemoveListener( m_SlicesRotator );
break;
case PLANE_MODE_SWIVEL:
- m_SlicesSwiveller->ResetMouseCursor();
+ m_SlicesSwiveller->ResetMouseCursor( NULL );
gi->RemoveListener( m_SlicesSwiveller );
break;
}
@@ -1715,7 +1720,7 @@
// Notify MainTemplate GUI that this mode has been deselected
emit WidgetPlaneModeRotation( false );
- m_SlicesRotator->ResetMouseCursor();
+ m_SlicesRotator->ResetMouseCursor( NULL );
gi->RemoveListener( m_SlicesRotator );
break;
@@ -1723,7 +1728,7 @@
// Notify MainTemplate GUI that this mode has been deselected
emit WidgetPlaneModeSwivel( false );
- m_SlicesSwiveller->ResetMouseCursor();
+ m_SlicesSwiveller->ResetMouseCursor( NULL );
gi->RemoveListener( m_SlicesSwiveller );
break;
}
@@ -1940,3 +1945,37 @@
m_RectangleRendering3->Disable();
m_RectangleRendering4->Disable();
}
+
+
+void QmitkStdMultiWidget::EnableTimeObserver( bool enable )
+{
+
+ mitk::Stepper* timeStepper = m_TimeNavigationController->GetTime();
+
+ //! an observer to the stepper, in order to change de range dynamically
+ itk::SimpleMemberCommand<QmitkStdMultiWidget>::Pointer m_timeStepperChangedCommand;
+
+ // Observer to time stepper
+ if ( enable )
+ {
+ m_timeStepperChangedCommand = itk::SimpleMemberCommand<QmitkStdMultiWidget>::New();
+ m_timeStepperChangedCommand->SetCallbackFunction(this, &QmitkStdMultiWidget::OnTimeStepperChanged);
+
+ m_timeStepperChangedCommandTag = timeStepper->AddObserver
+ (
+ itk::ModifiedEvent(),
+ m_timeStepperChangedCommand
+ );
+ }
+ else
+ {
+ timeStepper->RemoveObserver( m_timeStepperChangedCommandTag );
+ m_timeStepperChangedCommand = NULL;
+ }
+}
+
+void QmitkStdMultiWidget::OnTimeStepperChanged( )
+{
+ mitk::GlobalInteraction::GetInstance()->OnTimeStepChanged(
+ mitkWidget4->GetRenderer() );
+}
Index: CoreUI/Qmitk/QmitkStdMultiWidget.h
===================================================================
--- CoreUI/Qmitk/QmitkStdMultiWidget.h (revision 21081)
+++ CoreUI/Qmitk/QmitkStdMultiWidget.h (working copy)
@@ -193,6 +193,10 @@
void ResetCrosshair();
+ void EnableTimeObserver( bool enable );
+
+ void OnTimeStepperChanged( );
+
signals:
void WheelMoved( QWheelEvent* );
@@ -280,6 +284,8 @@
QWidget *mitkWidget3Container;
QWidget *mitkWidget4Container;
+ //! TAG for time stepper observer
+ unsigned long m_timeStepperChangedCommandTag;
};
#endif /*QMITKSTDMULTIWIDGET_H_*/

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
417
Default Alt Text
bug3252.diff (87 KB)