XdmfAttributeCenter.hpp 2.15 KB
Newer Older
1 2 3
#ifndef XDMFATTRIBUTECENTER_HPP_
#define XDMFATTRIBUTECENTER_HPP_

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

7 8 9 10 11 12 13 14 15 16 17 18 19 20
/**
 * @brief Property describing where XdmfAttribute values are centered.
 *
 * XdmfAttributeCenter is a property used by XdmfAttribute to specify where its values are centered
 * on the XdmfGrid.  A specific XdmfAttributeCenter can be created by calling on of the static methods
 * in the class, i.e. XdmfAttributeCenter::Cell().
 *
 * Xdmf supports the following attribute centers:
 * 	Grid
 * 	Cell
 * 	Face
 * 	Edge
 * 	Node
 */
21
class XdmfAttributeCenter : public XdmfItemProperty {
22 23 24 25 26 27 28 29 30 31 32

public:

	// Supported Xdmf Attribute Centers
	static XdmfAttributeCenter Grid();
	static XdmfAttributeCenter Cell();
	static XdmfAttributeCenter Face();
	static XdmfAttributeCenter Edge();
	static XdmfAttributeCenter Node();

	/**
33
	 * Get the name of this attribute center.
34 35 36 37 38
	 *
	 * @return a string containing the name.
	 */
	std::string getName() const;

39 40
	void getProperties(std::map<std::string, std::string> & collectedProperties) const;

41
	/**
42 43
	 * Compare two XdmfAttributeCenters for equality.
	 *
44 45
	 * @param attributeCenter an XdmfAttributeCenter to compare equality to.
	 * @return true if the XdmfAttributeCenters are equal.
46
	 */
47
	bool operator==(const XdmfAttributeCenter & attributeCenter) const;
48 49 50 51

	/**
	 * Compare two XdmfAttributeCenters for inequality.
	 *
52 53
	 * @param attributeCenter an XdmfAttributeCenter to compare inequality to.
	 * @return true if the XdmfAttributeCenters are not equal.
54
	 */
55 56 57 58
	bool operator!=(const XdmfAttributeCenter & attributeCenter) const;

	XdmfAttributeCenter(const XdmfAttributeCenter & attributeCenter);
	XdmfAttributeCenter& operator=(const XdmfAttributeCenter & attributeCenter);
59 60 61 62 63

protected:

	/**
	 * Protected constructor for XdmfAttributeCenter.  The constructor is protected because all attribute centers supported
64 65 66 67
	 * by Xdmf should be accessed through more specific static methods that construct XdmfAttributeCenters - i.e.
	 * XdmfAttributeCenter::Node().
	 *
	 * @param name the name of the XdmfAttributeCenter to construct.
68
	 */
69
	XdmfAttributeCenter(const std::string & name);
70 71 72 73 74 75 76

private:

	std::string mName;
};

#endif /* XDMFATTRIBUTECENTER_HPP_ */