X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSeqEntry.cxx;h=615863efca6b641a4438396a97bb3b5d27d349a4;hb=197dc522382e753249bcb2a75e22f61bd6d589b4;hp=815031811b443b9c86dc3c2ad1d7ac1cfb3fc919;hpb=d5ebba38c596bd5a0514fc9e08fe8ac2a45482f5;p=gdcm.git diff --git a/src/gdcmSeqEntry.cxx b/src/gdcmSeqEntry.cxx index 81503181..615863ef 100644 --- a/src/gdcmSeqEntry.cxx +++ b/src/gdcmSeqEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSeqEntry.cxx,v $ Language: C++ - Date: $Date: 2005/02/11 15:22:18 $ - Version: $Revision: 1.55 $ + Date: $Date: 2005/10/25 14:52:35 $ + Version: $Revision: 1.60 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -18,7 +18,6 @@ #include "gdcmSeqEntry.h" #include "gdcmSQItem.h" -#include "gdcmValEntry.h" #include "gdcmTS.h" #include "gdcmGlobal.h" #include "gdcmUtil.h" @@ -117,6 +116,7 @@ void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber) // Or we can add (or remove) anywhere, and SQItemNumber will be broken sqItem->SetSQItemNumber(itemNumber); Items.push_back(sqItem); + sqItem->Register(); } /** @@ -126,11 +126,11 @@ void SeqEntry::ClearSQItem() { for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc) { - delete *cc; + (*cc)->Unregister(); } if (SeqTerm) { - delete SeqTerm; + SeqTerm->Unregister(); } } @@ -196,6 +196,22 @@ unsigned int SeqEntry::GetNumberOfSQItems() return Items.size(); } +/** + * \brief Sets the Sequence Delimitation Item + * \param e Delimitation item + */ +void SeqEntry::SetDelimitationItem(DocEntry *e) +{ + if( SeqTerm != e ) + { + if( SeqTerm ) + SeqTerm->Unregister(); + SeqTerm = e; + if( SeqTerm ) + SeqTerm->Register(); + } +} + //----------------------------------------------------------------------------- // Protected @@ -228,10 +244,12 @@ void SeqEntry::Print( std::ostream &os, std::string const & ) // at end, print the sequence terminator item, if any if (DelimitorMode) { - for ( int i = 0; i < SQDepthLevel; i++ ) - { + int i; + for ( i = 0; i < SQDepthLevel; i++ ) + os << " | " ; + os << " --- " << std::endl; + for ( i = 0; i < SQDepthLevel; i++ ) os << " | " ; - } if (SeqTerm != NULL) { SeqTerm->SetPrintLevel(PrintLevel);