XdmfSetType.hpp 1.98 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#ifndef XDMFSETTYPE_HPP_
#define XDMFSETTYPE_HPP_

// Includes
#include "XdmfItemProperty.hpp"

/**
 * @brief Property describing the type of an XdmfSet.
 *
 * An XdmfSet consist of a collection of nodes, cells, faces, or edges that are part of an XdmfGrid.  This
 * property indicates which element type the set contains.
 *
 * Xdmf supports the following set types:
 * 	NoSetType
 * 	Node
 * 	Cell
 * 	Face
 * 	Edge
 */
class XdmfSetType : public XdmfItemProperty {

public:

24 25
	virtual ~XdmfSetType();

26 27 28
	friend class XdmfSet;

	// Supported Xdmf Set Types
29 30 31 32 33
	static boost::shared_ptr<const XdmfSetType> NoSetType();
	static boost::shared_ptr<const XdmfSetType> Node();
	static boost::shared_ptr<const XdmfSetType> Cell();
	static boost::shared_ptr<const XdmfSetType> Face();
	static boost::shared_ptr<const XdmfSetType> Edge();
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

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

	/*
	 * Compare two XdmfSetTypes for equality.
	 *
	 * @param setType a XdmfSetType to compare equality to.
	 * @return true if the XdmfSetTypes are equal.
	 */
	bool operator==(const XdmfSetType & setType) const;

	/**
	 * Compare two XdmfSetTypes for inequality.
	 *
	 * @param setType a XdmfSetType to compare inequality to.
	 * @return true if the XdmfSetTypes are not equal.
	 */
	bool operator!=(const XdmfSetType & setType) const;

protected:

	/**
	 * 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().
	 *
	 * @param name a std::string containing the name of the XdmfSetType.
	 */
	XdmfSetType(const std::string & name);

private:

66 67 68 69
	XdmfSetType(const XdmfSetType & setType); // Not implemented.
	void operator=(const XdmfSetType & setType); // Not implemented.

	static boost::shared_ptr<const XdmfSetType> New(const std::map<std::string, std::string> & itemProperties);
70 71 72 73 74

	std::string mName;
};

#endif /* XDMFGEOMETRYTYPE_HPP_ */