]> Creatis software - creaImageIO.git/commitdiff
Remove timestamp_database and timestamp files (now management only with maintenance_d...
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Thu, 2 Jul 2009 08:27:45 +0000 (08:27 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Thu, 2 Jul 2009 08:27:45 +0000 (08:27 +0000)
src2/CMakeLists.txt
src2/creaImageIOGimmick.cpp
src2/creaImageIOGimmick.h
src2/creaImageIOSynchron.cpp
src2/creaImageIOSynchron.h
src2/creaImageIOTreeHandlerImageAdder.cpp
src2/creaImageIOWxGimmickView.cpp
src2/creaImageIOWxGimmickView.h
src2/creaImageIOWxTreeView.cpp
src2/creaImageIOWxTreeView.h

index 3fe2c57375bc66ec67816ed022d36865f5c31a5f..56eb3c8302ad0ac0de7fee0147ab10685143f960 100644 (file)
@@ -34,7 +34,6 @@ SET( SRCS
   # 
   creaImageIOGimmick
   creaImageIOSynchron
-  creaImageIOTimestampDatabaseHandler
   creaImageIOListener
   creaImageIOPACSConnection
 
index 55491754e15f980b53cee48b2a8f74a4b178d0f2..f5d21100df39391a3be34cd7251915189e6cc4d2 100644 (file)
@@ -3,7 +3,7 @@
 #include <creaImageIOSystem.h>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
-#include "io.h"
+//#include "io.h"
 #ifndef PATH_MAX // If not defined yet : do it 
 #  define PATH_MAX 2048
 #endif
@@ -42,7 +42,6 @@ namespace creaImageIO
   //==============================================================
   void Gimmick::Initialize(const std::string& path)
   {
-         mDescriptorPath=path;
          Initialize();
   }
 
@@ -72,35 +71,7 @@ namespace creaImageIO
        //Add additional DB from user Settings
        addDBSettings();
 
-       // Creates files and directories database
-    mTimestampDatabase = new TimestampDatabaseHandler(GetTimestampDatabasePath());
-    // Create or open local database
-    if (! boost::filesystem::exists( GetTimestampDatabasePath() ) )
-      {
-       std::string mess = "Timestamp database '";
-       mess += GetTimestampDatabasePath();
-       mess += "' does not exist : creating it";
-       GimmickMessage(1,mess<<std::endl);
-       
-       if ( ! mTimestampDatabase->Create() )
-         {
-           GimmickError("ERROR CREATING '"<<GetTimestampDatabasePath()<<"'");
-         }
        
-     }
-    else 
-      {
-       /// Open and test it
-       GimmickMessage(1,"Opening Timestamp database '"
-                      <<GetTimestampDatabasePath()<<"' "
-                      <<std::endl);
-       if ( ! mTimestampDatabase->Open() )
-         {
-           GimmickError("ERROR OPENING '"<<GetTimestampDatabasePath()<<"'");
-         }
-       
-      }
-
   }
 
    ///////////////////////////////////////////////////////////////////////
@@ -172,7 +143,6 @@ namespace creaImageIO
           {
                   delete it->second;
           }
-       delete mTimestampDatabase;
   }
   //==============================================================
 
@@ -230,21 +200,7 @@ namespace creaImageIO
     return mLocalDatabasePath;    
   }
 
-  //================================================================
 
-  //================================================================
-  const std::string& Gimmick::GetTimestampDatabasePath()
-  {
-    if (mTimestampDatabasePath.size()==0) 
-      {
-       mTimestampDatabasePath = GetUserSettingsDirectory();
-       mTimestampDatabasePath += "Shared/gimmick/timestamp_database.sqlite3";
-       boost::algorithm::replace_all( mTimestampDatabasePath,
-                                      INVALID_FILE_SEPARATOR , 
-                                      VALID_FILE_SEPARATOR);
-      }
-    return mTimestampDatabasePath;    
-  }
   //========================================================================
 
   //========================================================================
@@ -323,12 +279,6 @@ namespace creaImageIO
     return i->second;
   }
 
