XdmfTopology.hpp 1.94 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1 2 3
#ifndef XDMFTOPOLOGY_HPP_
#define XDMFTOPOLOGY_HPP_

4 5 6
// Forward Declarations
class XdmfTopologyType;

7
// Includes
8
#include "Xdmf.hpp"
9
#include "XdmfArray.hpp"
10

11 12 13
/**
 * @brief Handles the connectivity information in an XdmfGrid.
 *
14
 * XdmfTopology is a required part of an XdmfGrid.  It stores the connectivity information
15 16 17
 * between all points contained in an XdmfGrid.  XdmfTopology contains an XdmfTopologyType property
 * which should be set that specifies the element type stored.
 */
18
class XDMF_EXPORT XdmfTopology : public XdmfArray {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
19 20 21

public:

22 23 24 25 26
	/**
	 * Create a new XdmfTopology.
	 *
	 * @return constructed XdmfTopology.
	 */
27
	static boost::shared_ptr<XdmfTopology> New();
28

29 30
	virtual ~XdmfTopology();

31
	LOKI_DEFINE_VISITABLE(XdmfTopology, XdmfArray)
32
	static const std::string ItemTag;
33

34 35
	std::map<std::string, std::string> getItemProperties() const;

36 37
	std::string getItemTag() const;

38 39 40 41 42
	/**
	 * Get the number of elements this Topology contains.
	 *
	 * @return int of number elements in the Topology.
	 */
43
	virtual unsigned int getNumberElements() const;
44

45
	/**
46
	 * Get the XdmfTopologyType associated with this topology.
47
	 *
48
	 * @return XdmfTopologyType of the topology.
49
	 */
50
	boost::shared_ptr<const XdmfTopologyType> getType() const;
51

52
	/**
53
	 * Set the XdmfTopologyType associated with this topology.
54
	 *
55
	 * @param type the XdmfTopologyType to set.
56
	 */
57
	void setType(const boost::shared_ptr<const XdmfTopologyType> type);
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
58 59 60 61

protected:

	XdmfTopology();
62
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
63

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
64 65
private:

66 67
	XdmfTopology(const XdmfTopology & topology);  // Not implemented.
	void operator=(const XdmfTopology & topology);  // Not implemented.
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
68

69
	boost::shared_ptr<const XdmfTopologyType> mType;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
70 71
};

72 73 74 75
#ifdef _WIN32
    XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfTopologyType>;
#endif

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
76
#endif /* XDMFTOPOLOGY_HPP_ */