]> Creatis software - creaImageIO.git/commitdiff
#3218 creaImageIO Feature New Normal - vtk8itk4wx3-mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 17 Aug 2018 10:41:10 +0000 (12:41 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 17 Aug 2018 10:41:10 +0000 (12:41 +0200)
17 files changed:
bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml
src/creaImageIOGimmick.cpp
src/creaImageIOGimmick.h
src/creaImageIOGimmickView.cpp
src/creaImageIOMultiThreadImageReader.cpp
src/creaImageIOMultiThreadImageReader.h
src/creaImageIOSQLiteTreeHandler.h
src/creaImageIOSynchron.h
src/creaImageIOSynchronizer.cpp
src/creaImageIOWxGimmickReaderDialog.cpp
src/creaImageIOWxGimmickView.cpp
src/creaImageIOWxGimmickView.h
src/creaImageIOWxSimpleDlg.cpp
src/creaImageIOWxTreeView.cpp
src/creaImageIOWxTreeView.h
src/creaImageIOWxViewer.cpp
src/creaImageIOWxViewer.h

index 6fd5d71c4a7fcb77b27bd3af94eecc21ce63311a..96c25ddc79224bf9618c0bddabf1fff3f63475a5 100644 (file)
 
   <process>
     <PRE>
-        creaImageIO::WxSimpleDlg dlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
-        dlg.SetAttrDicomTags( bbGetInputDicomTags() );
-       dlg.ShowModal(); 
-       bbSetOutputDicomInfo( dlg.getDicomInfoImagesSelected() );
-       if (dlg.getImagesSelected().size()!=0)
+//    creaImageIO::WxSimpleDlg dlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
+    creaImageIO::WxSimpleDlg *dlg = new creaImageIO::WxSimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
+    dlg->SetAttrDicomTags( bbGetInputDicomTags() );
+       dlg->ShowModal(); 
+       bbSetOutputDicomInfo( dlg->getDicomInfoImagesSelected() );
+       if (dlg->getImagesSelected().size()!=0)
        { 
-               bbSetOutputFileName( std::string( dlg.getInfoImage().mb_str() ) );
-               bbSetOutputOut( dlg.getVolumeSelected() );
+               bbSetOutputFileName( std::string( dlg->getInfoImage().mb_str() ) );
+               bbSetOutputOut( dlg->getVolumeSelected() );
        } else { 
                bbSetOutputOut( NULL );
-       } // if dlg.getImagesSelected().size()!=0
-        bbSetOutputOutImages( dlg.getImagesSelected());  
+       } // if dlg getImagesSelected() size() !=0
+        bbSetOutputOutImages( dlg->getImagesSelected());  
        bbSignalOutputModification(  );
+       
+       delete dlg;
+       
     </PRE>
   </process>
 
index 7ba9b2a14f71b6f658f5522bec1f4e2b2e73ad16..898de344fb7d5ad09037b359f308cb11ed1d22a4 100644 (file)
@@ -52,10 +52,10 @@ namespace creaImageIO
     : mImageAdder(0)
   {    
   RegisterGimmickMessageTypes();
-       mSettings=0;
-       mSynchronizer=0;
+       mSettings               = NULL;
+       mSynchronizer   = NULL;
        mLocalDescpName = "localdatabase_Descriptor.dscp";
-       mLocalDBName = "Local database";
+       mLocalDBName    = "Local database";
   }
   //==============================================================
 
@@ -63,13 +63,12 @@ namespace creaImageIO
   //==============================================================
   Gimmick::~Gimmick()
   {
-
-        if(mSettings!=0)
+        if(mSettings!=NULL)
          {
                mSettings->writeSettingsFile();
                delete mSettings;
          }
-       if(mSynchronizer!=0)
+       if(mSynchronizer!=NULL)
          {
                delete mSynchronizer;
          }
@@ -79,8 +78,8 @@ namespace creaImageIO
   //==============================================================
   void Gimmick::Initialize(const std::string i_namedescp, const std::string i_namedb)
   {
-         mLocalDescpName = i_namedescp;
-         mLocalDBName = i_namedb;
+         mLocalDescpName       = i_namedescp;
+         mLocalDBName          = i_namedb;
          Initialize();
   }
 
@@ -92,22 +91,17 @@ namespace creaImageIO
     CreateUserSettingsDirectory();
     // Sets the current directory to the home dir
     mCurrentDirectory =  GetHomeDirectory();
-    mSynchronizer= new Synchronizer(GetUserSettingsDirectory()+"share/creaImageIO/");
-
+    mSynchronizer= new Synchronizer( GetUserSettingsDirectory()+"share/creaImageIO/" );
     mSettings  = new Settings(mCurrentDirectory);
-       
     std::string dbpath = GetLocalDatabasePath();
-
     // Create or open local database
     std::string dpath= mCurrentDirectory + "/.creaImageIO/share/creaImageIO/" + mLocalDescpName;
-       
     boost::algorithm::replace_all( dpath,
                                   INVALID_FILE_SEPARATOR , 
                                   VALID_FILE_SEPARATOR);
     mLocalDatabase = createDB(i_nameDB, dpath, dbpath);
     // Add it to the TreeHandlerMap
     mTreeHandlerMap[i_nameDB] = mLocalDatabase;
-    
     //Add additional DB from user Settings
     addDBSettings();   
   }
index 69438787cc0de619413f23655f178471dd052396..d382f73324793d64d9a8bea3321642ab8ddf0e8f 100644 (file)
 
 
 
-
 #ifdef _DEBUG
 #include <crtdbg.h>
 #define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__)
 #else
 #define DEBUG_NEW new
 #endif
