From 994ec3301ff97e273e8d8588bdda50023d0f6402 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Tue, 18 May 2010 13:03:28 +0000 Subject: [PATCH] std::string vs wxString --- src/creaImageIOOutputModel.cpp | 25 ++++++++----------------- src/creaImageIOOutputModel.h | 25 +++++++++++++------------ src/creaImageIOWxOutputDlg.cpp | 6 +++--- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/src/creaImageIOOutputModel.cpp b/src/creaImageIOOutputModel.cpp index e072ea2..5db5fd7 100644 --- a/src/creaImageIOOutputModel.cpp +++ b/src/creaImageIOOutputModel.cpp @@ -6,6 +6,7 @@ #if defined(USE_GDCM) #include #include +#include #endif #if defined(USE_GDCM2) @@ -14,7 +15,6 @@ #include #endif - #if defined(USE_XERCES) #include #include @@ -27,12 +27,11 @@ using namespace xercesc; namespace creaImageIO { - OutputModel::~OutputModel() { } - #if defined(USE_GDCM) +#if defined(USE_GDCM) double OutputModel::orderFilesWithZspacing(std::vector &im) { double spacing=1; @@ -55,8 +54,7 @@ namespace creaImageIO lstAux.push_back(*it); } } // for - - + if ((fileVector.size()>1) && (sh->IsCoherent( &fileVector ))) { sh->OrderFileList(&fileVector); @@ -78,7 +76,7 @@ namespace creaImageIO return spacing; } - #endif +#endif #if defined(USE_GDCM2) // TO DO @@ -88,8 +86,6 @@ namespace creaImageIO } #endif - - #if defined(USE_XERCES) OutputModel::OutputModel(OutputModelParser *i_outparser) : m_outparser(i_outparser) @@ -116,7 +112,6 @@ namespace creaImageIO } return bres; - } OutputModel::~OutputModel() @@ -240,8 +235,7 @@ namespace creaImageIO o_val[(*it)] = ""; } } - } - + } } //const gdcm::VR::VRType OutputModel::getType(const std::string i_tag) @@ -257,7 +251,6 @@ namespace creaImageIO #endif - #if defined(USE_GDCM) double OutputModel::orderFiles(std::vector im, std::vector &out) { @@ -304,7 +297,7 @@ namespace creaImageIO #endif - void OutputModel::sort(const std::vector i_filenames, std::vector &o_sort, int level) + void OutputModel::sort(const std::vector i_filenames, std::vector &o_sort, int level) { #if defined(USE_XERCES) int tags[3]; @@ -318,7 +311,7 @@ namespace creaImageIO if( checkModel(model, OUTPUTMODEL_TAG(3)) && !b_db) { #if defined (USE_GDCM2) - + //OutputSort< getType(model[OUTPUTMODEL_TAG(3)] > osort; getValues(i_filenames, model[OUTPUTMODEL_TAG(3)], values); @@ -395,8 +388,6 @@ namespace creaImageIO } #endif } - #endif - -} \ No newline at end of file +} diff --git a/src/creaImageIOOutputModel.h b/src/creaImageIOOutputModel.h index ada72a3..8b5b824 100644 --- a/src/creaImageIOOutputModel.h +++ b/src/creaImageIOOutputModel.h @@ -7,6 +7,8 @@ #include #endif +#include +#include #define OUTPUTMODEL_TAG_i "" #define OUTPUTMODEL_TAG_0 "TAG_BEGIN" @@ -16,11 +18,9 @@ #define OUTPUTMODEL_TAG_4 "ANCHOR" #define OUTPUTMODEL_TAG(i) OUTPUTMODEL_TAG_ ## i - - - namespace creaImageIO { + class OutputModel { public: @@ -30,15 +30,11 @@ namespace creaImageIO #if defined(USE_XERCES) OutputModel(OutputModelParser *i_outparser); - - - // Test if we need to check the "dicom" tag if it exists on database void setDB(const std::string i_db, const std::string i_table); const std::string getTag(); - private: @@ -106,7 +102,9 @@ namespace creaImageIO bool checkModel(std::map i_model, const std::string i_val); #endif }; - template + +/* + template class OutputSort { public : @@ -120,10 +118,11 @@ namespace creaImageIO void sort (const std::map i_values, std::vector &o_sort) { - for(T index = tags[OUTPUTMODEL_TAG(0)]; index <= tags[OUTPUTMODEL_TAG(1)]; index += tags[OUTPUTMODEL_TAG(2)]) + std::map::const_iterator it_val; + for(T index = tags[OUTPUTMODEL_TAG(0)]; index <= tags[OUTPUTMODEL_TAG(1)]; index += tags[OUTPUTMODEL_TAG(2)]) { - std::map::const_iterator it_val = i_values.begin(); - for(;it_val != values.end(); it_val++) + //std::map::const_iterator it_val; + for(it_val = i_values.begin();it_val != i_values.end(); it_val++) { if(it_val->second.c_str() == index) { @@ -134,5 +133,7 @@ namespace creaImageIO } } }; +*/ + } // namespace creaImageIO -#endif //__creaImageIOoutputModel_h_INCLUDED__ \ No newline at end of file +#endif //__creaImageIOoutputModel_h_INCLUDED__ diff --git a/src/creaImageIOWxOutputDlg.cpp b/src/creaImageIOWxOutputDlg.cpp index a927191..eee5600 100644 --- a/src/creaImageIOWxOutputDlg.cpp +++ b/src/creaImageIOWxOutputDlg.cpp @@ -71,12 +71,12 @@ namespace creaImageIO int start_point = 45; - wxStaticText * ExportText=new wxStaticText(this,-1,_T(sentence), wxPoint(5,10)); + wxStaticText * ExportText=new wxStaticText(this,-1,crea::std2wx(sentence), wxPoint(5,10)); std::vector::iterator it = outsentences.begin(); for(int i = 0;it != outsentences.end(); it++, i++, start_point += 45) { - wxCheckBox *check = new wxCheckBox(this, -1, _T((*it)), wxPoint(5,start_point) ); + wxCheckBox *check = new wxCheckBox(this, -1, crea::std2wx((*it)), wxPoint(5,start_point) ); if(i == deflt) check->SetValue(true); else @@ -85,7 +85,7 @@ namespace creaImageIO checkOut.push_back(check); } - checkAsking = new wxCheckBox(this, -1, _T(("Do you want to save this output and no more asking")), wxPoint(5,start_point) ); + checkAsking = new wxCheckBox(this, -1, _T("Do you want to save this output and no more asking"), wxPoint(5,start_point) ); // VALIDATION BUTTON wxButton *Ok = new wxButton(this, -1,_T("OK"), wxPoint(5,start_point+20) ); -- 2.45.0