1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
26 /*=========================================================================
29 Module: $RCSfile: wxMaracas_N_ViewersWidget.h,v $
31 Date: $Date: 2012/11/15 14:14:35 $
32 Version: $Revision: 1.14 $
34 Copyright: (c) 2002, 2003
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.
41 =========================================================================*/
43 #ifndef __WX__MARACAS__N_VIEWERSWIDGET__H__
44 #define __WX__MARACAS__N_VIEWERSWIDGET__H__
47 // -----------------------------------------------------------------------------------------------------------
48 // WX headers inclusion.
49 // For compilers that support precompilation, includes <wx/wx.h>.
50 // -----------------------------------------------------------------------------------------------------------
51 #include <wx/wxprec.h>
59 //------------------------------------------------------------------------------------------------------------
61 //------------------------------------------------------------------------------------------------------------
63 #include "vtkImageData.h"
64 #include "wxMaracas_ViewerWidget.h"
68 //------------------------------------------------------------------------------------------------------------
70 //------------------------------------------------------------------------------------------------------------
72 class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel
77 //------------------------------------------------------------------------------------------------------------
78 // Constructors & Destructors
79 //------------------------------------------------------------------------------------------------------------
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
93 wxMaracas_N_ViewersWidget(wxWindow *parent, vtkImageData* imagedata = NULL, std::vector<int> *nTypeView = NULL);
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
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
102 wxMaracas_N_ViewersWidget(wxWindow *parent, std::vector<int> *nTypeView, vtkImageData* imagedata = NULL);
105 * @post the viewer window is deleted, all of the interactors and the renderer are deleted
107 ~wxMaracas_N_ViewersWidget();
110 //------------------------------------------------------------------------------------------------------------
112 //------------------------------------------------------------------------------------------------------------
115 vtkRenderer *GetRenderer();
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 );
125 void SetType(std::vector<int>* type);
126 void UpdateLayout(vtkImageData* imagedata);
127 // double GetZ(int iWin);
132 void setColorTransferFunction(vtkColorTransferFunction* colortable);
133 void SetColorWindowLevel(double colorWindow, double colorLevel);
135 void SetInterpolate(bool interpolate);
138 //------------------------------------------------------------------------------------------------------------
140 //------------------------------------------------------------------------------------------------------------
148 wxMaracas_ViewerWidget *wxwindow1;
149 wxMaracas_ViewerWidget *wxwindow2;
150 wxMaracas_ViewerWidget *wxwindow3;
151 wxMaracas_ViewerWidget *wxwindow4;
153 wxWindow *_currentwxw;
156 std::vector<int> *nTypeView;
158 vtkMPRBaseData* mvtkmprbasedata;
161 DECLARE_EVENT_TABLE( );
165 #endif // __WX__MARACAS__N_VIEWERWIDGET__H__