]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfMainPanel.cxx
no message
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMainPanel.cxx
index 1597c26c53b792ccd2911433fc98801b3f4d206a..6a308294bee53d3d935666895bc01374bb701323 100644 (file)
@@ -18,21 +18,23 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
 : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
 {
 
-       PANEL = "New Contour";
-       PANEL1 = "I/O";
-       PANEL2 = "Edit";
-       PANEL3 = "Delete";
-       PANEL4 = "Tools";  
-       PANEL5 = "Segmentation";
-       segmentPanel = NULL;
-       segmentPanelITK = NULL;
-       configPanel = NULL;
-       spreadPanel = NULL;
-       infoWin = NULL;
-       informationPanel = NULL;
-       mirrorPanel = NULL;
-       thresholdPanel = NULL;
-       currentWindow = NULL;
+       PANEL                           = "New Contour";
+       PANEL1                          = "I/O";
+       PANEL2                          = "Edit";
+       PANEL3                          = "Delete";
+       PANEL4                          = "Tools";  
+       PANEL5                          = "Segmentation";
+       segmentPanel            = NULL;
+       segmentPanelITK         = NULL;
+       configPanel                     = NULL;
+       spreadPanel                     = NULL;
+       infoWin                         = NULL;
+       infoPanel                       = NULL;
+       infoPanelMask           = NULL;
+       informationPanel        = NULL;
+       mirrorPanel                     = NULL;
+       thresholdPanel          = NULL;
+       currentWindow           = NULL;
        
        splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
 
@@ -489,25 +491,20 @@ void interfMainPanel::onInterpolation(bool interpolate)
        wxContourMainFrame::getInstance()->onInterpolation(interpolate);
 }
 
-void interfMainPanel::onConfigurationPressed(){
 
+void interfMainPanel::onConfigurationPressed(){
        if(configPanel == NULL){
                configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);    
                configPanel->SetSizer(flexsizer, true);
                configPanel->SetAutoLayout( true );     
                //configPanel->SetEventHandler(this->contourevent);
-               
                wxPanel* panel = new interfConfigurationPanel(configPanel);
-
                wxStaticText* stattext = new wxStaticText(configPanel, -1, wxString(_T("   Interface Configuration   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
-
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
-
                flexsizer->Add(panel, wxEXPAND);
                configPanel->Layout();
-
        }
        showPanel(configPanel);
 }
@@ -556,6 +553,8 @@ void interfMainPanel::setStringSpread(std::string stringtemp){
 }
 
 void interfMainPanel::onInformationPressed(){
+       
+       // Statistics frame
        if(infoWin ==NULL){
                infoWin                                         = new wxFrame (this, -1,_T("  Statistics  "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER  );
                infoWin->SetSize( wxSize(825,650) );
@@ -569,9 +568,7 @@ void interfMainPanel::onInformationPressed(){
                infoWin->SetSizer( sizerPanel );
                infoWin->SetAutoLayout( true );
                infoWin->Layout();
-
                infoWin->Show();
-
        }else {
 
                if (infoWin->IsShown()==true)
@@ -582,6 +579,26 @@ void interfMainPanel::onInformationPressed(){
                        infoWin->Show(true);
                }
        }       
+       
+       // mask view control panel
+       if(infoPanelMask == NULL){
+               infoPanelMask = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
+               wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);    
+               infoPanelMask->SetSizer(flexsizer, true);
+               infoPanelMask->SetAutoLayout( true );   
+               //configPanel->SetEventHandler(this->contourevent);
+               wxPanel *panel = wxContourMainFrame::getInstance()->getThresholdImageViewPanel( infoPanelMask );                                
+               wxStaticText* stattext = new wxStaticText(infoPanelMask, -1, wxString(_T("   Mask segmentation    ")), wxDefaultPosition,
+                                                                                                 wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+               
+               flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+               
+               flexsizer->Add(panel, wxEXPAND);
+               infoPanelMask->Layout();
+               
+       }
+       showPanel(infoPanelMask);
+       wxContourMainFrame::getInstance()->changeInstant();
 }
 
 void interfMainPanel::getInstantVector(std::vector<int>& tempVector){
@@ -761,4 +778,7 @@ void interfMainPanel::ShowResultImages(int typeContourGroup, int selection, int
        wxContourMainFrame::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
 }
 
-
+void interfMainPanel::SetContourGroup(int contourGroup)
+{
+       wxContourMainFrame::getInstance()->SetContourGroup( contourGroup);
+}