Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MITKAFFINEINTERACTOR3D_H_HEADER_INCLUDED
00020 #define MITKAFFINEINTERACTOR3D_H_HEADER_INCLUDED
00021
00022 #include "mitkInteractor.h"
00023 #include "MitkExtExports.h"
00024 #include "mitkCommon.h"
00025 #include "mitkSurface.h"
00026
00027 #include <vtkPolyData.h>
00028 #include <vtkType.h>
00029
00030 namespace mitk
00031 {
00032
00033 class DataNode;
00034
00042 class MitkExt_EXPORT AffineInteractor3D : public Interactor
00043 {
00044 public:
00045 enum { INTERACTION_MODE_TRANSLATION, INTERACTION_MODE_ROTATION };
00046
00047 mitkClassMacro(AffineInteractor3D, Interactor);
00048 mitkNewMacro3Param(Self, const char *, DataNode *, int);
00049 mitkNewMacro2Param(Self, const char *, DataNode *);
00050
00051
00052 void SetInteractionMode( unsigned int interactionMode );
00053 void SetInteractionModeToTranslation();
00054 void SetInteractionModeToRotation();
00055 unsigned int GetInteractionMode() const;
00056
00058 void SetPrecision( ScalarType precision );
00059
00066 virtual float CanHandleEvent(StateEvent const *stateEvent) const;
00067
00068
00069 protected:
00075 AffineInteractor3D(const char *type,
00076 DataNode *dataNode, int n = -1);
00077
00081 virtual ~AffineInteractor3D();
00082
00083 virtual bool ExecuteAction( Action* action,
00084 mitk::StateEvent const* stateEvent );
00085
00086 bool ColorizeSurface( vtkPolyData *polyData, const Point3D &pickedPoint,
00087 double scalar = 0.0 );
00088
00089
00090 private:
00091
00093 ScalarType m_Precision;
00094
00095 bool m_InteractionMode;
00096
00097 Point3D m_InitialPickedPoint;
00098 Point2D m_InitialPickedDisplayPoint;
00099 vtkFloatingPointType m_InitialPickedPointWorld[4];
00100
00101 Point3D m_CurrentPickedPoint;
00102 Point2D m_CurrentPickedDisplayPoint;
00103 vtkFloatingPointType m_CurrentPickedPointWorld[4];
00104
00105 Geometry3D::Pointer m_Geometry;
00106
00107 Geometry3D::Pointer m_OriginalGeometry;
00108
00109 Vector3D m_ObjectNormal;
00110
00111 };
00112
00113 }
00114
00115 #endif