]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirStudy.cxx
* Add the Copy method in all datas
[gdcm.git] / src / gdcmDicomDirStudy.cxx
index b907e6983291b013b170765d75ebbe942ac62186..66c29bcb5bd250865b76f60803d849769341fcdf 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/25 14:52:33 $
-  Version:   $Revision: 1.41 $
+  Date:      $Date: 2005/11/29 12:48:46 $
+  Version:   $Revision: 1.42 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -213,6 +213,32 @@ DicomDirVisit *DicomDirStudy::GetLastVisit()
    return NULL;
 }
 
+/**
+ * \brief Copies all the attributes from an other DocEntrySet 
+ * @param set entry to copy from
+ * @remarks The contained DocEntries a not copied, only referenced
+ */
+void DicomDirStudy::Copy(DocEntrySet *set)
+{
+   // Remove all previous childs
+   ClearSerie();
+   ClearVisit();
+
+   DicomDirObject::Copy(set);
+
+   DicomDirStudy *ddEntry = dynamic_cast<DicomDirStudy *>(set);
+   if( ddEntry )
+   {
+      Series = ddEntry->Series;
+      for(ItSerie = Series.begin();ItSerie != Series.end();++ItSerie)
+         (*ItSerie)->Register();
+
+      Visits = ddEntry->Visits;
+      for(ItVisit = Visits.begin();ItVisit != Visits.end();++ItVisit)
+         (*ItVisit)->Register();
+   }
+}
+
 //-----------------------------------------------------------------------------
 // Protected