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