]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSuperposition.cxx
98f20f7ade46d84e93327d21df8e5f33f6896798
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasSuperposition.cxx
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: wxMaracasSuperposition.cxx,v $
5   Language:  C++
6   Date:      $Date: 2009/05/28 16:39:51 $
7   Version:   $Revision: 1.1 $
8
9   Copyright: (c) 2002, 2003
10   License:
11
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.
15
16 =========================================================================*/
17
18 #include "wxMaracasSuperposition.h"
19 #include "creaWx.h"
20
21 wxMaracasSuperposition* wxMaracasSuperposition::instance=NULL;
22
23 wxMaracasSuperposition::wxMaracasSuperposition( wxWindow* parent, std::vector<vtkImageData*> imgs);
24 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize)
25 {       
26         m_mgr.SetManagedWindow(this);
27         
28         _superposition1 = NULL;
29         _superposition2 = NULL;
30         _superposition3 = NULL; 
31         
32         _images = img;
33         
34         // set up default notebook style
35         m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER | wxAUI_NB_CLOSE_ON_ACTIVE_TAB;
36         m_notebook_theme = 0;
37         _notebook = this->createNotebook();
38         
39         createPanels();
40         configurePanels();
41 }
42
43 wxMaracasSuperposition::~wxMaracasSuperposition()
44 {
45         
46 }
47
48 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance ( wxWindow* parent, std::vector<vtkImageData*> imgs)
49 {
50                 if(instance == NULL)
51                 {
52                         instance = new wxMaracasSuperposition(parent, imgs);
53                 }
54                 return instance;
55 }
56         
57 wxMaracasSuperposition* wxMaracasSuperposition :: getInstance()
58 {
59         
60 }
61
62 //------------------------------------------------------------------------------------------------------------
63 // Creational and initialization methods using WxAui
64 //------------------------------------------------------------------------------------------------------------
65 //
66 wxAuiNotebook * IRMMainFrame :: createNotebook()
67
68 {
69         wxSize client_size = GetClientSize();
70         wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
71         wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
72
73         return noteBook;
74 }
75
76 void wxMaracasSuperposition :: configurePanels()
77 {
78         if( _superposition1!=NULL )
79         {
80                 notebook->AddPage( _superposition1, wxT("       Superoposition 1       ") );            
81                 m_mgr.Update();
82         }
83
84         if( _superposition2!=NULL )
85         {
86                 notebook->AddPage( _superposition2, wxT("       Superoposition 2       ") );
87                 m_mgr.Update();
88         }
89         
90         if( _superposition3!=NULL )
91         {
92                 notebook->AddPage( _superposition3, wxT(("       Superoposition 3       ") );
93                 m_mgr.Update();
94         }
95         
96
97         m_mgr.AddPane(_notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
98         m_mgr.Update();
99  
100         SetMinSize(wxSize(300,300));
101         m_mgr.Update();
102 }
103
104 void wxMaracasSuperposition :: createPanels()
105 {
106         if( _superposition1==NULL )
107         {
108                 createSuperpositionPanel(1)
109         }
110         
111         else if( _superposition1!=NULL )
112         {
113                 
114         }
115
116         if( _superposition2==NULL )
117         {
118                 createSuperpositionPanel(2)
119         }
120         
121         else if( _superposition2!=NULL )
122         {
123                 
124         }
125         
126         if( _superposition3==NULL )
127         {
128                 createSuperpositionPanel(3)
129         }
130         
131         else if( _superposition3!=NULL )
132         {
133                 
134         }       
135 }
136         
137 void wxMaracasSuperposition :: createSuperpositionPanel(int type)
138 {
139         
140 }
141
142 void wxMaracasSuperposition :: changeImages(std::vector<vtkImageData*> imgs)
143 {
144         _images = imgs;
145         
146         createPanels();
147         configurePanels();
148 }
149
150 std::vector<vtkImageData*> wxMaracasSuperposition :: getImages( )
151 {
152                 return _images;
153 }