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