]> Creatis software - gdcm.git/blob - src/gdcmObject.h
f482355324f973daedafdc784a1239f931c51575
[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    gdcmObject(ListTag::iterator begin,ListTag::iterator end,
21               TagHeaderEntryHT *ptagHT, ListTag *plistEntries); 
22    ~gdcmObject(void);
23
24    /**
25     * \ingroup gdcmParser
26     * \brief   Sets the print level for the Dicom Header 
27     * \note    0 for Light Print; 1 for 'medium' Print, 2 for Heavy
28     */
29    void SetPrintLevel(int level) 
30       { printLevel = level; };
31    virtual void Print(std::ostream &os = std::cout);
32
33    std::string GetEntryByNumber(guint16 group, guint16 element);
34    std::string GetEntryByName(TagName name);
35    bool SetEntryByNumber(std::string val,guint16 group,guint16 element);
36    
37    TagHeaderEntryHT GetEntry(void);
38    ListTag GetListEntry(void);
39    
40    void ResetBoundaries(int flag);
41 /**
42  * \ingroup gdcmObject
43  * \brief   returns an iterator on the first Header Entry (i.e Dicom Element),
44  *          inside the DICOMDIR chained list,
45  *          related to this 'Object' 
46  * @return
47  */
48    ListTag::iterator debut(void) 
49       { return(beginObj);}
50 /**
51  * \ingroup gdcmObject
52  * \brief   returns an iterator on the last Header Entry (i.e Dicom Element),
53  *          inside the DICOMDIR chained list,
54  *          related to this 'Object' 
55  * @return
56  */
57     ListTag::iterator fin  (void) 
58        { return(endObj);  }
59
60 /**
61  * \ingroup gdcmObject
62  * \brief   Sets the iterator on the 'new' last Header Entry (i.e Dicom Element),
63  *          inside the DICOMDIR chained list,
64  *          related to this 'Object' 
65  * \warning : NOT end user intended function
66  * \todo find a trick to make this function useless.
67 * @return
68  */
69     ListTag::iterator SetEndObj(ListTag::iterator newEnd) 
70        { endObj=newEnd;  }       
71    
72 protected:
73
74 void FillObject(std::list<gdcmElement> elemList);
75
76 /**
77 * \brief iterator on the first Header Entry (i.e Dicom Element), 
78 *       inside the DICOMDIR chained list,
79 *       related to this 'Object'
80 */   
81    ListTag::iterator beginObj;
82 /**
83 * \brief iterator on the last Header Entry (i.e Dicom Element), 
84 *       inside the DICOMDIR chained list,
85 *       related to this 'Object'
86 */
87    ListTag::iterator endObj;
88 /**
89 * \brief pointer to the HTable of the gdcmParser,
90 *        (because we don't know it within any gdcmObject) 
91 */
92   TagHeaderEntryHT *ptagHT;
93 /**
94 * \brief pointer to the Chained List of the gdcmParser,
95 *        (because we don't know it within any gdcmObject)  
96 */  
97    ListTag *plistEntries;
98 /**
99 * \brief
100 */   
101    int printLevel;
102    
103 /// used to pass variables to FillObject function
104 /// Work as 'global' variables
105    std::list<gdcmHeaderEntry *>::iterator debInsertion, finInsertion, i,j;
106
107 private:
108
109 };
110
111 //-----------------------------------------------------------------------------
112 #endif