-  //========================================================================
-  ///Returns the timestamp database handler
-  TimestampDatabaseHandler* Gimmick::GetTimestampDatabase() const 
-  {  
-    return mTimestampDatabase;
-  }
 
 
   //========================================================================
@@ -340,7 +290,6 @@ namespace creaImageIO
  
        mImageAdder.SetCurrentDatabase(d);
     mImageAdder.SetTreeHandler(GetTreeHandler(d));
-       mImageAdder.SetTimestampHandler(mTimestampDatabase);
        mImageAdder.SetSynchronizer(mSynchronizer);
     mImageAdder.AddFiles(filenames);
        
@@ -358,7 +307,6 @@ namespace creaImageIO
        TreeHandler * handler=GetTreeHandler(d);
        mImageAdder.SetCurrentDatabase(d);
     mImageAdder.SetTreeHandler(handler);
-       mImageAdder.SetTimestampHandler(mTimestampDatabase);
        mImageAdder.SetSynchronizer(mSynchronizer);
     mImageAdder.AddDirectory(f,recurse);  
   }
@@ -371,7 +319,6 @@ namespace creaImageIO
   {
          mImageAdder.SetCurrentDatabase(d);
          mImageAdder.SetSynchronizer(mSynchronizer);
-         mTimestampDatabase->RemoveNode("PATH",node,d);
          mImageAdder.RemoveFile(node);
   }
   //========================================================================
@@ -383,7 +330,6 @@ namespace creaImageIO
          TreeHandler * handler=GetTreeHandler(d);
          mImageAdder.SetCurrentDatabase(d);
          mImageAdder.SetTreeHandler(handler);
-         mImageAdder.SetTimestampHandler(mTimestampDatabase);
          mImageAdder.SetSynchronizer(mSynchronizer);
          mImageAdder.CopyFiles(filenames, mSettings->getValue(SETTINGS_COPY_PATH));
   }
@@ -395,7 +341,6 @@ namespace creaImageIO
          TreeHandler * handler=GetTreeHandler(d);
          mImageAdder.SetCurrentDatabase(d);
          mImageAdder.SetTreeHandler(handler);
-         mImageAdder.SetTimestampHandler(mTimestampDatabase);
          mImageAdder.SetSynchronizer(mSynchronizer);
          return mImageAdder.Synchronize(repair, checkAttributes);
   }
@@ -424,7 +369,6 @@ namespace creaImageIO
          TreeHandler * handler=GetTreeHandler(d);
          mImageAdder.SetCurrentDatabase(d);
          mImageAdder.SetTreeHandler(handler);
-         mImageAdder.SetTimestampHandler(mTimestampDatabase);
          mImageAdder.SetSynchronizer(mSynchronizer);
          mImageAdder.GetAttributes(params, filename, results);
   }
@@ -447,7 +391,6 @@ namespace creaImageIO
                   mImageAdder.SetTreeHandler(it->second);
                   mImageAdder.DeleteDriveFromMainDB(drive);
           }
-         mImageAdder.SetTimestampHandler(mTimestampDatabase);
          mImageAdder.SetSynchronizer(mSynchronizer);
          mImageAdder.DeleteDriveFromOtherDB(drive);
   }
index 41e6b3b183d53616872fc81404fa713c02f9c099..8085f69ac86a5567eb9114390d6735e9d5f202e5 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <creaImageIOSQLiteTreeHandler.h>
 #include <creaImageIOTreeHandlerImageAdder.h>
-#include <creaImageIOTimestampDatabaseHandler.h>
 #include <creaImageIOSynchron.h>
 #include <creaImageIOSettings.h>
 
@@ -125,9 +124,7 @@ namespace creaImageIO
     /// Returns the TreeHandler with a given name
     TreeHandler* GetTreeHandler(const std::string& name) const;
 
-       /// Returns the TimestampDatabase
-       TimestampDatabaseHandler* GetTimestampDatabase() const;
-    /// 
+       /// 
     SQLiteTreeHandler* GetLocalDatabase() { return mLocalDatabase; }
 
     const SQLiteTreeHandler* GetLocalDatabase() const 
