b311480e |
1 | -- Created on: 1992-01-30 |
2 | -- Created by: Didier PIFFAULT |
3 | -- Copyright (c) 1992-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 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public version 2.1 as published |
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. |
b311480e |
16 | |
7fd59977 |
17 | -- xpu:4/3/97 implementation |
7fd59977 |
18 | |
19 | |
20 | class SurfaceTransition from TopTrans |
21 | |
22 | ---Purpose: This algorithm is used to compute the transition |
23 | -- of a 3D surface intersecting a topological surfacic |
24 | -- boundary on a 3D curve ( intersection curve ). |
25 | -- The boundary is described by a set of faces |
26 | -- each face is described by |
27 | -- - its support surface, |
28 | -- - an orientation defining its matter side. |
29 | -- The geometric elements are described locally at the |
30 | -- intersection point by a second order development. |
31 | -- A surface is described by the normal vector, the |
32 | -- principal directions and the principal curvatures. |
33 | -- A curve is described by the tangent, the normal |
34 | -- and the curvature. |
35 | -- The algorithm keeps track of the two faces elements |
36 | -- closest to the part of the curve "before" and "after" |
37 | -- the intersection, these two elements are updated |
38 | -- for each new face. |
39 | -- The position of the curve can be computed when at |
40 | -- least one surface element has been given, this |
41 | -- position is "In","Out" or "On" for the part of the |
42 | -- curve "Before" or "After" the intersection. |
43 | |
44 | uses |
45 | Pnt from gp, |
46 | Dir from gp, |
47 | State from TopAbs, |
48 | Orientation from TopAbs, |
49 | Array2OfReal from TColStd, |
50 | Array2OfOrientation from TopTrans |
51 | is |
52 | |
53 | Create returns SurfaceTransition from TopTrans; |
54 | ---Purpose: Create an empty Surface Transition. |
55 | |
56 | Reset ( me : in out; |
57 | Tgt : Dir from gp; -- curve tangent at this point |
58 | Norm : Dir from gp; -- surface normal at this point |
59 | MaxD, MinD : Dir from gp; -- surface principal directions at this point |
60 | MaxCurv, MinCurv : in Real ); -- curvatures on surface at this point |
61 | ---Purpose: Initialize a Surface Transition with the local |
62 | -- description of the intersection curve and of the |
63 | -- reference surface. |
64 | -- PREQUESITORY : Norm oriented OUTSIDE "geometric matter" |
65 | |
66 | Reset ( me : in out; |
67 | Tgt : Dir from gp; |
68 | Norm : Dir from gp ); |
69 | ---Purpose: Initialize a Surface Transition with the local |
70 | -- description of a straight line. |
71 | |
72 | Compare(me : in out; |
73 | Tole : Real; -- Cosine tolerance |
74 | Norm : Dir from gp; -- surface normal oriented at this point |
75 | MaxD, MinD : Dir from gp; -- surface principal directions at this point |
76 | MaxCurv, MinCurv : in Real; -- curvatures on surface at this point |
77 | S : Orientation from TopAbs; |
78 | O : Orientation from TopAbs ); |
79 | ---Purpose: Add a face element to the boundary. |
80 | -- |
81 | -- - S defines topological orientation for the face : |
82 | -- S FORWARD means: along the intersection curve on the |
83 | -- reference surface, transition states while crossing |
84 | -- the face are OUT,IN. |
85 | -- S REVERSED means states are IN,OUT. |
86 | -- S INTERNAL means states are IN,IN. |
87 | -- |
88 | -- - O defines curve's position on face : |
89 | -- O FORWARD means the face is before the intersection |
90 | -- O REVERSED means the face is AFTER |
91 | -- O INTERNAL means the curve intersection is in the face. |
92 | -- PREQUESITORY : Norm oriented OUTSIDE "geometric matter" |
93 | |
94 | Compare(me : in out; |
95 | Tole : Real; |
96 | Norm : Dir from gp; |
97 | S : Orientation from TopAbs; |
98 | O : Orientation from TopAbs); |
99 | ---Purpose: Add a plane or a cylindric face to the boundary. |
100 | |
101 | StateBefore(me) returns State from TopAbs; |
102 | ---Purpose: Returns the state of the reference surface before |
103 | -- the interference, this is the position relative to |
104 | -- the surface of a point very close to the intersection |
105 | -- on the negative side of the tangent. |
106 | |
107 | StateAfter(me) returns State from TopAbs; |
108 | ---Purpose: Returns the state of the reference surface after |
109 | -- interference, this is the position relative to the |
110 | -- surface of a point very close to the intersection |
111 | -- on the positive side of the tangent. |
112 | |
113 | -- |
114 | -- Private : |
115 | -- |
116 | |
117 | UpdateReference(me : in out; |
118 | Tole : Real; |
119 | isInfRef : Boolean; |
120 | CosInf, CosSup : in out Real; |
121 | Tran : Orientation from TopAbs; |
122 | TranRef : in out Orientation from TopAbs) is private; |
123 | |
124 | ComputeCos(me; |
125 | Tole : Real; -- cosinus tolerance |
126 | Norm : Dir from gp; -- face normal |
127 | O : Orientation from TopAbs; -- intersection position on face |
128 | isleft : out Boolean) returns Real is private; |
129 | |
130 | GetBefore(myclass; |
131 | Tran : Orientation from TopAbs) |
132 | returns State from TopAbs; |
133 | |
134 | GetAfter(myclass; |
135 | Tran : Orientation from TopAbs) |
136 | returns State from TopAbs; |
137 | |
138 | fields |
139 | |
140 | -- local reference input data : |
141 | myTgt : Dir from gp; -- intersection curve tangent |
142 | myNorm : Dir from gp; -- reference surface normal |
143 | beafter : Dir from gp; -- direction (Before, After) on reference surface. |
144 | myCurvRef : Real; -- for the reference surface |
145 | |
146 | -- local data for boundary faces : |
147 | myAng : Array2OfReal from TColStd; |
148 | myCurv : Array2OfReal from TColStd; |
149 | myOri : Array2OfOrientation from TopTrans; |
150 | |
151 | -- flag for touch case (eap Mar 25 2002) |
152 | myTouchFlag : Boolean from Standard; |
153 | |
154 | end SurfaceTransition; |
155 | |
156 | |