XdmfGeometryType.hpp 4.65 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfGeometryType.hpp                                                */
/*                                                                           */
/*  Author:                                                                  */
/*     Kenneth Leiter                                                        */
/*     kenneth.leiter@arl.army.mil                                           */
/*     US Army Research Laboratory                                           */
/*     Aberdeen Proving Ground, MD                                           */
/*                                                                           */
/*     Copyright @ 2011 US Army Research Laboratory                          */
/*     All Rights Reserved                                                   */
/*     See Copyright.txt for details                                         */
/*                                                                           */
/*     This software is distributed WITHOUT ANY WARRANTY; without            */
/*     even the implied warranty of MERCHANTABILITY or FITNESS               */
/*     FOR A PARTICULAR PURPOSE.  See the above copyright notice             */
/*     for more information.                                                 */
/*                                                                           */
/*****************************************************************************/

24 25 26
#ifndef XDMFGEOMETRYTYPE_HPP_
#define XDMFGEOMETRYTYPE_HPP_

27
// Includes
28
#include "Xdmf.hpp"
29
#include "XdmfItemProperty.hpp"
30

31
/**
32 33
 * @brief Property describing the types of coordinate values stored in
 * an XdmfGeometry.
34
 *
35 36 37 38
 * XdmfGeometryType is a property used by XdmfGeometry to specify the
 * type of coordinate values stored in the XdmfGeometry. A specific
 * XdmfGeometryType can be created by calling one of the static
 * methods in the class, i.e.  XdmfAttributeType::XYZ().
39
 *
40 41
 * Example of use:
 *
42 43 44
 * C++
 *
 * @dontinclude ExampleXdmfGeometryType.cpp
45 46 47 48
 * @skipline //#initialization
 * @until //#initialization
 * @skipline //#getType
 * @until //#getType
49 50 51 52
 *
 * Python
 *
 * @dontinclude XdmfExampleGeometryType.py
53 54
 * @skipline #//getType
 * @until #//getType
55
 *
56
 * Xdmf supports the following geometry types:
57 58 59
 *   NoGeometryType
 *   XYZ
 *   XY
60
 */
61
class XDMF_EXPORT XdmfGeometryType : public XdmfItemProperty {
62

63
public:
64

65
  virtual ~XdmfGeometryType();
66

67
  friend class XdmfGeometry;
68

69
  // Supported Xdmf Geometry Types
70 71 72
  static shared_ptr<const XdmfGeometryType> NoGeometryType();
  static shared_ptr<const XdmfGeometryType> XYZ();
  static shared_ptr<const XdmfGeometryType> XY();
73

74 75 76
  /**
   * Get the dimensions of this geometry type - i.e. XYZ = 3.
   *
77
   * Example of use:
78 79
   * 
   * C++
80
   *
81
   * @dontinclude ExampleXdmfGeometryType.cpp
82 83
   * @skipline //#getDimensions
   * @until //#getDimensions
84 85 86
   *
   * Python
   *
87
   * @dontinclude XdmfExampleGeometryType.py
88 89
   * @skipline #//getDimensions
   * @until #//getDimensions
90
   *
91
   * @return    An int containing number of dimensions.
92 93
   */
  virtual unsigned int getDimensions() const;
94

95 96 97
  /**
   * Get the name of this geometry type.
   *
98 99
   * Example of use:
   *
100 101
   * C++
   *
102
   * @dontinclude ExampleXdmfGeometryType.cpp
103 104
   * @skipline //#getName
   * @until //#getName
105 106 107
   *
   * Python
   *
108
   * @dontinclude XdmfExampleGeometryType.py
109 110
   * @skipline #//getName
   * @until #//getName
111
   *
112
   * @return    The name of this geometry type.
113 114
   */
  std::string getName() const;
115

116 117
  virtual void
  getProperties(std::map<std::string, std::string> & collectedProperties) const;
118

119
protected:
120

121
  /**
122 123 124 125
   * Protected constructor for XdmfGeometryType.  The constructor is
   * protected because all geometry types supported by Xdmf should be
   * accessed through more specific static methods that construct
   * XdmfGeometryTypes - i.e.  XdmfGeometryType::XYZ().
126 127 128 129 130
   *
   * @param name a std::string containing the name of the geometry type..
   * @param dimensions an int containing the dimensions of the geometry type.
   */
  XdmfGeometryType(const std::string & name, const int & dimensions);
131

132
private:
133

134 135
  XdmfGeometryType(const XdmfGeometryType &); // Not implemented.
  void operator=(const XdmfGeometryType &); // Not implemented.
136

137
  static shared_ptr<const XdmfGeometryType>
138
  New(const std::map<std::string, std::string> & itemProperties);
139

140 141
  unsigned int mDimensions;
  std::string mName;
142 143
};

144
#endif /* XDMFGEOMETRYTYPE_HPP_ */