@@ -156,21 +153,19 @@ namespace creaImageIO
     const std::string& GetUserSettingsDirectory();
     void CreateUserSettingsDirectory();
     const std::string& GetLocalDatabasePath();
-       const std::string& GetTimestampDatabasePath();
+       
 
 
     //=============================================
   private:
     SQLiteTreeHandler* mLocalDatabase;
-       TimestampDatabaseHandler* mTimestampDatabase;
-    TreeHandlerMapType mTreeHandlerMap;
+       TreeHandlerMapType mTreeHandlerMap;
        Synchronizer* mSynchronizer;
 
     std::string mCurrentDirectory;
     std::string mHomeDirectory;
     std::string mUserSettingsDirectory;
     std::string mLocalDatabasePath;
-       std::string mTimestampDatabasePath;
        Settings        *mSettings;
     TreeHandlerImageAdder mImageAdder;
   };
index 74e9e98ced8fc532e9c0843a593098db249dce02..0748a861351066682f3336f1fee4dd54672f1c47 100644 (file)
@@ -377,5 +377,43 @@ namespace creaImageIO
                sql += "';";
                UPDATESYNCDB(sql);
     }
-}
 
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+    // get the files name to ignore for a add operation synchronization
+    // @param : the add key
+    //@result : list (path) of ignore files
+    /////////////////////////////////////////////////////////////////////////////////////////////////
+    void Synchronizer::GetList()
+    {
+               mList.clear();
+        std::vector<std::string> i_names;
+               std::string query = "SELECT PATH, REMOVE FROM IGNORED_FILES";
+               CppSQLite3Query res;
+        QUERYSYNCDB(query, res);
+               while (!res.eof())
+        {
+                       std::string file(res.getStringField(0));
+                       std::string ignore(res.getStringField(1));
+                       mList[file] = ignore == "0"? true : false;
+                       res.nextRow();
+        }
+               
+    }
+
+       bool Synchronizer::isIndexed(const std::string filename)
+       {
+               bool valid = true;
+               std::map <std::string, bool>::iterator it_list = mList.begin();
+               for(;it_list != mList.end(); it_list++)
+               {
+                       if(it_list->first == filename)
+                       {
+                               valid = false;
+                               break;
+                       }
+               }
+               return valid;
+       }
+}
\ No newline at end of file
index 422c2ebb79c4db2e51118a1be4b3c6a32d682b2f..fde9f2d21afb090d69978ab69cbe375f54667b97 100644 (file)
@@ -102,6 +102,12 @@ namespace creaImageIO
                                                                                const std::string& searchParam,
                                                                                const std::string& searchValue, 
                                                                                const std::string& refdb);
+                         // Get the List of indexed files (removed or not)
+                         void GetList();
+                         // Test to not if a file is indexed on db or not
+                         bool isIndexed(const std::string filename);
+                         // List of all indexed files
+                         std::map <std::string, bool> mList;
                          ///The current AddList
               std::vector<AddList>  mAddList;
                          ///The current RemoveList
