Medical Imaging Interaction Toolkit  2021.02.99-c7792db0
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 
43  {
44  public:
45  // sent when the pen size is changed or should be updated in a GUI.
47 
49 
50  void SetSize(int value);
51 
52  protected:
53  PaintbrushTool(int paintingPixelValue = 1); // purposely hidden
54  ~PaintbrushTool() override;
55 
56  void ConnectActionsAndFunctions() override;
57 
58  void Activated() override;
59  void Deactivated() override;
60 
61  virtual void OnMousePressed(StateMachineAction *, InteractionEvent *);
62  virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *);
63  virtual void OnPrimaryButtonPressedMoved(StateMachineAction *, InteractionEvent *);
64  virtual void MouseMoved(mitk::InteractionEvent *interactionEvent, bool leftMouseButtonPressed);
65  virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *);
66  virtual void OnInvertLogic(StateMachineAction *, InteractionEvent *);
67 
72  void UpdateContour(const InteractionPositionEvent *);
73 
77  mitk::Point2D upperLeft(mitk::Point2D p);
78 
82  void CheckIfCurrentSliceHasChanged(const InteractionPositionEvent *event);
83 
84  void OnToolManagerWorkingDataModified();
85 
87  static int m_Size;
88 
90 
92 
97  };
98 
99 } // namespace
100 
101 #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:40
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