XdmfSetType.hpp 1.97 KB
Newer Older
1 2 3 4
#ifndef XDMFSETTYPE_HPP_
#define XDMFSETTYPE_HPP_

// Includes
5
#include "Xdmf.hpp"
6 7 8
#include "XdmfItemProperty.hpp"

/**
9
 * @brief Property describing the type of ids an XdmfSet contains.
10
 *
11 12 13
 * An XdmfSet holds ids for a collection of nodes, cells, faces, or
 * edges that are part of an XdmfGrid. This property indicates which
 * type the set contains.
14
 *
15 16
 * Example of use:
 *
17 18 19
 * C++
 *
 * @dontinclude ExampleXdmfSet.cpp
20 21 22 23 24 25
 * @skipline //#initialize
 * @until //#initialize
 * @skipline //#setType
 * @until //#setType
 * @skipline //#getType
 * @until //#getType
26 27 28 29
 *
 * Python
 *
 * @dontinclude XdmfExampleSet.py
30 31 32 33 34 35
 * @skipline #//initialize
 * @until #//initialize
 * @skipline #//setType
 * @until #//setType
 * @skipline #//getType
 * @until #//getType
36
 *
37
 * Xdmf supports the following set types:
38 39 40 41 42
 *   NoSetType
 *   Node
 *   Cell
 *   Face
 *   Edge
43
 */
44
class XDMF_EXPORT XdmfSetType : public XdmfItemProperty {
45

46
public:
47

48
  virtual ~XdmfSetType();
49

50
  friend class XdmfSet;
51

52
  // Supported Xdmf Set Types
53 54 55 56 57
  static shared_ptr<const XdmfSetType> NoSetType();
  static shared_ptr<const XdmfSetType> Node();
  static shared_ptr<const XdmfSetType> Cell();
  static shared_ptr<const XdmfSetType> Face();
  static shared_ptr<const XdmfSetType> Edge();
58

59 60
  void
  getProperties(std::map<std::string, std::string> & collectedProperties) const;
61

62
protected:
63

64
  /**
65 66 67 68
   * Protected constructor for XdmfSetType. The constructor is
   * protected because all set types supported by Xdmf should be
   * accessed through more specific static methods that construct
   * XdmfSetTypes - i.e. XdmfSetType::Node().
69
   *
70
   * @param     name    A std::string containing the name of the XdmfSetType.
71 72
   */
  XdmfSetType(const std::string & name);
73

74
private:
75

76 77
  XdmfSetType(const XdmfSetType &); // Not implemented.
  void operator=(const XdmfSetType &); // Not implemented.
78

79
  static shared_ptr<const XdmfSetType>
80
  New(const std::map<std::string, std::string> & itemProperties);
81

82
  std::string mName;
83 84
};

85
#endif /* XDMFSETTYPE_HPP_ */