]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
index e202f987e1758ae98719cbe999e9e45da2f43199..4cfa08134be989b9946325c498bb01b7ab4ca905 100644 (file)
@@ -72,19 +72,8 @@ char wxContourMainFrame::COPY = 'C';
                m_mgr.SetManagedWindow(this);
                _creatingContoursActive         = false;
                _theViewPanel                           = NULL;
-//             _modelManager                           = NULL;
-               _instantPanel                           = NULL;
-//             _buttonsBar                                     = NULL;
-//             _gridPanel                                      = NULL; 
-//             _drawToolsPanel                         = NULL;
-//             _operationsToolsPanel           = NULL;
-//             _autoFormsPanel                         = NULL; 
-//             _standardToolsPanel                     = NULL;
-//             _editionToolsPanel                      = NULL;
-//             _listViewPanel                          = NULL;
-//             _sceneManager                           = NULL;
-//             _actualInstant                          = NULL;
 
+               _instantPanel                           = NULL;
                _refLineControl                         = NULL;
                _refLineModel                           = NULL;
                _refLineView                            = NULL;
@@ -93,57 +82,48 @@ char wxContourMainFrame::COPY = 'C';
                m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
                m_notebook_theme = 0;   
                //wxContour_ActionCommandsID a;
-               _numberOfVariablesStatistics = 6+1;
-
+               _numberOfVariablesStatistics = 7;
 
-               _performingOperation                    = new PerformingOperation();
-//JCP 17 - 10 - 2008
+               _datadir = datadir;
 
+       
        inredo = 0;
        inundo = 0;
 
-#if defined(__GNUC__)
-               std::string str_home(getenv("HOME"));
-#elif defined(_WIN32)
-               std::string str_home(getenv("USERPROFILE"));
-#endif
-               std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
-//             std::string command("mkdir "+strCreaContourDataTmp);
-//        system( command.c_str() );
-               
-               kernelManager = new KernelManagerContour( images , datadir+"/data/" , strCreaContourDataTmp );
-       //kernelManager->setVectImages(images);
-       //kernelManager->initializeEnvironment();
-                       
-       //vtkImageData* selectedimage = kernelManager->getVectImages()[0];
-       
-//-------------------------------------------------------------
+       interfMainPanel* pannew = interfMainPanel::getInstance(parent,datadir+"/data/Icons");//, eventHandler);
+       _performingOperation                    = new PerformingOperation();
 
-       /*frame = new wxContourMainFrame(_builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(),  _builder->getContourEnv(),NULL, wxID_ANY, wxT("ROI Application Sample"), wxPoint(50,50), wxSize(800, 600)); 
-       frame->Show(TRUE);*/
 
-       //Creating the evtHandler of the panels
-       //wxContourEventHandler * eventHandler = new wxContourEventHandler();
 
-       //Creating the window that will show the panels
+       if(images.size() > 0){
+               this->setVectImages(images);
+       }
 
-       //Getting the parent for the panels ( using aui )
-       wxAuiNotebook * notebook = this->createNotebook();
+}
+
+void wxContourMainFrame::setVectImages( std::vector<vtkImageData*> images ){
+
+       #if defined(__GNUC__)
+               std::string str_home(getenv("HOME"));
+       #elif defined(_WIN32)
+                       std::string str_home(getenv("USERPROFILE"));
+       #endif
+               std::string strCreaContourDataTmp = str_home + "/.creaContourDataTemp/";
 
-       //JCP 17 - 11 - 08
-       //wxInstantChooserPanel * instantPanel                          = new wxInstantChooserPanel( notebook, "Instant Chooser", true);
-       //JCP 17 - 11 - 08
        std::vector<std::string> conceptNameVect;
        std::vector<int> conceptSizeVect;
-       
 
+       wxAuiNotebook * notebook = this->createNotebook();              
 
-       _instantPanel                           = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
-       _theViewPanel                           = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );  
 
+       kernelManager = new KernelManagerContour( images , _datadir+"/data/" , strCreaContourDataTmp );
 
 
-    kernelManager->getConceptsInformation(conceptNameVect, conceptSizeVect);
+       _instantPanel                           = new wxInstantChooserPanel( notebook, "Instant Chooser", true, false, "c" );
+       _theViewPanel                           = new wxContourViewPanel( kernelManager->getSourceImage(), notebook );  
+               
+//-------------------------------------------------------------
+       kernelManager->getConceptsInformation(conceptNameVect, conceptSizeVect);
        _instantPanel->addConcepts(conceptNameVect, conceptSizeVect);
                
 
@@ -154,22 +134,9 @@ char wxContourMainFrame::COPY = 'C';
        //*******************changeInstant();
        _theViewPanel->setVerticalConcept( "Axe Depth", data->getMinValue(), data->getMaxValue(), data->getMinShowedValue(),  data->getMaxShowedValue(), data->getActualValue() );
 
-       //eventHandler->setModelManager( kernelManager->getOutlineModelManager() );
-       //eventHandler->setViewPanel( _theViewPanel );
-       //_theViewPanel->initializeScenceManager();
-       //eventHandler->setInstantChooserPanel( _instantPanel );
-       
-       //bool successConfiuration = eventHandler->configureEventsHandling();
-
-       //successConfiuration &= this->configurePanels( notebook );
        this->configurePanels( notebook );
 
-       interfMainPanel* pannew = interfMainPanel::getInstance(parent,datadir+"/data/Icons");//, eventHandler);
-
-//JCP 17 -10 - 2008
-
-
-       }
+}
 
 
        wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir ){
@@ -1620,21 +1587,21 @@ void wxContourMainFrame::referenceLine()
        viewer2D->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _refLineControl );
        _refLineModel->SetCloseContour(false);
        _refLineControl->CreateNewManualContour();
-/*
+
        double z = _refLineControl->GetZ();
+/*
+       _refLineControl->AddPoint(50,100,z);
+       _refLineControl->AddPoint(80,40,z);
+       _refLineControl->SetCompleteCreation(true);
 
        _refLineModel->AddPoint(50,100,z);
        _refLineModel->AddPoint(80,40,z);
-
-       _refLineControl->AddPoint(50,100,z);
-       _refLineControl->AddPoint(80,40,z);
+       _refLineModel->UpdateSpline();
 
        _refLineView->UpdateViewPoint(0);
        _refLineView->UpdateViewPoint(1);
-
-       _refLineControl->SetCompleteCreation(true);
-       _refLineControl->SetEditable(true);
 */
+
        _refLineControl->SetActive(true);
        _refLineView->RefreshContour();
 }
@@ -1644,7 +1611,9 @@ void wxContourMainFrame::refLineHide()
 {
        if (_refLineControl!=NULL)
        {
-               _refLineView->RemoveCompleteContourActor();     
+               _refLineView->RemoveCompleteContourActor();
+               _refLineControl->SetEditable(false);
+               _refLineControl->SetActive(false);
        }
 }
 
@@ -1663,8 +1632,7 @@ void wxContourMainFrame::refLineShow()
                _refLineControl->SetModelView( _refLineModel , _refLineView );
                viewer2D->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _refLineControl );
                _refLineControl->CreateNewManualContour();
-               //_refLineControl->SetActive(true);
-               //_refLineControl->SetEditable(true);
+               _refLineControl->SetActive(true);
                _refLineView->RefreshContour();
        }
 }