XdmfAttribute.hpp 1.95 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1
2
3
#ifndef XDMFATTRIBUTE_HPP_
#define XDMFATTRIBUTE_HPP_

Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
4
// Includes
5
#include "XdmfAttributeCenter.hpp"
6
#include "XdmfAttributeType.hpp"
7
#include "XdmfDataItem.hpp"
8

9
10
11
12
13
14
/**
 * @brief Handles computed values attached to an XdmfGrid.
 *
 * XdmfAttribute contains two properties that should be set, XdmfAttributeCenter and XdmfAttributeType.
 * XdmfAttribute is a subclass of XdmfDataItem, meaning it contains an XdmfArray to store values.
 */
15
class XdmfAttribute : public XdmfDataItem {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
16

17
18
public:

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
19
20
	XdmfNewMacro(XdmfAttribute);

21
	/**
22
	 * Get the XdmfAttributeCenter associated with this attribute.
23
	 *
24
	 * @return XdmfAttributeCenter of the attribute.
25
	 */
26
	XdmfAttributeCenter getAttributeCenter() const;
27
28

	/**
29
	 * Get the XdmfAttributeType associated with this attribute.
30
	 *
31
	 * @return XdmfAttributeType of the attribute.
32
33
34
	 */
	XdmfAttributeType getAttributeType() const;

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

42
	virtual std::string printSelf() const;
43
44

	/**
45
	 * Set the XdmfAttributeCenter associated with this attribute.
46
	 *
47
	 * @param attributeCenter the XdmfAttributeCenter to set.
48
	 */
49
	void setAttributeCenter(const XdmfAttributeCenter & attributeCenter);
50
51

	/**
52
	 * Set the XdmfAttributeType associated with this attribute.
53
	 *
54
	 * @param attributeType XdmfAttributeType to set.
55
	 */
56
	void setAttributeType(const XdmfAttributeType & attributeType);
57
58

	/**
59
	 * Set the name of the attribute.
60
	 *
61
	 * @param name a string containing the name to set.
62
	 */
63
	void setName(const std::string & name);
64
65
66
67
68
69
70
71
72
73

	void write(boost::shared_ptr<XdmfVisitor> visitor) const;

protected:

	XdmfAttribute();
	virtual ~XdmfAttribute();

private:

74
75
	XdmfAttribute(const XdmfAttribute & attribute);  // Not implemented.
	void operator=(const XdmfAttribute & attribute);  // Not implemented.
76
77
78

	std::string mName;
	XdmfAttributeType mAttributeType;
79
	XdmfAttributeCenter mAttributeCenter;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
80
81
82
};

#endif /* XDMFATTRIBUTE_HPP_ */