0025121: Visualization, OpenGl_Text - correct scaling factor for fixed-size text...
[occt.git] / src / ShapeAnalysis / ShapeAnalysis_Edge.cdl
CommitLineData
b311480e 1-- Created on: 1998-06-08
2-- Created by: data exchange team
3-- Copyright (c) 1998-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
17class Edge from ShapeAnalysis
18
19 ---Purpose: Tool for analyzing the edge.
20 -- Queries geometrical representations of the edge (3d curve, pcurve
21 -- on the given face or surface) and topological sub-shapes (bounding
22 -- vertices).
23 -- Provides methods for analyzing geometry and topology consistency
24 -- (3d and pcurve(s) consistency, their adjacency to the vertices).
25
26uses
27 Pnt from gp,
28 Pnt2d from gp,
29 Vec2d from gp,
30 Curve from Geom2d,
31 Curve from Geom,
32 Surface from Geom,
33 Vertex from TopoDS,
34 Edge from TopoDS,
35 Face from TopoDS,
36 Location from TopLoc,
37 Status from ShapeExtend
38
39is
40
41 Create returns Edge from ShapeAnalysis;
42 ---Purpose: Empty constructor; initialises Status to OK
43
44 HasCurve3d (me; edge: Edge from TopoDS) returns Boolean;
45 ---Purpose: Tells if the edge has a 3d curve
46
47 Curve3d (me; edge : Edge from TopoDS;
48 C3d : out Curve from Geom;
49 cf, cl: out Real;
50 orient: Boolean = Standard_True)
51 returns Boolean;
52 ---Purpose: Returns the 3d curve and bounding parameteres for the edge
53 -- Returns False if no 3d curve.
54 -- If <orient> is True (default), takes orientation into account:
55 -- if the edge is reversed, cf and cl are toggled
56
57 IsClosed3d (me; edge: Edge from TopoDS) returns Boolean;
58 ---Purpose: Gives True if the edge has a 3d curve, this curve is closed,
59 -- and the edge has the same vertex at start and end
60
61 HasPCurve (me; edge: Edge from TopoDS;
62 face: Face from TopoDS)
63 returns Boolean;
64 ---Purpose: Tells if the Edge has a pcurve on the face.
65
66 HasPCurve (me; edge : Edge from TopoDS;
67 surface : Surface from Geom;
68 location: Location from TopLoc)
69 returns Boolean;
70 ---Purpose: Tells if the edge has a pcurve on the surface (with location).
71
72 PCurve (me; edge : Edge from TopoDS;
73 face : Face from TopoDS;
74 C2d : out Curve from Geom2d;
75 cf, cl: out Real;
76 orient: Boolean = Standard_True)
77 returns Boolean;
78
79 PCurve (me; edge : Edge from TopoDS;
80 surface : Surface from Geom;
81 location: Location from TopLoc;
82 C2d : out Curve from Geom2d;
83 cf, cl : out Real;
84 orient : Boolean = Standard_True)
85 returns Boolean;
86 ---Purpose: Returns the pcurve and bounding parameteres for the edge
87 -- lying on the surface.
88 -- Returns False if the edge has no pcurve on this surface.
89 -- If <orient> is True (default), takes orientation into account:
90 -- if the edge is reversed, cf and cl are toggled
91
92 BoundUV (me; edge : Edge from TopoDS;
93 face : Face from TopoDS;
94 first, last: out Pnt2d from gp)
95 returns Boolean;
96
97 BoundUV (me; edge : Edge from TopoDS;
98 surface : Surface from Geom;
99 location: Location from TopLoc;
100 first, last: out Pnt2d from gp)
101 returns Boolean;
102 ---Purpose: Returns the ends of pcurve
103 -- Calls method PCurve with <orient> equal to True
104
105 IsSeam (me; edge: Edge from TopoDS;
106 face: Face from TopoDS)
107 returns Boolean;
108
109 IsSeam (me; edge : Edge from TopoDS;
110 surface : Surface from Geom;
111 location: Location from TopLoc)
112 returns Boolean;
113 ---Purpose: Returns True if the edge has two pcurves on one surface
114 ---Remark : Calls BRep_Tool::IsClosed()
115
116 FirstVertex (me; edge: Edge from TopoDS) returns Vertex from TopoDS;
117 ---Purpose: Returns start vertex of the edge (taking edge orientation
118 -- into account).
119 ---Remark: Vertex orientation is always FORWARD
120
121 LastVertex (me; edge: Edge from TopoDS) returns Vertex from TopoDS;
122 ---Purpose: Returns end vertex of the edge (taking edge orientation
123 -- into account).
124 ---Remark: Vertex orientation is always REVERSED
125
126 GetEndTangent2d (me; edge: Edge from TopoDS;
127 face: Face from TopoDS;
128 atEnd: Boolean;
129 pos : out Pnt2d from gp;
130 tang: out Vec2d from gp;
131 dparam: Real from Standard =0.0)
132 returns Boolean;
133
134 GetEndTangent2d (me; edge: Edge from TopoDS;
135 surface : Surface from Geom;
136 location: Location from TopLoc;
137 atEnd: Boolean;
138 pos : out Pnt2d from gp;
139 tang: out Vec2d from gp;
140 dparam: Real from Standard =0.0)
141 returns Boolean;
142 ---Purpose: Returns tangent of the edge pcurve at its start (if atEnd is
143 -- False) or end (if True), regarding the orientation of edge.
144 -- If edge is REVERSED, tangent is reversed before return.
145 -- Returns True if pcurve is available and tangent is computed
146 -- and is not null, else False.
147
148 CheckVerticesWithCurve3d (me: in out; edge : Edge from TopoDS;
149 preci: Real = -1;
150 vtx : Integer = 0)
151 returns Boolean;
152 ---Purpose: Checks the start and/or end vertex of the edge for matching
153 -- with 3d curve with the given precision.
154 -- <vtx> = 1 : start vertex only
155 -- <vtx> = 2 : end vertex only
156 -- <vtx> = 0 : both (default)
157 -- If preci < 0 the vertices are considered with their own
158 -- tolerances, else with the given <preci>.
159 ---Returns: True if mismatching of the vertex to the curve was detected
160 -- else returns False (OK)
161 ---Status : OK - ends of the 3d curve are comprised by checked vertices
162 -- FAIL1 - edge has no 3d curve
163 -- DONE1 - if first vertex of the edge does not comprise start of 3d curve
164 -- DONE2 - if last vertex of the edge does not comprise end of 3d curve
165
166 CheckVerticesWithPCurve (me: in out; edge : Edge from TopoDS;
167 face : Face from TopoDS;
168 preci: Real = -1;
169 vtx : Integer = 0)
170 returns Boolean;
171
172 CheckVerticesWithPCurve (me: in out; edge : Edge from TopoDS;
173 surface : Surface from Geom;
174 location: Location from TopLoc;
175 preci : Real = -1;
176 vtx : Integer = 0)
177 returns Boolean;
178 ---Purpose: Checks the start and/or end vertex of the edge for matching
179 -- with pcurve with the given precision.
180 -- <vtx> = 1 : start vertex
181 -- <vtx> = 2 : end vertex
182 -- <vtx> = 0 : both
183 -- If preci < 0 the vertices are considered with their own
184 -- tolerances, else with the given <preci>.
185 ---Returns: True if mismatching of the curves to the vertex was detected
186 -- else returns False (OK)
187 ---Status : OK - ends of the 3d curve are comprised by checked vertices
188 -- FAIL1 - edge has no pcurve on a given (sur)face
189 -- DONE1 - if first vertex of the edge does not comprise start of pcurve
190 -- DONE2 - if last vertex of the edge does not comprise end of pcurve
191
192 CheckVertexTolerance(me: in out; edge : Edge from TopoDS;
193 face : Face from TopoDS;
194 toler1: out Real;
195 toler2: out Real)
196 returns Boolean;
197 CheckVertexTolerance(me: in out; edge : Edge from TopoDS;
198 toler1: out Real;
199 toler2: out Real)
200 returns Boolean;
201 ---Purpose: Checks if it is necessary to increase tolerances of the edge
202 -- vertices to comprise the ends of 3d curve and pcurve on
203 -- the given face (first method) or all pcurves stored in an edge
204 -- (second one)
205 -- toler1 returns necessary tolerance for first vertex,
206 -- toler2 returns necessary tolerance for last vertex.
207 ---Returns: True, if tolerances should be increased, otherwise False
208 ---Status:
209 -- OK : the original tolerances are sufficient
210 -- DONE1: the tolerance of first vertex should be increased
211 -- DONE2: the tolerance of last vertex should be increased
212 -- FAIL1: edge has no vertice(s), no check is done
213 -- FAIL2: edge has no 3d curve, only pcurves are checked
214 -- FAIL3: edge has no pcurve on a given face, only 3d curve is checked
215
216 CheckCurve3dWithPCurve (me: in out; edge: Edge from TopoDS;
217 face: Face from TopoDS)
218 returns Boolean;
219
220 CheckCurve3dWithPCurve (me: in out; edge :Edge from TopoDS;
221 surface : Surface from Geom;
222 location: Location from TopLoc)
223 returns Boolean;
224 ---Purpose: Checks mutual orientation of 3d curve and pcurve on the
225 -- analysis of curves bounding points
226 ---Returns: Returns True if mismatching of orientation was detected,
227 -- else returns False (if OK or no curve)
228 ---Status:
229 -- OK : orientations match each other (both go in the same
230 -- directions), or edge is closed
231 -- DONE1: orientations mismatch each other (curves go in
232 -- opposite directions)
233 -- FAIL1: no pcurve
234 -- FAIL2: no 3d curve
235
236 CheckPoints (me: in out; P1A, P1B: Pnt from gp;
237 P2A, P2B: Pnt from gp;
238 preci1, preci2: Real)
239 returns Boolean is private;
240 ---Purpose: Check points by pairs (A and A, B and B) with precisions
241 -- (preci1 and preci2).
242 -- P1 are the points either from 3d curve or from vertices,
243 -- P2 are the points from pcurve
244 ---Returns: False if status is OK, else True
245 --- Status:
246 -- OK : distances (P1A, P2A) and (P1B, P2B) are within
247 -- precisions
248 -- DONE1: distance (P1A, P2B) + (P1B, P2A) is less than
249 -- distance (P1A, P2A) + (P1B, P2B),
250 -- the precisions are not taken into account in this case
251
252
253
254 Status (me; status: Status from ShapeExtend) returns Boolean;
255 ---Purpose: Returns the status (in the form of True/False) of last Check
256 ---Returns: True if status contains bit corresponding to enumerated argument
257
258 CheckSameParameter (me: in out; edge : Edge from TopoDS;
259 maxdev: out Real;
260 NbControl: Integer = 23)
261 returns Boolean;
262 ---Purpose: Checks the edge to be SameParameter.
263 -- Calculates the maximal deviation between 3d curve and each
264 -- pcurve of the edge on <NbControl> equidistant points (the same
265 -- algorithm as in BRepCheck; default value is 23 as in BRepCheck).
266 -- This deviation is returned in <maxdev> parameter.
267 -- If deviation is greater than tolerance of the edge (i.e.
268 -- incorrect flag) returns False, else returns True.
269 ---Returns: True if edge has either SameParameter False and/or its real
270 -- deviation of curves is more than tolerance
271 ---Status : OK - Edge is SameParameter with the associated tolerance
272 -- DONE1 - if deviation of the pcurves from 3d curve is greater
273 -- than tolerance of edge
274 -- DONE2 - if SameParameter flag in edge is False
275 -- FAIL1 - edge does not have 3d curve
276 -- FAIL2 - if some computational problems were encountered (when
277 -- projecting points on curves)
278
279 CheckOverlapping(me :in out; theEdge1, theEdge2 : Edge from TopoDS;
280 theTolOverlap:in out Real; theDomainDist : Real =0.0) returns Boolean;
281 ---Purpose: Checks the first edge is overlapped with second edge.
282 -- If distance between two edges is less then theTolOverlap
283 -- edges is overlapped.
284 -- theDomainDis - length of part of edges on wich edges is overlapped.
285 ---Status : DONE3 - edges is overlapped on whole length
286 -- : DONE4 - edges is overlapped on the length equal to theDomainDist
287
288
289fields
290
291 myStatus: Integer is protected;
292
293end Edge;