]> Creatis software - cpPlugins.git/blob - lib/cpBaseQtApplication/ActorProperties.h
4372ef5d6d35ffe167d1fde0ac85848a14975ce1
[cpPlugins.git] / lib / cpBaseQtApplication / ActorProperties.h
1 #ifndef __CPBASEQTAPPLICATION__ACTORPROPERTIES__H__
2 #define __CPBASEQTAPPLICATION__ACTORPROPERTIES__H__
3
4 #include <cpBaseQtApplication_Export.h>
5 #include <cpPlugins/Config.h>
6
7 #include <set>
8 #include <QWidget>
9 #include <vtkProp.h>
10 #include <vtkRenderWindow.h>
11 #include <vtkSmartPointer.h>
12
13 // -------------------------------------------------------------------------
14 namespace cpBaseQtApplication
15 {
16   /**
17    */
18   class cpBaseQtApplication_EXPORT ActorProperties
19     : public QWidget
20   {
21     Q_OBJECT;
22
23   public:
24     template< class _TObj >
25     struct TCmp
26     {
27       bool operator()(
28         const vtkSmartPointer< _TObj >& a,
29         const vtkSmartPointer< _TObj >& b ) const
30         { return( a.GetPointer( ) < b.GetPointer( ) ); }
31     };
32     typedef vtkSmartPointer< vtkProp >                         TActor;
33     typedef vtkSmartPointer< vtkRenderWindow >                 TRenderWindow;
34     typedef std::set< TActor, TCmp< vtkProp > >                TActors;
35     typedef std::set< TRenderWindow, TCmp< vtkRenderWindow > > TWindows;
36
37   public:
38     explicit ActorProperties( QWidget* parent = 0 );
39     virtual ~ActorProperties( );
40
41     virtual bool addActor( vtkProp* obj ) = 0;
42     bool addRenderWindow( vtkRenderWindow* win );
43     void _render( );
44
45   protected:
46     virtual void _updateWidgets( ) = 0;
47
48   protected:
49     TActors  m_Actors;
50     TWindows m_Windows;
51   };
52
53 } // ecapseman
54
55 #endif // __CPBASEQTAPPLICATION__ACTORPROPERTIES__H__
56
57 // eof - $RCSfile$