]> Creatis software - creaImageIO.git/commitdiff
std::string vs wxString
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 18 May 2010 13:03:28 +0000 (13:03 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 18 May 2010 13:03:28 +0000 (13:03 +0000)
src/creaImageIOOutputModel.cpp
src/creaImageIOOutputModel.h
src/creaImageIOWxOutputDlg.cpp

index e072ea271110f1304e752f5446af62d35e3ca58c..5db5fd790a08af9a2615eb9651202f1290a738c2 100644 (file)
@@ -6,6 +6,7 @@
 #if defined(USE_GDCM)
 #include <gdcmGlobal.h>
 #include <gdcmSerieHelper.h>
+#include <gdcmFile.h>
 #endif
 
 #if defined(USE_GDCM2)
@@ -14,7 +15,6 @@
 #include <gdcmGlobal.h>
 #endif
 
-
 #if defined(USE_XERCES)
 #include <xercesc/dom/DOM.hpp>
 #include <xercesc/dom/DOMDocument.hpp>
@@ -27,12 +27,11 @@ using namespace xercesc;
 namespace creaImageIO
 {
 
-
        OutputModel::~OutputModel()
        {
        }
 
-                #if defined(USE_GDCM)
+#if defined(USE_GDCM)
         double OutputModel::orderFilesWithZspacing(std::vector<std::string> &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<std::string> im, std::vector<std::string> &out)
 {
@@ -304,7 +297,7 @@ namespace creaImageIO
 #endif 
 
 
-        void OutputModel::sort(const std::vector<std::string> i_filenames, std::vector<std::string> &o_sort, int level)
+       void OutputModel::sort(const std::vector<std::string> i_filenames, std::vector<std::string> &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<std::string>(i_filenames, model[OUTPUTMODEL_TAG(3)], values);
@@ -395,8 +388,6 @@ namespace creaImageIO
                }
 #endif
        }
-
 #endif
 
-
-}
\ No newline at end of file
+}
index ada72a358d9bf49c0fceecdba9dcbdff08d308fc..8b5b8240e13733c7640e637d7835f6b43225aeab 100644 (file)
@@ -7,6 +7,8 @@
 #include <gdcmScanner.h>
 #endif
 
+#include <vector>
+#include <string>
 
 #define OUTPUTMODEL_TAG_i      ""
 #define OUTPUTMODEL_TAG_0      "TAG_BEGIN"
 #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<std::string, std::string> i_model, const std::string i_val);
 #endif
        };
-                template <class T>
+       
+/*
+        template <class T>
         class OutputSort
         {
         public :
@@ -120,10 +118,11 @@ namespace creaImageIO
 
                 void sort (const std::map<std::string, T> i_values, std::vector<std::string> &o_sort)
                 {
-                        for(T index = tags[OUTPUTMODEL_TAG(0)]; index <= tags[OUTPUTMODEL_TAG(1)]; index += tags[OUTPUTMODEL_TAG(2)])
+                       std::map<std::string, T>::const_iterator it_val; 
+                       for(T index = tags[OUTPUTMODEL_TAG(0)]; index <= tags[OUTPUTMODEL_TAG(1)]; index += tags[OUTPUTMODEL_TAG(2)])
                        {
-                               std::map<std::string, T>::const_iterator it_val = i_values.begin();
-                               for(;it_val != values.end(); it_val++)
+                               //std::map<std::string, T>::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__
index a9271911cb9e075253d261e58919b528a3c970da..eee5600914af868db09e818962694a5445756a18 100644 (file)
@@ -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<std::string>::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) );