X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRLEFramesInfo.cxx;h=ba65b834c394c5b340d13358cd478e0c498be9b6;hb=dd9001df5c1b8d5be917f635a6316aa4f0869af7;hp=0c3d1ba397a97bb32e5cd0d41b34d0c84098353c;hpb=64f79e8efbfae49231d1f469aa4fcc4acf0da70c;p=gdcm.git diff --git a/src/gdcmRLEFramesInfo.cxx b/src/gdcmRLEFramesInfo.cxx index 0c3d1ba3..ba65b834 100644 --- a/src/gdcmRLEFramesInfo.cxx +++ b/src/gdcmRLEFramesInfo.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRLEFramesInfo.cxx,v $ Language: C++ - Date: $Date: 2004/10/06 09:58:08 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/01/28 15:42:22 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -17,8 +17,12 @@ =========================================================================*/ #include "gdcmRLEFramesInfo.h" +#include "gdcmDebug.h" -gdcmRLEFramesInfo::~gdcmRLEFramesInfo() +namespace gdcm +{ + +RLEFramesInfo::~RLEFramesInfo() { for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) { @@ -26,3 +30,52 @@ gdcmRLEFramesInfo::~gdcmRLEFramesInfo() } Frames.clear(); } + +/** + * \brief Print self. + * @param indent Indentation string to be prepended during printing. + * @param os Stream to print to. + */ +void RLEFramesInfo::Print( std::ostream &os, std::string indent ) +{ + os << std::endl; + os << indent + << "----------------- RLE frames --------------------------------" + << std::endl; + os << indent + << "Total number of Frames : " << Frames.size() + << std::endl; + int frameNumber = 0; + for(RLEFrameList::iterator it = Frames.begin(); it != Frames.end(); ++it) + { + os << indent + << " frame number :" << frameNumber++ + << std::endl; + (*it)->Print( os, indent + " " ); + } +} + +void RLEFramesInfo::AddFrame(RLEFrame *frame) +{ + Frames.push_back(frame); +} + +RLEFrame *RLEFramesInfo::GetFirstFrame() +{ + ItFrames = Frames.begin(); + if (ItFrames != Frames.end()) + return *ItFrames; + return NULL; +} + +RLEFrame *RLEFramesInfo::GetNexttFrame() +{ + gdcmAssertMacro (ItFrames != Frames.end()); + + ++ItFrames; + if (ItFrames != Frames.end()) + return *ItFrames; + return NULL; +} + +} // end namespace gdcm