2 //-----------------------------------------------------------------------------
4 #include "gdcmSeqEntry.h"
5 #include "gdcmSQItem.h"
7 #include "gdcmGlobal.h"
12 //-----------------------------------------------------------------------------
13 // Constructor / Destructor
15 * \ingroup gdcmSeqEntry
16 * \brief Constructor from a given gdcmSeqEntry
18 gdcmSeqEntry::gdcmSeqEntry(gdcmDictEntry* e)
21 //ListSQItem items est un *champ* de gdcmSeqEntry.
22 // inutile de faire new ?
27 * \ingroup gdcmSeqEntry
28 * \brief Canonical destructor.
30 gdcmSeqEntry::~gdcmSeqEntry() {
31 for(ListSQItem::iterator cc = items.begin();cc != items.end();++cc)
37 //-----------------------------------------------------------------------------
40 * \ingroup gdcmSeqEntry
41 * \brief canonical Printer
43 void gdcmSeqEntry::Print(std::ostream &os){
47 unsigned short int g, e;
50 char greltag[10]; //group element tag
53 // First, Print the Dicom Element itself.
58 sprintf(greltag,"%04x|%04x ",g,e);
60 if (GetPrintLevel()>=2) {
62 lgth = GetReadLength(); // ReadLength, as opposed to UsableLength
63 if (lgth == 0xffffffff) {
64 sprintf(st,"x(ffff)"); // I said : "x(ffff)" !
65 s.setf(std::ios::left);
66 s << std::setw(10-strlen(st)) << " ";
68 s.setf(std::ios::left);
69 s << std::setw(8) << "-1";
71 sprintf(st,"x(%x)",lgth);
72 s.setf(std::ios::left);
73 s << std::setw(10-strlen(st)) << " ";
75 s.setf(std::ios::left);
76 s << std::setw(8) << lgth;
79 sprintf(st,"x(%x)",o);
80 s << std::setw(10-strlen(st)) << " ";
82 s << std::setw(8) << o;
85 s << "[" << vr << "] ";
86 if (GetPrintLevel()>=1) {
87 s.setf(std::ios::left);
88 s << std::setw(66-GetName().length()) << " ";
91 s << "[" << GetName()<< "]";
95 // Then, Print each SQ Item
96 for(ListSQItem::iterator cc = items.begin();cc != items.end();++cc)
98 //(*cc)->SetPrintLevel(GetPrintLevel()); aurait-ce un sens ?
104 //-----------------------------------------------------------------------------
107 /// \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
108 void gdcmSeqEntry::AddEntry(gdcmSQItem *sqItem) {
109 items.push_back(sqItem);
111 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
117 // end-user intended : the guy *wants* to create his own SeQuence ?!?
118 gdcmDocEntry *gdcmSeqEntry::NewDocEntryByNumber(guint16 group,
125 gdcmDocEntry *gdcmSeqEntry::NewDocEntryByName (std::string Name) {
130 //-----------------------------------------------------------------------------