X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSQItem.cxx;h=c0d3b27d2925525ab203f655f1cc6d431e07816e;hb=4378b05ce0f0ed0b89492e65bfa6d1db57fca4f7;hp=7316a268b2f8e512c849281b91e9af3aeb295a40;hpb=95e43356511d138225d8f718f632b3e7a8fcc106;p=gdcm.git diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index 7316a268..c0d3b27d 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/05 01:37:09 $ - Version: $Revision: 1.69 $ + Date: $Date: 2005/07/06 08:43:18 $ + Version: $Revision: 1.73 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -103,6 +103,7 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype) * \brief Inserts *in the right place* any Entry (Dicom Element) * into the Sequence Item * @param entry Entry to add + * @return always true */ bool SQItem::AddEntry(DocEntry *entry) { @@ -147,7 +148,7 @@ bool SQItem::RemoveEntry( DocEntry *entryToRemove ) it != DocEntries.end(); ++it) { - if( *it == entryToRemove ) + if ( *it == entryToRemove ) { DocEntries.erase(it); gdcmWarningMacro( "One element erased: " << entryToRemove->GetKey() ); @@ -170,10 +171,10 @@ bool SQItem::RemoveEntryNoDestroy(DocEntry *entryToRemove) it != DocEntries.end(); ++it) { - if( *it == entryToRemove ) + if ( *it == entryToRemove ) { DocEntries.erase(it); - gdcmWarningMacro( "One element erased, no destroyed: " + gdcmWarningMacro( "One element removed, no destroyed: " << entryToRemove->GetKey() ); return true; } @@ -204,7 +205,7 @@ void SQItem::ClearEntry() DocEntry *SQItem::GetFirstEntry() { ItDocEntries = DocEntries.begin(); - if( ItDocEntries != DocEntries.end() ) + if ( ItDocEntries != DocEntries.end() ) return *ItDocEntries; return 0; } @@ -216,47 +217,11 @@ DocEntry *SQItem::GetFirstEntry() DocEntry *SQItem::GetNextEntry() { ++ItDocEntries; - if( ItDocEntries != DocEntries.end() ) + if ( ItDocEntries != DocEntries.end() ) return *ItDocEntries; 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