+
+
 // Only when asked
 /*
 #ifdef TRACKING_MEMORY_LEAKS
index 0a0dd0c13c18a557ff2cacf2c336472476f3e19b..9b4169f571d09d296304fee2f6833fa7e7b2ddff 100644 (file)
@@ -124,6 +124,7 @@ namespace creaImageIO
   /// Destructor
   GimmickView::~GimmickView()
   {
+         printf("EED GimmickView::~GimmickView  DESTROCTEUR \n");
     GimmickDebugMessage(1,"GimmickView::~GimmickView"
                        <<std::endl);
   }
@@ -143,6 +144,7 @@ namespace creaImageIO
   /// Finalize 
   void GimmickView::Finalize()
   {
+         printf("EED GimmickView::Finalize  \n");
   }
 
   //======================================================================
index 62eb7bdbee05a3d5fb9c5a06e6c65ad091176a64..7aa60acedeb72adf688478a6af7494b0edbf46e5 100644 (file)
@@ -45,7 +45,6 @@ namespace creaImageIO
     vtkImageData* image)
   {
     wxMutexLocker lock(mMultiThreadImageReaderUserMutex);
-
     this->OnMultiThreadImageReaderEvent(filename,type,image);
   }
   //=====================================================================
@@ -57,12 +56,9 @@ namespace creaImageIO
     ThreadedImageReader(MultiThreadImageReader* tir) :
       mMultiThreadImageReader(tir)
     {}
-
     void* Entry();
     void  OnExit();
-
     vtkImageData* Read(const std::string& filename);
-    
        struct deleter
        {
                void operator()(ThreadedImageReader* p)
@@ -72,11 +68,9 @@ namespace creaImageIO
        };
        friend struct deleter;
 
-
   private:
     ImageReader mReader;
     MultiThreadImageReader* mMultiThreadImageReader;
-       
   };
 
   //=====================================================================
@@ -94,6 +88,9 @@ namespace creaImageIO
 
          mDone = false;
     // Create the threads
+       
+printf("EED MultiThreadImageReader::MultiThreadImageReader %d \n", number_of_threads); 
+
     for (int i=0; i<number_of_threads; i++) 
       {
                  //ThreadedImageReader* t = new ThreadedImageReader(this);
@@ -119,6 +116,7 @@ namespace creaImageIO
   //=====================================================================
   bool MultiThreadImageReader::Start()
   {
+printf("EED MultiThreadImageReader::Start  Start\n");
     //    std::cout << "#### MultiThreadImageReader::Start()"
     //               <<std::endl;
          if (mNumberOfThreadedReadersRunning > 0) return true;
@@ -127,24 +125,21 @@ namespace creaImageIO
     for (i =mThreadedImageReaderList.begin();
         i!=mThreadedImageReaderList.end();
         i++)
-      {
-       (*i)->Create();
-       if ( (*i)->Run() != wxTHREAD_NO_ERROR )
-         {
-           std::cout << "ERROR starting a thread"<< std::endl;
-           return false;
-         }
-       else 
-         {
-                   std::cout << "  ===> Thread "<<(*i)->GetCurrentId()
-                             <<" successfully created"<< std::endl;
-           
-         }
-      }
-    wxMutexLocker locker(GetMultiThreadImageReaderUserMutex());
-    //    std::cout << "EO Start : #Threads running = "
-    //               << mNumberOfThreadedReadersRunning<<std::endl;
-
+    {
+               (*i)->Create();
+               if ( (*i)->Run() != wxTHREAD_NO_ERROR )
+                 {
+                       std::cout << "ERROR starting a thread"<< std::endl;
+                       return false;
+                 }     else  {
+                                       std::cout << "  ===> Thread "<<(*i)->GetCurrentId()
+                                                 <<" successfully created"<< std::endl;
+                 } // if
+               } // for
+               wxMutexLocker locker(GetMultiThreadImageReaderUserMutex());
+               //    std::cout << "EO Start : #Threads running = "
+               //                    << mNumberOfThreadedReadersRunning<<std::endl;
+printf("EED MultiThreadImageReader::Start  Start\n");
     return true;
   }
   //=====================================================================
@@ -152,23 +147,27 @@ namespace creaImageIO
   //=====================================================================
   void MultiThreadImageReader::Stop()
   { 
+printf("EED MultiThreadImageReader::Stop  Start\n");
 //                 std::cout << "#### MultiThreadImageReader::Stop()"
 //           <<std::endl;
   //  std::cout << "Sending stop order to the threads..."<<std::endl;
+  
          if (mDone) return;
 
     ThreadedImageReaderListType::iterator i;
     for (i =mThreadedImageReaderList.begin();
         i!=mThreadedImageReaderList.end();
         i++)
-      { std::cout << "  ===> Thread "<<(*i)->GetCurrentId()
+    { 
+               std::cout << "  ===> Thread "<<(*i)->GetCurrentId()
                              <<" successfully stopped"<< std::endl;
                  if((*i)->IsAlive())
-                 {(*i)->Pause();
+                 {
+                         (*i)->Pause();
                          (*i).reset();
-                        //                       (*i)->Delete();
-                 }
-      }
+//                       (*i)->Delete();
+                 } // if i
+    } // for
    mThreadedImageReaderList.clear();
     // Wait a little to be sure that all threads have stopped
     // A better way to do this ?
@@ -196,26 +195,26 @@ namespace creaImageIO
 //        std::cout << "All threads stopped : OK "<<std::endl;
 
     ImageMapType::iterator j;
-    for (j =mImages.begin();
-        j!=mImages.end();
-        ++j)
-
-      {
-       delete j->first;
-      }
+    for (j =mImages.begin(); j!=mImages.end(); ++j)
+       {
+               delete j->first;
+    } //for 
     mImages.clear();
        mDone = true;
+printf("EED MultiThreadImageReader::Stop  End\n");
   }
   //=====================================================================
 
   //=====================================================================
   MultiThreadImageReader::~MultiThreadImageReader()
   {
+printf("EED MultiThreadImageReader::~MultiThreadImageReader  Start\n");
     //    std::cout << "#### MultiThreadImageReader::~MultiThreadImageReader()"
     //       <<std::endl;
     Stop();
     if (mReader) delete mReader;
        mThreadedImageReaderList.clear();
+printf("EED MultiThreadImageReader::~MultiThreadImageReader  End\n");
   }
   //=====================================================================
 
index a49b57fddd665c199a11991d00aedb440afe9cef..f2b5f83c706c1ea53bfb005f20270ac8008527c2 100644 (file)
@@ -151,16 +151,18 @@ namespace creaImageIO
          mPriority(prio), 
          mIndex(-1), 
          mUnloadIndex(-1), 
-         mImage(0)
+         mImage(NULL)
       {}
+         
       ~ImageToLoad()
       {
-       if (mImage>0
-         {
-           //      std::cout << "Refs = "<<mImage->GetReferenceCount()<<std::endl;
-           mImage->Delete();
-         }
+               if (mImage != NULL
+               {
+                       //          std::cout << "Refs = "<<mImage->GetReferenceCount()<<std::endl;
+                       mImage->Delete();
+               } // if
       }
+         
       MultiThreadImageReaderUser* GetUser() const { return mUser; }
       void SetUser( MultiThreadImageReaderUser* u ) { mUser = u; }
       const std::string& GetFilename() const { return mFilename; }
index 023e7d11fc8ac99732f3525be758029115d00a7f..c4f1ea7d0043f7ba4b5771db7eb250a10c907160 100644 (file)
@@ -48,7 +48,7 @@ namespace creaImageIO
   public:
     //====================================================================
     /// Ctor with database file name 
-    SQLiteTreeHandler(const std::string& filename);
+    SQLiteTreeHandler( const std::string& filename);
     /// Dtor
     virtual ~SQLiteTreeHandler();
     //====================================================================
index ba10cb8ddd20ccd1a46bd99a9e0b4b2d391ed1f7..da3b3d2318cab6ffb291a49c413df2136b6b771c 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace creaImageIO
 {
-       using namespace std;
+//     using namespace std;
    //================================================================================================================
        ///Represents the list of currently added files
     class AddList
@@ -90,7 +90,7 @@ namespace creaImageIO
     {
       public:
                  ///Ctor
-              Synchronizer(const std::string& path);
+              Synchronizer( const std::string& path);
                          ///Dtor
               virtual ~Synchronizer();
                          ///Initializes the database
index 4404114381feb9faeebc655156f5e2afd6ae8529..7ab34c304800719189c857ae51f22f3fe4502a1a 100644 (file)
@@ -34,12 +34,12 @@ namespace fs = boost::filesystem;
 
 namespace creaImageIO
 {
+  YYYYYY 
 
   //==============================================================
        Synchronizer::Synchronizer(TreeHandler * th)
     : mHandler(th)
   {    
-   
   }
   //==============================================================
  
index 8c11f0319a84b8ee12eb9e3f694ab343d8e39521..3af978666b7d69615c5faf91c29cf2711c71a95a 100644 (file)
@@ -59,7 +59,7 @@ namespace creaImageIO
                  wxCAPTION  
               ),
  //   mGimmick(0),
-     mView(0)
+     mView(NULL)
   {
     GimmickDebugMessage(1,"WxGimmickReaderDialog::WxGimmickReaderDialog"
                        <<std::endl);
@@ -81,11 +81,11 @@ namespace creaImageIO
        mView->Initialize();
           // Connect the AddProgress callback
       mView->ConnectValidationObserver( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) );
-    }
-    catch (crea::Exception e)
-    {
-      e.Print();
-      return;
+    } catch (crea::Exception e) {
+               printf("EED WxGimmickReaderDialog::WxGimmickReaderDialog catch 1\n");
+        e.Print();
+               printf("EED WxGimmickReaderDialog::WxGimmickReaderDialog catch 2\n");
+        return;
     }
     mtopsizer->Add( mView,1,wxGROW,0);
     wxSizer* bsizer = this->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
index 0e2fa1e537a7005d5695f4f288d2a26f58d1f866..ea691e387973e3500f5b076de29fcca3ec39f79b 100644 (file)
@@ -131,22 +131,19 @@ namespace creaImageIO
                               const wxPoint& pos, 
                               const wxSize& size,
                               int min_dim,
-                               int max_dim,
+                   int max_dim,
                               int number_of_threads)
     : wxPanel(parent,id,pos,size),
       GimmickView(gimmick, number_of_threads),
-      mProgressDialog(0),
+      mProgressDialog(NULL),
       mConstructed(false)
   {
-    GimmickDebugMessage(1,"WxGimmickView::WxGimmickView"
-                       <<std::endl);
+    GimmickDebugMessage(1,"WxGimmickView::WxGimmickView" <<std::endl);
     // Sets the current directory to the home dir
     mCurrentDirectory =  std2wx(gimmick->GetHomeDirectory());
 
-
      // Connect the AddProgress callback
-    gimmick->ConnectAddProgressObserver 
-     ( boost::bind( &WxGimmickView::OnAddProgress , this, _1 ) );
+    gimmick->ConnectAddProgressObserver( boost::bind( &WxGimmickView::OnAddProgress , this, _1 ) );
 
     // Create the list of icons (mIcon)
     CreateIconList();
@@ -163,8 +160,7 @@ namespace creaImageIO
     mSplitter = new wxSplitterWindow( this , -1);
 
     // Notebook
-    mNotebook = new wxNotebook(mSplitter,
-                              -1, wxDefaultPosition, wxDefaultSize, 0);
+    mNotebook = new wxNotebook(mSplitter, -1, wxDefaultPosition, wxDefaultSize, 0);
 
     //Gimmick
     mGimmick=gimmick;
@@ -195,9 +191,7 @@ namespace creaImageIO
 
     mText = new wxStaticText(mBottomPanel, wxID_ANY, wxT("Welcome to Gimmick!"));
     mbottom_sizer->Add(mText,0,wxGROW,0);
-
-         
-         
+       
     mBottomPanel->SetSizer(mbottom_sizer);
 
     // Splitting
@@ -208,12 +202,11 @@ namespace creaImageIO
     int bottom_minsize         = 50;
 
     mSplitter->SetMinimumPaneSize( bottom_minsize );
-    mSplitter->SplitHorizontally( mNotebook, mBottomPanel, 
-                                 top_minsize);
+    mSplitter->SplitHorizontally( mNotebook, mBottomPanel, top_minsize);
 
     msizer->Add( mSplitter, 1, wxGROW, 0);
 
-    mProgressDialog=0;
+    mProgressDialog=NULL;
     SetSizer( msizer );     
     SetAutoLayout(true);
     Layout();
@@ -233,8 +226,7 @@ namespace creaImageIO
   {
        // stop the viewer before application exit.
     mViewer->StopPlayer();
-    GimmickDebugMessage(1,"WxGimmickView::~WxGimmickView"
-                       <<std::endl);
+    GimmickDebugMessage(1,"WxGimmickView::~WxGimmickView" <<std::endl);
        delete mIcon;
        delete mViewer;
     //if(mListener->IsAlive())   {        mListener->Delete();    }
@@ -313,8 +305,7 @@ namespace creaImageIO
   void WxGimmickView::CreateTreeView( TreeHandler* h)
   {
     std::string name(h->GetTree().GetAttribute("Name"));
-    GimmickMessage(2,"Creating the tree view for '"<<
-                  name<<"'"<<std::endl);
+    GimmickMessage(2,"Creating the tree view for '"<<  name<<"'"<<std::endl);
     // Create the WxTreeView
     WxTreeView* view = new WxTreeView(h, this, mNotebook, -1);
 
@@ -703,7 +694,7 @@ namespace creaImageIO
          
          
 //EED1 2018-08  
-//EED1 ReadImageThreaded(sel);
+//     ReadImageThreaded(sel);
 
    }
 
@@ -713,9 +704,7 @@ namespace creaImageIO
   ///Reads Images (Threaded)
   void WxGimmickView::ReadImageThreaded(const std::vector<tree::Node*>& sel)
   {    
-   GimmickDebugMessage(5,
-                      "ReadImageThreaded"
-                      <<std::endl);
+   GimmickDebugMessage(5,  "ReadImageThreaded"   <<std::endl);
    int maxprio = GetMaximalPriority();
    int prio = maxprio + 2000;
 
@@ -1254,7 +1243,7 @@ printf("EED WxGimmickView::ClearSelection End\n");
     wxString s(wxString::From8BitData(mess));
     //  std::cout << "Pulse"<<std::endl;
 
-       if(mProgressDialog != 0)
+       if(mProgressDialog != NULL)
        {
                if (!mProgressDialog->Pulse(s)) 
                  {
@@ -1350,7 +1339,7 @@ printf("EED WxGimmickView::ClearSelection End\n");
   {
                mProgressDialog->Resume();
                mProgressDialog->Destroy();
-               mProgressDialog = 0;
+               mProgressDialog = NULL;
   }
 
    //=================================================
index 62e113695fe3a7ab8d80b6e51e0af9fb072b9a24..9e2f359523cfacfad98a36c355cba65a734afb76 100644 (file)
@@ -150,35 +150,35 @@ namespace creaImageIO
     
     
   private:
-         wxBoxSizer *mbottom_sizer;
-         wxBoxSizer    *msizer;
+       wxBoxSizer                      *mbottom_sizer;
+       wxBoxSizer                      *msizer;
     /// Is set to true at the end of constructor 
     /// (in order to lock callbacks from threaded objects or event 
     /// before everything is ok)
-    bool mConstructed;
+    bool                               mConstructed;
     /// The ToolBar and the tools
-    wxToolBar*         mToolBar;
-    wxToolBarToolBasemToolAddFile;
-    wxToolBarToolBasemToolAddDir;
-    wxToolBarToolBasemToolRemove;
-    wxToolBarToolBasemToolAddDatabase;
-    wxToolBarToolBasemToolHelp;
-       wxToolBarToolBasemToolSynchronize;
-       wxToolBarToolBasemToolSettings;
-       wxToolBarToolBasemToolTools;
+    wxToolBar                  *mToolBar;
+    wxToolBarToolBase  *mToolAddFile;
+    wxToolBarToolBase  *mToolAddDir;
+    wxToolBarToolBase  *mToolRemove;
+    wxToolBarToolBase  *mToolAddDatabase;
+    wxToolBarToolBase  *mToolHelp;
+       wxToolBarToolBase       *mToolSynchronize;
+       wxToolBarToolBase       *mToolSettings;
+       wxToolBarToolBase       *mToolTools;
     
-    wxSplitterWindowmSplitter;
-    wxPanel*          mBottomPanel;
-    wxStaticText *    mText;
-    wxNotebook*       mNotebook;
+    wxSplitterWindow   *mSplitter;
+    wxPanel                            *mBottomPanel;
+    wxStaticText               *mText;
+    wxNotebook                 *mNotebook;
     
     /// The list of icons 
-    wxImageList *    mIcon;
+    wxImageList                *mIcon;
     void CreateIconList();
     
     boost::shared_ptr<Gimmick> mGimmick;
                
-       ListenermListener;
+       Listener                        *mListener;
 
     /// Callback for adding files
     void OnAddFiles(wxCommandEvent& event);
@@ -247,7 +247,7 @@ namespace creaImageIO
        void ExportToStorage(const std::vector<std::string> i_filenames);
  
     /// Progress dialog
-    wxProgressDialogmProgressDialog;
+    wxProgressDialog   *mProgressDialog;
 
     ///The selection's maximum dimension
     int mSelectionMaxDimension;
@@ -256,10 +256,10 @@ namespace creaImageIO
     int mSelectionMinDimension;
 
     ///Image previewer
-    WxViewermViewer;
+    WxViewer                   *mViewer;
 
     ///Currently Displayed Node
-    tree::NodemCurImageItemToShow;
+    tree::Node                 *mCurImageItemToShow;
 
     //Pointer holders for images to be shown
        std::vector< boost::shared_ptr<ImagePointerHolder> > pointers;
index d5566aab01260f2d0bd3763148897d946e0420d2..9ae6791c48192056357ea80f928e56a41d7ecb0c 100644 (file)
@@ -146,14 +146,15 @@ namespace creaImageIO
                    GIMMICK_2D_IMAGE_SELECTION,
                    GIMMICK_3D_IMAGE_SELECTION,
                    _3D,
-                                  1);
+                                  0);
                 dlg.ShowModal();
                 if (dlg.GetReturnCode() == wxID_OK)
             {
-//EED1 2018-08
-//EED1                         dlg.stopReading();
+                       dlg.stopReading();
                        std::vector<creaImageIO::OutStrGimmick> outStrGimmick;
+printf("EED WxSimpleDlg::OnReadGimmick 1 \n");
                        dlg.getSelected(outStrGimmick, m_attrDicomTags,true,"");
+printf("EED WxSimpleDlg::OnReadGimmick 2 \n");
                        m_results.clear();
                        int size=(int)outStrGimmick.size();
                        int ii;
index 3a1c04e603fc9f3d747c392f15cbe28b35601633..6d43dda4a73d6f6ce6ec5abdd4dfc00b728ab54f 100644 (file)
@@ -51,6 +51,7 @@ int wxCALLBACK CompareFunctionStrings(long item1, long item2, long sortData)
 
   const std::string& s1(*(data1->attr));
   const std::string& s2(*(data2->attr));
+  
   if(sortData==1)
     {
       // inverse the order
@@ -125,104 +126,91 @@ namespace creaImageIO
     : wxPanel(parent,id),
       TreeView(handler, gimmick)
   {
-    GimmickDebugMessage(1,"WxTreeView::WxTreeView"
-                       <<std::endl);
+    GimmickDebugMessage(1,"WxTreeView::WxTreeView"<<std::endl);
 
-    
     // Split part below toolbar into notebook for views and panel
     // for preview, messages...
     // TO DO : Splitter
     //    mSplitter = new wxSplitterWindow( this , -1);
 
     // Global sizer
-    msizer = new wxBoxSizer(wxHORIZONTAL);
-    
-    int ctrl_style = wxLC_REPORT | wxLC_VRULES;
-    int col_style = wxLIST_FORMAT_LEFT;
-
+    msizer                     = new wxBoxSizer(wxHORIZONTAL);    
+    int ctrl_style     = wxLC_REPORT | wxLC_VRULES;
+    int col_style      = wxLIST_FORMAT_LEFT;
     // Creating the ListCtrl for the levels > 0 (not for Root level)
-    for (int i = 0;
-        i < handler->GetTree().GetNumberOfLevels() -1;
-        ++i)
-      {
-       GimmickDebugMessage(5,"Creating view for level "<<i
-                           <<std::endl);
-       LevelType level;
-       level.SelectedUpToDate = true;
-       level.SortColumn = 0;
-
-       // If the first level : parent = this
-       wxWindow* sparent = this;
-       // else parent = last splitter
-       if (i>0) 
-               sparent = mLevelList[i-1].wxSplitter;
-
-       level.wxSplitter = new wxSplitterWindow( sparent , -1);
-       if(i!=0)
-       {
-       level.wxSplitter->Show(false);
-       }
-       //          level.wxSplitter->SetMinimumPaneSize(100);
-       
-       wxListCtrl* ctrl = new wxListCtrl(level.wxSplitter,
-                                         i,
-                                         wxDefaultPosition, 
-                                         wxDefaultSize,
-                                         ctrl_style);
-       level.wxCtrl = ctrl;
-       level.wxSplitter->Initialize(ctrl);
-   
-       // Create the columns : one for each attribute of the level
-       int col = 0;
-       std::string title;
-
-       tree::LevelDescriptor::AttributeDescriptorListType::const_iterator a;
-       for (a  = handler->GetTree().GetAttributeDescriptorList(i+1).begin();
-            a != handler->GetTree().GetAttributeDescriptorList(i+1).end();
-            ++a)
-
-{
-       
-           GimmickDebugMessage(5,"Creating column "<<col<<" : "
-                               <<a->GetName()
-                               <<std::endl);
-           
-           if(a->GetFlags()!=creaImageIO::tree::AttributeDescriptor::PRIVATE)
-             {
-               
-               if(a->GetName()=="UNKNOWN")
-                 {
-                   title = "#";
-                   title += handler->GetTree().GetLevelDescriptor(i+1).GetName();
-                   if (title[title.size()-1]!='s')
-                     title += "s";
-                   
-                 }
-               else
-                 {
-                   title=a->GetName();
-                 }
-                 std::string temp = a->GetKey();
-                 if (temp.compare("ID") != 0)
-                 {
+    for (int i = 0;i < handler->GetTree().GetNumberOfLevels() -1; ++i)
+    {
+               GimmickDebugMessage(5,"Creating view for level "<<i <<std::endl);
+               LevelType level;
+               level.SelectedUpToDate  = true;
+               level.SortColumn                = 0;
+
+               // If the first level : parent = this
+               wxWindow* sparent               = this;
+               // else parent = last splitter
+               if (i>0) 
+               {
+                       sparent = mLevelList[i-1].wxSplitter;
+               } // if
+               level.wxSplitter = new wxSplitterWindow( sparent , -1);
+               if(i!=0)
+               {
+                       level.wxSplitter->Show(false);
+               } // if
+               //          level.wxSplitter->SetMinimumPaneSize(100);
                
-               ctrl->InsertColumn(col, 
-                                  crea::std2wx(title),
-                                  col_style);
-               col++;
-                 }
-               level.key.push_back(a->GetKey());
-             }
+               wxListCtrl* ctrl = new wxListCtrl(level.wxSplitter,
                
-         }
-         
-       mLevelList.push_back(level);
-      }
+// EED1 2018-08-16
+//                                               i,
+                                                 wxID_ANY,
+                                                  
+                                                 wxDefaultPosition, 
+                                                 wxDefaultSize,
+                                                 ctrl_style);
+               level.wxCtrl = ctrl;
+               level.wxSplitter->Initialize(ctrl);
+          
+               // Create the columns : one for each attribute of the level
+               int col = 0;
+               std::string title;
+
+               tree::LevelDescriptor::AttributeDescriptorListType::const_iterator a;
+               for (a  = handler->GetTree().GetAttributeDescriptorList(i+1).begin();
+                        a != handler->GetTree().GetAttributeDescriptorList(i+1).end();
+                        ++a)
+               {
+                       GimmickDebugMessage(5,"Creating column "<<col<<" : " <<a->GetName() <<std::endl);       
+                       if(a->GetFlags()!=creaImageIO::tree::AttributeDescriptor::PRIVATE)
+                       {
+                               if(a->GetName()=="UNKNOWN")
+                               {
+                                       title = "#";
+                                       title += handler->GetTree().GetLevelDescriptor(i+1).GetName();
+                                       if (title[title.size()-1]!='s')
+                                       {               
+                                               title += "s";
+                                       } // if
+                               } else {
+                                       title=a->GetName();
+                               } // if a
+                               std::string temp = a->GetKey();
+                               if (temp.compare("ID") != 0)
+                               {               
+                                       ctrl->InsertColumn(col,crea::std2wx(title),col_style);
+                                       col++;
+                               } // if temp
+                                       level.key.push_back(a->GetKey());
+                       } // if
+                       
+               } // for a  
+               mLevelList.push_back(level);
+      } //  for i
     
 #if wxUSE_MENUS
 
         // Column Menu
-    menu =new wxMenu;
+    menu =new wxMenu();
        wxMenuItem* m1=menu->Append(wxID_ANY, _T("&Sort ascending"));
        wxMenuItem* m2=menu->Append(wxID_ANY, _T("&Sort descending"));
        wxMenuItem* m3=menu->Append(wxID_ANY, _T("&Filter"));
@@ -235,20 +223,18 @@ namespace creaImageIO
 
 
        ////SubMenuItem EXPORT
-       subExportMenu = new wxMenu;
+       subExportMenu = new wxMenu();
        wxMenuItem *subExp1 = subExportMenu->Append(wxID_ANY, _T("&Export to Storage"));
        Connect( subExp1->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnExportToStorage) );
 
        //ItemMenu
-       menuItem =new wxMenu;
-
+       menuItem =new wxMenu();
 
        wxMenuItem* m2Item=menuItem->Append(wxID_ANY, _T("&Local Copy"));
        wxMenuItem* m3Item=menuItem->Append(wxID_ANY, _T("&Edit Fields"));
        wxMenuItem* m4Item=menuItem->Append(wxID_ANY, _T("&Display Dicom Tags"));
        menuItem->AppendSubMenu(subExportMenu, wxT("&Export"));
 
-
        wxMenuItem* m1Item=menuItem->Append(wxID_ANY, _T("&Anonymize"));
        mAnonymizingID=m1Item->GetId();
        Connect( mAnonymizingID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnAnonymizer) );
@@ -257,21 +243,18 @@ namespace creaImageIO
        mEditFieldID=m3Item->GetId();
        mDumpID=m4Item->GetId();
        
-       
        Connect( mLocalCopyID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnLocalCopy) );
        Connect( mEditFieldID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnEditField) );
        Connect( mDumpID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnDumpTags) );
        
-
-       
 #endif // wxUSE_MENUS
        /// Initialize the first level splitter
          
        msizer->Add( mLevelList[0].wxSplitter ,1, wxGROW  ,0);
-       //      mColumnSelected=1;
-       mLastSelected=0;
-       mLastLevel=0;
-       //      mDirection=true;
+       //      mColumnSelected = 1;
+       mLastSelected           = 0;
+       mLastLevel                      = 0;
+       //      mDirection              = true;
 
        mIgnoreSelectedChanged = false;
 
@@ -281,7 +264,6 @@ namespace creaImageIO
     SetSizer( msizer );     
     SetAutoLayout(true);
     Layout();
-
   }
   //=====================================================================
 
@@ -289,61 +271,47 @@ namespace creaImageIO
   /// Destructor
   WxTreeView::~WxTreeView()
   {
-    GimmickDebugMessage(1,"WxTreeView::~WxTreeView"
-                       <<std::endl);
+    GimmickDebugMessage(1,"WxTreeView::~WxTreeView"<<std::endl);
        delete menu;
        delete menuItem;
-
   }
   //=====================================================================
   
-  
-  
   //=====================================================================
   const std::vector<tree::Node*>& WxTreeView::GetSelected(int level)
   {
-printf("EED WxTreeView::GetSelected Start\n");   
-         
          std::vector<tree::Node*>& sel = mLevelList[0].Selected;
     //  if (GetSelectedUpToDate(level)) 
     int l = level - 1;
     // the selection of upper level
-printf("EED WxTreeView::GetSelected 1\n");       
        if(mLevelList.size() == level -1)
        {
                sel = mLevelList.back().Selected;
        } else {
                sel=  mLevelList[l].Selected;
        }
-printf("EED WxTreeView::GetSelected 2\n");       
        if (sel.size() > 0)
        {
                sel.clear();
        }
-printf("EED WxTreeView::GetSelected 3\n");       
        if (level == 1) 
     {
-printf("EED WxTreeView::GetSelected 4\n");       
-               sel.push_back(GetTreeHandler()->GetTree().GetTree());
-    } else if (level < mLevelList.size()+2 )  
-       {
-printf("EED WxTreeView::GetSelected 5\n");       
+               sel.push_back( GetTreeHandler()->GetTree().GetTree() );
+    } else if (level < mLevelList.size()+2 ) {
                long item = -1;
                for ( ;; )
                {
-printf("EED WxTreeView::GetSelected 5.1\n");     
-                       item = GetCtrl(l-1)->GetNextItem(item,
+               item = GetCtrl(l-1)->GetNextItem(item,
                                                                                 wxLIST_NEXT_ALL,
                                                                                 wxLIST_STATE_SELECTED);
-printf("EED WxTreeView::GetSelected 5.2\n");     
                        if ( item == -1 )
                        {
-printf("EED WxTreeView::GetSelected 5.3\n");     
                                break;
                        }
-                       long adr = (long)GetCtrl(l-1)->GetItemData(item);
-printf("EED WxTreeView::GetSelected 5.4\n");     
-                       tree::Node* n = ((ItemData*)adr)->node;
+//                     long adr = (long)GetCtrl(l-1)->GetItemData(item);
+                       ItemData* adr = (ItemData*)GetCtrl(l-1)->GetItemData(item);
+//                     tree::Node* n = ((ItemData*)adr)->node;
+                       tree::Node* n = adr->node;
                        /* FCY 18-04-2011: don't understand the real purpose of these lines,
                         if uncomment add last frame in first place 
                                if(mLastSelected==item)
@@ -354,7 +322,6 @@ printf("EED WxTreeView::GetSelected 5.4\n");
                        }
                        else
                        {*/     
