]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/DataObject.h
Windows compilation is broken.
[cpPlugins.git] / lib / cpPlugins / DataObject.h
1 #ifndef __CPPLUGINS__DATAOBJECT__H__
2 #define __CPPLUGINS__DATAOBJECT__H__
3
4 #include <cpPlugins/Object.h>
5 #include <set>
6 #include <vtkProp.h>
7 #include <vtkRenderer.h>
8
9 namespace cpPlugins
10 {
11   // Some forward declarations
12   class ProcessObject;
13   class DataObjectVisualizationQtDialog;
14
15   /**
16    */
17   class cpPlugins_EXPORT DataObject
18     : public Object
19   {
20   public:
21     typedef DataObject                      Self;
22     typedef Object                          Superclass;
23     typedef itk::SmartPointer< Self >       Pointer;
24     typedef itk::SmartPointer< const Self > ConstPointer;
25
26   public:
27     itkNewMacro( Self );
28     itkTypeMacro( DataObject, Object );
29     cpPlugins_Id_Macro( DataObject, Object );
30
31     struct TDataView
32     {
33       vtkSmartPointer< vtkProp >     Actor;
34       vtkSmartPointer< vtkRenderer > Renderer;
35       bool operator<( const TDataView& b ) const
36         { return( this->Actor.GetPointer( ) < b.Actor.GetPointer( ) ); }
37     };
38     typedef std::set< TDataView > TDataViews;
39
40   public:
41     ProcessObject* GetSource( );
42     const ProcessObject* GetSource( ) const;
43     void SetSource( ProcessObject* src );
44
45     void DisconnectFromPipeline( );
46
47     // Qt dialog creation
48     virtual DataObjectVisualizationQtDialog* CreateQtDialog( );
49
50     // VTK actors
51     virtual void AddVTKActor( vtkProp* actor, vtkRenderer* renderer );
52     virtual void ClearVTKActors( );
53     virtual void RenderVTKActors( );
54     TDataViews::iterator BeginVTKActors( );
55     TDataViews::iterator EndVTKActors( );
56     TDataViews::const_iterator BeginVTKActors( ) const;
57     TDataViews::const_iterator EndVTKActors( ) const;
58
59   protected:
60     DataObject( );
61     virtual ~DataObject( );
62
63   private:
64     // Purposely not implemented
65     DataObject( const Self& );
66     Self& operator=( const Self& );
67
68   protected:
69     ProcessObject* m_Source;
70     TDataViews     m_Actors;
71   };
72
73 } // ecapseman
74
75 #endif // __CPPLUGINS__DATAOBJECT__H__
76
77 // eof - $RCSfile$