Medical Imaging Interaction Toolkit  2022.10.99-122321bb
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(bool startWithFillMode = true); // 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  void UpdateFeedbackColor();
66  virtual void OnInvertLogic(StateMachineAction *, InteractionEvent *);
67 
72  void UpdateContour(const InteractionPositionEvent *);
73 
77  mitk::Point2D upperLeft(mitk::Point2D p);
78 
82  bool CheckIfCurrentSliceHasChanged(const InteractionPositionEvent *event);
83 
84  void ResetWorkingSlice(const InteractionPositionEvent* event);
85 
86  void OnToolManagerWorkingDataModified();
87 
88  bool m_FillMode;
89  static int m_Size;
90 
92 
94 
95  const int m_InternalFillValue = 255;
96 
102 
103  };
104 
105 } // namespace
106 
107 #endif
mitkFeedbackContourTool.h
mitk::InteractionEvent
Definition: mitkInteractionEvent.h:26
mitk::Message1< int >
mitk::PaintbrushTool::m_CurrentPlane
PlaneGeometry::ConstPointer m_CurrentPlane
Definition: mitkPaintbrushTool.h:99
mitk::PaintbrushTool::m_MasterContour
ContourModel::Pointer m_MasterContour
Definition: mitkPaintbrushTool.h:91
itk::SmartPointer< Self >
mitk::PaintbrushTool::m_FillMode
bool m_FillMode
Definition: mitkPaintbrushTool.h:88
mitk::PaintbrushTool::m_Size
static int m_Size
Definition: mitkPaintbrushTool.h:89
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::PaintbrushTool
Paintbrush tool for InteractiveSegmentation.
Definition: mitkPaintbrushTool.h:41
mitk::InteractionPositionEvent
Super class for all position events.
Definition: mitkInteractionPositionEvent.h:36
mitk::FeedbackContourTool
Base class for tools that use a contour for feedback.
Definition: mitkFeedbackContourTool.h:49
mitk::PaintbrushTool::SizeChanged
Message1< int > SizeChanged
Definition: mitkPaintbrushTool.h:45
mitk::Point< ScalarType, 2 >
mitk::PaintbrushTool::m_PaintingNode
DataNode::Pointer m_PaintingNode
Definition: mitkPaintbrushTool.h:100
mitkCommon.h
mitk::PaintbrushTool::m_LastContourSize
int m_LastContourSize
Definition: mitkPaintbrushTool.h:93
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
mitk::PaintbrushTool::m_LastPosition
mitk::Point3D m_LastPosition
Definition: mitkPaintbrushTool.h:101
mitk::PaintbrushTool::m_PaintingSlice
Image::Pointer m_PaintingSlice
Definition: mitkPaintbrushTool.h:98
mitk::PaintbrushTool::m_WorkingSlice
Image::Pointer m_WorkingSlice
Definition: mitkPaintbrushTool.h:97
mitk::StateMachineAction
Represents an action, that is executed after a certain event (in statemachine-mechanism) TODO: implem...
Definition: mitkStateMachineAction.h:30
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MitkSegmentationExports.h
mitk::BaseData::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkBaseData.h:46