00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MITKAFFINEINTERACTOR_H_HEADER_INCLUDED_C188C29F 00020 #define MITKAFFINEINTERACTOR_H_HEADER_INCLUDED_C188C29F 00021 00022 #include "mitkCommon.h" 00023 #include "mitkInteractor.h" 00024 #include "mitkVector.h" 00025 00026 namespace mitk { 00027 class DisplayPositionEvent; 00028 00029 //##Documentation 00030 //## @brief Interactor for Affine transformations translate, rotate and scale 00031 //## 00032 //## An object of this class can translate, rotate and scale the data objects 00033 //## by modifying its geometry. 00034 //## @ingroup Interaction 00035 class MITK_CORE_EXPORT AffineInteractor : public Interactor 00036 { 00037 public: 00038 mitkClassMacro(AffineInteractor,Interactor); 00039 // itkNewMacro(Self); 00040 mitkNewMacro2Param(Self, const char*, DataNode*); 00041 00042 protected: 00043 // AffineInteractor(); //obsolete 00044 00045 //##Documentation 00046 //## @brief Constructor 00047 //## 00048 //## @param dataNode is the node, this Interactor is connected to 00049 //## @param type is the type of StateMachine like declared in the XML-Configure-File 00050 AffineInteractor(const char * type, DataNode* dataNode); 00051 00052 //##Documentation 00053 //## @brief Destructor 00054 ~AffineInteractor(){}; 00055 00056 virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent); 00057 00058 //##Documentation 00059 //## @brief calculates how good the data this state machine handles is hit by the event. 00060 //## 00061 //## Returns a value between 0 and 1. 00062 //## (Used by GlobalInteraction to decide which DESELECTED state machine to send the event to.) 00063 //## 00064 //## \WARNING This is interactor currently does not work for interaction in 3D. Try using mitkAffineInteractor3D instead. 00065 virtual float CanHandleEvent(StateEvent const* stateEvent) const; 00066 00067 bool CheckSelected(const mitk::Point3D& worldPoint, int timestep); 00068 bool ConvertDisplayEventToWorldPosition(mitk::DisplayPositionEvent const* displayEvent, mitk::Point3D& worldPoint); 00069 00070 mitk::Point3D m_LastMousePosition; 00071 }; 00072 00073 } // namespace mitk 00074 00075 #endif /* MITKAFFINEINTERACTOR_H_HEADER_INCLUDED_C188C29F */