1 /*=========================================================================
4 Module: $RCSfile: wxMaracasSuperposition.cxx,v $
6 Date: $Date: 2009/06/03 13:47:07 $
7 Version: $Revision: 1.3 $
9 Copyright: (c) 2002, 2003
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.
16 =========================================================================*/
18 #include "wxMaracasSuperposition.h"
20 #include "vtkMetaImageReader.h"
21 #include "wx/artprov.h"
25 wxMaracasSuperposition* wxMaracasSuperposition::instance=NULL;
27 wxMaracasSuperposition::wxMaracasSuperposition( wxWindow* parent, std::vector<vtkImageData*> imgs): wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
29 m_mgr.SetManagedWindow(this);
31 _superposition1 = NULL;
32 _superposition2 = NULL;
33 _superposition3 = NULL;
37 // set up default notebook style
38 m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
40 _notebook = this->createNotebook();
46 wxMaracasSuperposition::~wxMaracasSuperposition()
52 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance ( wxWindow* parent, std::vector<vtkImageData*> imgs)
56 instance = new wxMaracasSuperposition(parent, imgs);
61 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance()
66 //------------------------------------------------------------------------------------------------------------
67 // Creational and initialization methods using WxAui
68 //------------------------------------------------------------------------------------------------------------
70 wxAuiNotebook * wxMaracasSuperposition :: createNotebook()
72 wxSize client_size = GetClientSize();
73 wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
74 wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
79 void wxMaracasSuperposition :: configurePanels()
81 if( _superposition1!=NULL )
83 _notebook->AddPage( _superposition1, wxT(" Superoposition 1 ") );
87 if( _superposition2!=NULL )
89 _notebook->AddPage( _superposition2, wxT(" Superoposition 2 ") );
93 if( _superposition3!=NULL )
95 _notebook->AddPage( _superposition3, wxT(" Superoposition 3 ") );
100 m_mgr.AddPane(_notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
103 SetMinSize(wxSize(300,300));
107 void wxMaracasSuperposition :: createPanels()
109 if( _superposition1==NULL )
111 createSuperpositionPanel(1);
114 else if( _superposition1!=NULL )
119 if( _superposition2==NULL )
121 createSuperpositionPanel(2);
124 else if( _superposition2!=NULL )
129 if( _superposition3==NULL )
131 createSuperpositionPanel(3);
134 else if( _superposition3!=NULL )
140 void wxMaracasSuperposition :: createSuperpositionPanel(int type)
144 _superposition1 = new wxMaracasSuperpositionPanel ( _images, _notebook );
148 _superposition2 = new wxMaracasSuperpositionPanel ( _images, _notebook );
152 _superposition3 = new wxMaracasSuperpositionPanel ( _images, _notebook );
156 void wxMaracasSuperposition :: changeImages(std::vector<vtkImageData*> imgs)
164 std::vector<vtkImageData*> wxMaracasSuperposition :: getImages( )