00001 #ifndef CELLTYPE_H 00002 #define CELLTYPE_H 00003 00004 #include "SundanceDefs.h" 00005 00006 00007 #include <string> 00008 #include "TSFUtils.h" 00009 #include "TSFHashUtils.h" 00010 00011 namespace Sundance 00012 { 00013 00014 using namespace TSF; 00015 using std::string; 00016 00017 using std::ostream; 00018 00019 enum CellType {NullCell, PointCell, LineCell, TriangleCell, TetCell, 00020 QuadCell, BrickCell, PrismCell}; 00021 00022 /** \ingroup LowLevelGeometry 00023 * Description of the topology of a cell 00024 * 00025 */ 00026 00027 class CellTopologyCode 00028 { 00029 public: 00030 inline CellTopologyCode() : type_(NullCell) {;} 00031 inline CellTopologyCode(const CellType& type) : type_(type) {;} 00032 00033 inline bool operator==(const CellTopologyCode& other) const 00034 {return type_==other.type_;} 00035 00036 inline bool operator<(const CellTopologyCode& other) const 00037 {return type_ < other.type_;} 00038 00039 inline bool operator==(const CellType& type) const {return type_==type;} 00040 inline bool operator<(const CellType& type) const {return type_<type;} 00041 00042 inline operator CellType () const {return type_;} 00043 00044 string toString() const ; 00045 00046 inline int hashCode() const {return (int) type_;} 00047 private: 00048 CellType type_; 00049 }; 00050 00051 } 00052 00053 namespace TSF 00054 { 00055 inline int hashCode(const Sundance::CellTopologyCode& c) 00056 {return c.hashCode();} 00057 00058 inline string toString(const Sundance::CellTopologyCode& c) 00059 {return c.toString();} 00060 } 00061 #endif 00062 00063