index ad88ef77abb5d800743a1a64097ac54126cd0a10..b1a60437cd2fa22737e4f1bd0b0fd2e339c4a273 100644 (file)
@@ -50,7 +50,7 @@ namespace creaImageIO
     std::vector<std::string>::const_iterator i;
     for (i=filenames.begin();i!=filenames.end();++i)
       {
-       mTimestampHandler->AddFile((*i), fs::last_write_time(*i), time(0),mCurrentDB);
+       
        mProgress.IncNumberScannedFiles();
        if (IsHandledFile(*i)) 
          {
@@ -80,6 +80,7 @@ namespace creaImageIO
        mSynchronizer->InsertAddOp(directory,rec.str(),"0",mCurrentDB);
        std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","ADD_OPS","PATH",directory,mCurrentDB);
        mTreeHandler->BeginTransaction();
+       mSynchronizer->GetList();
        AddDirectoryRecursor( directory, recurse, addKey );
        
        int nFiles=GetProgress().GetNumberAddedFiles();
@@ -161,6 +162,7 @@ namespace creaImageIO
          }
   }
 
   //=====================================================================
   void TreeHandlerImageAdder::AddDirectoryRecursor(const std::string &dirpath, 
                                                   bool recursive,
@@ -172,11 +174,12 @@ namespace creaImageIO
     if ( !fs::exists( dirpath ) ) return;
        time_t lastModif=fs::last_write_time(dirpath);
 
+       
     fs::directory_iterator end_itr; // default construction yields past-the-end
     for ( fs::directory_iterator itr( dirpath );
          itr != end_itr;
          ++itr )
-      {
+       {
        // If is directory & recurse : do recurse
        if ( fs::is_directory(itr->status()) )
          {
@@ -188,7 +191,8 @@ namespace creaImageIO
        else 
          {
                std::string parent_id;
-               bool valid=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
+               // tTest if directory (and only it) exists or not.
+               bool valid = mSynchronizer->isIndexed(itr->string());//true;//=mTimestampHandler->AddDirectory(dirpath, itr->string(), lastModif, time(0),mCurrentDB);
                if(valid)
                {
                        mProgress.IncNumberScannedFiles();
@@ -197,7 +201,6 @@ namespace creaImageIO
                        mProgress.IncNumberHandledFiles();
                        AddFile( itr->string() );
                        mTreeHandler->GetTopLevelNodeId("FullFileName",itr->string(),parent_id);
-                       mTimestampHandler->SetAttribute("TopLevelNodeId",parent_id,"PATH",itr->string());
                        std::stringstream removedOn;
                        removedOn<<time(0);
                        mSynchronizer->InsertIgnoreFile(addKey, itr->string(),"0",removedOn.str(),mCurrentDB);
@@ -211,7 +214,6 @@ namespace creaImageIO
                        }
                        
                }
-               mTimestampHandler->SetAttribute("TopLevelNodeId",parent_id,"PATH",dirpath);
          }
       }
        
@@ -352,7 +354,6 @@ namespace creaImageIO
                        //For the new files, add them
                        for (i=newFiles.begin();i!=newFiles.end();++i)
                        {
-                       mTimestampHandler->AddFile((*i), fs::last_write_time(*i), time(0),mCurrentDB);
                        if (IsHandledFile(*i)) 
                        {
                                std::stringstream removedOn;
@@ -487,17 +488,14 @@ namespace creaImageIO
          if(!boost::filesystem::exists(directory))
          {
          boost::filesystem::create_directory(boost::filesystem::path(directory));
-         mTimestampHandler->AddDirectory("",directory,fs::last_write_time(directory)+10, time(0),mCurrentDB);
          mSynchronizer->InsertAddOp(directory,"0","0",mCurrentDB);
          }
          std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","ADD_OPS","PATH",directory,mCurrentDB);
-         std::string parent_id=mTimestampHandler->IsIndexed(directory,mCurrentDB);
          size_t last;
          std::vector<std::string> newNames;
          for(i=filenames.begin();i!=filenames.end();++i)
          {
                  std::string dir=directory.c_str();
-                 mTimestampHandler->CleanPath(dir);
                  if(boost::filesystem::exists(*i) && (*i).find(dir)==std::string::npos)
                  {
                  std::string path=*i;
@@ -514,19 +512,11 @@ namespace creaImageIO
                          p++;
                  }
                  std::string result=out.str();
-                 mTimestampHandler->CleanPath(result);
                  boost::filesystem::copy_file((*i),result);
 
                  //To update image database
                  mTreeHandler->SetAttribute("Image","FullFileName",result,"FullFileName", (*i));
                  
-                 //To update timestamp database
-                 mTimestampHandler->SetAttribute("PATH",result,"PATH",(*i));
-                 mTimestampHandler->SetAttribute("PARENT_ID",parent_id,"PATH",result);
-                 std::stringstream t;
-                 t<<fs::last_write_time(directory)+10;
-                 mTimestampHandler->SetAttribute("LastModified",t.str(),"PATH",result);
-
                  //To update maintenance database
                  //1.Add the new path and increase number of children on new operation.
                  std::stringstream removedOn;
@@ -580,9 +570,6 @@ namespace creaImageIO
 
   void TreeHandlerImageAdder::DeleteDriveFromOtherDB(const std::string& drive)
   {
-         //Delete from timestamp
-         mTimestampHandler->RemoveEntries("FILES", "PATH", "LIKE", drive+"%");
-
          //Delete from maintenance
          mSynchronizer->RemoveEntries("ADD_OPS", "PATH", "LIKE", drive+"%");
          mSynchronizer->RemoveEntries("IGNORED_FILES", "PATH", "LIKE", drive+"%");
index a77f9a7fe9de9bdc1726f0db2b1d01a3b22868ee..447b35bc298a4a9a99a7e6e2f552f7138836614c 100644 (file)
@@ -20,6 +20,7 @@ using namespace crea;
 #include "icons/synchronize.xpm"
 #include "icons/settings.xpm"
 #include "icons/tools.xpm"
+//#include "icons/import.xpm"
 
 #include <wx/imaglist.h>
 #include <wx/popupwin.h>
@@ -423,9 +424,10 @@ namespace creaImageIO
                mProgressDialog = 
                new wxProgressDialog(_T("Adding directory"),
                                        _T(""),
-                                       1000,
+                                       NumberFilesToAdd(dirname,recurse),
                                        this,
-                                       wxPD_ELAPSED_TIME |
+                                       wxPD_ELAPSED_TIME | 
+                                       wxPD_SMOOTH |
                                        //                             wxPD_ESTIMATED_TIME | 
                                        //                             wxPD_REMAINING_TIME |
                                        wxPD_CAN_ABORT );
@@ -442,6 +444,33 @@ namespace creaImageIO
     mViewer->StartPlayer();
   }
 
+
+   //=================================================
+  // Determines number of files potentially to add to database
+   int WxGimmickView::NumberFilesToAdd(const std::string &dirpath, bool recursive)
+  {
+          int nb = 0;
+          if ( !boost::filesystem::exists( dirpath ) ) return nb;
+          boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end
+          for ( boost::filesystem::directory_iterator itr( dirpath );  itr != end_itr;  ++itr )
+         {
+               // If is directory & recurse : do recurse
+               if ( boost::filesystem::is_directory(itr->status()) )
+               {
+                       if (recursive) 
+                       {
+                               nb += NumberFilesToAdd(itr->string(), recursive);
+                       }
+               }
+               else
+               {
+                       nb++;
+               }
+         }
+       return nb;
+
+  }
+
     //=================================================
    // Test a directory to know if contains sub-directory to analyze
   bool WxGimmickView::isNeedRecursive(std::string i_name)
@@ -715,6 +744,38 @@ namespace creaImageIO
     dial->ShowModal();
   }
   //=================================================
+  void WxGimmickView::OnImportExport(wxCommandEvent &Event)
+  {
+       wxBusyCursor busy;
+       // Test if one image is selected => export
+       // if not =>import
+    if (GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))])
+       {
+               ExportImages();
+       }
+       else
+       {
+               ImportImages();
+       }
+  }
+
+  void WxGimmickView::ExportImages()
+  {
+               //Archive selection: name, emplacement
+               //same process than copy local but to a zip
+               // if settings are yes "always ask for descriptor addition", ask
+               // if settings are yes, adding descriptor
+  }
+
+  void WxGimmickView::ImportImages()
+  {
+               //Find the *.zip
+               //dezip
+               // Contain a descriptor.text
+               // create a new database, and add to database
+               // if not, add to current database
+               // 
+  }
 
   //=================================================
   //AndresDonadio
index 0b4c74d4896cd987952ff9b0c93874d242714ab2..b710bca54d2fe762b82e1fd69901276e1b70ad38 100644 (file)
@@ -8,6 +8,9 @@
 #include <creaImageIOWxGimmickTools.h>
 #include <creaImageIOListener.h>
 #include <creaWx.h>
+
+#include "wx/progdlg.h"
+
 #include "wx/wx.h"
 #include <wx/splitter.h>
 #include <wx/toolbar.h> 
@@ -150,6 +153,15 @@ namespace creaImageIO
     void OnSettings(wxCommandEvent& event);
        /// Callback for settings edition
     void OnTools(wxCommandEvent& event);
+       /// Callback for Import/Export images
+    void OnImportExport(wxCommandEvent& event);
+
+       // Import Images from an archive
+       void ImportImages();
+
+       //Export Images to an archive
+       void ExportImages();
+
        ///Creates the settings dialog (the pages inside and the information)
        void CreateSettingsDialog(wxNotebook* nb, wxDialog* dial);
     
@@ -158,6 +170,9 @@ namespace creaImageIO
 
        /// Test a directory to know if contains sub-directory to analyze
        bool isNeedRecursive(std::string i_name);
+
+       /// Determines number of files potentially to add to database
+       int NumberFilesToAdd(const std::string &dirpath, bool recursive);
     
     /// AddProgress Gimmick callback
     void OnAddProgress( Gimmick::AddProgress& );
@@ -170,6 +185,8 @@ namespace creaImageIO
        ///Create a DB from an Attributes Descriptor files 
        void OnCreateDB(wxCommandEvent& event);
 
+       std::string ExtractName(const std::string &i_name);
+
        ///Edits the fields of a given node
        void CreateEditFieldsDialog(tree::Node* node, std::vector<std::string> names, std::vector<std::string> keys);
  
@@ -194,150 +211,7 @@ namespace creaImageIO
   // EO class WxGimmickView
   //=====================================================================
   
-  
-  /*
-
-
-
-
-
-
-
-
-       //====================================================================
-       // General
-       //====================================================================
-
-    /// Returns the size of the current selection
-    virtual int GetSelectionSize() { return 0; } 
-    /// Returns true if there is a valid selection
-    virtual bool IsSelectionValid(){ return false; }
-    /// Returns the vector of full filenames of selected images
-    virtual void GetSelectedFiles(std::vector<std::string>&){ return; }
-    /// Returns the vector of images corresponding to selection
-    virtual void GetSelectedImages(std::vector<vtkImageData*>&){ return; }
-    /// Returns the vector of DicomNode corresponding to selection
-    virtual void GetSelectedDicomNodes(std::vector<DicomNode*>&){ return; }
-   /// Returns the DicomNode corresponding to the tree item
-    virtual DicomNode* GetDicomNodeOfItem(const TreeItemId& i);
-
-       
-       /// Type of list of DicomDatabase
-    typedef std::vector<DicomDatabase*> DicomDatabaseListType;
-    /// Returns the list of DicomDatabase open
-    virtual DicomDatabaseListType& GetDicomDatabaseList() 
-    { return null; }
-    /// Returns the list of DicomDatabase open (const)
-    virtual const DicomDatabaseListType& GetDicomDatabaseList() const 
-    { return null; }
-
-       protected:
-       ///Opens an existing database, or else, creates a local database.
-    virtual void OpenOrNewDatabase(bool open){ return; }
-       ///Shows the help
-       virtual void ShowHelp();
-
-       private:
-       ///Gets the extension of the database
-       const std::string& GetDatabaseExtension() { return null; }
-       ///Sets the extension of the database
-    virtual void SetDatabaseExtension(const std::string& ext){ return; }
-
-
-       //====================================================================
-    // Preview Display Related
-       //====================================================================
-
-
-    ///Shows the image sent as a parameter
-       private:
-        virtual void ShowImage(vtkImageData* image){ return; }
-
-       //====================================================================
-    // Favorites Related
-       //====================================================================
-
-
-       public:
-       ///Loads or creates a favorites database
-    virtual void LoadOrCreateFavoritesDatabase(){ return; }
-       private:
-       ///Creates the user settings directory
-    void CreateUserSettingsDirectory(){ return; }
-       ///Obtains the user settings directory
-       const std::string& GetUserSettingsDirectory(){ return null; }
-
-       //====================================================================  
-       // Attribute Display Related
-       //====================================================================
-
-
-       ///Shows the Information regarding the node sent as a parameter
-       private:
-     virtual void ShowInformation(DicomNode*){ return; }
-   
-       //====================================================================
-    // Tree Display Related
-    //====================================================================
-
-       protected:
-    /// Completely rebuilds the view with 
-    /// current DicomDatabaseList
-    virtual void RebuildView(){ return; }
-       /// Recursively updates the part of the view corresponding 
-    /// to the DicomDatabase passed
-    /// i.e. creates items for the DicomNode which do not have
-    ///      deletes obsolete items (whose DicomNode has been deleted)
-    virtual void UpdateDicomDatabaseView(DicomDatabase*){ return; }
-    /// Recursively updates the part of the view corresponding 
-    /// to the DicomNode provided.
-    /// parent is its parent in the tree (where to insert / remove it)
-       virtual void UpdateDicomNodeView(DicomNode* n, const TreeItemId& parent){ return; }
-    
-       private:
-       ///Type definition of the data regarding the tree
-    typedef WxGimmickTreeItemData TreeItemData;
-       ///Gets the item data of the tree item passed as a parameter
-    TreeItemData* GetItemData(const TreeItemId& id){ return null; }
-    ///Type definition of the data insid a node of the tree
-    typedef WxGimmickDicomNodeData NodeData;
-
-
-       //====================================================================
-    // Class Attributes
-    //====================================================================
-
-       
-       int mSelectionType;
-    int mSelectionMaxImageDimension;
-    int mCurrentSelectionImageSize[4];
-
-       ///Existent Database List
-    DicomDatabaseListType mDicomDatabaseList;
-       ///Favorites database
-    DicomDatabase* mFavoriteDatabase;
-
-       ///Path to the database list file
-    std::string mDatabaseListFile;
-       ///Extension of the database
-    std::string mDatabaseExtension;
-
-    bool mJustStarted;
-
-    int  mFirstDicomDatabaseIconIndex;
-
-   // Previewer
-    vtkImageViewer2* mViewer;
-    
-    int mx1,mx2,my1,my2,mz1,mz2;
-    double mspx,mspy,mspz;
-  
-    // Image preview :
-    // Multi-thread image reader
-    MultiThreadImageReader mReader;
-    // map of images name to node
-    std::map<std::string,DicomNode*> mImageFileNameToNode;
-  */
  
 } // EO namespace creaImageIO
 