-printf("EED WxTreeView::GetSelected 6\n");       
                                sel.push_back(n);
                        //}                     
                        
@@ -385,7 +352,6 @@ printf("EED WxTreeView::GetSelected 6\n");
        }   
         
     //    return mLevelList[level-1].Selected;
-printf("EED WxTreeView::GetSelected End\n");     
     return sel;
   }
 
@@ -404,7 +370,6 @@ printf("EED WxTreeView::GetSelected End\n");
        // if no selection, no remove action.
     if(sel.size() != 0)
        {
-       
            std::stringstream out;
            std::string levelName=GetTreeHandler()->GetTree().GetLevelDescriptor(mLastLevel).GetName();
            out<<"Delete ";
@@ -474,7 +439,6 @@ printf("EED WxTreeView::GetSelected End\n");
   /// Updates a level of the view (adds or removes children, etc.)
   void WxTreeView::UpdateLevel( int level )
   {
-printf("EED WxTreeView::UpdateLevel Start\n "); 
        GimmickDebugMessage(1,
                        GetTreeHandler()->GetTree().GetLabel()
                        <<"WxTreeView::UpdateLevel(level "
@@ -483,26 +447,19 @@ printf("EED WxTreeView::UpdateLevel Start\n ");
                        <<std::endl);
     
     wxBusyCursor busy;
-printf("EED WxTreeView::UpdateLevel 1\n "); 
     RecursiveUpdateLevel(level);
-printf("EED WxTreeView::UpdateLevel 2\n "); 
     int i;
     for (i=0; i<level-1; i++)
     {
-printf("EED WxTreeView::UpdateLevel 3\n "); 
                if (!GetSplitter(i)->IsSplit()) 
                { 
-printf("EED WxTreeView::UpdateLevel 4\n "); 
                        GetSplitter(i)->SplitVertically(  GetCtrl(i), GetSplitter(i+1),100 );
                } // if
       } // for
-printf("EED WxTreeView::UpdateLevel 5\n "); 
     if (GetSplitter(i)->IsSplit()) 
        { 
-printf("EED WxTreeView::UpdateLevel 6\n "); 
                GetSplitter(i)->Unsplit(); 
        }
-printf("EED WxTreeView::UpdateLevel End\n "); 
     
   }
   //=====================================================================
@@ -511,33 +468,24 @@ printf("EED WxTreeView::UpdateLevel End\n ");
   /// Recursive method called upon by UpdateLevel to refresh all windows
   void WxTreeView::RecursiveUpdateLevel( int level )
   {
-printf("EED WxTreeView::RecursiveUpdateLevel Start\n");          
     GimmickDebugMessage(1,
                        GetTreeHandler()->GetTree().GetLabel()
                        <<"WxTreeView::RecursiveUpdateLevel(level "
                        <<level
                        <<")"<<std::endl);
     
-printf("EED WxTreeView::RecursiveUpdateLevel 0.1\n");    
-    
+    int l = level - 1; 
     const std::vector<tree::Node*>& sel(GetSelected(level));
     
-printf("EED WxTreeView::RecursiveUpdateLevel 0.2\n");    
-    int l = level - 1;
-printf("EED WxTreeView::RecursiveUpdateLevel 0.3\n");    
     
     // to speed up inserting we hide the control temporarily
     GetCtrl(l)->Hide();
-printf("EED WxTreeView::RecursiveUpdateLevel 0.4\n");    
     GetCtrl(l)->DeleteAllItems();
     
-printf("EED WxTreeView::RecursiveUpdateLevel 0.5\n");    
     std::vector<tree::Node*>::const_iterator i;
-printf("EED WxTreeView::RecursiveUpdateLevel 1\n");      
     
     for (i=sel.begin(); i!=sel.end(); ++i)
     {
-printf("EED WxTreeView::RecursiveUpdateLevel 2\n");      
        GimmickDebugMessage(1,
                            "adding children of '"
                            <<(*i)->GetLabel()
@@ -553,7 +501,6 @@ printf("EED WxTreeView::RecursiveUpdateLevel 2\n");
             j!= (*i)->GetChildrenList().rend(); 
             ++j)
          {
-printf("EED WxTreeView::RecursiveUpdateLevel 3\n");      
            GimmickDebugMessage(1,
                                "adding children "
                                <<(*j)->GetLabel()
@@ -569,9 +516,9 @@ printf("EED WxTreeView::RecursiveUpdateLevel 3\n");
                         wxLIST_MASK_FORMAT
                         );
            
-               ItemData* data = new ItemData();
-           data->node = *j;
-           data->id = _id;
+               ItemData* data  = new ItemData();
+           data->node          = *j;
+           data->id            = _id;
                
            item.SetId(_id);
            item.SetData(data);
@@ -581,58 +528,55 @@ printf("EED WxTreeView::RecursiveUpdateLevel 3\n");
            
            //Setting attributes
            for (int k=0; k<GetCtrl(l)->GetColumnCount(); ++k)                          
-             {
-               std::string val;
-               //  Temporary correction : it works but no explanation about the problem FCY
-               
-               if(k==0 && level <3)
-               {
-                 val = (*j)->GetAttribute("NumberOfChildren");
-               } else {
-                 val = (*j)->GetAttribute(mLevelList[l].key[k]);
-               }
-printf("EED WxTreeView::RecursiveUpdateLevel 4\n");      
-               if(((*j)->GetAttributeDescriptor(mLevelList[l].key[k])).isDateEntry()) // Date
-                 {
-                   //                                    std::cout << "["<<val<< "]" << std::endl;
-                   std::string valtmp(val);
-                   try
-                     {
-                       boost::gregorian::date d1(boost::gregorian::from_undelimited_string(val));                                 
-                       val = to_iso_extended_string(d1);
-                     }
-                   catch (...)
-                     {
-                       val =  valtmp;
-                     }
-                   //                                    std::cout << "["<<val<< "]" << std::endl;     
-                 } else if(((*j)->GetAttributeDescriptor(mLevelList[l].key[k])).isTimeEntry()) // Time
-                 {
-                   if ((val.size()>6) && 
-                       (val != "" || val != " "))
-                     val = val.substr(0,2) + " : " 
-                       + val.substr(2,2) + " : " 
-                       + val.substr(4,2);
-                 } else {
-                   if (val.size()==0) val = "?";
-                 }
-printf("EED WxTreeView::RecursiveUpdateLevel 5\n");      
-               if (val.size()==0) val = "X";
-               item.SetText( crea::std2wx(val));
-               item.SetColumn(k);
+           {
+                       std::string val;
+                       //  Temporary correction : it works but no explanation about the problem FCY            
+                       if(k==0 && level <3)
+                       {
+                               val = (*j)->GetAttribute("NumberOfChildren");
+                       } else {
+                               val = (*j)->GetAttribute(mLevelList[l].key[k]);
+                       }
+                       if(((*j)->GetAttributeDescriptor(mLevelList[l].key[k])).isDateEntry()) // Date
+                       {
+                               //                                        std::cout << "["<<val<< "]" << std::endl;
+                               std::string valtmp(val);
+                               try
+                               {
+                                       boost::gregorian::date d1(boost::gregorian::from_undelimited_string(val));                                 
+                                       val = to_iso_extended_string(d1);
+                               } catch (...) {
+                                       val =  valtmp;
+                               }
+                               //                                        std::cout << "["<<val<< "]" << std::endl;     
+                       } else if(((*j)->GetAttributeDescriptor(mLevelList[l].key[k])).isTimeEntry()) // Time
+                       {
+                               if ((val.size()>6) && (val != "" || val != " "))
+                               {               
+                                       val = val.substr(0,2) + " : " + val.substr(2,2) + " : " + val.substr(4,2);
+                               }
+                       } else {
+                               if (val.size()==0)
+                               { 
+                                       val = "?";
+                               }
+                       } // if j
+                       if (val.size()==0)
+                       {
+                               val = "X";
+                       }
+                       item.SetText( crea::std2wx(val));
+                       item.SetColumn(k);
                  
-                 GetCtrl(l)->SetItem(item);
-                 }
+                       GetCtrl(l)->SetItem(item);
+               } // for k
                item.Clear();
            
-         }
-      }
-printf("EED WxTreeView::RecursiveUpdateLevel 6\n");      
+         } // for j
+      }  // for i
     
     SortLevel(l);
