CommitLineData
b311480e 1-- Created on: 1992-01-30
2-- Created by: Didier PIFFAULT
3-- Copyright (c) 1992-1999 Matra Datavision
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
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--
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
23class CurveTransition from TopTrans
24
25 ---Purpose: This algorithm is used to compute the transition
26 -- of a Curve intersecting a curvilinear boundary.
27 --
28 -- The geometric elements are described locally at
29 -- the intersection point by a second order
30 -- development.
31 --
32 -- The curve is described by the intersection point,
33 -- the tangent vector and the curvature.
34 --
35 -- The boundary is described by a set of curve
36 -- elements, a curve element is either :
37 --
38 -- - A curve.
39 --
40 -- - A curve and an orientation called a half-curve,
41 -- the boundary of the curve is before or after the
42 -- intersection point depending on the orientation.
43 --
44
45uses
46
47 Boolean from Standard,
48 Real from Standard,
49
50 Pnt from gp,
51 Dir from gp,
52
53 State from TopAbs,
54 Orientation from TopAbs
55
56is
57
58 Create returns CurveTransition from TopTrans;
59 ---Purpose: Create an empty Curve Transition.
60
61
62 Reset( me : in out;
63 Tgt : in Dir from gp; -- Tangent at this point
64 Norm : in Dir from gp; -- Normal vector at this point
65 Curv : in Real from Standard);-- Curvature at this point
66 ---Purpose: Initialize a Transition with the local description
67 -- of a Curve.
68
69 Reset( me : in out;
70 Tgt : in Dir from gp); -- Tangent at this point
71 ---Purpose: Initialize a Transition with the local description
72 -- of a straigth line.
73
74 Compare(me : in out;
75 Tole : in Real from Standard; -- Cosine tolerance
76 Tang : in Dir from gp; -- Tangent on curve for this point
77 Norm : in Dir from gp; -- Normal vector at this point
78 Curv : in Real from Standard; -- Curvature at this point
79 S : in Orientation from TopAbs; -- transition locale
80 Or : in Orientation from TopAbs);-- orientation de la tangente
81 ---Purpose: Add a curve element to the boundary. If Or is
82 -- REVERSED the curve is before the intersection,
83 -- else if Or is FORWARD the curv is after the
84 -- intersection and if Or is INTERNAL the
85 -- intersection is in the middle of the curv.
86
87 StateBefore(me) returns State from TopAbs;
88 ---Purpose: returns the state of the curve before the
89 -- intersection, this is the position relative to the
90 -- boundary of a point very close to the intersection
91 -- on the negative side of the tangent.
92
93 StateAfter(me) returns State from TopAbs;
94 ---Purpose: returns the state of the curve after the
95 -- intersection, this is the position relative to the
96 -- boundary of a point very close to the intersection
97 -- on the positive side of the tangent.
98
99
100---Implementation functions :
101
102 IsBefore( me;
103 Tole : in Real from Standard;
104 Angl : in Real from Standard;
105 Nor1 : in Dir from gp;
106 Cur1 : in Real from Standard;
107 Nor2 : in Dir from gp;
108 Cur2 : in Real from Standard)
109 returns Boolean from Standard is private;
110 ---Purpose: Compare two curvature and return true if N1,C1 is
111 -- before N2,C2 in the edge orientation
112
113 Compare(me;
114 Ang1 : in Real from Standard;
115 Ang2 : in Real from Standard;
116 Tole : in Real from Standard)
117 returns Integer from Standard is private;
118 ---Purpose: Compare two angles at tolerance Tole
119
120
121fields
122
123 myTgt : Dir from gp; -- Tangent at this point
124 myNorm : Dir from gp; -- Normal vector at this point
125 myCurv : Real; -- Curvature at this point
126
127 Init : Boolean;
128
129 TgtFirst : Dir from gp; -- Elements to determine the state
130 NormFirst : Dir from gp; --
131 CurvFirst : Real; -- before the intersection
132 TranFirst : Orientation from TopAbs;
133
134 TgtLast : Dir from gp; -- Elements to determine the state
135 NormLast : Dir from gp; --
136 CurvLast : Real; -- After the intersection
137 TranLast : Orientation from TopAbs;
138
139end CurveTransition;