X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSQItem.cxx;h=f4f2a7664fe9e3a55cc50ada77a7da50a7a84011;hb=aabc92e9dcb866de68efd216d75ad197fe78aee9;hp=d5f11db52aa93f8046a37c2e647b9c076af403ce;hpb=a585fafed1e72e092c6a1942c8692991c1688e7f;p=gdcm.git diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index d5f11db5..f4f2a766 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/11/21 09:46:27 $ - Version: $Revision: 1.80 $ + Date: $Date: 2006/02/16 20:06:15 $ + Version: $Revision: 1.84 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -58,7 +58,7 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype) { int j; uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff }; - uint16_t itemt[4]= { 0xfffe, 0xe00d, 0xffff, 0xffff }; + uint16_t itemt[4]= { 0xfffe, 0xe00d, 0x0000, 0x0000 }; //we force the writting of an 'Item' Start Element // because we want to write the Item as a 'No Length' item @@ -95,7 +95,7 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype) // because we wrote the Item as a 'no Length' item for(j=0;j<4;++j) { - binary_write( *fp, itemt[j]); // fffe e000 ffff ffff + binary_write( *fp, itemt[j]); // fffe e000 0000 0000 } } @@ -157,7 +157,6 @@ bool SQItem::AddEntry(DocEntry *entry) ++it; insertSpot = it; - //++insertSpot; // ?!? DocEntries.insert(insertSpot, entry); entry->Register(); return true; @@ -200,15 +199,6 @@ void SQItem::ClearEntry() DocEntries.clear(); } -/** - * \brief Move all the entries from a given Sequence Item - */ -void SQItem::MoveObject(SQItem *source) -{ - DocEntries = source->DocEntries; - source->DocEntries.clear(); -} - /** * \brief Get the first Dicom entry while visiting the SQItem * \return The first DocEntry if found, otherwhise 0 @@ -251,6 +241,30 @@ DocEntry *SQItem::GetDocEntry(uint16_t group, uint16_t elem) return NULL; } +/** + * \brief Copies all the attributes from an other DocEntrySet + * @param set entry to copy from + * @remarks The contained DocEntries a not copied, only referenced + */ +void SQItem::Copy(DocEntrySet *set) +{ + // Remove all previous entries + ClearEntry(); + + DocEntrySet::Copy(set); + + SQItem *sq = dynamic_cast(set); + if( sq ) + { + SQDepthLevel = sq->SQDepthLevel; + SQItemNumber = sq->SQItemNumber; + + DocEntries = sq->DocEntries; + for(ItDocEntries = DocEntries.begin();ItDocEntries != DocEntries.end();++ItDocEntries) + (*ItDocEntries)->Register(); + } +} + //----------------------------------------------------------------------------- // Protected