00001 /* 00002 * 00003 * Copyright (C) 2000-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmsr 00015 * 00016 * Author: Joerg Riesmeier 00017 * 00018 * Purpose: 00019 * classes: DSRTreeNodeCursor 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:33 $ 00023 * CVS/RCS Revision: $Revision: 1.13 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 00031 #ifndef DSRTNCSR_H 00032 #define DSRTNCSR_H 00033 00034 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00035 00036 #include "dcmtk/ofstd/ofstring.h" 00037 #include "dcmtk/ofstd/ofstack.h" 00038 #include "dcmtk/ofstd/oflist.h" 00039 00040 00041 /*-----------------------* 00042 * forward declaration * 00043 *-----------------------*/ 00044 00045 class DSRTreeNode; 00046 00047 00048 /*-------------------* 00049 * type definition * 00050 *-------------------*/ 00051 00052 // this typedef is needed to avoid a warning on Sun CC 2.0.1 00053 typedef DSRTreeNode *DSRTreeNodePointer; 00054 00055 00056 /*---------------------* 00057 * class declaration * 00058 *---------------------*/ 00059 00062 class DSRTreeNodeCursor 00063 { 00064 00065 public: 00066 00069 DSRTreeNodeCursor(); 00070 00074 DSRTreeNodeCursor(const DSRTreeNodeCursor &cursor); 00075 00079 DSRTreeNodeCursor(DSRTreeNode *node); 00080 00083 virtual ~DSRTreeNodeCursor(); 00084 00089 DSRTreeNodeCursor &operator=(const DSRTreeNodeCursor &cursor); 00090 00095 DSRTreeNodeCursor &operator=(DSRTreeNode *node); 00096 00099 virtual void clear(); 00100 00104 virtual OFBool isValid() const; 00105 00109 inline DSRTreeNode *getNode() const 00110 { 00111 return NodeCursor; 00112 } 00113 00118 const DSRTreeNode *getParentNode(); 00119 00124 const DSRTreeNode *getNextNode() const; 00125 00129 size_t gotoPrevious(); 00130 00134 size_t gotoNext(); 00135 00139 size_t goUp(); 00140 00144 size_t goDown(); 00145 00151 size_t iterate(const OFBool searchIntoSub = OFTrue); 00152 00157 size_t gotoNode(const size_t searchID); 00158 00166 size_t gotoNode(const OFString &position, 00167 const char separator = '.'); 00168 00174 size_t getNodeID() const; 00175 00180 size_t getLevel() const; 00181 00193 const OFString &getPosition(OFString &position, 00194 const char separator = '.') const; 00195 00196 00197 protected: 00198 00201 void clearNodeCursorStack(); 00202 00208 size_t setCursor(DSRTreeNode *node); 00209 00211 DSRTreeNode *NodeCursor; 00213 OFStack< DSRTreeNodePointer > NodeCursorStack; 00214 00216 size_t Position; 00218 OFList<size_t> PositionList; 00219 }; 00220 00221 00222 #endif 00223 00224 00225 /* 00226 * CVS/RCS Log: 00227 * $Log: dsrtncsr.h,v $ 00228 * Revision 1.13 2010-10-14 13:16:33 joergr 00229 * Updated copyright header. Added reference to COPYRIGHT file. 00230 * 00231 * Revision 1.12 2005-12-08 16:05:28 meichel 00232 * Changed include path schema for all DCMTK header files 00233 * 00234 * Revision 1.11 2005/07/27 16:36:14 joergr 00235 * Added flag to iterate() method indicating whether to perform a "deep search". 00236 * 00237 * Revision 1.10 2003/08/07 12:55:46 joergr 00238 * Updated documentation to get rid of doxygen warnings. 00239 * 00240 * Revision 1.9 2001/12/18 09:55:06 meichel 00241 * Introduced typedef to avoid warning on Sun CC 2.0.1 00242 * 00243 * Revision 1.8 2001/03/28 09:06:56 joergr 00244 * Fixed bug in cycle/loop detection "algorithm". 00245 * 00246 * Revision 1.7 2000/11/09 20:32:08 joergr 00247 * Added support for non-ASCII characters in HTML 3.2 (use numeric value). 00248 * 00249 * Revision 1.6 2000/11/07 18:14:31 joergr 00250 * Enhanced support for by-reference relationships. 00251 * 00252 * Revision 1.5 2000/10/26 14:20:49 joergr 00253 * Generalized routine to get and search for position strings ("1.2.3"). 00254 * 00255 * Revision 1.4 2000/10/18 17:09:06 joergr 00256 * Made some functions inline. 00257 * 00258 * Revision 1.3 2000/10/16 16:31:08 joergr 00259 * Updated comments. 00260 * 00261 * Revision 1.2 2000/10/16 11:57:00 joergr 00262 * Added doc++ comments. 00263 * 00264 * Revision 1.1 2000/10/13 07:49:34 joergr 00265 * Added new module 'dcmsr' providing access to DICOM structured reporting 00266 * documents (supplement 23). Doc++ documentation not yet completed. 00267 * 00268 * 00269 */