]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirSerie.cxx
- now, DicomDir stuff stakes into account the 'new' structure
[gdcm.git] / src / gdcmDicomDirSerie.cxx
index ecdb07c29ddcd296011de71cf4b276e388f02732..22f4b4d43ef63c539432154fa012416bc8c0b279 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/06/20 18:08:47 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2004/08/26 15:29:52 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -48,7 +48,9 @@ gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT *ptagHT):
  */
 gdcmDicomDirSerie::~gdcmDicomDirSerie() 
 {
-   for(ListDicomDirImage::iterator cc = images.begin();cc != images.end();++cc)
+   for(ListDicomDirImage::iterator cc = images.begin();
+                                   cc != images.end();
+                                   ++cc)
    {
       delete *cc;
    }
@@ -62,28 +64,47 @@ gdcmDicomDirSerie::~gdcmDicomDirSerie()
  */ 
 void gdcmDicomDirSerie::Print(std::ostream &os)
 {
-   os<<"SERIE"<<std::endl;
+   os << "SERIE" << std::endl;
    gdcmObject::Print(os);
 
-   for(ListDicomDirImage::iterator cc = images.begin();cc != images.end();++cc)
+   for(ListDicomDirImage::iterator cc = images.begin();
+                                   cc != images.end();
+                                   ++cc)
    {
-      (*cc)->SetPrintLevel(printLevel);
+      (*cc)->SetPrintLevel(PrintLevel);
       (*cc)->Print(os);
    }
 }
 
 //-----------------------------------------------------------------------------
 // Public
+
 /**
- * \brief   adds a new Image to a partially created DICOMDIR
+ * \brief   Writes the Object
+ * @return
+ */ 
+void gdcmDicomDirSerie::Write(FILE *fp, FileType t)
+{
+   gdcmObject::Write(fp, t);
+
+   for(ListDicomDirImage::iterator cc = images.begin();cc!=images.end();++cc)
+   {
+      (*cc)->Write( fp, t );
+   }
+}
+
+/**
+ * \brief   adds a new Image (with the basic elements) to a partially created DICOMDIR
  */
-gdcmDicomDirImage * gdcmDicomDirSerie::NewImage(void) {
-   std::list<gdcmElement> elemList;   
-   elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements();
-      
-   gdcmDicomDirImage *st = new gdcmDicomDirImage(ptagHT);
+gdcmDicomDirImage * gdcmDicomDirSerie::NewImage()
+{
+   std::list<gdcmElement> elemList = 
+      gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements();
+
+   gdcmDicomDirImage *st = new gdcmDicomDirImage(PtagHT);
    FillObject(elemList);
    images.push_front(st);
+
    return st;   
 } 
 //-----------------------------------------------------------------------------