XdmfTopology.hpp 1.98 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
 * @brief Holds the connectivity information in an XdmfGrid.
13
 *
14 15 16 17
 * XdmfTopology is a required part of an XdmfGrid. It stores the connectivity
 * information for all points contained in an XdmfGrid. XdmfTopology contains
 * an XdmfTopologyType property which should be set that specifies the
 * element type stored.
18
 */
19
class XDMF_EXPORT XdmfTopology : public XdmfArray {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
20

21
 public:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
22

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

30
  virtual ~XdmfTopology();
31

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

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

37
  std::string getItemTag() const;
38

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

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

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

60
 protected:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
61

62
  XdmfTopology();
63

64 65 66 67
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
               std::vector<boost::shared_ptr<XdmfItem> > & childItems,
               const XdmfCoreReader * const reader);
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
68

69
 private:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
70

71 72 73 74
  XdmfTopology(const XdmfTopology &);  // Not implemented.
  void operator=(const XdmfTopology &);  // Not implemented.

  boost::shared_ptr<const XdmfTopologyType> mType;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
75 76
};

77
#ifdef _WIN32
78 79
XDMF_TEMPLATE template class XDMF_EXPORT
boost::shared_ptr<const XdmfTopologyType>;
80 81
#endif

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