From: jean-pierre roux Date: Thu, 21 Jan 2010 15:07:46 +0000 (+0000) Subject: Fix wxString vs std::string X-Git-Tag: CREATOOLS.2-0-3~74 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f40ea0e58a37e5419541915fdf7a24107513d9f3;p=creaMaracasVisu.git Fix wxString vs std::string --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx index f80bc74..88ebdd3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/OpenImageDialog.cxx @@ -1,55 +1,49 @@ #include "OpenImageDialog.h" +#include "creaWx.h" typedef vtkImageData* (*GETIMAGEDATADIALOG)(); namespace creaMaracasVisuKernel{ OpenImageDialog::OpenImageDialog() { - - img = NULL; bool gimmicknotfound = true; - + #ifdef WIN32 - HINSTANCE gimmickhandle; - gimmickhandle = LoadLibrary(TEXT("creaImageIO2.dll")); + HINSTANCE gimmickhandle; + gimmickhandle = LoadLibrary(TEXT("creaImageIO2.dll")); std::cout<<"imagehandle "<ShowModal()==wxID_OK) { - std::string path= FD->GetPath(); + std::string path= crea::wx2std(FD->GetPath()); - vtkMetaImageReader *reader = vtkMetaImageReader::New(); - reader->SetFileName(path.c_str()); - img = reader->GetOutput(); - } - } - - - + vtkMetaImageReader *reader = vtkMetaImageReader::New(); + reader->SetFileName(path.c_str()); + img = reader->GetOutput(); + } + } } //------------------------------------------------------------------- @@ -61,4 +55,3 @@ namespace creaMaracasVisuKernel{ return img; } } - diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp index 0c2037d..b654f09 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp @@ -7,7 +7,7 @@ manualViewContour::manualViewContour() { _id_viewPoint_for_text = 0; - _mesureScale = 1; + _mesureScale = 1; _initialConoturModel = new manualContourModel(); } // ---------------------------------------------------------------------------- @@ -55,12 +55,9 @@ void manualViewContour::Open(FILE *pFile) { } - - // ---------------------------------------------------------------------------- void manualViewContour::RefreshContour() // virtual { - int i,np,nps; //JSTG 25-02-08 -------------------- @@ -88,8 +85,7 @@ void manualViewContour::RefreshContour() // virtual //-------------------------------------------------------------- // EED 27 sep 2006 // _pts->SetPoint(i, x,y,z ); - _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] ); - + _pts->SetPoint(i, x*_spc[0], y*_spc[1], z*_spc[2] ); }// for } @@ -108,7 +104,7 @@ void manualViewContour::RefreshText() // virtual int size = GetNumberOfPoints(); char text[50]; char resultText[50]; - strcpy(resultText," "); + strcpy(resultText, " "); //CMRU 19-08-09 ---------------------------------- std::string label; @@ -118,7 +114,7 @@ void manualViewContour::RefreshText() // virtual if (size==2) { strcpy(resultText,"L= "); - gcvt ( _mesureScale * this->_manContModel->GetPathSize() , 5, text ); + gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); strcat(resultText,text); //CMRU 19-08-09 ---------------------------------- @@ -131,15 +127,15 @@ void manualViewContour::RefreshText() // virtual if (_manContModel->IfCloseContour()==true) { strcpy(resultText,"P= "); - gcvt ( _mesureScale * this->_manContModel->GetPathSize() , 5, text ); + gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); strcat(resultText,text); - gcvt ( _mesureScale * _mesureScale * this->_manContModel->GetPathArea() , 5, text ); + gcvt ( _mesureScale * _mesureScale * this->_manContModel->GetPathArea(), 5, text ); strcat(resultText," A= "); strcat(resultText,text); strcat(resultText," "); } else { strcpy(resultText,"L= "); - gcvt ( _mesureScale * this->_manContModel->GetPathSize() , 5, text ); + gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); strcat(resultText,text); } //CMRU 19-08-09 ---------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp index bf11360..fd6463b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderTabbedPanel.cpp @@ -16,6 +16,7 @@ #include "Color.xpm" //#include "creaSystem.h" +#include "creaWx.h" BEGIN_EVENT_TABLE( wxMaracasRenderTabbedPanel, wxPanel ) EVT_MENU( 12121, wxMaracasRenderTabbedPanel::OnRefreshView ) @@ -26,13 +27,13 @@ ** Class constructor **/ wxMaracasRenderTabbedPanel::wxMaracasRenderTabbedPanel(wxWindow* parent, int id, wxVtk3DBaseView* _baseView) -: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize) + : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize) { _id = id; baseView = _baseView; dialog = NULL; - volmanager = new wxMaracasMultipleVolumeRendererManager(); + volmanager = new wxMaracasMultipleVolumeRendererManager(); surrendmanager1 = new wxMaracasSurfaceRenderingManager(); surrendmanager2 = new wxMaracasSurfaceRenderingManager(); surrendmanager3 = new wxMaracasSurfaceRenderingManager(); @@ -48,12 +49,12 @@ wxMaracasRenderTabbedPanel::~wxMaracasRenderTabbedPanel() //wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSB(_propid, false); //wxMaracasRenderTabbedPanel::getInstance()->addRemoveActorSC(_propid, false); addRemoveActorMPR(false); - if( vtkmpr3Ddataviewer ) { delete vtkmpr3Ddataviewer; } - if( mwxvtkmpr3Dview ) { delete mwxvtkmpr3Dview; } + if( vtkmpr3Ddataviewer ) { delete vtkmpr3Ddataviewer; } + if( mwxvtkmpr3Dview ) { delete mwxvtkmpr3Dview; } this->deleteVolume(_id); delete dialog; - delete wxtabs; + delete wxtabs; } /** @@ -110,12 +111,12 @@ void wxMaracasRenderTabbedPanel::createControls(vtkImageData* inImg, std::string //vtkImageData* img3 = surrendmanager3->getImageData(pathfile); if(img!=NULL /*&& img1!=NULL && img2!=NULL && img3!=NULL*/) { - addVolume(img, filename); + addVolume(img, filename); addSurface1(img, filename); addSurface2(img, filename); addSurface3(img, filename); addMPROptions(); - volname = (wxString) filename; + volname = crea::std2wx(filename); wxtabs->Refresh(); } } @@ -897,4 +898,4 @@ vtkImageData* wxMaracasRenderTabbedPanel::getSurfCImage() int wxMaracasRenderTabbedPanel::getPropIdV() { return _id; -} \ No newline at end of file +}