-printf("EED WxTreeView::RecursiveUpdateLevel 7\n");      
     GetCtrl(l)->Show();
-printf("EED WxTreeView::RecursiveUpdateLevel End\n");    
   }
   //=====================================================================
   
@@ -660,18 +604,14 @@ printf("EED WxTreeView::RecursiveUpdateLevel End\n");
   //================================================================
   void WxTreeView::OnItemSelected(wxListEvent& event)
   { 
-printf("EED  WxTreeView::OnItemSelected Start\n");       
     GimmickDebugMessage(1,GetTreeHandler()->GetTree().GetLabel()<<" WxTreeView::OnItemSelected"<<std::endl);
 
     if (mIgnoreSelectedChanged) 
     {
                GimmickDebugMessage(1, " mIgnoreSelectedChanged true: returning"<<std::endl);
-printf("EED  WxTreeView::OnItemSelected 0.1\n");         
                return;
     }
-    
-printf("EED  WxTreeView::OnItemSelected 1\n");   
-    
+        
     wxListItem info;
     info.m_itemId = event.m_itemIndex;
     mLastSelected = event.m_itemIndex;
@@ -685,25 +625,18 @@ printf("EED  WxTreeView::OnItemSelected 1\n");
        mLastLevel=level;
     GimmickDebugMessage(1," Level "<<level+1<<std::endl);
     
-printf("EED  WxTreeView::OnItemSelected 2 %d  %d  \n", level, mLevelList.size() );       
     // Update the children level (if selection not at last level)
     if (level<mLevelList.size()-1) 
     {  
-printf("EED  WxTreeView::OnItemSelected 2.0\n");         
                UpdateLevel( level + 2 ); 
                // Reset the viewer setting the default image
-printf("EED  WxTreeView::OnItemSelected 2.1\n");         
                GetGimmickView()->ClearSelection();
-printf("EED  WxTreeView::OnItemSelected 2.2\n");         
     }
-printf("EED  WxTreeView::OnItemSelected 3\n");   
     // Select all images if the selection is at series level
     if (level==mLevelList.size()-2) 
        {
-printf("EED  WxTreeView::OnItemSelected 4\n");   
                SelectAll(level+1);
        }
-printf("EED  WxTreeView::OnItemSelected 5\n");   
     // Validate selected images if the selection is at image level
     if (level==(mLevelList.size()-1)) //&&mProcess) 
     {
@@ -714,37 +647,30 @@ printf("EED  WxTreeView::OnItemSelected 5\n");
                  ValidateSelectedImages (false);
                }
     } // if
