XdmfTopology.hpp 3.7 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
 * @brief Holds the connectivity information in an XdmfGrid.
36
 *
37 38 39 40
 * 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.
41
 */
42
class XDMF_EXPORT XdmfTopology : public XdmfArray {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
43

44
 public:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
45

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

53
  virtual ~XdmfTopology();
54

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

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

60
  std::string getItemTag() const;
61

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

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

76 77 78 79 80 81
  /**
   * 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
82

83
 protected:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
84

85
  XdmfTopology();
86

87 88 89 90
  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
91

92
 private:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
93

94 95 96 97
  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
98 99
};

100
#ifdef _WIN32
101 102
XDMF_TEMPLATE template class XDMF_EXPORT
boost::shared_ptr<const XdmfTopologyType>;
103 104
#endif

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