Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:53 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2005/02/01 10:29:56 $
+ Version: $Revision: 1.52 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
-
//-----------------------------------------------------------------------------
// Constructor / Destructor
/**
}
}
-//-----------------------------------------------------------------------------
-// Print
-/**
- * \brief canonical Printer
- */
-void SeqEntry::Print( std::ostream &os, std::string const & )
-{
- // First, Print the Dicom Element itself.
- os << "S ";
- DocEntry::Print(os);
- os << std::endl;
-
- if (GetReadLength() == 0)
- return;
-
- // Then, Print each SQ Item
- for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
- {
- (*cc)->SetPrintLevel(PrintLevel);
- (*cc)->Print(os);
- }
-
- // at end, print the sequence terminator item, if any
- if (DelimitorMode)
- {
- for ( int i = 0; i < SQDepthLevel; i++ )
- {
- os << " | " ;
- }
- if (SeqTerm != NULL)
- {
- SeqTerm->SetPrintLevel(PrintLevel);
- SeqTerm->Print(os);
- os << std::endl;
- }
- else
- {
- // fuse
- gdcmVerboseMacro(" -------- should have a sequence terminator item");
- }
- }
-}
-
//-----------------------------------------------------------------------------
// Public
/*
/**
* \brief return a pointer to the SQItem referenced by its ordinal number.
* Returns the first item when argument is negative.
- * Returns the last item when argument is bigger than the total
+ * Returns the last item when argument is bigger than the total
* item number.
*/
SQItem *SeqEntry::GetSQItem(int nb)
return *(Items.end());
}
-/// \brief retuens the number of SQItems within the current Sequence
+/**
+ * \brief returns the number of SQItems within the current Sequence
+ */
unsigned int SeqEntry::GetNumberOfSQItems()
{
return Items.size();
}
-/// \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
+/**
+ * \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
+ * @param sqItem SQItem to be pushed back in the SeqEntry
+ * @param itemNumber ordinal number of the SQItem
+ * \note NOT end-user intendend method !
+ */
void SeqEntry::AddSQItem(SQItem *sqItem, int itemNumber)
{
+// FIXME : SQItemNumber is supposed to be the ordinal number of the SQItem
+// within the Sequence.
+// Either only 'push_back' is allowed,
+// and we just have to do something like SeqEntry::lastNb++
+// Or we can add (or remove) anywhere, and SQItemNumber will be broken
sqItem->SetSQItemNumber(itemNumber);
Items.push_back(sqItem);
}
// Private
//-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Print
+/**
+ * \brief canonical Printer
+ */
+void SeqEntry::Print( std::ostream &os, std::string const & )
+{
+ // First, Print the Dicom Element itself.
+ os << "S ";
+ DocEntry::Print(os);
+ os << std::endl;
+ if (GetReadLength() == 0)
+ return;
+
+ // Then, Print each SQ Item
+ for(ListSQItem::iterator cc = Items.begin(); cc != Items.end(); ++cc)
+ {
+ (*cc)->SetPrintLevel(PrintLevel);
+ (*cc)->Print(os);
+ }
+
+ // at end, print the sequence terminator item, if any
+ if (DelimitorMode)
+ {
+ for ( int i = 0; i < SQDepthLevel; i++ )
+ {
+ os << " | " ;
+ }
+ if (SeqTerm != NULL)
+ {
+ SeqTerm->SetPrintLevel(PrintLevel);
+ SeqTerm->Print(os);
+ os << std::endl;
+ }
+ else
+ {
+ // fuse
+ gdcmVerboseMacro(" -------- should have a sequence terminator item");
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm