0023024: Update headers of OCCT files
[occt.git] / src / BRepMesh / BRepMesh_Vertex.cxx
CommitLineData
b311480e 1// Created on: 1993-09-23
2// Created by: Didier PIFFAULT
3// Copyright (c) 1993-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
22#include <BRepMesh_Vertex.ixx>
23#include <Precision.hxx>
24
25
26BRepMesh_Vertex::BRepMesh_Vertex()
0d88155b 27: myLocation(0), myMovability(BRepMesh_Free)
7fd59977 28{}
29
30BRepMesh_Vertex::BRepMesh_Vertex(const gp_XY& UV,
0d88155b
O
31 const Standard_Integer Locat3d,
32 const BRepMesh_DegreeOfFreedom Move)
33 : myUV(UV), myLocation(Locat3d), myMovability(Move)
7fd59977 34{}
35
36BRepMesh_Vertex::BRepMesh_Vertex(const Standard_Real U,
0d88155b
O
37 const Standard_Real V,
38 const BRepMesh_DegreeOfFreedom Move)
39 : myUV(U, V), myLocation(0), myMovability(Move)
7fd59977 40{}
41
42void BRepMesh_Vertex::Initialize(const gp_XY& UV,
0d88155b
O
43 const Standard_Integer Locat3d,
44 const BRepMesh_DegreeOfFreedom Move)
7fd59977 45{
46 myUV=UV;
47 myLocation=Locat3d;
48 myMovability=Move;
49}
50
0d88155b 51void BRepMesh_Vertex::SetMovability(const BRepMesh_DegreeOfFreedom Move)
7fd59977 52{
53 myMovability=Move;
54}
55
56//=======================================================================
57//function : HashCode IsEqual
58//purpose : Services for Map
59//=======================================================================
60Standard_Integer BRepMesh_Vertex::HashCode(const Standard_Integer Upper)const
61{
62 return ::HashCode (Floor(1e5*myUV.X())*Floor(1e5*myUV.Y()), Upper);
63}
64
65Standard_Boolean BRepMesh_Vertex::IsEqual(const BRepMesh_Vertex& Other)const
66{
0d88155b 67 if (myMovability!=BRepMesh_Deleted && Other.myMovability!=BRepMesh_Deleted)
7fd59977 68 return (myUV.IsEqual(Other.myUV, Precision::PConfusion()));
69 return Standard_False;
70}
71