XdmfGeometryType.hpp 3.84 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 : XdmfGeometryType.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.                                                 */
/*                                                                           */
/*****************************************************************************/

24 25 26
#ifndef XDMFGEOMETRYTYPE_HPP_
#define XDMFGEOMETRYTYPE_HPP_

27
// Includes
28
#include "Xdmf.hpp"
29
#include "XdmfItemProperty.hpp"
30

31
/**
32 33
 * @brief Property describing the types of coordinate values stored in
 * an XdmfGeometry.
34
 *
35 36 37 38
 * XdmfGeometryType is a property used by XdmfGeometry to specify the
 * type of coordinate values stored in the XdmfGeometry. A specific
 * XdmfGeometryType can be created by calling one of the static
 * methods in the class, i.e.  XdmfAttributeType::XYZ().
39 40
 *
 * Xdmf supports the following geometry types:
41 42 43
 *   NoGeometryType
 *   XYZ
 *   XY
44
 */
45
class XDMF_EXPORT XdmfGeometryType : public XdmfItemProperty {
46

47
public:
48

49
  virtual ~XdmfGeometryType();
50

51
  friend class XdmfGeometry;
52

53
  // Supported Xdmf Geometry Types
54 55 56
  static shared_ptr<const XdmfGeometryType> NoGeometryType();
  static shared_ptr<const XdmfGeometryType> XYZ();
  static shared_ptr<const XdmfGeometryType> XY();
57

58 59 60 61 62 63
  /**
   * Get the dimensions of this geometry type - i.e. XYZ = 3.
   *
   * @return an int containing number of dimensions.
   */
  virtual unsigned int getDimensions() const;
64

65 66 67 68 69 70
  /**
   * Get the name of this geometry type.
   *
   * @return the name of this geometry type.
   */
  std::string getName() const;
71

72 73
  virtual void
  getProperties(std::map<std::string, std::string> & collectedProperties) const;
74

75
protected:
76

77
  /**
78 79 80 81
   * Protected constructor for XdmfGeometryType.  The constructor is
   * protected because all geometry types supported by Xdmf should be
   * accessed through more specific static methods that construct
   * XdmfGeometryTypes - i.e.  XdmfGeometryType::XYZ().
82 83 84 85 86
   *
   * @param name a std::string containing the name of the geometry type..
   * @param dimensions an int containing the dimensions of the geometry type.
   */
  XdmfGeometryType(const std::string & name, const int & dimensions);
87

88
private:
89

90 91
  XdmfGeometryType(const XdmfGeometryType &); // Not implemented.
  void operator=(const XdmfGeometryType &); // Not implemented.
92

93
  static shared_ptr<const XdmfGeometryType>
94
  New(const std::map<std::string, std::string> & itemProperties);
95

96 97
  unsigned int mDimensions;
  std::string mName;
98 99
};

100
#endif /* XDMFGEOMETRYTYPE_HPP_ */