wxMaracasSuperposition.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   wxMaracas
00004   Module:    $RCSfile: wxMaracasSuperposition.cxx,v $
00005   Language:  C++
00006   Date:      $Date: 2009/06/08 12:35:29 $
00007   Version:   $Revision: 1.5 $
00008 
00009   Copyright: (c) 2002, 2003
00010   License:
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notice for more information.
00015 
00016 =========================================================================*/
00017 
00018 #include "wxMaracasSuperposition.h"
00019 #include "creaWx.h"
00020 #include "vtkMetaImageReader.h"
00021 #include "wx/artprov.h"
00022 
00023 
00024 
00025 wxMaracasSuperposition* wxMaracasSuperposition::instance=NULL;
00026 
00027 wxMaracasSuperposition::wxMaracasSuperposition( wxWindow* parent, std::vector<vtkImageData*> imgs): wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
00028 {       
00029         m_mgr.SetManagedWindow(this);
00030         
00031         _superposition1 = NULL;
00032         _superposition2 = NULL;
00033         _superposition3 = NULL; 
00034         
00035         _images = imgs;
00036         
00037         // set up default notebook style
00038         m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
00039         m_notebook_theme = 0;
00040         _notebook = this->createNotebook();
00041         
00042         createPanels();
00043         configurePanels();
00044 }
00045 
00046 wxMaracasSuperposition::~wxMaracasSuperposition()
00047 {
00048         _notebook->Destroy();
00049         instance = NULL;
00050         m_mgr.UnInit();
00051 }
00052 
00053 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance ( wxWindow* parent, std::vector<vtkImageData*> imgs)
00054 {
00055                 if(instance == NULL)
00056                 {
00057                         instance = new wxMaracasSuperposition(parent, imgs);
00058                 }
00059                 return instance;
00060 }
00061         
00062 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance()
00063 {
00064         return instance;
00065 }
00066 
00067 //------------------------------------------------------------------------------------------------------------
00068 // Creational and initialization methods using WxAui
00069 //------------------------------------------------------------------------------------------------------------
00070 
00071 wxAuiNotebook * wxMaracasSuperposition :: createNotebook()
00072 {
00073         wxSize client_size = GetClientSize();
00074         wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
00075         wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
00076 
00077         return noteBook;
00078 }
00079 
00080 void wxMaracasSuperposition :: configurePanels()
00081 {
00082         if( _superposition1!=NULL )
00083         {
00084                 _notebook->AddPage( _superposition1, wxT("       Superoposition 1       ") );           
00085                 m_mgr.Update();
00086         }
00087 
00088         if( _superposition2!=NULL )
00089         {
00090                 _notebook->AddPage( _superposition2, wxT("       Superoposition 2       ") );
00091                 m_mgr.Update();
00092         }
00093         
00094         if( _superposition3!=NULL )
00095         {
00096                 _notebook->AddPage( _superposition3, wxT("       Superoposition 3       ") );
00097                 m_mgr.Update();
00098         }
00099         
00100 
00101         m_mgr.AddPane(_notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
00102         m_mgr.Update();
00103  
00104         SetMinSize(wxSize(300,300));
00105         m_mgr.Update();
00106 }
00107 
00108 void wxMaracasSuperposition :: createPanels()
00109 {
00110         if( _superposition1==NULL )
00111         {
00112                 _superposition1 = new wxMaracasSuperpositionPanel ( _images, 1, _notebook );
00113         }
00114         
00115         else if( _superposition1!=NULL )
00116         {
00117                 
00118         }
00119 
00120         if( _superposition2==NULL )
00121         {
00122                 _superposition2 = new wxMaracasSuperpositionPanel ( _images, 2, _notebook );
00123         }
00124         
00125         else if( _superposition2!=NULL )
00126         {
00127                 
00128         }
00129         
00130         if( _superposition3==NULL )
00131         {
00132                 _superposition3 = new wxMaracasSuperpositionPanel ( _images, 3, _notebook );
00133         }
00134         
00135         else if( _superposition3!=NULL )
00136         {
00137                 
00138         }       
00139 }
00140 
00141 
00142 void wxMaracasSuperposition :: changeImages(std::vector<vtkImageData*> imgs)
00143 {
00144         _images = imgs;
00145         
00146         createPanels();
00147         configurePanels();
00148 }
00149 
00150 std::vector<vtkImageData*> wxMaracasSuperposition :: getImages( )
00151 {
00152                 return _images;
00153 }       

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1