b311480e |
1 | // Created on: 1993-11-30 |
2 | // Created by: Isabelle GRIGNON |
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 | |
42cf5bc1 |
17 | |
18 | #include <ChFiDS_CommonPoint.hxx> |
19 | #include <gp_Pnt.hxx> |
20 | #include <gp_Vec.hxx> |
21 | #include <Standard_DomainError.hxx> |
22 | #include <Standard_TypeMismatch.hxx> |
23 | #include <TopoDS_Edge.hxx> |
24 | #include <TopoDS_Vertex.hxx> |
7fd59977 |
25 | |
26 | //======================================================================= |
27 | //function : ChFiDS_CommonPoint |
28 | //purpose : |
29 | //======================================================================= |
7fd59977 |
30 | ChFiDS_CommonPoint::ChFiDS_CommonPoint() : |
31 | tol(0.), |
32 | isonarc(Standard_False), |
33 | isvtx(Standard_False), |
34 | hasvector(Standard_False) |
35 | { |
36 | } |
37 | |
38 | |
39 | //======================================================================= |
40 | //function : Reset |
41 | //purpose : |
42 | //======================================================================= |
43 | |
44 | void ChFiDS_CommonPoint::Reset() |
45 | { |
46 | tol = 0.; |
47 | isvtx = Standard_False; |
48 | isonarc = Standard_False; |
49 | hasvector = Standard_False; |
50 | } |
51 | |
52 | |
53 | //======================================================================= |
54 | //function : SetArc |
55 | //purpose : |
56 | // 30/09/1997 : PMN On n'ecrabouille plus la tolerance |
57 | //======================================================================= |
58 | |
59 | void ChFiDS_CommonPoint::SetArc(const Standard_Real Tol, |
60 | const TopoDS_Edge& A, |
61 | const Standard_Real Param, |
62 | const TopAbs_Orientation TArc) |
63 | { |
64 | isonarc = Standard_True; |
65 | if (Tol > tol) tol = Tol; |
66 | arc = A; |
67 | prmarc = Param; |
68 | traarc = TArc; |
69 | } |
70 | |
71 | //======================================================================= |
72 | //function : SetParameter |
73 | //purpose : |
74 | //======================================================================= |
75 | |
76 | void ChFiDS_CommonPoint::SetParameter(const Standard_Real Param) |
77 | { |
78 | prmtg = Param; |
79 | } |
80 | |
81 | //======================================================================= |
82 | //function : Arc |
83 | //purpose : |
84 | //======================================================================= |
85 | |
86 | const TopoDS_Edge& ChFiDS_CommonPoint::Arc()const |
87 | { |
88 | if (!isonarc){ |
89 | Standard_DomainError::Raise("CommonPoint not on Arc"); |
90 | } |
91 | return arc; |
92 | } |
93 | |
94 | |
95 | //======================================================================= |
96 | //function : TransitionOnArc |
97 | //purpose : |
98 | //======================================================================= |
99 | |
100 | TopAbs_Orientation ChFiDS_CommonPoint::TransitionOnArc()const |
101 | { |
102 | if (!isonarc){ |
103 | Standard_DomainError::Raise("CommonPoint not on Arc"); |
104 | } |
105 | return traarc; |
106 | } |
107 | |
108 | |
109 | //======================================================================= |
110 | //function : ParameterOnArc |
111 | //purpose : |
112 | //======================================================================= |
113 | |
114 | Standard_Real ChFiDS_CommonPoint::ParameterOnArc()const |
115 | { |
116 | if (!isonarc){ |
117 | Standard_DomainError::Raise("CommonPoint not on Arc"); |
118 | } |
119 | return prmarc; |
120 | } |
121 | |
122 | //======================================================================= |
123 | //function : Parameter |
124 | //purpose : |
125 | //======================================================================= |
126 | |
127 | Standard_Real ChFiDS_CommonPoint::Parameter()const |
128 | { |
129 | return prmtg; |
130 | } |
131 | |
132 | |