GDCM 2.2.0

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

- File List
- File Members

gdcmMeshPrimitive.h
Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004
    00005   Copyright (c) 2006-2011 Mathieu Malaterre
    00006   All rights reserved.
    00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00008
    00009      This software is distributed WITHOUT ANY WARRANTY; without even
    00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00011      PURPOSE.  See the above copyright notice for more information.
    00012
    00013 =========================================================================*/
    00014
    00015 #ifndef GDCMMESHPRIMITIVE_H
    00016 #define GDCMMESHPRIMITIVE_H
    00017
    00018 #include <gdcmObject.h>
    00019 #include <gdcmDataElement.h>
    00020
    00021 namespace gdcm
    00022 {
    00023
    00030 class GDCM_EXPORT MeshPrimitive : public Object
    00031 {
    00032 public:
    00033
    00034   typedef std::vector< DataElement > PrimitivesData;
    00035
    00041     typedef enum {
    00042         VERTEX = 0,
    00043         EDGE,
    00044         TRIANGLE,
    00045         TRIANGLE_STRIP,
    00046         TRIANGLE_FAN,
    00047         LINE,
    00048         FACET,
    00049         MPType_END
    00050         } MPType;
    00051
    00052     static const char * GetMPTypeString(const MPType type);
    00053
    00054     static MPType GetMPType(const char * type);
    00055
    00056     MeshPrimitive();
    00057
    00058     virtual ~MeshPrimitive();
    00059
    00060     MPType GetPrimitiveType() const;
    00061     void SetPrimitiveType(const MPType type);
    00062
    00063     const DataElement & GetPrimitiveData() const;
    00064     DataElement & GetPrimitiveData();
    00065     void SetPrimitiveData(DataElement const & de);
    00066
    00067     const PrimitivesData & GetPrimitivesData() const;
    00068     PrimitivesData & GetPrimitivesData();
    00069     void SetPrimitivesData(PrimitivesData const & DEs);
    00070
    00071     const DataElement & GetPrimitiveData(const unsigned int idx) const;
    00072     DataElement & GetPrimitiveData(const unsigned int idx);
    00073     void SetPrimitiveData(const unsigned int idx, DataElement const & de);
    00074     void AddPrimitiveData(DataElement const & de);
    00075
    00076     unsigned int GetNumberOfPrimitivesData() const;
    00077
    00078 protected:
    00079
    00080     // Use to define tag where PrimitiveData will be put.
    00081     MPType          PrimitiveType;
    00082
    00083     // PrimitiveData contains point index list.
    00084     // It shall have 1 or 1-n DataElement following PrimitiveType.
    00085     PrimitivesData  PrimitiveData;
    00086 };
    00087
    00088 }
    00089
    00090 #endif // GDCMMESHPRIMITIVE_H