XdmfAttributeCenter.hpp 2.17 KB
Newer Older
1 2 3
#ifndef XDMFATTRIBUTECENTER_HPP_
#define XDMFATTRIBUTECENTER_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
/**
 * @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
 */
22
class XdmfAttributeCenter : public XdmfItemProperty {
23 24 25 26 27 28 29 30 31 32 33

public:

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

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

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

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

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

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

protected:

	/**
	 * Protected constructor for XdmfAttributeCenter.  The constructor is protected because all attribute centers supported
65 66 67 68
	 * 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.
69
	 */
70
	XdmfAttributeCenter(const std::string & name);
71 72 73 74 75 76 77

private:

	std::string mName;
};

#endif /* XDMFATTRIBUTECENTER_HPP_ */