-printf("EED  WxTreeView::OnItemSelected End\n");
   }
   //================================================================
 
   //================================================================
   void WxTreeView::SelectAll(int level)
-  {
-printf("EED  WxTreeView::SelectAll Start\n");    
-         
+  {      
     long item = -1;
     //    int level=mLevelList.size()-1;
     for ( ;; )
-      {
-       item = GetCtrl(level)->GetNextItem(item,
-                                          wxLIST_NEXT_ALL);
-        if ( item == -1 )
-         break;
-       
-       if(item==(GetCtrl(level)->GetItemCount()-1))
-         {
-           mIgnoreSelectedChanged = false;//mProcess=true;
-         }
-       else
-         {
-           mIgnoreSelectedChanged = true;//    mProcess=false;
-         }
-       GetCtrl(level)->SetItemState(item,wxLIST_STATE_SELECTED, wxLIST_MASK_STATE 
-                                    | wxLIST_MASK_TEXT |wxLIST_MASK_IMAGE | wxLIST_MASK_DATA | wxLIST_MASK_WIDTH | wxLIST_MASK_FORMAT);
-      }
-printf("EED  WxTreeView::SelectAll End\n");      
-         
+    {
+               item = GetCtrl(level)->GetNextItem(item,wxLIST_NEXT_ALL);
+               if ( item == -1 )
+               {
+                       break;
+               }
+               if(item==(GetCtrl(level)->GetItemCount()-1))
+               {
+                       mIgnoreSelectedChanged = false;//mProcess=true;
+               } else {
+                       mIgnoreSelectedChanged = true;//        mProcess=false;
+               }
+               GetCtrl(level)->SetItemState(item,wxLIST_STATE_SELECTED, wxLIST_MASK_STATE 
+                                                | wxLIST_MASK_TEXT |wxLIST_MASK_IMAGE | wxLIST_MASK_DATA | wxLIST_MASK_WIDTH | wxLIST_MASK_FORMAT);
+    } // for
   }
 
   //================================================================
@@ -1001,7 +927,6 @@ printf("EED  WxTreeView::SelectAll End\n");
   //================================================================
   void WxTreeView::SortLevel(int level)
   { 
-printf("EED WxTreeView::SortLevel Start %d \n", level);
     GimmickDebugMessage(1,
                        "WxTreeView::SortLevel(" 
                        <<level<<")"
@@ -1042,13 +967,10 @@ printf("EED WxTreeView::SortLevel Start %d \n", level);
                        <<nbselected<<" selected before sorting"
                        <<std::endl);  
 
-printf("EED WxTreeView::SortLevel 1\n");
     mIgnoreSelectedChanged = true; 
     // 
     if (mLevelList[level].SortAscending)
     {
-printf("EED WxTreeView::SortLevel 2\n");
-       
                if(ty==1)
                {
                        GetCtrl(level)->SortItems(CompareFunctionInts, 0);
@@ -1064,8 +986,6 @@ printf("EED WxTreeView::SortLevel 2\n");
                } // if ty
     } //mLevelList
  
-printf("EED WxTreeView::SortLevel 3\n");
-
     // Reselects the unselected 
     n = GetCtrl(level)->GetItemCount();
     int after = 0;
@@ -1084,7 +1004,6 @@ printf("EED WxTreeView::SortLevel 3\n");
                
                if (data->selected)
                {
-printf("EED WxTreeView::SortLevel 4\n");
                        nbselected--;
                        if (nbselected==0)
                        {
@@ -1112,9 +1031,7 @@ printf("EED WxTreeView::SortLevel 4\n");
                        "WxTreeView::SortLevel : " 
                        <<after<<" selected after sorting"
                        <<std::endl);  
-  
-printf("EED WxTreeView::SortLevel End\n");
-  }
+    }
   //================================================================
 
   
index fbac52b94bfe08ccc7042b1217eb8e8e50599ff1..6683a13f5d07a5a3a5d44243947065c262f3175a 100644 (file)
@@ -141,21 +141,21 @@ namespace creaImageIO
       /// such as the vector of attribute keys corresponding to the columns
       struct LevelType
       {
-       // The List Control
-       wxListCtrl* wxCtrl;
-       wxSplitterWindow* wxSplitter;
-       std::vector<std::string> key;
-       // The vector of currently selected nodes of the level
-       std::vector<tree::Node*> Selected;
-       // True iff the vector Selected is up to date
-       bool SelectedUpToDate;
-       // The column used for sorting
-       unsigned int SortColumn;
-       ///Boolean that defines the direction of the sort
-       ///True is ascending order and false is descending
-       bool SortAscending;
-       //The vector of not shown attributes
-       std::vector<std::string> notShownAtts; 
+                       // The List Control
+                       wxListCtrl                                      *wxCtrl;
+                       wxSplitterWindow                        *wxSplitter;
+                       std::vector<std::string>        key;
+                       // The vector of currently selected nodes of the level
+                       std::vector<tree::Node*>        Selected;
+                       // True iff the vector Selected is up to date
+                       bool SelectedUpToDate;
+                       // The column used for sorting
+                       unsigned int SortColumn;
+                       ///Boolean that defines the direction of the sort
+                       ///True is ascending order and false is descending
+                       bool SortAscending;
+                       //The vector of not shown attributes
+                       std::vector<std::string> notShownAtts; 
       };
       /// The vector of levels : one for each level of the tree      
       std::vector<LevelType> mLevelList;
@@ -210,16 +210,16 @@ namespace creaImageIO
       ///Initial color palette
       std::vector<std::string> mColorPalette;
 
-      wxMenumenu;
+      wxMenu           *menu;
          
-      wxObjectsenderCtrl;
+      wxObject         *senderCtrl;
       int mAscendingID;
       int mDescendingID;
       int mFilterID;
       unsigned int mLastLevel;
       
-         wxMenumenuItem;
-         wxMenu *subExportMenu;
+         wxMenu        *menuItem;
+         wxMenu        *subExportMenu;
          int mAnonymizingID;
          int mLocalCopyID;
          int mEditFieldID;
@@ -244,7 +244,6 @@ namespace creaImageIO
                                               wxString title,    
                                                   const wxSize& size);
                ~RemoveAlertDlg();
