00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: 1.12 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef mitkPaintbrushTool_h_Included 00019 #define mitkPaintbrushTool_h_Included 00020 00021 #include "mitkCommon.h" 00022 #include "MitkExtExports.h" 00023 #include "mitkFeedbackContourTool.h" 00024 #include "mitkPointSet.h" 00025 #include "mitkPointOperation.h" 00026 00027 namespace mitk 00028 { 00046 class MitkExt_EXPORT PaintbrushTool : public FeedbackContourTool 00047 { 00048 public: 00049 00050 // sent when the pen size is changed or should be updated in a GUI. 00051 Message1<int> SizeChanged; 00052 00053 mitkClassMacro(PaintbrushTool, FeedbackContourTool); 00054 00055 void SetSize(int value); 00056 00057 protected: 00058 00059 PaintbrushTool(int paintingPixelValue = 1); // purposely hidden 00060 virtual ~PaintbrushTool(); 00061 00062 virtual void Activated(); 00063 virtual void Deactivated(); 00064 00065 virtual bool OnMousePressed (Action*, const StateEvent*); 00066 virtual bool OnMouseMoved (Action*, const StateEvent*); 00067 virtual bool OnMouseReleased(Action*, const StateEvent*); 00068 virtual bool OnInvertLogic (Action*, const StateEvent*); 00069 00074 void UpdateContour(const StateEvent* stateEvent); 00075 00076 int m_PaintingPixelValue; 00077 static int m_Size; 00078 00079 Contour::Pointer m_MasterContour; 00080 00081 int m_LastContourSize; 00082 }; 00083 00084 } // namespace 00085 00086 #endif 00087