#pragma once /*========================================================================= medInria Copyright (c) INRIA 2013 - 2020. All rights reserved. See LICENSE.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =========================================================================*/ #include #include #include #include #include #include #include #include #include #include #include class medAbstractPaintCommandPrivate; class medClickAndMoveEventFilter; class medAbstractImageView; class medAbstractData; class medAnnotationData; class medAbstractImageData; typedef itk::Image MaskType; typedef itk::AttributeLabelObject LabelObjectType; typedef itk::LabelMap< LabelObjectType > LabelMapType; typedef itk::SmartPointer >MaskTypePointer; typedef itk::SmartPointer > LabelMapTypePointer; class MEDVIEWSEGMENTATIONPLUGIN_EXPORT medPaintCommandManager : public QObject { Q_OBJECT public: static medPaintCommandManager *instance(); LabelMapType::Pointer labelMap(MaskType* mask); protected: medPaintCommandManager(){} ~medPaintCommandManager(){} protected: static medPaintCommandManager *s_instance; QHash labelMaps; }; struct medPaintCommandOptions { medAbstractImageView *view; medAbstractData* data; medAnnotationData *maskAnnotationData; MaskType::Pointer itkMask; QVector points; unsigned int maskValue; double radius; }; class MEDVIEWSEGMENTATIONPLUGIN_EXPORT medAbstractPaintCommand : public QUndoCommand { public: medAbstractPaintCommand(medPaintCommandOptions *options, QUndoCommand *parent = nullptr); virtual ~medAbstractPaintCommand(); virtual void undo() = 0; virtual void redo() = 0; medPaintCommandOptions *options() const; private: medAbstractPaintCommandPrivate *d; };