-
                bool isChecked();
 
        private :
index ee2258aa2ea73d8b4b921e1e3dba275799a261dd..0b99b6675b06754e6ed90988671a8d511c012cb9 100644 (file)
@@ -78,10 +78,9 @@ namespace creaImageIO
                 size)
   {
     wxMutexLocker lock(mMutex);
-    GimmickDebugMessage(6,"WxViewer::WxViewer"
-                       <<std::endl);
+    GimmickDebugMessage(6,"WxViewer::WxViewer" <<std::endl);
 
-    mNeedRefresh = false;
+    mNeedRefresh       = false;
     mLastImageShown = NULL;
        
        // previewer    
@@ -91,8 +90,8 @@ namespace creaImageIO
     mViewer    = vtkImageViewer2::New();
     mViewer->SetupInteractor ( mInteractor );
     
-    mCurrent = 0;
-       mPlayer = 0;
+    mCurrent   = 0;
+       mPlayer         = NULL;
 
        // Grid to place checkbox and slider 
        mflexSizer = new wxFlexGridSizer(1,2,1,1);
@@ -122,8 +121,7 @@ namespace creaImageIO
   WxViewer::~WxViewer()
   {
     wxMutexLocker lock(mMutex);
-    GimmickDebugMessage(6,"WxViewer::~WxViewer"
-                       <<std::endl);
+    GimmickDebugMessage(6,"WxViewer::~WxViewer"<<std::endl);
     // TO DO : desallocate cleanly
        if(mPlayer)
        {
@@ -158,9 +156,7 @@ namespace creaImageIO
 
   void WxViewer::ShowNextImage()
   {
-        
-       
-         mMutex.Unlock();
+       mMutex.Unlock();
        wxMutexLocker lock(mMutex);
            
     GimmickMessage(2,"WxViewer::ShowNextImage() "
@@ -180,10 +176,8 @@ namespace creaImageIO
                                mNeedRefresh = true;
                                mLastImageShown = currIm;
                        }
-               mCurrent++;
-           }
-               else
-               {
+                       mCurrent++;
+           } else {
                        mCurrent = 0;
                        //ImagePointerHolder* iph=imagePointers[mCurrent];
                        boost::shared_ptr<ImagePointerHolder> iph = imagePointers[mCurrent];
@@ -195,8 +189,8 @@ namespace creaImageIO
                                mLastImageShown = currIm;
                        }
                        mCurrent++;
-               }
-       }
+               } // if mCurrent
+       } // if imagePointers
   }
   //================================================================
 
