]> Creatis software - gdcm.git/blob - src/gdcmObject.h
Zilch.
[gdcm.git] / src / gdcmObject.h
1 // gdcmObject.h
2 //-----------------------------------------------------------------------------
3 #ifndef GDCMOBJECT_H
4 #define GDCMOBJECT_H
5
6 #include <string>
7 #include <list>
8 #include "gdcmCommon.h"
9 #include "gdcmHeaderEntry.h"
10 #include "gdcmParser.h"
11 #include "gdcmDicomDirElement.h"
12 //-----------------------------------------------------------------------------
13 class gdcmObject;
14 typedef std::list<gdcmObject *> ListContent;
15
16 //-----------------------------------------------------------------------------
17 class GDCM_EXPORT gdcmObject 
18 {
19 public:
20    /**
21     * \ingroup gdcmParser
22     * \brief   Sets the print level for the Dicom Header 
23     * \note    0 for Light Print; 1 for 'medium' Print, 2 for Heavy
24     */
25    void SetPrintLevel(int level) 
26       { printLevel = level; };
27    virtual void Print(std::ostream &os = std::cout);
28
29    std::string GetEntryByNumber(guint16 group, guint16 element);
30    std::string GetEntryByName(TagName name);
31    bool SetEntryByNumber(std::string val,guint16 group,guint16 element);
32    
33    TagHeaderEntryHT GetEntry(void);
34    ListTag GetListEntry(void);
35    
36    void ResetBoundaries(int flag);
37 /**
38  * \ingroup gdcmObject
39  * \brief   returns an iterator on the first Header Entry (i.e Dicom Element),
40  *          inside the DICOMDIR chained list,
41  *          related to this 'Object' 
42  * @return
43  */
44    ListTag::iterator debut(void) 
45       { return(beginObj);}
46 /**
47  * \ingroup gdcmObject
48  * \brief   returns an iterator on the last Header Entry (i.e Dicom Element),
49  *          inside the DICOMDIR chained list,
50  *          related to this 'Object' 
51  * @return
52  */
53     ListTag::iterator fin  (void) 
54        { return(endObj);  }
55
56 protected:
57  // constructor and destructor are protected to avoid end user to instanciate this class.
58    gdcmObject(ListTag::iterator begin,ListTag::iterator end,
59               TagHeaderEntryHT *ptagHT, ListTag *plistEntries); 
60    ~gdcmObject(void);
61
62
63    void FillObject(std::list<gdcmElement> elemList);
64
65 /**
66 * \brief iterator on the first Header Entry (i.e Dicom Element), 
67 *       inside the DICOMDIR chained list,
68 *       related to this 'Object'
69 */   
70    ListTag::iterator beginObj;
71 /**
72 * \brief iterator on the last Header Entry (i.e Dicom Element), 
73 *       inside the DICOMDIR chained list,
74 *       related to this 'Object'
75 */
76    ListTag::iterator endObj;
77 /**
78 * \brief pointer to the HTable of the gdcmParser,
79 *        (because we don't know it within any gdcmObject) 
80 */
81   TagHeaderEntryHT *ptagHT;
82 /**
83 * \brief pointer to the Chained List of the gdcmParser,
84 *        (because we don't know it within any gdcmObject)  
85 */  
86    ListTag *plistEntries;
87 /**
88 * \brief detail level to be printed
89 */   
90    int printLevel;
91    
92 /// used to pass variables to FillObject function
93 /// Works as 'global' variable
94 /**
95 * \brief used to pass variables to FillObject function
96 *        Works as 'global' variable
97 */   std::list<gdcmHeaderEntry *>::iterator debInsertion, finInsertion, i,j;
98
99 private:
100
101 };
102
103 //-----------------------------------------------------------------------------
104 #endif