Warning, file /include/opencascade/BRepMesh_Vertex.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepMesh_Vertex_HeaderFile
0015 #define _BRepMesh_Vertex_HeaderFile
0016
0017 #include <Standard.hxx>
0018 #include <Standard_DefineAlloc.hxx>
0019 #include <gp_XY.hxx>
0020 #include <BRepMesh_DegreeOfFreedom.hxx>
0021 #include <Precision.hxx>
0022
0023
0024
0025
0026 class BRepMesh_Vertex
0027 {
0028 public:
0029 DEFINE_STANDARD_ALLOC
0030
0031
0032 BRepMesh_Vertex()
0033 : myLocation3d(0),
0034 myMovability(BRepMesh_Free)
0035 {
0036 }
0037
0038
0039
0040
0041
0042 BRepMesh_Vertex(const gp_XY& theUV,
0043 const int theLocation3d,
0044 const BRepMesh_DegreeOfFreedom theMovability)
0045 {
0046 Initialize(theUV, theLocation3d, theMovability);
0047 }
0048
0049
0050
0051
0052
0053 BRepMesh_Vertex(const double theU,
0054 const double theV,
0055 const BRepMesh_DegreeOfFreedom theMovability)
0056 : myUV(theU, theV),
0057 myLocation3d(0),
0058 myMovability(theMovability)
0059 {
0060 }
0061
0062
0063
0064
0065
0066 void Initialize(const gp_XY& theUV,
0067 const int theLocation3d,
0068 const BRepMesh_DegreeOfFreedom theMovability)
0069 {
0070 myUV = theUV;
0071 myLocation3d = theLocation3d;
0072 myMovability = theMovability;
0073 }
0074
0075
0076 const gp_XY& Coord() const { return myUV; }
0077
0078
0079 gp_XY& ChangeCoord() { return myUV; }
0080
0081
0082 int Location3d() const { return myLocation3d; }
0083
0084
0085 BRepMesh_DegreeOfFreedom Movability() const { return myMovability; }
0086
0087
0088 void SetMovability(const BRepMesh_DegreeOfFreedom theMovability) { myMovability = theMovability; }
0089
0090
0091
0092
0093 bool IsEqual(const BRepMesh_Vertex& theOther) const
0094 {
0095 if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted)
0096 {
0097 return false;
0098 }
0099
0100 return (myUV.IsEqual(theOther.myUV, Precision::PConfusion()));
0101 }
0102
0103
0104 bool operator==(const BRepMesh_Vertex& Other) const { return IsEqual(Other); }
0105
0106 private:
0107 gp_XY myUV;
0108 int myLocation3d;
0109 BRepMesh_DegreeOfFreedom myMovability;
0110 };
0111
0112 namespace std
0113 {
0114 template <>
0115 struct hash<BRepMesh_Vertex>
0116 {
0117 size_t operator()(const BRepMesh_Vertex& theVertex) const noexcept
0118 {
0119 return std::hash<double>{}(
0120 (std::floor(1e5 * theVertex.Coord().X()) * std::floor(1e5 * theVertex.Coord().Y())));
0121 }
0122 };
0123 }
0124
0125 #endif