XdmfTopology.hpp 2.46 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1 2 3 4 5 6 7 8 9 10 11 12
/*
 * XdmfTopology.hpp
 *
 *  Created on: Jan 25, 2010
 *      Author: kleiter
 */

#ifndef XDMFTOPOLOGY_HPP_
#define XDMFTOPOLOGY_HPP_

#include "XdmfObject.hpp"

13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 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 66 67 68 69
class XdmfTopologyType {

public:

	const int numberVertices;
	const std::string name;

	// Supported Xdmf Topology Type
	static const XdmfTopologyType NoTopology;
	static const XdmfTopologyType Polyvertex;
	static const XdmfTopologyType Polyline;
	static const XdmfTopologyType Polygon;
	static const XdmfTopologyType Triangle;
	static const XdmfTopologyType Quadrilateral;
	static const XdmfTopologyType Tetrahedron;
	static const XdmfTopologyType Pyramid;
	static const XdmfTopologyType Wedge;
	static const XdmfTopologyType Hexahedron;
	static const XdmfTopologyType Edge_3;
	static const XdmfTopologyType Triangle_6;
	static const XdmfTopologyType Quadrilateral_8;
	static const XdmfTopologyType Tetrahedron_10;
	static const XdmfTopologyType Pyramid_13;
	static const XdmfTopologyType Wedge_15;
	static const XdmfTopologyType Hexahedron_20;
	static const XdmfTopologyType Mixed;
	static const XdmfTopologyType TwoDSMesh;
	static const XdmfTopologyType TwoDRectMesh;
	static const XdmfTopologyType TwoDCoRectMesh;
	static const XdmfTopologyType ThreeDSMesh;
	static const XdmfTopologyType ThreeDRectMesh;
	static const XdmfTopologyType ThreeDCoRectMesh;

	bool operator==(const XdmfTopologyType& top) const
	{
		return (this == &top) ? true : false;
	}

	bool operator!=(const XdmfTopologyType& top) const
	{
		return (this != &top) ? true : false;
	}

protected:

	XdmfTopologyType(const int & numberVertices, const std::string & name) :
		numberVertices(numberVertices),
		name(name)
	{};

private:

	//XdmfTopologyType(const XdmfTopologyType&);  // Not implemented.
	//void operator=(const XdmfTopologyType&);  // Not implemented.

};

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
70 71 72 73 74 75
class XdmfTopology : public XdmfObject {

public:

	XdmfNewMacro(XdmfTopology);

76 77 78 79 80 81 82 83 84 85 86 87 88 89
	// Get the topology type for this topology
	const XdmfTopologyType & getXdmfTopologyType() const
	{
		return *mTopologyType;
	}
	// Set the topology type for this topology
	void setTopologyType(const XdmfTopologyType & topType)
	{
		mTopologyType = &topType;
	}

	const std::string getTopologyTypeAsString() const;

	virtual const std::string printSelf() const;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
90 91 92 93 94 95 96 97 98 99 100

protected:

	XdmfTopology();
	virtual ~XdmfTopology();

private:

  XdmfTopology(const XdmfTopology&);  // Not implemented.
  void operator=(const XdmfTopology&);  // Not implemented.

101
  const XdmfTopologyType * mTopologyType;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
102 103 104
};

#endif /* XDMFTOPOLOGY_HPP_ */