GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

gdcmMeshPrimitive.h
Go to the documentation of this file.
1 /*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13 =========================================================================*/
14
15 #ifndef GDCMMESHPRIMITIVE_H
16 #define GDCMMESHPRIMITIVE_H
17
18 #include <gdcmObject.h>
19 #include <gdcmDataElement.h>
20
21 namespace gdcm
22 {
23
30 class GDCM_EXPORT MeshPrimitive : public Object
31 {
32 public:
33
34 typedef std::vector< DataElement > PrimitivesData;
35
41 typedef enum {
42 VERTEX = 0,
43 EDGE,
44 TRIANGLE,
45 TRIANGLE_STRIP,
46 TRIANGLE_FAN,
47 LINE,
48 FACET,
49 MPType_END
50 } MPType;
51
52 static const char * GetMPTypeString(const MPType type);
53
54 static MPType GetMPType(const char * type);
55
56 MeshPrimitive();
57
58 virtual ~MeshPrimitive();
59
60 MPType GetPrimitiveType() const;
61 void SetPrimitiveType(const MPType type);
62
63 const DataElement & GetPrimitiveData() const;
64 DataElement & GetPrimitiveData();
65 void SetPrimitiveData(DataElement const & de);
66
67 const PrimitivesData & GetPrimitivesData() const;
68 PrimitivesData & GetPrimitivesData();
69 void SetPrimitivesData(PrimitivesData const & DEs);
70
71 const DataElement & GetPrimitiveData(const unsigned int idx) const;
72 DataElement & GetPrimitiveData(const unsigned int idx);
73 void SetPrimitiveData(const unsigned int idx, DataElement const & de);
74 void AddPrimitiveData(DataElement const & de);
75
76 unsigned int GetNumberOfPrimitivesData() const;
77
78 protected:
79
80 // Use to define tag where PrimitiveData will be put.
81 MPType PrimitiveType;
82
83 // PrimitiveData contains point index list.
84 // It shall have 1 or 1-n DataElement following PrimitiveType.
85 PrimitivesData PrimitiveData;
86 };
87
88 }
89
90 #endif // GDCMMESHPRIMITIVE_H