XdmfGeometry.hpp 5.04 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 : XdmfGeometry.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 XDMFGEOMETRY_HPP_
#define XDMFGEOMETRY_HPP_

27 28 29
// Forward Declarations
class XdmfGeometryType;

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

34 35 36
/**
 * @brief Handles the coordinate positions of points in an XdmfGrid.
 *
37 38 39 40
 * XdmfGeometry is a required part of an XdmfGrid. It stores the
 * coordinate locations of all points contained in an
 * XdmfGrid. XdmfGeometry contains an XdmfGeometryType property which
 * should be set that specifies the types of coordinate values stored.
41
 */
42
class XDMF_EXPORT XdmfGeometry : 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
  /**
   * Create a new XdmfGeometry.
   *
49 50 51 52
   * Example of use:
   *
   * C++
   *
53
   * @dontinclude ExampleXdmfGeometry.cpp
54 55
   * @skipline //#initialization
   * @until //#initialization
56 57 58
   *
   * Python
   *
59
   * @dontinclude XdmfExampleGeometry.py
60 61
   * @skipline #//initialization
   * @until #//initialization
62
   *
63
   * @return	Constructed XdmfGeometry.
64
   */
65
  static shared_ptr<XdmfGeometry> New();
66

67
  virtual ~XdmfGeometry();
68

69 70
  LOKI_DEFINE_VISITABLE(XdmfGeometry, XdmfArray);
  static const std::string ItemTag;
71

72
  std::map<std::string, std::string> getItemProperties() const;
73

74
  std::string getItemTag() const;
75

76 77
  /**
   * Get the number of points stored in this geometry.
78 79 80 81 82
   *
   * Example of use:
   *
   * C++
   *
83
   * @dontinclude ExampleXdmfGeometry.cpp
84 85 86 87
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#getNumberPoints
   * @until //#getNumberPoints
88 89 90
   *
   * Python
   *
91
   * @dontinclude XdmfExampleGeometry.py
92 93 94 95
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//getNumberPoints
   * @until #//getNumberPoints
96 97
   */
  virtual unsigned int getNumberPoints() const;
98

99 100 101
  /**
   * Get the XdmfGeometryType associated with this geometry.
   *
102 103 104 105
   * Example of use:
   *
   * C++
   *
106
   * @dontinclude ExampleXdmfGeometry.cpp
107 108 109 110
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#getType
   * @until //#getType
111 112 113
   *
   * Python
   *
114
   * @dontinclude XdmfExampleGeometry.py
115 116 117 118
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//getType
   * @until #//getType
119
   *
120
   * @return	XdmfGeometryType of this geometry.
121
   */
122
  shared_ptr<const XdmfGeometryType> getType() const;
123

124 125 126
  /**
   * Set the XdmfGeometryType associated with this geometry.
   *
127 128 129 130
   * Example of use:
   *
   * C++
   *
131
   * @dontinclude ExampleXdmfGeometry.cpp
132 133 134 135
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setType
   * @until //#setType
136 137 138
   *
   * Python
   *
139
   * @dontinclude XdmfExampleGeometry.py
140 141 142 143
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setType
   * @until #//setType
144
   *
145
   * @param	type	The XdmfGeometryType to set.
146
   */
147
  void setType(const shared_ptr<const XdmfGeometryType> type);
148

149
protected:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
150

151
  XdmfGeometry();
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
152

153 154
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
155
               const std::vector<shared_ptr<XdmfItem> > & childItems,
156
               const XdmfCoreReader * const reader);
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
157

158
private:
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
159

160 161 162 163
  XdmfGeometry(const XdmfGeometry &);  // Not implemented.
  void operator=(const XdmfGeometry &);  // Not implemented.

  int mNumberPoints;
164
  shared_ptr<const XdmfGeometryType> mType;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
165 166
};

167
#ifdef _WIN32
168
XDMF_TEMPLATE template class XDMF_EXPORT
169
shared_ptr<const XdmfGeometryType>;
170 171
#endif

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
172
#endif /* XDMFGEOMETRY_HPP_ */