]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDirSerie.cxx
Cosmetic modifs to be more Coding style compliant
[gdcm.git] / src / gdcmDicomDirSerie.cxx
index f632168cee5452aef7c872b6755a2bb3fac99fdc..f9e2d6309da29b7445ff64faae578998542d0aad 100644 (file)
@@ -1,5 +1,21 @@
-// gdcmDicomDirSerie.cxx
-//-----------------------------------------------------------------------------
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmDicomDirSerie.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/09/24 11:39:21 $
+  Version:   $Revision: 1.15 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+
 #include "gdcmDicomDirSerie.h"
 #include "gdcmDicomDirElement.h"
 #include "gdcmGlobal.h"
 /**
  * \brief  Constructor 
  * @param  s  SQ Item holding the elements related to this "SERIE" part
- * @param ptagHT pointer to the HTable (gdcmObject needs it 
+ * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it 
  *               to build the gdcmDocEntries)
  */
-gdcmDicomDirSerie::gdcmDicomDirSerie(gdcmSQItem *s, TagDocEntryHT *ptagHT):
-   gdcmObject(ptagHT)
+gdcmDicomDirSerie::gdcmDicomDirSerie(gdcmSQItem* s, TagDocEntryHT* ptagHT):
+   gdcmDicomDirObject(ptagHT)
 {
    docEntries = s->GetDocEntries();
 }
-gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT *ptagHT):
-   gdcmObject(ptagHT)
+
+/**
+ * \brief  Constructor 
+ * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it 
+ *               to build the gdcmDocEntries)
+ */
+gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT* ptagHT):
+   gdcmDicomDirObject(ptagHT)
 {
 }
 /**
@@ -26,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;
    }
@@ -38,30 +62,49 @@ gdcmDicomDirSerie::~gdcmDicomDirSerie()
  * \brief   Prints the Object
  * @return
  */ 
-void gdcmDicomDirSerie::Print(std::ostream &os)
+void gdcmDicomDirSerie::Print(std::ostreamos)
 {
-   os<<"SERIE"<<std::endl;
-   gdcmObject::Print(os);
+   os << "SERIE" << std::endl;
+   gdcmDicomDirObject::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   Writes the Object
+ * @return
+ */ 
+void gdcmDicomDirSerie::Write(FILE* fp, FileType t)
+{
+   gdcmDicomDirObject::Write(fp, t);
+
+   for(ListDicomDirImage::iterator cc = images.begin();cc!=images.end();++cc)
+   {
+      (*cc)->Write( fp, t );
+   }
+}
+
 /**
- * \brief   adds a new Image to a partially created DICOMDIR
+ * \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;   
 } 
 //-----------------------------------------------------------------------------