@@ -300,13 +294,12 @@ std::cout << std::endl;
   bool WxViewer::RefreshIfNecessary()
   {
     if (mNeedRefresh)
-      {
-       GimmickDebugMessage(10,"WxViewer : Refreshing"<<std::endl);
-
-       mInteractor->Render();
-       mNeedRefresh = false;
-       return true;
-      }
+    {
+               GimmickDebugMessage(10,"WxViewer : Refreshing"<<std::endl);
+               mInteractor->Render();
+               mNeedRefresh = false;
+               return true;
+    }
     return false;
   }
   //================================================================
@@ -315,9 +308,9 @@ std::cout << std::endl;
   void WxViewer::StopPlayer()
   {
          wxMutexLocker lock(mMutex);
-         if (mPlayer==0 ) return;
+         if (mPlayer==NULL ) return;
          mPlayer->Delete();  
-         mPlayer=0;
+         mPlayer=NULL;
          mMutex.Unlock();
   }
   //================================================================
@@ -328,15 +321,13 @@ std::cout << std::endl;
                if(mcheck->IsChecked())
                {
                        //      wxMutexLocker lock(mMutex);
-                       if (mPlayer != 0) return;
+                       if (mPlayer != NULL) return;
                        mPlayer = new WxViewerPlayer(this);
                        mPlayer->Create();
                        mPlayer->Run();  
-               }
-               else
-               {
+               } else {
                        ShowNextImage();
-               }
+               } // if
        }
 
   //================================================================
