]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirPatient.h
We are no longer cheated by Elem belonging to group 0x0002,
[gdcm.git] / src / gdcmDicomDirPatient.h
index e1cc299e7f70490e997cfa716f50dc3701ca1da6..9b6dfaa9a6c135492bcde140caa0f4e23aef611c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/17 10:59:52 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2007/07/26 08:36:49 $
+  Version:   $Revision: 1.32 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -21,7 +21,7 @@
 
 #include "gdcmDicomDirObject.h"
 
-namespace gdcm 
+namespace GDCM_NAME_SPACE 
 {
 class DicomDirStudy;
 
@@ -35,34 +35,36 @@ typedef std::list<DicomDirStudy*> ListDicomDirStudy;
 
 class GDCM_EXPORT DicomDirPatient : public DicomDirObject 
 {
-public:
-   DicomDirPatient(); 
-   ~DicomDirPatient();
+   gdcmTypeMacro(DicomDirPatient);
 
-   void Print(std::ostream &os = std::cout, std::string const & indent = "" );
-   void WriteContent(std::ofstream *fp, FileType t);
+public:
+/// \brief Constructs a DicomDirPatient with a RefCounter
+   static DicomDirPatient *New(bool empty=false) {return new DicomDirPatient(empty);}
 
-    // TODO Remove GetDicomDirStudies
-    // use InitTraversal + GetNextEntry instead.
+   void Print(std::ostream &os = std::cout, std::string const &indent = "" );
+   void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements);
   
-   /// Returns the STUDY chained List for this PATIENT.
-   ListDicomDirStudy const &GetDicomDirStudies() const { return Studies; };
+   // Patient methods
+   /// \brief Adds a new gdcmDicomDirStudy to the Patient
+   void AddStudy(DicomDirStudy *obj) { Studies.push_back(obj); }
+   DicomDirStudy *NewStudy(); 
+   void ClearStudy();
 
-   // should avoid exposing internal mechanism
-   void InitTraversal();
-   DicomDirStudy *GetNextEntry();
+   DicomDirStudy *GetFirstStudy();
+   DicomDirStudy *GetNextStudy();
+   DicomDirStudy *GetLastStudy();
 
-   /// adds the passed STUDY to the STUDY chained List for this PATIENT.
-   void AddDicomDirStudy (DicomDirStudy *obj) { Studies.push_back(obj); };
+   virtual void Copy(DocEntrySet *set);
 
-   DicomDirStudy *NewStudy(); 
-         
-private:
+protected:
+   DicomDirPatient(bool empty=false); 
+   ~DicomDirPatient();
 
-   /// chained list of DicomDirStudy  (to be exploited recursively)
+private:
+   /// chained list of DicomDirStudy  (to be exploited hierarchicaly)
    ListDicomDirStudy Studies;
    /// iterator on the DicomDirStudies of the current DicomDirPatient
-   ListDicomDirStudy::iterator ItDicomDirStudy;
+   ListDicomDirStudy::iterator ItStudy;
 };
 } // end namespace gdcm