XdmfGeometryType.hpp 2.15 KB
Newer Older
1
2
3
#ifndef XDMFGEOMETRYTYPE_HPP_
#define XDMFGEOMETRYTYPE_HPP_

4
// Includes
5
#include "Xdmf.hpp"
6
#include "XdmfItemProperty.hpp"
7

8
/**
9
10
 * @brief Property describing the types of coordinate values stored in an
 * XdmfGeometry.
11
 *
12
13
14
15
 * 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().
16
17
 *
 * Xdmf supports the following geometry types:
18
19
20
 *   NoGeometryType
 *   XYZ
 *   XY
21
 */
22
class XDMF_EXPORT XdmfGeometryType : public XdmfItemProperty {
23

24
 public:
25

26
  virtual ~XdmfGeometryType();
27

28
  friend class XdmfGeometry;
29

30
31
32
33
  // Supported Xdmf Geometry Types
  static boost::shared_ptr<const XdmfGeometryType> NoGeometryType();
  static boost::shared_ptr<const XdmfGeometryType> XYZ();
  static boost::shared_ptr<const XdmfGeometryType> XY();
34

35
36
37
38
39
40
  /**
   * Get the dimensions of this geometry type - i.e. XYZ = 3.
   *
   * @return an int containing number of dimensions.
   */
  virtual unsigned int getDimensions() const;
41

42
43
44
45
46
47
  /**
   * Get the name of this geometry type.
   *
   * @return the name of this geometry type.
   */
  std::string getName() const;
48

49
50
  virtual void
  getProperties(std::map<std::string, std::string> & collectedProperties) const;
51

52
 protected:
53

54
55
56
57
58
59
60
61
62
63
  /**
   * 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().
   *
   * @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);
64

65
 private:
66

67
68
  XdmfGeometryType(const XdmfGeometryType &); // Not implemented.
  void operator=(const XdmfGeometryType &); // Not implemented.
69

70
71
  static boost::shared_ptr<const XdmfGeometryType>
  New(const std::map<std::string, std::string> & itemProperties);
72

73
74
  unsigned int mDimensions;
  std::string mName;
75
76
};

77
#endif /* XDMFGEOMETRYTYPE_HPP_ */