]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracas_N_ViewersWidget.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: wxMaracas_N_ViewersWidget.h,v $
5   Language:  C++
6   Date:      $Date: 2010/10/23 12:01:32 $
7   Version:   $Revision: 1.12 $
8
9   Copyright: (c) 2002, 2003
10   License:
11
12      This software is distributed WITHOUT ANY WARRANTY; without even
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14      PURPOSE.  See the above copyright notice for more information.
15
16 =========================================================================*/
17
18 #ifndef __WX__MARACAS__N_VIEWERSWIDGET__H__
19 #define __WX__MARACAS__N_VIEWERSWIDGET__H__
20
21
22 // -----------------------------------------------------------------------------------------------------------
23 // WX headers inclusion.
24 // For compilers that support precompilation, includes <wx/wx.h>.
25 // -----------------------------------------------------------------------------------------------------------
26 #include <wx/wxprec.h>
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30 #ifndef WX_PRECOMP
31 #include <wx/wx.h>
32 #endif
33
34 //------------------------------------------------------------------------------------------------------------
35 // Includes
36 //------------------------------------------------------------------------------------------------------------
37
38 #include "vtkImageData.h"
39 #include "wxMaracas_ViewerWidget.h"
40 #include <iostream>
41 #include <vector>
42
43 //------------------------------------------------------------------------------------------------------------
44 // Class definition
45 //------------------------------------------------------------------------------------------------------------
46
47 class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel
48   {
49   public:
50
51
52         //------------------------------------------------------------------------------------------------------------
53         // Constructors & Destructors
54         //------------------------------------------------------------------------------------------------------------
55
56         /**
57         *       @pre A wxWindow* object must be provided as a parent for the viewer
58         *       @post The layout of the viewer is initialize, if there is no image or type set,
59                         only the panel of the viwer is created with no vtk objects
60         *       @param wxWindow* parent of the window
61         *       @param vtkImageData* imagedata of the viewer
62         *       @param std::vector<int>* vector of the type for the viewer
63         *       @deprecated This method will be eliminated in future versions,
64         *       @deprecated the viewers will start with a default image if it is not specified,
65         *       @deprecated this is in order to create the layout of the viewer,
66         *       @deprecated the vtkInteractors* and the object vtkRenderer* use second constructor
67         */
68         wxMaracas_N_ViewersWidget(wxWindow *parent, vtkImageData* imagedata = NULL, std::vector<int> *nTypeView = NULL);
69         /**
70         *       @pre A wxWindow* object must be provided as a parent for the viewer and the type of layout for the viewer
71         *       @post The layout of the viewer is initialized, if no image is provided at first, a default image is
72         *               used
73         *       @param wxWindow* parent of the window
74         *       @param std::vector<int>* vector of the type for the viewer
75         *       @param vtkImageData* imagedata of the viewer
76         */
77         wxMaracas_N_ViewersWidget(wxWindow *parent, std::vector<int> *nTypeView, vtkImageData* imagedata = NULL);
78         /**
79         *       @pre none
80         *       @post the viewer window is deleted, all of the interactors and the renderer are deleted
81         */
82         ~wxMaracas_N_ViewersWidget();
83
84
85         //------------------------------------------------------------------------------------------------------------
86         // Methods
87         //------------------------------------------------------------------------------------------------------------
88
89     void Update();
90     vtkRenderer *GetRenderer();
91         void RefreshView();
92
93         virtual void OnRefreshView(wxCommandEvent & event);
94         void OnDClickLeft(wxCommandEvent & event);
95         wxMaracas_ViewerWidget *GetWindow(int iWin);
96         wxVtkBaseView *GetwxVtkBaseView(int iWin);
97         virtual void Refresh(bool eraseBackground = true,const wxRect* rect = NULL );
98         void SetImage( vtkImageData *image      );
99         void ConfigureVTK();
100         void SetType(std::vector<int>* type);
101         void UpdateLayout(vtkImageData* imagedata);
102 //      double GetZ(int iWin);
103         double GetX();
104         double GetY();
105         double GetZ();
106
107         void setColorTransferFunction(vtkColorTransferFunction* colortable);
108
109         void setWindowLevel(double level);
110         void setColorLevel(double level);
111
112         //------------------------------------------------------------------------------------------------------------
113         // Attributes
114         //------------------------------------------------------------------------------------------------------------
115
116   private:
117
118         wxPanel *wxw1;
119         wxPanel *wxw2;
120         wxPanel *wxw3;
121         wxPanel *wxw4;
122         wxMaracas_ViewerWidget  *wxwindow1;
123         wxMaracas_ViewerWidget  *wxwindow2;
124         wxMaracas_ViewerWidget  *wxwindow3;
125         wxMaracas_ViewerWidget  *wxwindow4;
126
127         wxWindow *_currentwxw;
128
129
130         std::vector<int> *nTypeView;
131
132         vtkMPRBaseData* mvtkmprbasedata;
133
134         void invariant();
135   DECLARE_EVENT_TABLE( );
136   };
137
138
139 #endif // __WX__MARACAS__N_VIEWERWIDGET__H__