Medical Imaging Interaction Toolkit  2021.10.00
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkPaintbrushTool_h_Included
14 #define mitkPaintbrushTool_h_Included
15 
16 #include "mitkCommon.h"
19 
20 namespace mitk
21 {
22  class StateMachineAction;
23  class InteractionEvent;
24  class InteractionPositionEvent;
25 
42  {
43  public:
44  // sent when the pen size is changed or should be updated in a GUI.
46 
48 
49  void SetSize(int value);
50 
51  protected:
52  PaintbrushTool(int paintingPixelValue = 1); // purposely hidden
53  ~PaintbrushTool() override;
54 
55  void ConnectActionsAndFunctions() override;
56 
57  void Activated() override;
58  void Deactivated() override;
59 
60  virtual void OnMousePressed(StateMachineAction *, InteractionEvent *);
61  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *);
62  virtual void OnPrimaryButtonPressedMoved(StateMachineAction *, InteractionEvent *);
63  virtual void MouseMoved(mitk::InteractionEvent *interactionEvent, bool leftMouseButtonPressed);
64  virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *);
65  virtual void OnInvertLogic(StateMachineAction *, InteractionEvent *);
66 
71  void UpdateContour(const InteractionPositionEvent *);
72 
76  mitk::Point2D upperLeft(mitk::Point2D p);
77 
81  void CheckIfCurrentSliceHasChanged(const InteractionPositionEvent *event);
82 
83  void OnToolManagerWorkingDataModified();
84 
86  static int m_Size;
87 
89 
91 
96  };
97 
98 } // namespace
99 
100 #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...
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Message1< int > SizeChanged
Image::Pointer m_WorkingSlice
Base class for tools that use a contour for feedback.
PlaneGeometry::ConstPointer m_CurrentPlane
itk::SmartPointer< Self > Pointer
Definition: mitkBaseData.h:46