Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPaintbrushTool.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkPaintbrushTool_h_Included
18 #define mitkPaintbrushTool_h_Included
19 
20 #include "mitkCommon.h"
22 #include "mitkLegacyAdaptors.h"
23 #include "mitkPointOperation.h"
24 #include "mitkPointSet.h"
26 
27 namespace mitk
28 {
29  class StateMachineAction;
30  class InteractionEvent;
31  class InteractionPositionEvent;
32 
50  {
51  public:
52  // sent when the pen size is changed or should be updated in a GUI.
54 
56 
57  void SetSize(int value);
58 
59  protected:
60  PaintbrushTool(int paintingPixelValue = 1); // purposely hidden
61  virtual ~PaintbrushTool();
62 
63  void ConnectActionsAndFunctions() override;
64 
65  virtual void Activated() override;
66  virtual void Deactivated() override;
67 
68  virtual void OnMousePressed(StateMachineAction *, InteractionEvent *);
69  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *);
70  virtual void OnPrimaryButtonPressedMoved(StateMachineAction *, InteractionEvent *);
71  virtual void MouseMoved(mitk::InteractionEvent *interactionEvent, bool leftMouseButtonPressed);
72  virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *);
73  virtual void OnInvertLogic(StateMachineAction *, InteractionEvent *);
74 
79  void UpdateContour(const InteractionPositionEvent *);
80 
84  mitk::Point2D upperLeft(mitk::Point2D p);
85 
89  void CheckIfCurrentSliceHasChanged(const InteractionPositionEvent *event);
90 
91  void OnToolManagerWorkingDataModified();
92 
94  static int m_Size;
95 
97 
99 
104  };
105 
106 } // namespace
107 
108 #endif
DataNode::Pointer m_WorkingNode
Paintbrush tool for InteractiveSegmentation.
Super class for all position events.
mitk::Point3D m_LastPosition
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
ContourModel::Pointer m_MasterContour
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
virtual void ConnectActionsAndFunctions() override
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Message1< int > SizeChanged
PlaneGeometry::Pointer m_CurrentPlane
Image::Pointer m_WorkingSlice
Base class for tools that use a contour for feedback.