XdmfTopology.hpp 3.66 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfTopology.hpp                                                    */
/*                                                                           */
/*  Author:                                                                  */
/*     Kenneth Leiter                                                        */
/*     kenneth.leiter@arl.army.mil                                           */
/*     US Army Research Laboratory                                           */
/*     Aberdeen Proving Ground, MD                                           */
/*                                                                           */
/*     Copyright @ 2011 US Army Research Laboratory                          */
/*     All Rights Reserved                                                   */
/*     See Copyright.txt for details                                         */
/*                                                                           */
/*     This software is distributed WITHOUT ANY WARRANTY; without            */
/*     even the implied warranty of MERCHANTABILITY or FITNESS               */
/*     FOR A PARTICULAR PURPOSE.  See the above copyright notice             */
/*     for more information.                                                 */
/*                                                                           */
/*****************************************************************************/

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
24 25 26
#ifndef XDMFTOPOLOGY_HPP_
#define XDMFTOPOLOGY_HPP_

27 28 29
// Forward Declarations
class XdmfTopologyType;

30
// Includes
31
#include "Xdmf.hpp"
32
#include "XdmfArray.hpp"
33

34 35 36
/**
 * @brief Handles the connectivity information in an XdmfGrid.
 *
37
 * XdmfTopology is a required part of an XdmfGrid.  It stores the connectivity information
38 39 40
 * between all points contained in an XdmfGrid.  XdmfTopology contains an XdmfTopologyType property
 * which should be set that specifies the element type stored.
 */
41
class XDMF_EXPORT XdmfTopology : public XdmfArray {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
42 43 44

public:

45 46 47 48 49
	/**
	 * Create a new XdmfTopology.
	 *
	 * @return constructed XdmfTopology.
	 */
50
	static boost::shared_ptr<XdmfTopology> New();
51

52 53
	virtual ~XdmfTopology();

54
	LOKI_DEFINE_VISITABLE(XdmfTopology, XdmfArray)
55
	static const std::string ItemTag;
56

57 58
	std::map<std::string, std::string> getItemProperties() const;

59 60
	std::string getItemTag() const;

61 62 63 64 65
	/**
	 * Get the number of elements this Topology contains.
	 *
	 * @return int of number elements in the Topology.
	 */
66
	virtual unsigned int getNumberElements() const;
67

68
	/**
69
	 * Get the XdmfTopologyType associated with this topology.
70
	 *
71
	 * @return XdmfTopologyType of the topology.
72
	 */
73
	boost::shared_ptr<const XdmfTopologyType> getType() const;
74

75
	/**
76
	 * Set the XdmfTopologyType associated with this topology.
77
	 *
78
	 * @param type the XdmfTopologyType to set.
79
	 */
80
	void setType(const boost::shared_ptr<const XdmfTopologyType> type);
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
81 82 83 84

protected:

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

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
87 88
private:

89 90
	XdmfTopology(const XdmfTopology & topology);  // Not implemented.
	void operator=(const XdmfTopology & topology);  // Not implemented.
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
91

92
	boost::shared_ptr<const XdmfTopologyType> mType;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
93 94
};

95 96 97 98
#ifdef _WIN32
    XDMF_TEMPLATE template class XDMF_EXPORT boost::shared_ptr<const XdmfTopologyType>;
#endif

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