X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDicomDirPatient.cxx;h=73680f8051df592defd78eac10bae7c8e14198f7;hb=82afaad85d04083d5d7945e2a70a79a720a9ba3a;hp=ea7d00fc7d7c13dd0686ed64e37b5625048f48cd;hpb=1ce6ae86daabc8b64c9309acce4ecf137ee79f07;p=gdcm.git diff --git a/src/gdcmDicomDirPatient.cxx b/src/gdcmDicomDirPatient.cxx index ea7d00fc..73680f80 100644 --- a/src/gdcmDicomDirPatient.cxx +++ b/src/gdcmDicomDirPatient.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirPatient.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 12:19:33 $ - Version: $Revision: 1.35 $ + 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 @@ -25,17 +25,16 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor /** * \brief Constructor * \note End user must use : DicomDir::NewPatient() */ -DicomDirPatient::DicomDirPatient(bool empty): - DicomDirObject() +DicomDirPatient::DicomDirPatient(bool empty) + :DicomDirObject() { - if( !empty ) + if ( !empty ) { ListDicomDirStudyElem const &elemList = Global::GetDicomDirElements()->GetDicomDirPatientElements(); @@ -51,27 +50,6 @@ DicomDirPatient::~DicomDirPatient() ClearStudy(); } -//----------------------------------------------------------------------------- -// Print -/** - * \brief Prints the Object - * @param os ostream to write to - * @param indent Indentation string to be prepended during printing - */ -void DicomDirPatient::Print(std::ostream &os, std::string const & ) -{ - os << "PATIENT" << std::endl; - DicomDirObject::Print(os); - - for(ListDicomDirStudy::const_iterator cc = Studies.begin(); - cc != Studies.end(); - ++cc ) - { - (*cc)->SetPrintLevel(PrintLevel); - (*cc)->Print(os); - } -} - //----------------------------------------------------------------------------- // Public /** @@ -97,9 +75,9 @@ void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t) */ DicomDirStudy* DicomDirPatient::NewStudy() { - DicomDirStudy *st = new DicomDirStudy(); - Studies.push_back(st); - return st; + DicomDirStudy *dd = DicomDirStudy::New(); + Studies.push_back(dd); + return dd; } /** @@ -111,7 +89,7 @@ void DicomDirPatient::ClearStudy() cc != Studies.end(); ++cc ) { - delete *cc; + (*cc)->Delete(); } Studies.clear(); } @@ -164,5 +142,26 @@ DicomDirStudy *DicomDirPatient::GetLastStudy() //----------------------------------------------------------------------------- // Private +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints the Object + * @param os ostream to write to + * @param indent Indentation string to be prepended during printing + */ +void DicomDirPatient::Print(std::ostream &os, std::string const & ) +{ + os << "PATIENT" << std::endl; + DicomDirObject::Print(os); + + for(ListDicomDirStudy::const_iterator cc = Studies.begin(); + cc != Studies.end(); + ++cc ) + { + (*cc)->SetPrintLevel(PrintLevel); + (*cc)->Print(os); + } +} + //----------------------------------------------------------------------------- } // end namespace gdcm