@@ -349,7 +340,7 @@ std::cout << std::endl;
                {
                        mPlayer->Pause();
                        mPlayer->Delete();
-                       mPlayer = 0;
+                       mPlayer = NULL;
                }
                StartPlayer();
        }
index 566e316a989481e60a1c778d853e8e4edbc55760..72fe10e53a0ecf79197aaf6643c194ac0a9ec593 100644 (file)
@@ -88,13 +88,13 @@ namespace creaImageIO
     ///Shows the image passed as parameter
     void ShowImage(vtkImageData* im);
     /// Previewer
-    vtkImageViewer2mViewer;
+    vtkImageViewer2            *mViewer;
 
        ///Slider
-       wxSlider *mslide ;
+       wxSlider                        *mslide ;
 
        ///CheckBox to cine loop
-       wxCheckBox  *mcheck;
+       wxCheckBox              *mcheck;
 
     /// Associated wxvtk interactor
        crea::wxVTKRenderWindowInteractor  *mInteractor;
@@ -106,7 +106,7 @@ namespace creaImageIO
     /// Current image shown
     int mCurrent;
     ///The threaded movie player
-    WxViewerPlayermPlayer;
+    WxViewerPlayer             *mPlayer;
     /// The mutex
     wxMutex mMutex;
     /// Boolean that declares if the player needs to be refreshed