X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSQItem.cxx;h=1b46a482946cdb1a6ae49a1c2f78d21b90d7270c;hb=0f8bcdd7eb7538bda5c38c4587c0ae54cb0c3693;hp=e6b4e1c9cf145dd40fac7e17992e80063d91d2cd;hpb=5b89bede4607999aeb8d5b45311e7ee82f9471ef;p=gdcm.git diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index e6b4e1c9..1b46a482 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2005/02/02 16:18:48 $ - Version: $Revision: 1.66 $ + Date: $Date: 2005/02/04 14:49:01 $ + Version: $Revision: 1.67 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -210,7 +210,7 @@ DocEntry *SQItem::GetFirstEntry() } /** - * \brief Get the next Dicom entry while visiting the chained list + * \brief Get the next Dicom entry while visiting the SQItem * \return The next DocEntry if found, otherwhise NULL */ DocEntry *SQItem::GetNextEntry() @@ -221,6 +221,42 @@ DocEntry *SQItem::GetNextEntry() return NULL; } +/** + * \brief Get the first ValEntry while visiting theSQItem + * This method is designed for Python users + * \return The first ValEntry if found, otherwhise NULL + */ +ValEntry *SQItem::GetFirstValEntry() +{ + gdcm::ValEntry *valEntry; + gdcm::DocEntry *d = GetFirstEntry(); + // an other iterator is needed to allow user iterate + // at the same time both on DocEntries and ValEntries + ItValEntries = ItDocEntries; + if ( valEntry = dynamic_cast(d)) + return valEntry; + return GetNextValEntry(); +} + +/** + * \brief Get the next ValEntry while visiting the SQItem + * \return The next ValEntry if found, otherwhise NULL + */ +ValEntry *SQItem::GetNextValEntry() +{ + gdcm::ValEntry *valEntry; + gdcm::DocEntry *d = *ItValEntries; + ++ItValEntries; + while( d ) + { + if ( valEntry = dynamic_cast(d)) + return valEntry; + else + return GetNextValEntry(); + } + return 0; +} + /** * \brief Gets a Dicom Element inside a SQ Item Entry * @param group Group number of the Entry