0032922: Data Exchange, STEP - The torus is stored incorrectly in STEP format
[occt.git] / src / ShapeAnalysis / ShapeAnalysis_Wire.hxx
1 // Created on: 1998-06-03
2 // Created by: data exchange team
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _ShapeAnalysis_Wire_HeaderFile
18 #define _ShapeAnalysis_Wire_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TopoDS_Face.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Transient.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <IntRes2d_SequenceOfIntersectionPoint.hxx>
29 #include <TColgp_SequenceOfPnt.hxx>
30 #include <TColStd_SequenceOfReal.hxx>
31 #include <TopTools_IndexedMapOfShape.hxx>
32 #include <TopTools_DataMapOfShapeListOfShape.hxx>
33 #include <TopTools_MapOfShape.hxx>
34 #include <ShapeExtend_Status.hxx>
35 class ShapeExtend_WireData;
36 class ShapeAnalysis_Surface;
37 class TopoDS_Wire;
38 class Geom_Surface;
39 class TopLoc_Location;
40 class ShapeAnalysis_WireOrder;
41 class Geom2d_Curve;
42 class gp_Pnt2d;
43 class TopoDS_Shape;
44 class TopoDS_Edge;
45
46 // resolve name collisions with X11 headers
47 #ifdef Status
48   #undef Status
49 #endif
50
51 class ShapeAnalysis_Wire;
52 DEFINE_STANDARD_HANDLE(ShapeAnalysis_Wire, Standard_Transient)
53
54 //! This class provides analysis of a wire to be compliant to
55 //! CAS.CADE requirements.
56 //!
57 //! The functionalities provided are the following:
58 //! 1. consistency of 2d and 3d edge curve senses
59 //! 2. connection of adjacent edges regarding to:
60 //! a. their vertices
61 //! b. their pcurves
62 //! c. their 3d curves
63 //! 3. adjacency of the edge vertices to its pcurve and 3d curve
64 //! 4. if a wire is closed or not (considering its 3d and 2d
65 //! contour)
66 //! 5. if a wire is outer on its face (considering pcurves)
67 //!
68 //! This class can be used in conjunction with class
69 //! ShapeFix_Wire, which will fix the problems detected by this class.
70 //!
71 //! The methods of the given class match to ones of the class
72 //! ShapeFix_Wire, e.g., CheckSmall and FixSmall.
73 //! This class also includes some auxiliary methods
74 //! (e.g., CheckOuterBound, etc.),
75 //! which have no pair in ShapeFix_Wire.
76 //!
77 //! Like methods of ShapeFix_Wire the ones of this class are
78 //! grouped into two levels:
79 //! - Public which are recommended for use (the most global
80 //! method is Perform),
81 //! - Advanced, for optional use only
82 //!
83 //! For analyzing result of Public API checking methods use
84 //! corresponding Status... method.
85 //! The 'advanced' functions share the single status field which
86 //! contains the result of the last performed 'advanced' method.
87 //! It is queried by the method LastCheckStatus().
88 //!
89 //! In order to prepare an analyzer, it is necessary to load a wire,
90 //! set face and precision.
91 class ShapeAnalysis_Wire : public Standard_Transient
92 {
93
94 public:
95
96   
97   //! Empty constructor
98   Standard_EXPORT ShapeAnalysis_Wire();
99   
100   //! Creates object with standard TopoDS_Wire, face
101   //! and precision
102   Standard_EXPORT ShapeAnalysis_Wire(const TopoDS_Wire& wire, const TopoDS_Face& face, const Standard_Real precision);
103   
104   //! Creates the object with WireData object, face
105   //! and precision
106   Standard_EXPORT ShapeAnalysis_Wire(const Handle(ShapeExtend_WireData)& sbwd, const TopoDS_Face& face, const Standard_Real precision);
107   
108   //! Initializes the object with standard TopoDS_Wire, face
109   //! and precision
110   Standard_EXPORT void Init (const TopoDS_Wire& wire, const TopoDS_Face& face, const Standard_Real precision);
111   
112   //! Initializes the object with WireData object, face
113   //! and precision
114   Standard_EXPORT void Init (const Handle(ShapeExtend_WireData)& sbwd, const TopoDS_Face& face, const Standard_Real precision);
115   
116   //! Loads the object with standard TopoDS_Wire
117   Standard_EXPORT void Load (const TopoDS_Wire& wire);
118   
119   //! Loads the object with WireData object
120   Standard_EXPORT void Load (const Handle(ShapeExtend_WireData)& sbwd);
121   
122   //! Loads the face the wire lies on
123   Standard_EXPORT void SetFace (const TopoDS_Face& face);
124   
125   //! Loads the surface the wire lies on
126   Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& surface);
127   
128   //! Loads the surface the wire lies on
129   Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& surface, const TopLoc_Location& location);
130   
131   Standard_EXPORT void SetPrecision (const Standard_Real precision);
132   
133   //! Unsets all the status and distance fields
134   //! wire, face and precision are not cleared
135   Standard_EXPORT void ClearStatuses();
136   
137   //! Returns True if wire is loaded and has number of edges >0
138     Standard_Boolean IsLoaded() const;
139   
140   //! Returns True if IsLoaded and underlying face is not null
141     Standard_Boolean IsReady() const;
142   
143   //! Returns the value of precision
144     Standard_Real Precision() const;
145   
146   //! Returns wire object being analyzed
147     const Handle(ShapeExtend_WireData)& WireData() const;
148   
149   //! Returns the number of edges in the wire, or 0 if it is not loaded
150     Standard_Integer NbEdges() const;
151   
152   //! Returns the working face
153     const TopoDS_Face& Face() const;
154   
155   //! Returns the working surface
156     const Handle(ShapeAnalysis_Surface)& Surface() const;
157   
158   //! Performs all the checks in the following order :
159   //! CheckOrder, CheckSmall, CheckConnected, CheckEdgeCurves,
160   //! CheckDegenerated, CheckSelfIntersection, CheckLacking,
161   //! CheckClosed
162   //! Returns: True if at least one method returned True;
163   //! For deeper analysis use Status...(status) methods
164   Standard_EXPORT Standard_Boolean Perform();
165   
166   //! Calls CheckOrder and returns False if wire is already
167   //! ordered (tail-to-head), True otherwise
168   //! Flag <isClosed> defines if the wire is closed or not
169   //! Flag <mode3d> defines which mode is used (3d or 2d)
170   Standard_EXPORT Standard_Boolean CheckOrder (const Standard_Boolean isClosed = Standard_True, const Standard_Boolean mode3d = Standard_True);
171   
172   //! Calls to CheckConnected for each edge
173   //! Returns: True if at least one pair of disconnected edges (not sharing the
174   //! same vertex) was detected
175   Standard_EXPORT Standard_Boolean CheckConnected (const Standard_Real prec = 0.0);
176   
177   //! Calls to CheckSmall for each edge
178   //! Returns: True if at least one small edge was detected
179   Standard_EXPORT Standard_Boolean CheckSmall (const Standard_Real precsmall = 0.0);
180   
181   //! Checks edges geometry (consistency of 2d and 3d senses, adjasment
182   //! of curves to the vertices, etc.).
183   //! The order of the checks :
184   //! Call ShapeAnalysis_Wire to check:
185   //! ShapeAnalysis_Edge::CheckCurve3dWithPCurve  (1),
186   //! ShapeAnalysis_Edge::CheckVertcesWithPCurve  (2),
187   //! ShapeAnalysis_Edge::CheckVertcesWithCurve3d (3),
188   //! CheckSeam                                   (4)
189   //! Additional:
190   //! CheckGap3d                                  (5),
191   //! CheckGap2d                                  (6),
192   //! ShapeAnalysis_Edge::CheckSameParameter      (7)
193   //! Returns: True if at least one check returned True
194   //! Remark:  The numbers in brackets show with what DONEi or FAILi
195   //! the status can be queried
196   Standard_EXPORT Standard_Boolean CheckEdgeCurves();
197   
198   //! Calls to CheckDegenerated for each edge
199   //! Returns: True if at least one incorrect degenerated edge was detected
200   Standard_EXPORT Standard_Boolean CheckDegenerated();
201   
202   //! Checks if wire is closed, performs CheckConnected,
203   //! CheckDegenerated and CheckLacking for the first and the last edges
204   //! Returns: True if at least one check returned True
205   //! Status:
206   //! FAIL1 or DONE1: see CheckConnected
207   //! FAIL2 or DONE2: see CheckDegenerated
208   Standard_EXPORT Standard_Boolean CheckClosed (const Standard_Real prec = 0.0);
209   
210   //! Checks self-intersection of the wire (considering pcurves)
211   //! Looks for self-intersecting edges and each pair of intersecting
212   //! edges.
213   //! Warning: It does not check each edge with any other one (only each two
214   //! adjacent edges)
215   //! The order of the checks :
216   //! CheckSelfIntersectingEdge, CheckIntersectingEdges
217   //! Returns: True if at least one check returned True
218   //! Status:  FAIL1 or DONE1 - see CheckSelfIntersectingEdge
219   //! FAIL2 or DONE2 - see CheckIntersectingEdges
220   Standard_EXPORT Standard_Boolean CheckSelfIntersection();
221   
222   //! Calls to CheckLacking for each edge
223   //! Returns: True if at least one lacking edge was detected
224   Standard_EXPORT Standard_Boolean CheckLacking();
225   
226   Standard_EXPORT Standard_Boolean CheckGaps3d();
227   
228   Standard_EXPORT Standard_Boolean CheckGaps2d();
229   
230   Standard_EXPORT Standard_Boolean CheckCurveGaps();
231   
232   //! Analyzes the order of the edges in the wire,
233   //! uses class WireOrder for that purpose.
234   //! Flag <isClosed> defines if the wire is closed or not
235   //! Flag <theMode3D> defines 3D or 2d mode.
236   //! Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored.
237   //! Returns False if wire is already ordered (tail-to-head),
238   //! True otherwise.
239   //! Use returned WireOrder object for deeper analysis.
240   //! Status:
241   //! OK   : the same edges orientation, the same edges sequence
242   //! DONE1: the same edges orientation, not the same edges sequence
243   //! DONE2: as DONE1 and gaps more than myPrecision
244   //! DONE3: not the same edges orientation (some need to be reversed)
245   //! DONE4: as DONE3 and gaps more than myPrecision
246   //! FAIL : algorithm failed (could not detect order)
247   Standard_EXPORT Standard_Boolean CheckOrder(ShapeAnalysis_WireOrder &sawo,
248                                               Standard_Boolean isClosed = Standard_True,
249                                               Standard_Boolean theMode3D = Standard_True,
250                                               Standard_Boolean theModeBoth = Standard_False);
251   
252   //! Checks connected edges (num-th and preceding).
253   //! Tests with starting preci from <SBWD> or  with <prec> if
254   //! it is greater.
255   //! Considers Vertices.
256   //! Returns: False if edges are connected by the common vertex, else True
257   //! Status  :
258   //! OK    : Vertices (end of num-1 th edge and start on num-th one)
259   //! are already the same
260   //! DONE1 : Absolutely confused (gp::Resolution)
261   //! DONE2 : Confused at starting <preci> from <SBWD>
262   //! DONE3 : Confused at <prec> but not <preci>
263   //! FAIL1 : Not confused
264   //! FAIL2 : Not confused but confused with <preci> if reverse num-th edge
265   Standard_EXPORT Standard_Boolean CheckConnected (const Standard_Integer num, const Standard_Real prec = 0.0);
266   
267   //! Checks if an edge has a length not greater than myPreci or
268   //! precsmall (if it is smaller)
269   //! Returns: False if its length is greater than precision
270   //! Status:
271   //! OK   : edge is not small or degenerated
272   //! DONE1: edge is small, vertices are the same
273   //! DONE2: edge is small, vertices are not the same
274   //! FAIL : no 3d curve and pcurve
275   Standard_EXPORT Standard_Boolean CheckSmall (const Standard_Integer num, const Standard_Real precsmall = 0.0);
276   
277   //! Checks if a seam pcurves are correct oriented
278   //! Returns: False (status OK) if given edge is not a seam or if it is OK
279   //! C1 - current pcurve for FORWARD edge,
280   //! C2 - current pcurve for REVERSED edge (if returns True they
281   //! should be swapped for the seam),
282   //! cf, cl - first and last parameters on curves
283   //! Status:
284   //! OK   : Pcurves are correct or edge is not seam
285   //! DONE : Seam pcurves should be swapped
286   Standard_EXPORT Standard_Boolean CheckSeam (const Standard_Integer num, Handle(Geom2d_Curve)& C1, Handle(Geom2d_Curve)& C2, Standard_Real& cf, Standard_Real& cl);
287   
288   //! Checks if a seam pcurves are correct oriented
289   //! See previous functions for details
290   Standard_EXPORT Standard_Boolean CheckSeam (const Standard_Integer num);
291   
292   //! Checks for degenerated edge between two adjacent ones.
293   //! Fills parameters dgnr1 and dgnr2 with points in parametric
294   //! space that correspond to the singularity (either gap that
295   //! needs to be filled by degenerated edge or that already filled)
296   //! Returns: False if no singularity or edge is already degenerated,
297   //! otherwise True
298   //! Status:
299   //! OK   : No surface singularity, or edge is already degenerated
300   //! DONE1: Degenerated edge should be inserted (gap in 2D)
301   //! DONE2: Edge <num> should be made degenerated (recompute pcurve
302   //! and set the flag)
303   //! FAIL1: One of edges neighbouring to degenerated one has
304   //! no pcurve
305   //! FAIL2: Edge marked as degenerated and has no pcurve
306   //! but singularity is not detected
307   Standard_EXPORT Standard_Boolean CheckDegenerated (const Standard_Integer num, gp_Pnt2d& dgnr1, gp_Pnt2d& dgnr2);
308   
309   //! Checks for degenerated edge between two adjacent ones.
310   //! Remark : Calls previous function
311   //! Status : See the function above for details
312   Standard_EXPORT Standard_Boolean CheckDegenerated (const Standard_Integer num);
313   
314   //! Checks gap between edges in 3D (3d curves).
315   //! Checks the distance between ends of 3d curves of the num-th
316   //! and preceding edge.
317   //! The distance can be queried by MinDistance3d.
318   //!
319   //! Returns: True if status is DONE
320   //! Status:
321   //! OK   : Gap is less than myPrecision
322   //! DONE : Gap is greater than myPrecision
323   //! FAIL : No 3d curve(s) on the edge(s)
324   Standard_EXPORT Standard_Boolean CheckGap3d (const Standard_Integer num = 0);
325   
326   //! Checks gap between edges in 2D (pcurves).
327   //! Checks the distance between ends of pcurves of the num-th
328   //! and preceding edge.
329   //! The distance can be queried by MinDistance2d.
330   //!
331   //! Returns: True if status is DONE
332   //! Status:
333   //! OK   : Gap is less than parametric precision out of myPrecision
334   //! DONE : Gap is greater than parametric precision out of myPrecision
335   //! FAIL : No pcurve(s) on the edge(s)
336   Standard_EXPORT Standard_Boolean CheckGap2d (const Standard_Integer num = 0);
337   
338   //! Checks gap between points on 3D curve and points on surface
339   //! generated by pcurve of the num-th edge.
340   //! The distance can be queried by MinDistance3d.
341   //!
342   //! Returns: True if status is DONE
343   //! Status:
344   //! OK   : Gap is less than myPrecision
345   //! DONE : Gap is greater than myPrecision
346   //! FAIL : No 3d curve(s) on the edge(s)
347   Standard_EXPORT Standard_Boolean CheckCurveGap (const Standard_Integer num = 0);
348   
349   //! Checks if num-th edge is self-intersecting.
350   //! Self-intersection is reported only if intersection point lies outside
351   //! of both end vertices of the edge.
352   //! Returns: True if edge is self-intersecting.
353   //! If returns True it also fills the sequences of intersection points
354   //! and corresponding 3d points (only that are not enclosed by a vertices)
355   //! Status:
356   //! FAIL1 : No pcurve
357   //! FAIL2 : No vertices
358   //! DONE1 : Self-intersection found
359   Standard_EXPORT Standard_Boolean CheckSelfIntersectingEdge (const Standard_Integer num, IntRes2d_SequenceOfIntersectionPoint& points2d, TColgp_SequenceOfPnt& points3d);
360   
361   Standard_EXPORT Standard_Boolean CheckSelfIntersectingEdge (const Standard_Integer num);
362   
363   //! Checks two adjacent edges for intersecting.
364   //! Intersection is reported only if intersection point is not enclosed
365   //! by the common end vertex of the edges.
366   //! Returns: True if intersection is found.
367   //! If returns True it also fills the sequences of intersection points,
368   //! corresponding 3d points, and errors for them (half-distances between
369   //! intersection points in 3d calculated from one and from another edge)
370   //! Status:
371   //! FAIL1 : No pcurve
372   //! FAIL2 : No vertices
373   //! DONE1 : Self-intersection found
374   Standard_EXPORT Standard_Boolean CheckIntersectingEdges (const Standard_Integer num, IntRes2d_SequenceOfIntersectionPoint& points2d, TColgp_SequenceOfPnt& points3d, TColStd_SequenceOfReal& errors);
375   
376   //! Checks two adjacent edges for intersecting.
377   //! Remark : Calls the previous method
378   //! Status : See the function above for details
379   Standard_EXPORT Standard_Boolean CheckIntersectingEdges (const Standard_Integer num);
380   
381   //! Checks i-th and j-th edges for intersecting.
382   //! Remark : See the previous method for details
383   Standard_EXPORT Standard_Boolean CheckIntersectingEdges (const Standard_Integer num1, const Standard_Integer num2, IntRes2d_SequenceOfIntersectionPoint& points2d, TColgp_SequenceOfPnt& points3d, TColStd_SequenceOfReal& errors);
384   
385   //! Checks i-th and j-th edges for intersecting.
386   //! Remark : Calls  previous method.
387   //! Status : See the function above for details
388   Standard_EXPORT Standard_Boolean CheckIntersectingEdges (const Standard_Integer num1, const Standard_Integer num2);
389   
390   //! Checks if there is a gap in 2d between edges, not comprised by
391   //! the tolerance of their common vertex.
392   //! If <Tolerance> is greater than 0. and less than tolerance of
393   //! the vertex, then this value is used for check.
394   //! Returns: True if not closed gap was detected
395   //! p2d1 and p2d2 are the endpoint of <num-1>th edge and start of
396   //! the <num>th edge in 2d.
397   //! Status:
398   //! OK: No edge is lacking (3d and 2d connection)
399   //! FAIL1: edges have no vertices (at least one of them)
400   //! FAIL2: edges are neither connected by common vertex, nor have
401   //! coincided vertices
402   //! FAIL1: edges have no pcurves
403   //! DONE1: the gap is detected which cannot be closed by the tolerance
404   //! of the common vertex (or with value of <Tolerance>)
405   //! DONE2: is set (together with DONE1) if gap is detected and the
406   //! vector (p2d2 - p2d1) goes in direction opposite to the pcurves
407   //! of the edges (if angle is more than 0.9*PI).
408   Standard_EXPORT Standard_Boolean CheckLacking (const Standard_Integer num, const Standard_Real Tolerance, gp_Pnt2d& p2d1, gp_Pnt2d& p2d2);
409   
410   //! Checks if there is a gap in 2D between edges and not comprised by vertex tolerance
411   //! The value of SBWD.thepreci is used.
412   //! Returns: False if no edge should be inserted
413   //! Status:
414   //! OK    : No edge is lacking (3d and 2d connection)
415   //! DONE1 : The vertex tolerance should be increased only (2d gap is
416   //! small)
417   //! DONE2 : Edge can be inserted (3d and 2d gaps are large enough)
418   Standard_EXPORT Standard_Boolean CheckLacking (const Standard_Integer num, const Standard_Real Tolerance = 0.0);
419   
420   //! Checks if wire defines an outer bound on the face
421   //! Uses ShapeAnalysis::IsOuterBound for analysis
422   //! If <APIMake> is True uses BRepAPI_MakeWire to build the
423   //! wire, if False (to be used only when edges share common
424   //! vertices) uses BRep_Builder to build the wire
425   Standard_EXPORT Standard_Boolean CheckOuterBound (const Standard_Boolean APIMake = Standard_True);
426   
427   //! Detects a notch
428   Standard_EXPORT Standard_Boolean CheckNotchedEdges (const Standard_Integer num, Standard_Integer& shortNum, Standard_Real& param, const Standard_Real Tolerance = 0.0);
429   
430   //! Checks if wire has parametric area less than precision.
431   Standard_EXPORT Standard_Boolean CheckSmallArea (const TopoDS_Wire& theWire);
432   
433   //! Checks with what orientation <shape> (wire or edge) can be
434   //! connected to the wire.
435   //! Tests distances with starting <preci> from <SBWD> (close confusion),
436   //! but if given <prec> is greater, tests with <prec> (coarse confusion).
437   //! The smallest found distance can be returned by MinDistance3d
438   //!
439   //! Returns: False if status is FAIL (see below)
440   //! Status:
441   //! DONE1 : If <shape> follows <SBWD>, direct sense (normal)
442   //! DONE2 : If <shape> follows <SBWD>, but if reversed
443   //! DONE3 : If <shape> precedes <SBWD>, direct sense
444   //! DONE4 : If <shape> precedes <SBWD>, but if reversed
445   //! FAIL1 : If <shape> is neither an edge nor a wire
446   //! FAIL2 : If <shape> cannot be connected to <SBWD>
447   //!
448   //! DONE5 : To the tail of <SBWD> the <shape> is closer with
449   //! direct sense
450   //! DONE6 : To the head of <SBWD> the <shape> is closer with
451   //! direct sense
452   //!
453   //! Remark:   Statuses DONE1 - DONE4, FAIL1 - FAIL2 are basic and
454   //! describe the nearest connection of the <shape> to <SBWD>.
455   //! Statuses DONE5 and DONE6 are advanced and are to be used when
456   //! analyzing with what sense (direct or reversed) the <shape>
457   //! should be connected to <SBWD>:
458   //! For tail of <SBWD> if DONE4 is True <shape> should be direct,
459   //! otherwise reversed.
460   //! For head of <SBWD> if DONE5 is True <shape> should be direct,
461   //! otherwise reversed.
462   Standard_EXPORT Standard_Boolean CheckShapeConnect (const TopoDS_Shape& shape, const Standard_Real prec = 0.0);
463   
464   //! The same as previous CheckShapeConnect but is more advanced.
465   //! It returns the distances between each end of <sbwd> and each
466   //! end of <shape>. For example, <tailhead> stores distance
467   //! between tail of <sbwd> and head of <shape>
468   //! Remark:  First method CheckShapeConnect calls this one
469   Standard_EXPORT Standard_Boolean CheckShapeConnect (Standard_Real& tailhead, Standard_Real& tailtail, Standard_Real& headtail, Standard_Real& headhead, const TopoDS_Shape& shape, const Standard_Real prec = 0.0);
470   
471   //! Checks existence of loop on wire and return vertices which are loop vertices
472   //! (vertices belonging to a few pairs of edges)
473   Standard_EXPORT Standard_Boolean CheckLoop (TopTools_IndexedMapOfShape& aMapLoopVertices, TopTools_DataMapOfShapeListOfShape& aMapVertexEdges, TopTools_MapOfShape& aMapSmallEdges, TopTools_MapOfShape& aMapSeemEdges);
474   
475   Standard_EXPORT Standard_Boolean CheckTail (const TopoDS_Edge& theEdge1, const TopoDS_Edge& theEdge2, const Standard_Real theMaxSine, const Standard_Real theMaxWidth, const Standard_Real theMaxTolerance, TopoDS_Edge& theEdge11, TopoDS_Edge& theEdge12, TopoDS_Edge& theEdge21, TopoDS_Edge& theEdge22);
476   
477     Standard_Boolean StatusOrder (const ShapeExtend_Status Status) const;
478   
479     Standard_Boolean StatusConnected (const ShapeExtend_Status Status) const;
480   
481     Standard_Boolean StatusEdgeCurves (const ShapeExtend_Status Status) const;
482   
483     Standard_Boolean StatusDegenerated (const ShapeExtend_Status Status) const;
484   
485     Standard_Boolean StatusClosed (const ShapeExtend_Status Status) const;
486   
487     Standard_Boolean StatusSmall (const ShapeExtend_Status Status) const;
488   
489     Standard_Boolean StatusSelfIntersection (const ShapeExtend_Status Status) const;
490   
491     Standard_Boolean StatusLacking (const ShapeExtend_Status Status) const;
492   
493     Standard_Boolean StatusGaps3d (const ShapeExtend_Status Status) const;
494   
495     Standard_Boolean StatusGaps2d (const ShapeExtend_Status Status) const;
496   
497     Standard_Boolean StatusCurveGaps (const ShapeExtend_Status Status) const;
498   
499     Standard_Boolean StatusLoop (const ShapeExtend_Status Status) const;
500   
501   //! Querying the status of the LAST performed 'Advanced' checking procedure
502     Standard_Boolean LastCheckStatus (const ShapeExtend_Status Status) const;
503   
504   //! Returns the last lowest distance in 3D computed by
505   //! CheckOrientation, CheckConnected, CheckContinuity3d,
506   //! CheckVertex, CheckNewVertex
507     Standard_Real MinDistance3d() const;
508   
509   //! Returns the last lowest distance in 2D-UV computed by
510   //! CheckContinuity2d
511     Standard_Real MinDistance2d() const;
512   
513   //! Returns the last maximal distance in 3D computed by
514   //! CheckOrientation, CheckConnected, CheckContinuity3d,
515   //! CheckVertex, CheckNewVertex, CheckSameParameter
516     Standard_Real MaxDistance3d() const;
517   
518   //! Returns the last maximal distance in 2D-UV computed by
519   //! CheckContinuity2d
520     Standard_Real MaxDistance2d() const;
521
522
523
524
525   DEFINE_STANDARD_RTTIEXT(ShapeAnalysis_Wire,Standard_Transient)
526
527 protected:
528
529
530   Handle(ShapeExtend_WireData) myWire;
531   TopoDS_Face myFace;
532   Handle(ShapeAnalysis_Surface) mySurf;
533   Standard_Real myPrecision;
534   Standard_Real myMin3d;
535   Standard_Real myMin2d;
536   Standard_Real myMax3d;
537   Standard_Real myMax2d;
538   Standard_Integer myStatusOrder;
539   Standard_Integer myStatusConnected;
540   Standard_Integer myStatusEdgeCurves;
541   Standard_Integer myStatusDegenerated;
542   Standard_Integer myStatusClosed;
543   Standard_Integer myStatusSmall;
544   Standard_Integer myStatusSelfIntersection;
545   Standard_Integer myStatusLacking;
546   Standard_Integer myStatusGaps3d;
547   Standard_Integer myStatusGaps2d;
548   Standard_Integer myStatusCurveGaps;
549   Standard_Integer myStatusLoop;
550   Standard_Integer myStatus;
551
552
553 private:
554
555
556
557
558 };
559
560
561 #include <ShapeAnalysis_Wire.lxx>
562
563
564
565
566
567 #endif // _ShapeAnalysis_Wire_HeaderFile