]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h
1495dc19ebc2cb8310cfde8907858d592e4232d0
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracas_N_ViewersWidget.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 /*=========================================================================
27
28   Program:   wxMaracas
29   Module:    $RCSfile: wxMaracas_N_ViewersWidget.h,v $
30   Language:  C++
31   Date:      $Date: 2012/11/15 14:14:35 $
32   Version:   $Revision: 1.14 $
33
34   Copyright: (c) 2002, 2003
35   License:
36
37      This software is distributed WITHOUT ANY WARRANTY; without even
38      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
39      PURPOSE.  See the above copyright notice for more information.
40
41 =========================================================================*/
42
43 #ifndef __WX__MARACAS__N_VIEWERSWIDGET__H__
44 #define __WX__MARACAS__N_VIEWERSWIDGET__H__
45
46
47 // -----------------------------------------------------------------------------------------------------------
48 // WX headers inclusion.
49 // For compilers that support precompilation, includes <wx/wx.h>.
50 // -----------------------------------------------------------------------------------------------------------
51 #include <wx/wxprec.h>
52 #ifdef __BORLANDC__
53 #pragma hdrstop
54 #endif
55 #ifndef WX_PRECOMP
56 #include <wx/wx.h>
57 #endif
58
59 //------------------------------------------------------------------------------------------------------------
60 // Includes
61 //------------------------------------------------------------------------------------------------------------
62
63 #include "vtkImageData.h"
64 #include "wxMaracas_ViewerWidget.h"
65 #include <iostream>
66 #include <vector>
67
68 //------------------------------------------------------------------------------------------------------------
69 // Class definition
70 //------------------------------------------------------------------------------------------------------------
71
72 class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel
73   {
74   public:
75
76
77         //------------------------------------------------------------------------------------------------------------
78         // Constructors & Destructors
79         //------------------------------------------------------------------------------------------------------------
80
81         /**
82         *       @pre A wxWindow* object must be provided as a parent for the viewer
83         *       @post The layout of the viewer is initialize, if there is no image or type set,
84                         only the panel of the viwer is created with no vtk objects
85         *       @param wxWindow* parent of the window
86         *       @param vtkImageData* imagedata of the viewer
87         *       @param std::vector<int>* vector of the type for the viewer
88         *       @deprecated This method will be eliminated in future versions,
89         *       @deprecated the viewers will start with a default image if it is not specified,
90         *       @deprecated this is in order to create the layout of the viewer,
91         *       @deprecated the vtkInteractors* and the object vtkRenderer* use second constructor
92         */
93         wxMaracas_N_ViewersWidget(wxWindow *parent, vtkImageData* imagedata = NULL, std::vector<int> *nTypeView = NULL);
94         /**
95         *       @pre A wxWindow* object must be provided as a parent for the viewer and the type of layout for the viewer
96         *       @post The layout of the viewer is initialized, if no image is provided at first, a default image is
97         *               used
98         *       @param wxWindow* parent of the window
99         *       @param std::vector<int>* vector of the type for the viewer
100         *       @param vtkImageData* imagedata of the viewer
101         */
102         wxMaracas_N_ViewersWidget(wxWindow *parent, std::vector<int> *nTypeView, vtkImageData* imagedata = NULL);
103         /**
104         *       @pre none
105         *       @post the viewer window is deleted, all of the interactors and the renderer are deleted
106         */
107         ~wxMaracas_N_ViewersWidget();
108
109
110         //------------------------------------------------------------------------------------------------------------
111         // Methods
112         //------------------------------------------------------------------------------------------------------------
113
114     void Update();
115     vtkRenderer *GetRenderer();
116         void RefreshView();
117
118         virtual void OnRefreshView(wxCommandEvent & event);
119         void OnDClickLeft(wxCommandEvent & event);
120         wxMaracas_ViewerWidget *GetWindow(int iWin);
121         wxVtkBaseView *GetwxVtkBaseView(int iWin);
122         virtual void Refresh(bool eraseBackground = true,const wxRect* rect = NULL );
123         void SetImage( vtkImageData *image      );
124         void ConfigureVTK();
125         void SetType(std::vector<int>* type);
126         void UpdateLayout(vtkImageData* imagedata);
127 //      double GetZ(int iWin);
128         double GetX();
129         double GetY();
130         double GetZ();
131
132         void setColorTransferFunction(vtkColorTransferFunction* colortable);
133     void SetColorWindowLevel(double colorWindow, double colorLevel);
134
135         //------------------------------------------------------------------------------------------------------------
136         // Attributes
137         //------------------------------------------------------------------------------------------------------------
138
139   private:
140
141         wxPanel *wxw1;
142         wxPanel *wxw2;
143         wxPanel *wxw3;
144         wxPanel *wxw4;
145         wxMaracas_ViewerWidget  *wxwindow1;
146         wxMaracas_ViewerWidget  *wxwindow2;
147         wxMaracas_ViewerWidget  *wxwindow3;
148         wxMaracas_ViewerWidget  *wxwindow4;
149
150         wxWindow *_currentwxw;
151
152
153         std::vector<int> *nTypeView;
154
155         vtkMPRBaseData* mvtkmprbasedata;
156
157         void invariant();
158   DECLARE_EVENT_TABLE( );
159   };
160
161
162 #endif // __WX__MARACAS__N_VIEWERWIDGET__H__