X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FwxContourGUIExample%2FwxContourGUIExample.cxx;h=fd48714364c1e224174cb93a028761999186f9c6;hb=6383d69864c69a97539b59d3e39406c79408577b;hp=8fb4a1002810a2d846f516b2f3297bc841255e2d;hpb=383158b7df6b1d0a4c95177979219eb30472dbde;p=creaContours.git diff --git a/appli/wxContourGUIExample/wxContourGUIExample.cxx b/appli/wxContourGUIExample/wxContourGUIExample.cxx index 8fb4a10..fd48714 100644 --- a/appli/wxContourGUIExample/wxContourGUIExample.cxx +++ b/appli/wxContourGUIExample/wxContourGUIExample.cxx @@ -1,14 +1,16 @@ //---------------------------------------------------------------------------------------------------------------- // Class definition include //---------------------------------------------------------------------------------------------------------------- - + #include "wxContourGUIExample.h" #include "wxContourMainFrame.h" //#include "OutlineModelManager.h" //#include "wxContourEventHandler.h" //#include -#include +//#include +#include + #include #include @@ -64,31 +66,7 @@ wxContourMainFrame* wxTheApplication::frame = 0; -#if defined(_WIN32) -#define CREACONTOUR_VALID_FILE_SEPARATOR_CHAR '\\' -#else -#define CREACONTOUR_VALID_FILE_SEPARATOR_CHAR '/' -#endif -//========================================================================= -std::string GetExecutablePath() -{ - char name[PATH_MAX]; - //EED int err = get_app_path(name, PATH_MAX); - int err = crea::System::GetAppPath(name,PATH_MAX); - if (err) - { - printf("Could not determine current executable path ? "); - } - // remove the exe name - char *slash; - slash = strrchr(name, CREACONTOUR_VALID_FILE_SEPARATOR_CHAR); - if (slash) - { - *slash = 0; - } - return name; -} //========================================================================= //========================================================================= @@ -114,29 +92,34 @@ bool wxTheApplication :: OnInit() { wxInitAllImageHandlers(); - int min_image_type = GIMMICK_2D_IMAGE_SELECTION; - int max_image_type = GIMMICK_3D_IMAGE_SELECTION; - int output_dim = NATIVE; - int threads = 1; +//EED01Juin2010 int min_image_type = GIMMICK_2D_IMAGE_SELECTION; +//EED01Juin2010 int max_image_type = GIMMICK_3D_IMAGE_SELECTION; +//EED01Juin2010 int output_dim = NATIVE; +//EED01Juin2010 int threads = 1; - std::vector images; - creaImageIO::WxGimmickReaderDialog w(0, - -1, - "creaContours_Descriptor.dscp", - "creatisContours DB", - _T("WxGimmickDialog test"), - wxDefaultPosition,wxSize(1200,800) - ,min_image_type, - max_image_type, - output_dim, - threads); + +//EED 1Juin2010 + creaImageIO::WxSimpleDlg w(0,_T("Select your image"),"creaContours_Descriptor.dscp","creatisContours DB"); + w.ShowModal(); - w.ShowModal(); + std::vector images; +//EED 1Juin2010 +// creaImageIO::WxGimmickReaderDialog w(0, +// -1, +// "creaContours_Descriptor.dscp", +// "creatisContours DB", +// _T("WxGimmickDialog test"), +// wxDefaultPosition,wxSize(1200,800) +// ,min_image_type, +// max_image_type, +// output_dim, +// threads); +// w.ShowModal(); //JCP //std::string datadir( crea::wx2std(GetExecutablePath()) ); - std::string datadir( GetExecutablePath() ); + std::string datadir( crea::System::GetExecutablePath() ); //JCP #ifdef LINUX /* assume this is OSX */ @@ -148,21 +131,47 @@ bool wxTheApplication :: OnInit() #endif // MACOSX - if(w.GetReturnCode() == wxID_OK) - { + if(w.GetReturnCode() == wxID_OK) + { std::vector s; - w.GetSelectedFiles(s); - std::vector::iterator i; - for (i=s.begin();i!=s.end();++i) - { - std::cout << *i << std::endl; - } - std::cout << "$$$$ "<::iterator i; +// for (i=s.begin();i!=s.end();++i) +// { +// std::cout << *i << std::endl; +// } +// std::cout << "$$$$ "< out; +// std::vector attr; +//// attr.push_back("D0028_0010"); +//// attr.push_back("D0008_0023"); +//// attr.push_back("D0008_1070"); +// w.getSelected(out, attr,true,""); +//// std::cout<SetFileName( filename.c_str() );