]> Creatis software - cpPlugins.git/blob - plugins/cpPluginsWidgets/SeedWidget.h
92c744b20397e58eb28edb02cacb163b9885d2e7
[cpPlugins.git] / plugins / cpPluginsWidgets / SeedWidget.h
1 #ifndef __CPPLUGINSWIDGETS__SEEDWIDGET__H__
2 #define __CPPLUGINSWIDGETS__SEEDWIDGET__H__
3
4 #include <plugins/cpPluginsWidgets/cpPluginsWidgets_Export.h>
5 #include <cpPlugins/BaseWidget.h>
6
7 #include <cpExtensions/Interaction/SeedWidget.h>
8 #include <vtkImageActorPointPlacer.h>
9 #include <vtkPointHandleRepresentation3D.h>
10 #include <vtkSeedRepresentation.h>
11 #include <vtkSmartPointer.h>
12
13 namespace cpPluginsWidgets
14 {
15   /**
16    */
17   class cpPluginsWidgets_EXPORT SeedWidget
18     : public cpPlugins::BaseWidget
19   {
20   public:
21     typedef SeedWidget                      Self;
22     typedef cpPlugins::BaseWidget           Superclass;
23     typedef itk::SmartPointer< Self >       Pointer;
24     typedef itk::SmartPointer< const Self > ConstPointer;
25
26   public:
27     itkNewMacro( Self );
28     itkTypeMacro( SeedWidget, cpPlugins::BaseWidget );
29     cpPlugins_Id_Macro( SeedWidget, Widgets );
30
31     struct WidgetData
32     {
33       vtkSmartPointer< cpExtensions::Interaction::SeedWidget > Widget;
34       vtkSmartPointer< vtkImageActorPointPlacer >              Placer;
35       vtkSmartPointer< vtkPointHandleRepresentation3D >        Handle;
36       vtkSmartPointer< vtkSeedRepresentation >                 Seed;
37
38       void Configure(
39         cpPluginsWidgets::SeedWidget* parent,
40         vtkRenderWindowInteractor* interactor, vtkImageActor* actor
41         );
42       void On( );
43       void Off( );
44     };
45
46   protected:
47     SeedWidget( );
48     virtual ~SeedWidget( );
49
50     virtual void _GenerateData( ) ITK_OVERRIDE;
51
52   private:
53     // Purposely not implemented
54     SeedWidget( const Self& );
55     Self& operator=( const Self& );
56
57   protected:
58     bool m_Configured;
59     std::vector< WidgetData > m_Widgets;
60     unsigned int m_InitialNumberOfSeeds;
61   };
62
63 } // ecapseman
64
65 #endif // __CPPLUGINSWIDGETS__SEEDWIDGET__H__
66
67 // eof - $RCSfile$