]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirSerie.cxx
* Some classes inherit now from gdcm::RefCounter
[gdcm.git] / src / gdcmDicomDirSerie.cxx
index 7dfcfdfddcc44d3638054109c8ddc6fe41183721..090dac646c530056d5274e317a7289760e887254 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/28 17:01:29 $
-  Version:   $Revision: 1.36 $
+  Date:      $Date: 2005/10/25 14:52:33 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -24,7 +24,6 @@
 
 namespace gdcm 
 {
-
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
 /**
@@ -34,7 +33,7 @@ namespace gdcm
 DicomDirSerie::DicomDirSerie(bool empty):
    DicomDirObject()
 {
-   if( !empty )
+   if ( !empty )
    {
       ListDicomDirSerieElem const &elemList = 
          Global::GetDicomDirElements()->GetDicomDirSerieElements();   
@@ -50,27 +49,6 @@ DicomDirSerie::~DicomDirSerie()
    ClearImage();
 }
 
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief   Prints the Object
- * @param os ostream to write to
- * @param indent Indentation string to be prepended during printing
- */ 
-void DicomDirSerie::Print(std::ostream &os, std::string const &)
-{
-   os << "SERIE" << std::endl;
-   DicomDirObject::Print(os);
-
-   for(ListDicomDirImage::iterator cc = Images.begin();
-                                   cc != Images.end();
-                                   ++cc)
-   {
-      (*cc)->SetPrintLevel(PrintLevel);
-      (*cc)->Print(os);
-   }
-}
-
 //-----------------------------------------------------------------------------
 // Public
 /**
@@ -96,9 +74,9 @@ void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t)
  */
 DicomDirImage *DicomDirSerie::NewImage()
 {
-   DicomDirImage *st = new DicomDirImage();
-   Images.push_back(st);
-   return st;   
+   DicomDirImage *dd = DicomDirImage::New();
+   Images.push_back(dd);
+   return dd;   
 }
 
 /**
@@ -110,7 +88,7 @@ void DicomDirSerie::ClearImage()
                                    cc != Images.end();
                                    ++cc)
    {
-      delete *cc;
+      (*cc)->Delete();
    }
    Images.clear();
 }
@@ -149,6 +127,25 @@ DicomDirImage *DicomDirSerie::GetNextImage()
 // Private
 
 //-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief   Prints the Object
+ * @param os ostream to write to
+ * @param indent Indentation string to be prepended during printing
+ */ 
+void DicomDirSerie::Print(std::ostream &os, std::string const &)
+{
+   os << "SERIE" << std::endl;
+   DicomDirObject::Print(os);
 
+   for(ListDicomDirImage::iterator cc = Images.begin();
+                                   cc != Images.end();
+                                   ++cc)
+   {
+      (*cc)->SetPrintLevel(PrintLevel);
+      (*cc)->Print(os);
+   }
+}
 
+//-----------------------------------------------------------------------------
+} // end namespace gdcm