X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FInterface_ManagerContour_NDimensions%2FwxContourMainFrame.cxx;h=8c8beb05edb61a3fae3d56edcde0459c526bc5da;hb=6aefbb5961fe348605e42445066f6c7933af32f6;hp=e86dc1b19c70df15bb30634ebcb340ab44402ede;hpb=eadfc36256b2a77d2c3073d9249ce3020c2f554b;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index e86dc1b..8c8beb0 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -153,7 +153,8 @@ void wxContourMainFrame::setVectImages(std::vector imgs) } - wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector images, long style,std::string datadir ){ + wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector 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,6 +990,23 @@ 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); + } + + } } //AD: 29-05-09 @@ -3085,4 +3107,4 @@ void wxContourMainFrame::SetFileLocation(std::string newFileLocation) _fileLocation = newFileLocation; std::cout<<"GETFILELOCATION:"<<_fileLocation<