00001 /* 00002 * 00003 * Copyright (C) 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: DSRGraphicData3DItem, DSRGraphicData3DList 00020 * 00021 * Last Update: $Author: joergr $ 00022 * Update Date: $Date: 2010-10-14 13:16:32 $ 00023 * CVS/RCS Revision: $Revision: 1.2 $ 00024 * Status: $State: Exp $ 00025 * 00026 * CVS/RCS Log at end of file 00027 * 00028 */ 00029 00030 00031 #ifndef DSRSC3GR_H 00032 #define DSRSC3GR_H 00033 00034 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00035 00036 #include "dcmtk/dcmsr/dsrtypes.h" 00037 #include "dcmtk/dcmsr/dsrtlist.h" 00038 00039 00040 /*---------------------* 00041 * class declaration * 00042 *---------------------*/ 00043 00046 class DSRGraphicData3DItem 00047 { 00048 public: 00049 00055 DSRGraphicData3DItem(const Float32 x = 0, 00056 const Float32 y = 0, 00057 const Float32 z = 0) 00058 : XCoord(x), 00059 YCoord(y), 00060 ZCoord(z) 00061 { 00062 } 00063 00068 inline OFBool operator==(const DSRGraphicData3DItem &item) const 00069 { 00070 return (item.XCoord == XCoord) && (item.YCoord == YCoord) && (item.ZCoord == ZCoord); 00071 } 00072 00077 inline OFBool operator!=(const DSRGraphicData3DItem &item) const 00078 { 00079 return (item.XCoord != XCoord) || (item.YCoord != YCoord) || (item.ZCoord != ZCoord); 00080 } 00081 00082 /* copy constructor and assignment operator are defined implicitly */ 00083 00085 Float32 XCoord; 00087 Float32 YCoord; 00089 Float32 ZCoord; 00090 }; 00091 00092 00095 class DSRGraphicData3DList 00096 : public DSRListOfItems<DSRGraphicData3DItem> 00097 { 00098 00099 public: 00100 00103 DSRGraphicData3DList(); 00104 00108 DSRGraphicData3DList(const DSRGraphicData3DList &lst); 00109 00112 virtual ~DSRGraphicData3DList(); 00113 00118 DSRGraphicData3DList &operator=(const DSRGraphicData3DList &lst); 00119 00128 OFCondition print(STD_NAMESPACE ostream &stream, 00129 const size_t flags = 0, 00130 const char tripletSeparator = '/', 00131 const char itemSeparator = ',') const; 00132 00137 OFCondition read(DcmItem &dataset); 00138 00143 OFCondition write(DcmItem &dataset) const; 00144 00149 const DSRGraphicData3DItem &getItem(const size_t idx) const; 00150 00158 OFCondition getItem(const size_t idx, 00159 Float32 &x, 00160 Float32 &y, 00161 Float32 &z) const; 00162 00168 void addItem(const Float32 x, 00169 const Float32 y, 00170 const Float32 z); 00171 00178 OFCondition putString(const char *stringValue); 00179 }; 00180 00181 00182 #endif 00183 00184 00185 /* 00186 * CVS/RCS Log: 00187 * $Log: dsrsc3gr.h,v $ 00188 * Revision 1.2 2010-10-14 13:16:32 joergr 00189 * Updated copyright header. Added reference to COPYRIGHT file. 00190 * 00191 * Revision 1.1 2010-09-28 14:08:14 joergr 00192 * Added support for Colon CAD SR which requires a new value type (SCOORD3D). 00193 * 00194 * 00195 * 00196 */