]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.cxx
index e86dc1b19c70df15bb30634ebcb340ab44402ede..83863e8d5827ec67a3b2d0741b7ef81d9a1c1e3e 100644 (file)
@@ -153,7 +153,8 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
 }
 
 
-       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 ){
+       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 )
+       {
                if(instance == NULL){
                        instance = new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
                }
@@ -912,11 +913,8 @@ void wxContourMainFrame ::loadContours( FILE *pFile, bool staticContour )
 }
 
 void wxContourMainFrame::onLoad()
-{
-       char tmp[255];
-       char tmpD[255];
+{      
        std::string fileNameContourROI = GetFileLocation();
-
 //CMRU 03-09-09-----------------------------------------------------------------------------------------------
        if(GetFileLocation().empty())
        {
@@ -928,6 +926,13 @@ void wxContourMainFrame::onLoad()
                }
        }
 
+       onLoadContours(fileNameContourROI);
+}
+
+void wxContourMainFrame::onLoadContours(std::string fileNameContourROI){
+       char tmp[255];
+       char tmpD[255];
+
        FILE *pFile =fopen(fileNameContourROI.c_str(),"r+");
 
 
@@ -985,8 +990,36 @@ void wxContourMainFrame::onLoad()
        }
        _theViewPanel->getSceneManager()->removeSceneContours();
        changeInstant();
+
 }
 
+void wxContourMainFrame::onImport(){
+       std::string filename, filenamecontours;
+       wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxOPEN );
+
+       if (dialog.ShowModal() == wxID_OK)
+       {
+               filename = dialog.GetPath().mb_str();           
+               filenamecontours = kernelManager->parseOsirixFile(filename);
+
+               if(filenamecontours.compare("") != 0){
+                       onLoadContours(filenamecontours);
+               }
+
+       }
+}
+void wxContourMainFrame::onTest(){
+       std::string filename, filenamecontours;
+       wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxOPEN );
+
+       if (dialog.ShowModal() == wxID_OK)
+       {
+               filename = dialog.GetPath().mb_str();           
+               std::cout << "This is the filename: " << filename << std::endl;
+       }
+}
+
+
 //AD: 29-05-09
 void wxContourMainFrame::onSave(){
 //CMRU 03-09-09-----------------------------------------------------------------------------------------------
@@ -3085,4 +3118,4 @@ void wxContourMainFrame::SetFileLocation(std::string newFileLocation)
        _fileLocation = newFileLocation;
        std::cout<<"GETFILELOCATION:"<<_fileLocation<<std::endl;
 }
-//------------------------------------------------------------------------------------------------------------
\ No newline at end of file
+//------------------------------------------------------------------------------------------------------------