![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 00022 #ifndef Tulip_FACE_H 00023 #define Tulip_FACE_H 00024 #include <tulip/tulipconf.h> 00025 #include <tulip/tuliphash.h> 00026 00027 #include <climits> 00028 00029 namespace tlp { 00030 00031 struct Face { 00032 unsigned int id; 00033 Face():id(UINT_MAX) {} 00034 explicit Face(unsigned int j):id(j) {} 00035 bool operator!=(const Face f) const { 00036 return id!=f.id; 00037 } 00038 bool operator==(const Face f) const { 00039 return id==f.id; 00040 } 00041 bool isValid() const { 00042 return id!=UINT_MAX; 00043 } 00044 }; 00045 00046 } 00047 00048 #ifndef DOXYGEN_NOTFOR_DEVEL 00049 00050 TLP_BEGIN_HASH_NAMESPACE { 00051 template<> struct hash<tlp::Face> { 00052 size_t operator()(const tlp::Face f) const {return f.id;} 00053 }; 00054 } 00055 TLP_END_HASH_NAMESPACE 00056 00057 namespace std { 00058 template<> struct equal_to<tlp::Face> { 00059 size_t operator()(const tlp::Face f,const tlp::Face f2) const { 00060 return f.id == f2.id; 00061 } 00062 }; 00063 template<> struct less<tlp::Face> { 00064 size_t operator()(const tlp::Face f,const tlp::Face f2) const { 00065 return f.id < f2.id; 00066 } 00067 }; 00068 } 00069 #endif // DOXYGEN_NOTFOR_DEVEL 00070 00071 #endif 00072 ///@endcond