b311480e |
1 | -- Created on: 1997-11-20 |
2 | -- Created by: Philippe MANGIN |
3 | -- Copyright (c) 1997-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 | |
23 | class Sweep from GeomFill |
24 | |
25 | ---Purpose: Geometrical Sweep Algorithm |
26 | ---Level: Advanced |
27 | |
28 | uses |
29 | SectionLaw from GeomFill, |
30 | LocationLaw from GeomFill, |
31 | ApproxStyle from GeomFill, |
32 | Shape from GeomAbs, |
33 | |
34 | Surface from Geom, |
35 | Curve from Geom2d, |
36 | HArray1OfCurve from TColGeom2d, |
37 | HArray2OfReal from TColStd |
38 | |
39 | raises |
40 | NotDone, |
41 | OutOfRange, |
42 | ConstructionError |
43 | |
44 | is |
45 | Create(Location : LocationLaw from GeomFill; |
46 | WithKpart : Boolean = Standard_True) |
47 | returns Sweep from GeomFill; |
48 | |
49 | SetDomain(me : in out; First, Last : Real; |
50 | SectionFirst, SectionLast : Real); |
51 | ---Purpose: Set parametric information |
52 | -- [<First>, <Last>] Sets the parametric bound of the |
53 | -- sweeping surface to build. |
54 | -- <SectionFirst>, <SectionLast> gives coresponding |
55 | -- bounds parameter on the section law of <First> and <Last> |
56 | -- |
57 | -- V-Iso on Sweeping Surface S(u,v) is defined by |
58 | -- Location(v) and Section(w) where |
59 | -- w = SectionFirst + (v - First) / (Last-First) |
60 | -- * (SectionLast - SectionFirst) |
61 | -- |
62 | -- By default w = v, and First and Last are given by |
63 | -- First and Last parameter stored in LocationLaw. |
64 | |
65 | SetTolerance(me : in out; |
66 | Tol3d : Real; |
67 | BoundTol : Real = 1.0; |
68 | Tol2d : Real = 1.0e-5; |
69 | TolAngular : Real = 1.0); |
70 | ---Purpose: Set Approximation Tolerance |
71 | -- Tol3d : Tolerance to surface approximation |
72 | -- Tol2d : Tolerance used to perform curve approximation |
73 | -- Normaly the 2d curve are approximated with a |
74 | -- tolerance given by the resolution method define in |
75 | -- <LocationLaw> but if this tolerance is too large Tol2d |
76 | -- is used. |
77 | -- TolAngular : Tolerance (in radian) to control the angle |
78 | -- beetween tangents on the section law and |
79 | -- tangent of iso-v on approximed surface |
80 | |
a31abc03 |
81 | SetForceApproxC1(me : in out; |
82 | ForceApproxC1 : Boolean from Standard); |
83 | ---Purpose: Set the flag that indicates attempt to approximate |
84 | -- a C1-continuous surface if a swept surface proved |
85 | -- to be C0. |
86 | |
7fd59977 |
87 | ExchangeUV(me) |
88 | ---Purpose: returns true if sections are U-Iso |
89 | -- This can be produce in some cases when <WithKpart> is True. |
90 | returns Boolean from Standard |
91 | is static; |
92 | |
93 | UReversed(me) |
94 | ---Purpose: returns true if Parametrisation sens in U is inverse of |
95 | -- parametrisation sens of section (or of path if ExchangeUV) |
96 | returns Boolean from Standard |
97 | is static; |
98 | |
99 | VReversed(me) |
100 | ---Purpose: returns true if Parametrisation sens in V is inverse of |
101 | -- parametrisation sens of path (or of section if ExchangeUV) |
102 | returns Boolean from Standard |
103 | is static; |
104 | |
105 | |
106 | Build(me : in out; |
107 | Section : SectionLaw from GeomFill; |
108 | Methode : ApproxStyle = GeomFill_Location; |
109 | Continuity : Shape = GeomAbs_C2; |
110 | Degmax : Integer = 10; |
111 | Segmax : Integer = 30) |
112 | ---Purpose: Build the Sweeep Surface |
113 | -- ApproxStyle defines Approximation Strategy |
114 | -- - GeomFill_Section : The composed Function : Location X Section |
115 | -- is directly approximed. |
116 | -- - GeomFill_Location : The location law is approximed, and the |
117 | -- SweepSurface is build algebric composition |
118 | -- of approximed location law and section law |
119 | -- This option is Ok, if Section.Surface() methode |
120 | -- is effective. |
121 | -- Continuity : The continuity in v waiting on the surface |
122 | -- Degmax : The maximum degree in v requiered on the surface |
123 | -- Segmax : The maximum number of span in v requiered on |
124 | -- the surface |
125 | -- |
126 | -- raise If Domain are infinite or Profile not Setted. |
127 | raises ConstructionError; |
128 | |
129 | Build2d(me:in out; |
130 | Continuity : Shape; |
131 | Degmax : Integer; |
132 | Segmax : Integer) |
133 | returns Boolean |
134 | is private; |
135 | |
136 | BuildAll(me:in out; |
137 | Continuity : Shape; |
138 | Degmax : Integer; |
139 | Segmax : Integer) |
140 | returns Boolean |
141 | is private; |
142 | |
143 | BuildProduct(me:in out; |
144 | Continuity : Shape; |
145 | Degmax : Integer; |
146 | Segmax : Integer) |
147 | returns Boolean |
148 | is private; |
149 | |
150 | BuildKPart(me:in out) |
151 | returns Boolean |
152 | is private; |
153 | |
154 | IsDone(me) |
155 | ---Purpose: Tells if the Surface is Buildt. |
156 | returns Boolean; |
157 | |
158 | ErrorOnSurface(me) |
159 | ---Purpose: Gets the Approximation error. |
160 | returns Real; |
161 | |
162 | ErrorOnRestriction(me; IsFirst : Boolean; |
163 | UError, VError : out Real) |
164 | ---Purpose: Gets the Approximation error. |
165 | raises NotDone; |
166 | |
167 | ErrorOnTrace(me; IndexOfTrace : Integer; |
168 | UError, VError : out Real) |
169 | ---Purpose: Gets the Approximation error. |
170 | raises NotDone, OutOfRange; |
171 | |
172 | Surface(me) |
173 | returns Surface from Geom |
174 | raises NotDone; |
175 | |
176 | Restriction(me; IsFirst : Boolean) |
177 | returns Curve from Geom2d |
178 | raises NotDone; |
179 | |
180 | NumberOfTrace(me) |
181 | returns Integer; |
182 | |
183 | Trace(me; IndexOfTrace : Integer) |
184 | returns Curve from Geom2d |
185 | raises NotDone, OutOfRange; |
186 | |
187 | |
188 | fields |
189 | First, Last : Real; |
190 | SFirst, SLast: Real; |
191 | Tol3d, BoundTol, Tol2d, TolAngular : Real; |
a31abc03 |
192 | SError : Real; |
193 | myForceApproxC1 : Boolean; |
194 | |
7fd59977 |
195 | myLoc : LocationLaw from GeomFill; |
196 | mySec : SectionLaw from GeomFill; |
197 | mySurface : Surface from Geom; |
198 | myCurve2d : HArray1OfCurve from TColGeom2d; |
199 | CError : HArray2OfReal from TColStd; |
200 | |
201 | done : Boolean; |
202 | myExchUV : Boolean from Standard; |
203 | isUReversed : Boolean; |
204 | isVReversed : Boolean; |
205 | myKPart : Boolean from Standard; |
206 | end Sweep; |