00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2008-02-08 13:23:19 +0100 (Fr, 08 Feb 2008) $ 00006 Version: $Revision: 13561 $ 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 MITKPOINTSELECTORINTERACTOR_H_HEADER_INCLUDED 00020 #define MITKPOINTSELECTORINTERACTOR_H_HEADER_INCLUDED 00021 00022 #include "mitkCommon.h" 00023 #include "MitkExtExports.h" 00024 #include <mitkInteractor.h> 00025 #include <mitkVector.h> 00026 00027 namespace mitk 00028 { 00029 class DataNode; 00030 00031 //##Documentation 00032 //## @brief Just select a point, that's the only way to interact with the point 00033 //## 00034 //## Interact with a point: Select the point without moving to get parameters that does not change 00035 //## All Set-operations would be done through the method "ExecuteAction", if there would be anyone. 00036 //## the identificationnumber of this point is set by this points and evalued from an empty place in the DataStructure 00037 //## @ingroup Interaction 00038 class MitkExt_EXPORT PointSelectorInteractor : public Interactor 00039 { 00040 public: 00041 mitkClassMacro(PointSelectorInteractor, Interactor); 00042 mitkNewMacro2Param(Self, const char*, DataNode*); 00043 00044 //##Documentation 00045 //## @brief Sets the amount of precision 00046 void SetPrecision(unsigned int precision); 00047 00048 //##Documentation 00049 //## @brief derived from mitk::Interactor; calculates Jurisdiction according to points 00050 //## 00051 //## standard method can not be used, since it doesn't calculate in points, only in BoundingBox of Points 00052 virtual float CanHandleEvent(StateEvent const* stateEvent) const; 00053 00054 00055 protected: 00056 //##Documentation 00057 //##@brief Constructor 00058 PointSelectorInteractor(const char * type, DataNode* dataNode); 00059 00060 //##Documentation 00061 //##@brief Destructor 00062 virtual ~PointSelectorInteractor(); 00063 00064 //##Documentation 00065 //## @brief select the point on the given position 00066 virtual void SelectPoint(int position); 00067 00068 //##Documentation 00069 //## @brief unselect all points that exist in mesh 00070 virtual void DeselectAllPoints(); 00071 00072 //##Documentation 00073 //## @brief Executes Actions 00074 virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent); 00075 00076 00077 private: 00078 00079 //##Documentation 00080 //## @brief to calculate a direction vector from last point and actual point 00081 Point3D m_LastPoint; 00082 00083 //##Documentation 00084 //## @brief to store a position 00085 unsigned int m_LastPosition; 00086 00087 }; 00088 } 00089 #endif /* MITKPointSelectorInteractor_H_HEADER_INCLUDED */