b311480e |
1 | // Created on: 1993-06-23 |
2 | // Created by: Jean Yves LEBEY |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | #include <TopOpeBRepDS_Point.ixx> |
18 | #include <TopOpeBRepTool_ShapeTool.hxx> |
19 | |
20 | //======================================================================= |
21 | //function : TopOpeBRepDS_Point |
22 | //purpose : |
23 | //======================================================================= |
24 | |
25 | TopOpeBRepDS_Point::TopOpeBRepDS_Point() |
26 | : myKeep(Standard_True) |
27 | { |
28 | } |
29 | |
30 | |
31 | //======================================================================= |
32 | //function : TopOpeBRepDS_Point |
33 | //purpose : |
34 | //======================================================================= |
35 | |
36 | TopOpeBRepDS_Point::TopOpeBRepDS_Point(const gp_Pnt& P, |
37 | const Standard_Real T) |
38 | : myPoint(P), |
39 | myTolerance(T), |
40 | myKeep(Standard_True) |
41 | { |
42 | } |
43 | |
44 | |
45 | //======================================================================= |
46 | //function : TopOpeBRepDS_Point |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | TopOpeBRepDS_Point::TopOpeBRepDS_Point(const TopoDS_Shape& S) |
51 | { |
52 | myPoint = TopOpeBRepTool_ShapeTool::Pnt(S); |
53 | myTolerance = TopOpeBRepTool_ShapeTool::Tolerance(S); |
54 | } |
55 | |
56 | |
57 | //======================================================================= |
58 | //function : IsEqual |
59 | //purpose : |
60 | //======================================================================= |
61 | |
62 | Standard_Boolean TopOpeBRepDS_Point::IsEqual(const TopOpeBRepDS_Point& P) const |
63 | { |
64 | Standard_Real t = Max(myTolerance,P.Tolerance()); |
65 | Standard_Boolean b = myPoint.IsEqual(P.Point(),t); |
66 | return b; |
67 | } |
68 | |
69 | |
70 | //======================================================================= |
71 | //function : Point |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | const gp_Pnt& TopOpeBRepDS_Point::Point()const |
76 | { |
77 | return myPoint; |
78 | } |
79 | |
80 | //======================================================================= |
81 | //function : ChangePoint |
82 | //purpose : |
83 | //======================================================================= |
84 | |
85 | gp_Pnt& TopOpeBRepDS_Point::ChangePoint() |
86 | { |
87 | return myPoint; |
88 | } |
89 | |
90 | |
91 | //======================================================================= |
92 | //function : Tolerance |
93 | //purpose : |
94 | //======================================================================= |
95 | |
96 | Standard_Real TopOpeBRepDS_Point::Tolerance()const |
97 | { |
98 | return myTolerance; |
99 | } |
100 | |
101 | //======================================================================= |
102 | //function : Tolerance |
103 | //purpose : |
104 | //======================================================================= |
105 | |
106 | void TopOpeBRepDS_Point::Tolerance(const Standard_Real Tol) |
107 | { |
108 | myTolerance = Tol; |
109 | } |
110 | |
111 | //======================================================================= |
112 | //function : Keep |
113 | //purpose : |
114 | //======================================================================= |
115 | |
116 | Standard_Boolean TopOpeBRepDS_Point::Keep() const |
117 | { |
118 | return myKeep; |
119 | } |
120 | //======================================================================= |
121 | //function : ChangeKeep |
122 | //purpose : |
123 | //======================================================================= |
124 | |
125 | void TopOpeBRepDS_Point::ChangeKeep(const Standard_Boolean b) |
126 | { |
127 | myKeep = b; |
128 | } |