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: wxMaracasSuperposition.cxx,v $
31 Date: $Date: 2012/11/15 14:14:35 $
32 Version: $Revision: 1.6 $
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 #include "wxMaracasSuperposition.h"
45 #include "vtkMetaImageReader.h"
46 #include "wx/artprov.h"
50 wxMaracasSuperposition* wxMaracasSuperposition::instance=NULL;
52 wxMaracasSuperposition::wxMaracasSuperposition( wxWindow* parent, std::vector<vtkImageData*> imgs): wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
54 m_mgr.SetManagedWindow(this);
56 _superposition1 = NULL;
57 _superposition2 = NULL;
58 _superposition3 = NULL;
62 // set up default notebook style
63 m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
65 _notebook = this->createNotebook();
71 wxMaracasSuperposition::~wxMaracasSuperposition()
78 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance ( wxWindow* parent, std::vector<vtkImageData*> imgs)
82 instance = new wxMaracasSuperposition(parent, imgs);
87 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance()
92 //------------------------------------------------------------------------------------------------------------
93 // Creational and initialization methods using WxAui
94 //------------------------------------------------------------------------------------------------------------
96 wxAuiNotebook * wxMaracasSuperposition :: createNotebook()
98 wxSize client_size = GetClientSize();
99 wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
100 wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
105 void wxMaracasSuperposition :: configurePanels()
107 if( _superposition1!=NULL )
109 _notebook->AddPage( _superposition1, wxT(" Superoposition 1 ") );
113 if( _superposition2!=NULL )
115 _notebook->AddPage( _superposition2, wxT(" Superoposition 2 ") );
119 if( _superposition3!=NULL )
121 _notebook->AddPage( _superposition3, wxT(" Superoposition 3 ") );
126 m_mgr.AddPane(_notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
129 SetMinSize(wxSize(300,300));
133 void wxMaracasSuperposition :: createPanels()
135 if( _superposition1==NULL )
137 _superposition1 = new wxMaracasSuperpositionPanel ( _images, 1, _notebook );
140 else if( _superposition1!=NULL )
145 if( _superposition2==NULL )
147 _superposition2 = new wxMaracasSuperpositionPanel ( _images, 2, _notebook );
150 else if( _superposition2!=NULL )
155 if( _superposition3==NULL )
157 _superposition3 = new wxMaracasSuperpositionPanel ( _images, 3, _notebook );
160 else if( _superposition3!=NULL )
167 void wxMaracasSuperposition :: changeImages(std::vector<vtkImageData*> imgs)
175 std::vector<vtkImageData*> wxMaracasSuperposition :: getImages( )