index 2fced885b158ecc2844ab93c8bb70ebe10625778..fdf3a5c67ccfd2036071fd683d00f66bb952f8df 100644 (file)
@@ -1084,114 +1084,6 @@ namespace creaImageIO
   }
 
    //================================================================
-  void WxTreeView::SetColor(int l, int item)
-  {
-         int colorId=12;
-         GetCtrl(l)->SetItemTextColour(item, wxColourDatabase().Find
-                  (crea::std2wx(mColorPalette[colorId])));
-         GetCtrl(l)->SetItemState(item,wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED);  /*
-         int colorId=0;
-         //Setting the color according to the parent
-               if(l==0)
-               {
-               item.SetBackgroundColour
-                 (wxColourDatabase().Find
-                  (crea::std2wx(mColorPalette[colorId]))); 
-               mColorMap.insert
-                 (NodeColorPair
-                  (*j,wxColourDatabase().Find
-                   (crea::std2wx(mColorPalette[colorId]))));
-               if(colorId<64)
-                 {
-                   colorId++;
-                 }
-               else
-                       {
-                         colorId=0;
-                       }
-               }
-               else if(l!=mLevelList.size()-1)
-                 {
-                   item.SetBackgroundColour(mColorMap[*i]); 
-                       mColorMap.insert(NodeColorPair(*j,mColorMap[*i]));
-               }
-               else
-               {
-                       item.SetBackgroundColour(mColorMap[*i]); 
-               }*/
-  }
-  //================================================================
-  void WxTreeView::CreateColorPalette()
-  {
-  GimmickDebugMessage(6,"WxTreeView::CreateColorPalette");
-  mColorPalette.push_back("WHITE");
-  mColorPalette.push_back("LIGHT GREY");
-  mColorPalette.push_back("AQUAMARINE");
-  mColorPalette.push_back("MEDIUM FOREST GREEN");
-  mColorPalette.push_back("INDIAN RED");
-  mColorPalette.push_back("KHAKI");
-  mColorPalette.push_back("ORANGE");
-  mColorPalette.push_back("LIGHT BLUE");
-  mColorPalette.push_back("LIGHT STEEL BLUE");
-  mColorPalette.push_back("PINK");
-  mColorPalette.push_back("PLUM");
-  mColorPalette.push_back("PURPLE");
-  mColorPalette.push_back("RED");
-  mColorPalette.push_back("SEA GREEN");
-  mColorPalette.push_back("SIENNA");
-  mColorPalette.push_back("SKY BLUE");
-  mColorPalette.push_back("SLATE BLUE");
-  mColorPalette.push_back("SPRING GREEN");
-  mColorPalette.push_back("TAN");
-  mColorPalette.push_back("THISTLE");
-  mColorPalette.push_back("TURQUOISE");
-  mColorPalette.push_back("VIOLET");
-  mColorPalette.push_back("VIOLET RED");
-  mColorPalette.push_back("WHEAT");
-  mColorPalette.push_back("YELLOW");
-  mColorPalette.push_back("YELLOW GREEN");
-  mColorPalette.push_back("BLUE");
-  mColorPalette.push_back("BLUE VIOLET");
-  mColorPalette.push_back("BROWN");
-  mColorPalette.push_back("CADET BLUE");
-  mColorPalette.push_back("CORAL");
-  mColorPalette.push_back("CORNFLOWER BLUE");
-  mColorPalette.push_back("CYAN");
-  mColorPalette.push_back("DARK GREY");
-  mColorPalette.push_back("DARK GREEN");
-  mColorPalette.push_back("DARK OLIVE GREEN");
-  mColorPalette.push_back("DARK ORCHID");
-  mColorPalette.push_back("DARK SLATE BLUE");
-  mColorPalette.push_back("DARK SLATE GREY");
-  mColorPalette.push_back("DARK TURQUOISE");
-  mColorPalette.push_back("FIREBRICK");
-  mColorPalette.push_back("FOREST GREEN");
-  mColorPalette.push_back("GOLD");
-  mColorPalette.push_back("GOLDENROD");
-  mColorPalette.push_back("GREY");
-  mColorPalette.push_back("GREEN");
-  mColorPalette.push_back("GREEN YELLOW");
-  mColorPalette.push_back("LIME GREEN");
-  mColorPalette.push_back("MAGENTA");
-  mColorPalette.push_back("MAROON");
-  mColorPalette.push_back("MEDIUM AQUAMARINE");
-  mColorPalette.push_back("MEDIUM BLUE");
-  mColorPalette.push_back("MEDIUM GOLDENROD");
-  mColorPalette.push_back("MEDIUM ORCHID");
-  mColorPalette.push_back("MEDIUM SEA GREEN");
-  mColorPalette.push_back("MEDIUM SLATE BLUE");
-  mColorPalette.push_back("MEDIUM SPRING GREEN");
-  mColorPalette.push_back("MEDIUM TURQUOISE");
-  mColorPalette.push_back("MEDIUM VIOLET RED");
-  mColorPalette.push_back("MIDNIGHT BLUE");
-  mColorPalette.push_back("NAVY");
-  mColorPalette.push_back("ORANGE RED");
-  mColorPalette.push_back("ORCHID, PALE GREEN");
-  mColorPalette.push_back("STEEL BLUE");
-  mColorPalette.push_back("BLACK");
-
-
-  }
 
    //================================================================
   void WxTreeView::GetAttributes(std::vector<std::string>& areShown, std::vector<std::string>& notShown, int level)
index b8e75f1baf4f8654f8ae44cb9b12994d42de23b0..126c9410a6aabe86abfa02274f783ad9c7609874 100644 (file)
@@ -130,10 +130,6 @@ namespace creaImageIO
       /// Updates the view of a level given the selected items of upper level
       /// Recursive method
       virtual void RecursiveUpdateLevel( int );
-      ///Sets the color of a selected item
-      void SetColor(int level, int item);
-      ///Creates the color palette for the first level
-      void CreateColorPalette();
       ///Selects all the elements of a level 
       void SelectAll(int level);
       ///UnSelects all the elements of a level