1 #include "interfMainPanel.h"
4 #include "interfNewContourMenu.h"
5 #include "interfIOMenu.h"
6 #include "interfEditMenu.h"
7 #include "interfDeleteMenu.h"
8 #include "interfToolsMenu.h"
9 #include "interfToolsSpreadPanel.h"
10 #include "interfMenuBar.h"
11 #include "interfSegmentationMenu.h"
14 interfMainPanel* interfMainPanel::interfmainpanel=NULL;
16 interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
17 : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
20 PANEL = "New Contour";
25 PANEL5 = "Segmentation";
27 segmentPanelITK = NULL;
31 informationPanel=NULL;
34 splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
35 splitterwindow->SetMinimumPaneSize( 10 );
40 wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
42 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
43 toolpanel->SetSizer(flexsizer, true);
44 toolpanel->SetAutoLayout( true );
46 wxButton* b = getButton(toolpanel);
47 b->SetClientData(&PANEL);
48 wxButton* b1 = getButton(toolpanel);
49 b1->SetClientData(&PANEL1);
50 wxButton* b2 = getButton(toolpanel);
51 b2->SetClientData(&PANEL2);
52 wxButton* b3 = getButton(toolpanel);
53 b3->SetClientData(&PANEL3);
54 wxButton* b4 = getButton(toolpanel);
55 b4->SetClientData(&PANEL4);
56 wxButton* b5 = getButton(toolpanel);
57 b5->SetClientData(&PANEL5);
59 wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
60 wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
61 wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
62 wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
63 wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
64 wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
66 menubar = new interfNewContourMenu(mentex, sizex, sizey, evtHandler, datadir);
67 menubar1 = new interfIOMenu(mentex1, sizex, sizey, evtHandler, datadir);
68 menubar2 = new interfEditMenu(mentex2, sizex, sizey, evtHandler, datadir);
69 menubar3 = new interfDeleteMenu(mentex3, sizex, sizey, evtHandler, datadir);
70 menubar4 = new interfToolsMenu(mentex4, sizex,sizey, evtHandler, datadir);
71 menubar5 = new interfSegmentationMenu(mentex5, sizex,sizey, evtHandler, datadir);
73 statictext = getText(mentex, PANEL);
74 statictext1 = getText(mentex1, PANEL1);
75 statictext2 = getText(mentex2, PANEL2);
76 statictext3 = getText(mentex3, PANEL3);
77 statictext4 = getText(mentex4, PANEL4);
78 statictext5 = getText(mentex5, PANEL5);
80 flexsizer->Add(b, wxFIXED_MINSIZE);
81 flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE);
83 flexsizer->Add(b1, wxFIXED_MINSIZE);
84 flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
86 flexsizer->Add(b2, wxFIXED_MINSIZE);
87 flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
89 flexsizer->Add(b3, wxFIXED_MINSIZE);
90 flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
92 flexsizer->Add(b4, wxFIXED_MINSIZE);
93 flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
95 flexsizer->Add(b5, wxFIXED_MINSIZE);
96 flexsizer->Add(setMenuTextSizer(mentex5, menubar5,statictext5), wxFIXED_MINSIZE);
101 infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
102 wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2);
103 infoPanel->SetSizer(infosizer, true);
104 infoPanel->SetAutoLayout( true );
106 splitterwindow->Initialize(toolpanel);
107 splitterwindow->SplitHorizontally(toolpanel, infoPanel);
109 Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
110 Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
111 Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
112 Connect(b3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
113 Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
114 Connect(b5->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
118 currentWindow = NULL;
120 PANEL = "New Contour";
127 wxPanel* toolpanel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
129 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,2,2);
130 toolpanel->SetSizer(flexsizer, true);
131 toolpanel->SetAutoLayout( true );
133 wxButton* b = getButton(toolpanel);
134 b->SetClientData(&PANEL);
135 wxButton* b1 = getButton(toolpanel);
136 b1->SetClientData(&PANEL1);
137 wxButton* b2 = getButton(toolpanel);
138 b2->SetClientData(&PANEL2);
139 wxButton* b3 = getButton(toolpanel);
140 b3->SetClientData(&PANEL3);
141 wxButton* b4 = getButton(toolpanel);
142 b4->SetClientData(&PANEL4);
145 wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
146 wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
147 wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
148 wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
149 wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(""));
151 menubar = new interfNewContourMenu(mentex, sizex, sizey, evtHandler);
152 menubar1 = new interfIOMenu(mentex1, sizex, sizey, evtHandler);
153 menubar2 = new interfEditMenu(mentex2, sizex, sizey, evtHandler);
154 menubar3 = new interfDeleteMenu(mentex3, sizex, sizey, evtHandler);
155 menubar4 = new interfToolsMenu(mentex4, sizex,sizey, evtHandler);
157 // this->initializeToolsPanel(mentex4, sizex, sizey, evtHandler);
159 statictext = getText(mentex, PANEL);
160 statictext1 = getText(mentex1, PANEL1);
161 statictext2 = getText(mentex2, PANEL2);
162 statictext3 = getText(mentex3, PANEL3);
163 statictext4 = getText(mentex4, PANEL4);
167 flexsizer->Add(b, wxFIXED_MINSIZE);
168 flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE);
170 flexsizer->Add(b1, wxFIXED_MINSIZE);
171 flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
173 flexsizer->Add(b2, wxFIXED_MINSIZE);
174 flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
176 flexsizer->Add(b3, wxFIXED_MINSIZE);
177 flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
179 flexsizer->Add(b4, wxFIXED_MINSIZE);
180 flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
184 infoPanel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(""));
185 wxFlexGridSizer* infosizer = new wxFlexGridSizer(5,2,2,2);
186 infoPanel->SetSizer(infosizer, true);
187 infoPanel->SetAutoLayout( true );
191 wxFlexGridSizer* mainsizer = new wxFlexGridSizer(1);
192 this->SetSizer(mainsizer, true);
193 this->SetAutoLayout( true );
196 mainsizer->Add(toolpanel,wxEXPAND);
197 mainsizer->Add(new wxSplitterWindow(this,-1, wxDefaultPosition, wxDefaultSize, wxSP_3DBORDER, wxString("")), wxEXPAND);
198 mainsizer->Add(infoPanel, wxEXPAND);
201 Connect(b->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
202 Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
203 Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
204 Connect(b3->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
205 Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
211 interfMainPanel::~interfMainPanel(void)
215 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler){
217 wxFrame* newframe = new wxFrame(parent, -1, wxT("New Interface"), wxPoint(1,1), wxSize(380,750),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
220 if(interfmainpanel == NULL){
221 interfmainpanel = new interfMainPanel(newframe, 380, 750, evtHandler, datadir);
224 newframe->Show(TRUE);
225 return interfmainpanel;
228 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler){
230 wxFrame* newframe = new wxFrame(parent, -1, wxT("New Interface"), wxPoint(1,1), wxSize(380,750),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
232 if(interfmainpanel == NULL){
233 interfmainpanel = new interfMainPanel(newframe, 380, 750, evtHandler);
236 newframe->Show(TRUE);
237 return interfmainpanel;
240 interfMainPanel* interfMainPanel::getInstance(){
242 return interfmainpanel;
246 wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler){
249 wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString(_T("Spread")));
251 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2) ;
252 panel->SetSizer(flexsizer, true);
253 panel->SetAutoLayout( true );
255 interfToolsMenu* menu = new interfToolsMenu(panel, sizex, sizey, evtHandler);
256 toolspread = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
258 flexsizer->Add(menu, wxFIXED_MINSIZE);
259 flexsizer->Add(toolspread, wxFIXED_MINSIZE);
269 ** Adds a new checkbox to the scrolledwindow using the checkboxsizer
270 ** @Params id of contour
273 void interfMainPanel::addContourCheckBox(std::string id){
274 toolspread->addContourCheckBox(id);
278 ** Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer)
279 ** @Params id of contour
282 void interfMainPanel::removeContourCheckBox(std::string id){
283 toolspread->removeContourCheckBox(id);
286 void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event ){
287 //((interfToolsMenu*)menubar4)->hideAxis();
288 wxButton* b = (wxButton*)event.GetEventObject();
291 std::string dstring = *((std::string*) b->GetClientData());
295 if(dstring.compare(PANEL)==0){
298 }else if(dstring.compare(PANEL1)==0 ){
301 }else if(dstring.compare(PANEL2)==0){
304 }else if(dstring.compare(PANEL3)==0){
307 }else if(dstring.compare(PANEL4)==0){
310 }else if(dstring.compare(PANEL5)==0){
315 if(wxStrcmp(b->GetLabel(),_T("+"))==0 ){
318 b->SetLabel(_T("-"));
322 b->SetLabel(_T("+"));
325 sizechange *= dmenu->GetSize().GetHeight();
326 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+sizechange);
332 wxStaticText* interfMainPanel::getText(wxWindow* parent, std::string nom){
333 return new wxStaticText(parent, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition,
334 wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
337 wxButton* interfMainPanel::getButton(wxWindow* parent){
338 wxButton* b = new wxButton(parent, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT,
339 wxDefaultValidator, wxString(_T("-")));
343 wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text){
345 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2);
346 parent->SetSizer(flexsizer, true);
347 parent->SetAutoLayout( true );
349 flexsizer->Add(text, wxFLEX_GROWMODE_ALL);
350 flexsizer->Add(panel, wxFLEX_GROWMODE_ALL);
353 return (wxPanel*)parent;
358 ** Shows the panel in the
360 void interfMainPanel::showPanel(wxWindow* panel){
361 wxContourMainFrame::getInstance()->showAxis(false);
362 wxSizer* sizer = infoPanel->GetSizer();
364 if(currentWindow != NULL){
365 currentWindow->Hide();
366 sizer->Remove(currentWindow);
369 currentWindow = panel;
370 currentWindow->Show(true);
372 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
373 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
376 infoPanel->Refresh();
382 ** Hide the panel in the
384 void interfMainPanel::hidePanel( ){
385 wxContourMainFrame::getInstance()->showAxis(false);
386 wxSizer* sizer = infoPanel->GetSizer();
388 if(currentWindow != NULL){
389 currentWindow->Hide();
390 sizer->Remove(currentWindow);
392 wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
393 sizer->Add(emptyPanel);
394 currentWindow = emptyPanel;
395 currentWindow->Show(true);
397 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
398 splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
401 infoPanel->Refresh();
407 ** Gets the Information panel
409 wxPanel* interfMainPanel::getInfoPanel(){
413 void interfMainPanel::onCreateContourSpline( ){
414 wxContourMainFrame::getInstance()->showAxis(false);
415 wxContourMainFrame::getInstance()->onCreateContourSpline();
417 void interfMainPanel::onCreateContourRectangle( ){
418 wxContourMainFrame::getInstance()->showAxis(false);
419 wxContourMainFrame::getInstance()->onCreateContourRectangle();
421 void interfMainPanel::onCreateContourCircle( ){
422 wxContourMainFrame::getInstance()->showAxis(false);
423 wxContourMainFrame::getInstance()->onCreateContourCircle();
425 void interfMainPanel::onCreateContourLine( ){
426 wxContourMainFrame::getInstance()->showAxis(false);
427 wxContourMainFrame::getInstance()->onCreateContourLine();
429 void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull){
430 wxContourMainFrame::getInstance()->showAxis(false);
431 wxContourMainFrame::getInstance()->onCreateContourBullEye(panBull);
433 void interfMainPanel::onDeleteContour(){
434 wxContourMainFrame::getInstance()->showAxis(false);
435 wxContourMainFrame::getInstance()->onDeleteContour();
437 void interfMainPanel::onDeleteContoursActSlice(){
438 wxContourMainFrame::getInstance()->showAxis(false);
439 wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
441 void interfMainPanel::onDeleteAllContours(){
442 wxContourMainFrame::getInstance()->showAxis(false);
443 wxContourMainFrame::getInstance()->onDeleteAllContours();
446 void interfMainPanel::onCopy(){
447 wxContourMainFrame::getInstance()->onCopy();
449 void interfMainPanel::onPaste(){
450 wxContourMainFrame::getInstance()->onPaste();
452 void interfMainPanel::onUndo(){
453 wxContourMainFrame::getInstance()->onUndo();
455 void interfMainPanel::onRedo(){
456 wxContourMainFrame::getInstance()->onRedo();
458 void interfMainPanel::onLoad(){
459 wxContourMainFrame::getInstance()->onLoad();
461 void interfMainPanel::onSave(){
462 wxContourMainFrame::getInstance()-> onSave();
464 void interfMainPanel::RefreshInterface(){
465 wxContourMainFrame::getInstance()->RefreshInterface();
468 vtkImageData* interfMainPanel::getImageData(){
469 return wxContourMainFrame::getInstance()->getImageData();
472 void interfMainPanel::onSegmentationOneSlice(int isovalue,int sampling,int method)
474 wxContourMainFrame::getInstance()->onSegmentationOneSlice(isovalue, sampling, method);
477 void interfMainPanel::onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation){
478 wxContourMainFrame::getInstance()->onSegmentationOneSliceITK(distance, sigma, alfa, beta, propagation, iterations, inflation);
481 int interfMainPanel::GetImageDataSizeZ(){
482 return wxContourMainFrame::getInstance()->GetImageDataSizeZ();
485 void interfMainPanel::GetImageDataRange(double *range){
486 wxContourMainFrame::getInstance()->GetImageDataRange(range);
489 void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method){
490 wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
493 void interfMainPanel::onMirror()
495 wxContourMainFrame::getInstance()->onMirror();
498 void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString){
499 ((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
501 void interfMainPanel::onSegmentationPressed(){
502 if(segmentPanel == NULL){
503 segmentPanel = new wxPanel(getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
504 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
505 segmentPanel->SetSizer(flexsizer, true);
506 segmentPanel->SetAutoLayout( true );
507 segmentPanel->SetEventHandler(this);
509 //wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel);
510 segmentationPanel = new interfSegmentationPanelVTK(segmentPanel);
513 wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(_T(" Automatic Segmentation ")), wxDefaultPosition,
514 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
516 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
517 flexsizer->Add(segmentationPanel, wxEXPAND);
518 segmentPanel->Layout();
520 showPanel(segmentPanel);
521 wxContourMainFrame::getInstance()->showAxis(true);
525 void interfMainPanel::onSegmentationPressedITK(){
526 if(segmentPanelITK == NULL){
527 segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
530 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
531 segmentPanelITK->SetSizer(flexsizer, true);
532 segmentPanelITK->SetAutoLayout( true );
533 //segmentPanelITK->SetEventHandler(this->contourevent);
535 //wxPanel* panel = contourevent->getSegmentationPanelITK(segmentPanelITK);
536 wxPanel* panel = new interfSegmentationPanelITK(segmentPanelITK);
539 wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T(" Automatic ITK Segmentation ")), wxDefaultPosition,
540 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
542 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
543 flexsizer->Add(panel, wxEXPAND);
544 segmentPanelITK->Layout();
546 showPanel(segmentPanelITK);
547 wxContourMainFrame::getInstance()->showAxis(true);
551 void interfMainPanel::onRigidPressed(){
552 wxContourMainFrame::getInstance()->onRigidPressed();
555 void interfMainPanel::onWidthOfContour(double width){
556 wxContourMainFrame::getInstance()->onWidthOfContour(width);
559 int interfMainPanel::getColorWindow(){
560 return wxContourMainFrame::getInstance()->getColorWindow();
562 int interfMainPanel::getWindowLevel(){
563 return wxContourMainFrame::getInstance()->getWindowLevel();
565 void interfMainPanel::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
566 wxContourMainFrame::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
569 void interfMainPanel::onInterpolation(bool interpolate){
570 wxContourMainFrame::getInstance()->onInterpolation(interpolate);
573 void interfMainPanel::onConfigurationPressed(){
575 if(configPanel == NULL){
576 configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
577 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
578 configPanel->SetSizer(flexsizer, true);
579 configPanel->SetAutoLayout( true );
580 //configPanel->SetEventHandler(this->contourevent);
582 wxPanel* panel = new interfConfigurationPanel(configPanel);
584 wxStaticText* stattext = new wxStaticText(configPanel, -1, wxString(_T(" Interface Configuration ")), wxDefaultPosition,
585 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
587 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
589 flexsizer->Add(panel, wxEXPAND);
590 configPanel->Layout();
593 showPanel(configPanel);
596 void interfMainPanel::onSpreadPressed(){
597 if(spreadPanel==NULL){
599 spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
600 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
601 spreadPanel->SetSizer(flexsizer, true);
602 spreadPanel->SetAutoLayout( true );
603 //spreadPanel->SetEventHandler(this->contourevent);
605 //wxPanel* panel = contourevent->getSpreadPanel(spreadPanel);
606 panelSpread = new interfSpreadPanel(spreadPanel);
609 wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(_T(" Automatic Spread ")), wxDefaultPosition,
610 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
612 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
613 flexsizer->Add(panelSpread, wxEXPAND);
614 spreadPanel->Layout();
616 showPanel(spreadPanel);
620 void interfMainPanel::resetAppend(){
621 wxContourMainFrame::getInstance()->resetAppend();
624 void interfMainPanel::onSpreadAdd(){
625 wxContourMainFrame::getInstance()->onSpreadAdd();
628 void interfMainPanel::appendStringSpread(std::string val){
629 panelSpread->appendStringSpread(val);
632 void interfMainPanel::onSpreadGo(int type){
633 wxContourMainFrame::getInstance()->onSpreadGo(type);
635 void interfMainPanel::setStringSpread(std::string stringtemp){
636 panelSpread->setStringSpread(stringtemp);
639 void interfMainPanel::onInformationPressed(){
641 infoWin = new wxFrame (this, -1,_T(" Spread "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER );
642 infoWin->SetSize( wxSize(500,450) );
644 wxSize sizepanel(200,300);
645 informationPanel = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
647 wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
648 sizerPanel -> Add( informationPanel , 1, wxEXPAND ,0);
650 infoWin->SetSizer( sizerPanel );
651 infoWin->SetAutoLayout( true );
658 if (infoWin->IsShown()==true)
660 infoWin->Show(false);
662 //contourevent->FillGridWithContoursInformation();
668 void interfMainPanel::getInstantVector(std::vector<int>& tempVector){
669 wxContourMainFrame::getInstance()->getInstantVector(tempVector);
672 std::vector<std::string> interfMainPanel::getOutlinesName(int slide){
673 return wxContourMainFrame::getInstance()->getOutlinesName(slide);
676 void interfMainPanel::onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ){
677 wxContourMainFrame::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ);
680 void interfMainPanel::setStringInfoPanel(wxString tmpString){
681 ((interfInformationPanel*)informationPanel)->setStringInfoPanel(tmpString);
684 void interfMainPanel::setRowLabelInfoPanel(int z, wxString tempString){
685 ((interfInformationPanel*)informationPanel)->setRowLabelInfoPanel(z, tempString);
688 int interfMainPanel::getNumberColsInformationPanel(){
689 return ((interfInformationPanel*)informationPanel)->getNumberCols();
692 void interfMainPanel::appendColsInformationPanel(int _numberOfVariablesStatistics){
693 ((interfInformationPanel*)informationPanel)->appendCols(_numberOfVariablesStatistics);
696 void interfMainPanel::setCellValueInfoPanel(int z,int tmpIntA,wxString tempString){
697 ((interfInformationPanel*)informationPanel)->setCellValue(z, tmpIntA, tempString);
700 void interfMainPanel::setColLableInfoPanel(int tmpIntB,wxString tmpTitleString){
701 ((interfInformationPanel*)informationPanel)->setColLabel(tmpIntB, tmpTitleString);
705 void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup){
706 wxContourMainFrame::getInstance()->onSaveResults(directory, namefile,filename, typeContourGroup);
709 wxString interfMainPanel::getCellValue(int j,int i){
710 return ((interfInformationPanel*)informationPanel)->getCellValue(j, i );
713 void interfMainPanel::onSnakePressed(){
714 wxContourMainFrame::getInstance()->onSnakePressed();
717 void interfMainPanel::onMirrorPressed(){
718 if(mirrorPanel==NULL){
720 mirrorPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
721 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
722 mirrorPanel->SetSizer(flexsizer, true);
723 mirrorPanel->SetAutoLayout( true );
724 panelMirror = new interfMirrorPanel(mirrorPanel);
726 wxStaticText* stattext = new wxStaticText(mirrorPanel, -1, wxString(_T(" Mirroring Tool ")), wxDefaultPosition,
727 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
729 flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
730 flexsizer->Add(panelMirror, wxEXPAND);
731 mirrorPanel->Layout();
735 showPanel(mirrorPanel);
736 wxContourMainFrame::getInstance()->referenceLine();
743 wxContourMainFrame::getInstance()->refLineHide();
749 else if (!refLineShown)
751 wxContourMainFrame::getInstance()->refLineShow();
754 showPanel(mirrorPanel);