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

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

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
 * @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
 */
25
class XdmfGeometryType : public XdmfItemProperty {
26
27
28

public:

29
30
	virtual ~XdmfGeometryType();

31
32
	friend class XdmfGeometry;

33
	// Supported Xdmf Geometry Types
34
35
36
37
38
39
40
41
42
	static boost::shared_ptr<const XdmfGeometryType> NoGeometryType();
	static boost::shared_ptr<const XdmfGeometryType> XYZ();
	static boost::shared_ptr<const XdmfGeometryType> XY();
	static boost::shared_ptr<const XdmfGeometryType> X_Y_Z();
	static boost::shared_ptr<const XdmfGeometryType> X_Y();
	static boost::shared_ptr<const XdmfGeometryType> VXVYVZ();
	static boost::shared_ptr<const XdmfGeometryType> Origin_DXDYDZ();
	static boost::shared_ptr<const XdmfGeometryType> VXVY();
	static boost::shared_ptr<const XdmfGeometryType> Origin_DXDY();
43
44
45
46
47
48

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

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

53
	/*
54
	 * Compare two XdmfGeometryTypes for equality.
55
	 *
56
57
	 * @param geometryType a XdmfGeometryType to compare equality to.
	 * @return true if the XdmfGeometryTypes are equal.
58
	 */
59
	bool operator==(const XdmfGeometryType & geometryType) const;
60
61

	/**
62
	 * Compare two XdmfGeometryTypes for inequality.
63
	 *
64
65
	 * @param geometryType a XdmfGeometryType to compare inequality to.
	 * @return true if the XdmfGeometryTypes are not equal.
66
	 */
67
	bool operator!=(const XdmfGeometryType & geometryType) const;
68
69
70
71
72

protected:

	/**
	 * Protected constructor for XdmfGeometryType.  The constructor is protected because all geometry types supported
73
74
75
76
77
	 * 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.
78
	 */
79
	XdmfGeometryType(const std::string & name, const int & dimensions);
80
81
82

private:

83
84
85
86
	XdmfGeometryType(const XdmfGeometryType & geometryType); // Not implemented.
	void operator=(const XdmfGeometryType & geometryType); // Not implemented.

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

88
	unsigned int mDimensions;
89
90
91
	std::string mName;
};

92
#endif /* XDMFGEOMETRYTYPE_HPP_ */