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