Medical Imaging Interaction Toolkit  2025.12.02
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
14 #define mitkPaintbrushTool_h
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(bool startWithFillMode = true); // purposely hidden
53  ~PaintbrushTool() override;
54 
55  void ConnectActionsAndFunctions() override;
56 
57  void Activated() override;
58  void Deactivated() override;
59 
63  virtual void MouseMoved(mitk::InteractionEvent *interactionEvent, bool leftMouseButtonPressed);
67 
68  virtual int GetFillValue() const;
69 
75 
80 
85 
87 
89 
90  bool m_FillMode;
91  int m_Size;
92 
93  ContourModel::Pointer m_MasterContour;
94 
96 
99  PlaneGeometry::ConstPointer m_CurrentPlane;
100  DataNode::Pointer m_PaintingNode;
102 
103  };
104 
105 } // namespace
106 
107 #endif
#define MITKSEGMENTATION_EXPORT
Base class for tools that use a contour for feedback.
Super class for all position events.
Paintbrush tool for InteractiveSegmentation.
virtual void OnMousePressed(StateMachineAction *, InteractionEvent *)
mitk::Point3D m_LastPosition
virtual void OnInvertLogic(StateMachineAction *, InteractionEvent *)
PlaneGeometry::ConstPointer m_CurrentPlane
void Deactivated() override
Called when the tool gets deactivated.
bool CheckIfCurrentSliceHasChanged(const InteractionPositionEvent *event)
void SetSize(int value)
virtual void OnPrimaryButtonPressedMoved(StateMachineAction *, InteractionEvent *)
mitk::Point2D upperLeft(mitk::Point2D p)
PaintbrushTool(bool startWithFillMode=true)
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *)
Image::Pointer m_WorkingSlice
virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *)
void OnToolManagerWorkingDataModified()
void ResetWorkingSlice(const InteractionPositionEvent *event)
DataNode::Pointer m_PaintingNode
virtual void MouseMoved(mitk::InteractionEvent *interactionEvent, bool leftMouseButtonPressed)
Image::Pointer m_PaintingSlice
virtual int GetFillValue() const
void ConnectActionsAndFunctions() override
Message1< int > SizeChanged
mitkClassMacro(PaintbrushTool, FeedbackContourTool)
~PaintbrushTool() override
void Activated() override
Called when the tool gets activated.
void UpdateContour(const InteractionPositionEvent *)
ContourModel::Pointer m_MasterContour
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Find image slices visible on a given plane.