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

4
// Includes
5
#include <string>
6
#include "XdmfItemProperty.hpp"
7

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * @brief Property describing the types of coordinate values stored in an XdmfGeometry.
 *
 * 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 on of the static methods
 * in the class, i.e. XdmfAttributeType::XYZ().
 *
 * Xdmf supports the following geometry types:
 * 	NoGeometryType
 * 	XYZ
 * 	XY
 * 	X_Y_Z
 * 	X_Y
 * 	VXVYVZ
 * 	Origin_DXDYDZ
 * 	VXVY
 * 	Origin_DXDY
 */
26
class XdmfGeometryType : public XdmfItemProperty {
27
28
29

public:

30
31
	friend class XdmfGeometry;

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
	// Supported Xdmf Geometry Types
	static XdmfGeometryType NoGeometryType();
	static XdmfGeometryType XYZ();
	static XdmfGeometryType XY();
	static XdmfGeometryType X_Y_Z();
	static XdmfGeometryType X_Y();
	static XdmfGeometryType VXVYVZ();
	static XdmfGeometryType Origin_DXDYDZ();
	static XdmfGeometryType VXVY();
	static XdmfGeometryType Origin_DXDY();

	/**
	 * Get the dimensions of this geometry type - i.e. XYZ = 3.
	 *
	 * @return an int containing number of dimensions.
	 */
	int getDimensions() const;

	/**
	 * Get the name of this geometry type
	 *
	 * @return a string containing the name.
	 */
	std::string getName() const;

57
58
	void getProperties(std::map<std::string, std::string> & collectedProperties) const;

59
60
61
	/*
	 * Compare two XdmfGeometry types for equality.
	 *
62
63
	 * @param geometryType a XdmfGeometryType to compare equality to.
	 * @return true if the XdmfGeometryTypes are equal.
64
	 */
65
	bool operator==(const XdmfGeometryType & geometryType) const;
66
67
68
69

	/**
	 * Compare two XdmfGeometry types for inequality.
	 *
70
71
	 * @param geometryType a XdmfGeometryType to compare inequality to.
	 * @return true if the XdmfGeometryTypes are not equal.
72
	 */
73
	bool operator!=(const XdmfGeometryType & geometryType) const;
74

75
76
	XdmfGeometryType(const XdmfGeometryType & geometryType);
	XdmfGeometryType& operator=(const XdmfGeometryType & geometryType);
77
78
79
80
81

protected:

	/**
	 * Protected constructor for XdmfGeometryType.  The constructor is protected because all geometry types supported
82
83
84
85
86
	 * 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 XdmfGeometryType.
	 * @param dimensions an int containing the dimensions of the XdmfGeometryType.
87
	 */
88
	XdmfGeometryType(const std::string & name, const int & dimensions);
89
90
91

private:

92
93
	static XdmfGeometryType New(const std::map<std::string, std::string> & itemProperties);

94
95
96
97
	int mDimensions;
	std::string mName;
};

98
#endif /* XDMFGEOMETRYTYPE_HPP_ */