]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Visualization/MPRObjects.h
merge async example
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRObjects.h
1 #ifndef __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
2 #define __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
3
4 #include <cpExtensions/cpExtensions_Export.h>
5 #include <cpExtensions/Visualization/MPRActors.h>
6
7 #include <vtkObject.h>
8 #include <vtkRenderer.h>
9 #include <vtkRenderWindow.h>
10
11 namespace cpExtensions
12 {
13   namespace Visualization
14   {
15     /**
16      */
17     class cpExtensions_EXPORT MPRObjects
18       : public vtkObject
19     {
20     public:
21       typedef MPRObjects Self;
22       typedef cpExtensions::Visualization::MPRActors TMPRActors;
23
24       typedef TMPRActors::TCursorCommand     TCursorCommand;
25       typedef TMPRActors::TMouseCommand      TMouseCommand;
26       typedef TMPRActors::TMouseWheelCommand TMouseWheelCommand;
27       typedef TMPRActors::TKeyCommand        TKeyCommand;
28
29     public:
30       vtkTypeMacro( MPRObjects, vtkObject );
31
32     public:
33       // Creation
34       static MPRObjects* New( );
35
36       void AddCursorCommand( TCursorCommand command, void* data )
37       {
38         this->m_MPRActors->AddCursorCommand( command, data );
39       }
40
41       void SetRenderWindows(
42         vtkRenderWindow* wx, vtkRenderWindow* wy,
43         vtkRenderWindow* wz, vtkRenderWindow* w3D
44         );
45       void AddImage( vtkImageData* image );
46       void ClearAll( );
47
48       void ResetCamera( const int& id );
49       void ResetCameras( );
50       void Render( const int& id );
51       void RenderAll( );
52       vtkRenderer* GetXRenderer( );
53       vtkRenderer* GetYRenderer( );
54       vtkRenderer* GetZRenderer( );
55       vtkRenderer* Get3DRenderer( );
56       const vtkRenderer* GetXRenderer( ) const;
57       const vtkRenderer* GetYRenderer( ) const;
58       const vtkRenderer* GetZRenderer( ) const;
59       const vtkRenderer* Get3DRenderer( ) const;
60
61       TMPRActors* GetMPRActors( );
62       const TMPRActors* GetMPRActors( ) const;
63
64       double GetWindow( ) const
65       {
66         return( this->m_MPRActors->GetWindow( ) );
67       }
68       double GetLevel( ) const
69       {
70         return( this->m_MPRActors->GetLevel( ) );
71       }
72
73     protected:
74       MPRObjects( );
75       virtual ~MPRObjects( );
76
77     private:
78       // Purposely not implemented
79       MPRObjects( const Self& );
80       Self& operator=( const Self& );
81
82     protected:
83       // Inputs
84       vtkSmartPointer< vtkRenderWindow > m_Windows[ 4 ];
85
86       // Internal pipelines
87       vtkSmartPointer< TMPRActors >  m_MPRActors;
88       vtkSmartPointer< vtkRenderer > m_Renderers[ 4 ];
89
90       std::vector< TCursorCommand >     CursorCommands;
91       std::vector< TMouseCommand >      MouseCommands;
92       std::vector< TMouseCommand >      MouseClickCommands;
93       std::vector< TMouseCommand >      MouseDoubleClickCommands;
94       std::vector< TMouseWheelCommand > MouseWheelCommands;
95       std::vector< TKeyCommand >        KeyCommands;
96     };
97
98   } // ecapseman
99
100 } // ecapseman
101
102 #endif //  __CPEXTENSIONS__VISUALIZATION__MPROBJECTS__H__
103
104 // eof - $RCSfile$