Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:59:14

0001 // Created on: 1998-06-03
0002 // Created by: data exchange team
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ShapeAnalysis_Wire_HeaderFile
0018 #define _ShapeAnalysis_Wire_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TopoDS_Face.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Transient.hxx>
0026 #include <IntRes2d_IntersectionPoint.hxx>
0027 #include <NCollection_Sequence.hxx>
0028 #include <gp_Pnt.hxx>
0029 #include <TopTools_ShapeMapHasher.hxx>
0030 #include <NCollection_IndexedMap.hxx>
0031 #include <TopoDS_Shape.hxx>
0032 #include <NCollection_List.hxx>
0033 #include <NCollection_DataMap.hxx>
0034 #include <NCollection_Map.hxx>
0035 #include <ShapeExtend_Status.hxx>
0036 class ShapeExtend_WireData;
0037 class ShapeAnalysis_Surface;
0038 class TopoDS_Wire;
0039 class Geom_Surface;
0040 class TopLoc_Location;
0041 class ShapeAnalysis_WireOrder;
0042 class Geom2d_Curve;
0043 class gp_Pnt2d;
0044 class TopoDS_Shape;
0045 class TopoDS_Edge;
0046 
0047 // resolve name collisions with X11 headers
0048 #ifdef Status
0049   #undef Status
0050 #endif
0051 
0052 //! This class provides analysis of a wire to be compliant to
0053 //! CAS.CADE requirements.
0054 //!
0055 //! The functionalities provided are the following:
0056 //! 1. consistency of 2d and 3d edge curve senses
0057 //! 2. connection of adjacent edges regarding to:
0058 //! a. their vertices
0059 //! b. their pcurves
0060 //! c. their 3d curves
0061 //! 3. adjacency of the edge vertices to its pcurve and 3d curve
0062 //! 4. if a wire is closed or not (considering its 3d and 2d
0063 //! contour)
0064 //! 5. if a wire is outer on its face (considering pcurves)
0065 //!
0066 //! This class can be used in conjunction with class
0067 //! ShapeFix_Wire, which will fix the problems detected by this class.
0068 //!
0069 //! The methods of the given class match to ones of the class
0070 //! ShapeFix_Wire, e.g., CheckSmall and FixSmall.
0071 //! This class also includes some auxiliary methods
0072 //! (e.g., CheckOuterBound, etc.),
0073 //! which have no pair in ShapeFix_Wire.
0074 //!
0075 //! Like methods of ShapeFix_Wire the ones of this class are
0076 //! grouped into two levels:
0077 //! - Public which are recommended for use (the most global
0078 //! method is Perform),
0079 //! - Advanced, for optional use only
0080 //!
0081 //! For analyzing result of Public API checking methods use
0082 //! corresponding Status... method.
0083 //! The 'advanced' functions share the single status field which
0084 //! contains the result of the last performed 'advanced' method.
0085 //! It is queried by the method LastCheckStatus().
0086 //!
0087 //! In order to prepare an analyzer, it is necessary to load a wire,
0088 //! set face and precision.
0089 class ShapeAnalysis_Wire : public Standard_Transient
0090 {
0091 
0092 public:
0093   //! Empty constructor
0094   Standard_EXPORT ShapeAnalysis_Wire();
0095 
0096   //! Creates object with standard TopoDS_Wire, face
0097   //! and precision
0098   Standard_EXPORT ShapeAnalysis_Wire(const TopoDS_Wire& wire,
0099                                      const TopoDS_Face& face,
0100                                      const double       precision);
0101 
0102   //! Creates the object with WireData object, face
0103   //! and precision
0104   Standard_EXPORT ShapeAnalysis_Wire(const occ::handle<ShapeExtend_WireData>& sbwd,
0105                                      const TopoDS_Face&                       face,
0106                                      const double                             precision);
0107 
0108   //! Initializes the object with standard TopoDS_Wire, face
0109   //! and precision
0110   Standard_EXPORT void Init(const TopoDS_Wire& wire,
0111                             const TopoDS_Face& face,
0112                             const double       precision);
0113 
0114   //! Initializes the object with WireData object, face
0115   //! and precision
0116   Standard_EXPORT void Init(const occ::handle<ShapeExtend_WireData>& sbwd,
0117                             const TopoDS_Face&                       face,
0118                             const double                             precision);
0119 
0120   //! Loads the object with standard TopoDS_Wire
0121   Standard_EXPORT void Load(const TopoDS_Wire& wire);
0122 
0123   //! Loads the object with WireData object
0124   Standard_EXPORT void Load(const occ::handle<ShapeExtend_WireData>& sbwd);
0125 
0126   //! Loads the face the wire lies on
0127   Standard_EXPORT void SetFace(const TopoDS_Face& face);
0128 
0129   //! Loads the face the wire lies on and surface analysis object
0130   Standard_EXPORT void SetFace(const TopoDS_Face&                        theFace,
0131                                const occ::handle<ShapeAnalysis_Surface>& theSurfaceAnalysis);
0132 
0133   //! Loads the surface analysis object
0134   Standard_EXPORT void SetSurface(const occ::handle<ShapeAnalysis_Surface>& theSurfaceAnalysis);
0135 
0136   //! Loads the surface the wire lies on
0137   Standard_EXPORT void SetSurface(const occ::handle<Geom_Surface>& surface);
0138 
0139   //! Loads the surface the wire lies on
0140   Standard_EXPORT void SetSurface(const occ::handle<Geom_Surface>& surface,
0141                                   const TopLoc_Location&           location);
0142 
0143   Standard_EXPORT void SetPrecision(const double precision);
0144 
0145   //! Unsets all the status and distance fields
0146   //! wire, face and precision are not cleared
0147   Standard_EXPORT void ClearStatuses();
0148 
0149   //! Returns True if wire is loaded and has number of edges >0
0150   bool IsLoaded() const;
0151 
0152   //! Returns True if IsLoaded and underlying face is not null
0153   bool IsReady() const;
0154 
0155   //! Returns the value of precision
0156   double Precision() const;
0157 
0158   //! Returns wire object being analyzed
0159   const occ::handle<ShapeExtend_WireData>& WireData() const;
0160 
0161   //! Returns the number of edges in the wire, or 0 if it is not loaded
0162   int NbEdges() const;
0163 
0164   //! Returns the working face
0165   const TopoDS_Face& Face() const;
0166 
0167   //! Returns the working surface
0168   const occ::handle<ShapeAnalysis_Surface>& Surface() const;
0169 
0170   //! Performs all the checks in the following order :
0171   //! CheckOrder, CheckSmall, CheckConnected, CheckEdgeCurves,
0172   //! CheckDegenerated, CheckSelfIntersection, CheckLacking,
0173   //! CheckClosed
0174   //! Returns: True if at least one method returned True;
0175   //! For deeper analysis use Status...(status) methods
0176   Standard_EXPORT bool Perform();
0177 
0178   //! Calls CheckOrder and returns False if wire is already
0179   //! ordered (tail-to-head), True otherwise
0180   //! Flag <isClosed> defines if the wire is closed or not
0181   //! Flag <mode3d> defines which mode is used (3d or 2d)
0182   Standard_EXPORT bool CheckOrder(const bool isClosed = true, const bool mode3d = true);
0183 
0184   //! Calls to CheckConnected for each edge
0185   //! Returns: True if at least one pair of disconnected edges (not sharing the
0186   //! same vertex) was detected
0187   Standard_EXPORT bool CheckConnected(const double prec = 0.0);
0188 
0189   //! Calls to CheckSmall for each edge
0190   //! Returns: True if at least one small edge was detected
0191   Standard_EXPORT bool CheckSmall(const double precsmall = 0.0);
0192 
0193   //! Checks edges geometry (consistency of 2d and 3d senses, adjasment
0194   //! of curves to the vertices, etc.).
0195   //! The order of the checks :
0196   //! Call ShapeAnalysis_Wire to check:
0197   //! ShapeAnalysis_Edge::CheckCurve3dWithPCurve  (1),
0198   //! ShapeAnalysis_Edge::CheckVertcesWithPCurve  (2),
0199   //! ShapeAnalysis_Edge::CheckVertcesWithCurve3d (3),
0200   //! CheckSeam                                   (4)
0201   //! Additional:
0202   //! CheckGap3d                                  (5),
0203   //! CheckGap2d                                  (6),
0204   //! ShapeAnalysis_Edge::CheckSameParameter      (7)
0205   //! Returns: True if at least one check returned True
0206   //! Remark:  The numbers in brackets show with what DONEi or FAILi
0207   //! the status can be queried
0208   Standard_EXPORT bool CheckEdgeCurves();
0209 
0210   //! Calls to CheckDegenerated for each edge
0211   //! Returns: True if at least one incorrect degenerated edge was detected
0212   Standard_EXPORT bool CheckDegenerated();
0213 
0214   //! Checks if wire is closed, performs CheckConnected,
0215   //! CheckDegenerated and CheckLacking for the first and the last edges
0216   //! Returns: True if at least one check returned True
0217   //! Status:
0218   //! FAIL1 or DONE1: see CheckConnected
0219   //! FAIL2 or DONE2: see CheckDegenerated
0220   Standard_EXPORT bool CheckClosed(const double prec = 0.0);
0221 
0222   //! Checks self-intersection of the wire (considering pcurves)
0223   //! Looks for self-intersecting edges and each pair of intersecting
0224   //! edges.
0225   //! Warning: It does not check each edge with any other one (only each two
0226   //! adjacent edges)
0227   //! The order of the checks :
0228   //! CheckSelfIntersectingEdge, CheckIntersectingEdges
0229   //! Returns: True if at least one check returned True
0230   //! Status:  FAIL1 or DONE1 - see CheckSelfIntersectingEdge
0231   //! FAIL2 or DONE2 - see CheckIntersectingEdges
0232   Standard_EXPORT bool CheckSelfIntersection();
0233 
0234   //! Calls to CheckLacking for each edge
0235   //! Returns: True if at least one lacking edge was detected
0236   Standard_EXPORT bool CheckLacking();
0237 
0238   Standard_EXPORT bool CheckGaps3d();
0239 
0240   Standard_EXPORT bool CheckGaps2d();
0241 
0242   Standard_EXPORT bool CheckCurveGaps();
0243 
0244   //! Analyzes the order of the edges in the wire,
0245   //! uses class WireOrder for that purpose.
0246   //! Flag <isClosed> defines if the wire is closed or not
0247   //! Flag <theMode3D> defines 3D or 2d mode.
0248   //! Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored.
0249   //! Returns False if wire is already ordered (tail-to-head),
0250   //! True otherwise.
0251   //! Use returned WireOrder object for deeper analysis.
0252   //! Status:
0253   //! OK   : the same edges orientation, the same edges sequence
0254   //! DONE1: the same edges orientation, not the same edges sequence
0255   //! DONE2: as DONE1 and gaps more than myPrecision
0256   //! DONE3: not the same edges orientation (some need to be reversed)
0257   //! DONE4: as DONE3 and gaps more than myPrecision
0258   //! FAIL : algorithm failed (could not detect order)
0259   Standard_EXPORT bool CheckOrder(ShapeAnalysis_WireOrder& sawo,
0260                                   bool                     isClosed    = true,
0261                                   bool                     theMode3D   = true,
0262                                   bool                     theModeBoth = false);
0263 
0264   //! Checks connected edges (num-th and preceding).
0265   //! Tests with starting preci from <SBWD> or with <prec> if
0266   //! it is greater.
0267   //! Considers Vertices.
0268   //! Returns: False if edges are connected by the common vertex, else True
0269   //! Status  :
0270   //! OK    : Vertices (end of num-1 th edge and start on num-th one)
0271   //! are already the same
0272   //! DONE1 : Absolutely confused (gp::Resolution)
0273   //! DONE2 : Confused at starting <preci> from <SBWD>
0274   //! DONE3 : Confused at <prec> but not <preci>
0275   //! FAIL1 : Not confused
0276   //! FAIL2 : Not confused but confused with <preci> if reverse num-th edge
0277   Standard_EXPORT bool CheckConnected(const int num, const double prec = 0.0);
0278 
0279   //! Checks if an edge has a length not greater than myPreci or
0280   //! precsmall (if it is smaller)
0281   //! Returns: False if its length is greater than precision
0282   //! Status:
0283   //! OK   : edge is not small or degenerated
0284   //! DONE1: edge is small, vertices are the same
0285   //! DONE2: edge is small, vertices are not the same
0286   //! FAIL : no 3d curve and pcurve
0287   Standard_EXPORT bool CheckSmall(const int num, const double precsmall = 0.0);
0288 
0289   //! Checks if a seam pcurves are correct oriented
0290   //! Returns: False (status OK) if given edge is not a seam or if it is OK
0291   //! C1 - current pcurve for FORWARD edge,
0292   //! C2 - current pcurve for REVERSED edge (if returns True they
0293   //! should be swapped for the seam),
0294   //! cf, cl - first and last parameters on curves
0295   //! Status:
0296   //! OK   : Pcurves are correct or edge is not seam
0297   //! DONE : Seam pcurves should be swapped
0298   Standard_EXPORT bool CheckSeam(const int                  num,
0299                                  occ::handle<Geom2d_Curve>& C1,
0300                                  occ::handle<Geom2d_Curve>& C2,
0301                                  double&                    cf,
0302                                  double&                    cl);
0303 
0304   //! Checks if a seam pcurves are correct oriented
0305   //! See previous functions for details
0306   Standard_EXPORT bool CheckSeam(const int num);
0307 
0308   //! Checks for degenerated edge between two adjacent ones.
0309   //! Fills parameters dgnr1 and dgnr2 with points in parametric
0310   //! space that correspond to the singularity (either gap that
0311   //! needs to be filled by degenerated edge or that already filled)
0312   //! Returns: False if no singularity or edge is already degenerated,
0313   //! otherwise True
0314   //! Status:
0315   //! OK   : No surface singularity, or edge is already degenerated
0316   //! DONE1: Degenerated edge should be inserted (gap in 2D)
0317   //! DONE2: Edge <num> should be made degenerated (recompute pcurve
0318   //! and set the flag)
0319   //! FAIL1: One of edges neighbouring to degenerated one has
0320   //! no pcurve
0321   //! FAIL2: Edge marked as degenerated and has no pcurve
0322   //! but singularity is not detected
0323   Standard_EXPORT bool CheckDegenerated(const int num, gp_Pnt2d& dgnr1, gp_Pnt2d& dgnr2);
0324 
0325   //! Checks for degenerated edge between two adjacent ones.
0326   //! Remark : Calls previous function
0327   //! Status : See the function above for details
0328   Standard_EXPORT bool CheckDegenerated(const int num);
0329 
0330   //! Checks gap between edges in 3D (3d curves).
0331   //! Checks the distance between ends of 3d curves of the num-th
0332   //! and preceding edge.
0333   //! The distance can be queried by MinDistance3d.
0334   //!
0335   //! Returns: True if status is DONE
0336   //! Status:
0337   //! OK   : Gap is less than myPrecision
0338   //! DONE : Gap is greater than myPrecision
0339   //! FAIL : No 3d curve(s) on the edge(s)
0340   Standard_EXPORT bool CheckGap3d(const int num = 0);
0341 
0342   //! Checks gap between edges in 2D (pcurves).
0343   //! Checks the distance between ends of pcurves of the num-th
0344   //! and preceding edge.
0345   //! The distance can be queried by MinDistance2d.
0346   //!
0347   //! Returns: True if status is DONE
0348   //! Status:
0349   //! OK   : Gap is less than parametric precision out of myPrecision
0350   //! DONE : Gap is greater than parametric precision out of myPrecision
0351   //! FAIL : No pcurve(s) on the edge(s)
0352   Standard_EXPORT bool CheckGap2d(const int num = 0);
0353 
0354   //! Checks gap between points on 3D curve and points on surface
0355   //! generated by pcurve of the num-th edge.
0356   //! The distance can be queried by MinDistance3d.
0357   //!
0358   //! Returns: True if status is DONE
0359   //! Status:
0360   //! OK   : Gap is less than myPrecision
0361   //! DONE : Gap is greater than myPrecision
0362   //! FAIL : No 3d curve(s) on the edge(s)
0363   Standard_EXPORT bool CheckCurveGap(const int num = 0);
0364 
0365   //! Checks if num-th edge is self-intersecting.
0366   //! Self-intersection is reported only if intersection point lies outside
0367   //! of both end vertices of the edge.
0368   //! Returns: True if edge is self-intersecting.
0369   //! If returns True it also fills the sequences of intersection points
0370   //! and corresponding 3d points (only that are not enclosed by a vertices)
0371   //! Status:
0372   //! FAIL1 : No pcurve
0373   //! FAIL2 : No vertices
0374   //! DONE1 : Self-intersection found
0375   Standard_EXPORT bool CheckSelfIntersectingEdge(
0376     const int                                         num,
0377     NCollection_Sequence<IntRes2d_IntersectionPoint>& points2d,
0378     NCollection_Sequence<gp_Pnt>&                     points3d);
0379 
0380   Standard_EXPORT bool CheckSelfIntersectingEdge(const int num);
0381 
0382   //! Checks two adjacent edges for intersecting.
0383   //! Intersection is reported only if intersection point is not enclosed
0384   //! by the common end vertex of the edges.
0385   //! Returns: True if intersection is found.
0386   //! If returns True it also fills the sequences of intersection points,
0387   //! corresponding 3d points, and errors for them (half-distances between
0388   //! intersection points in 3d calculated from one and from another edge)
0389   //! Status:
0390   //! FAIL1 : No pcurve
0391   //! FAIL2 : No vertices
0392   //! DONE1 : Self-intersection found
0393   Standard_EXPORT bool CheckIntersectingEdges(
0394     const int                                         num,
0395     NCollection_Sequence<IntRes2d_IntersectionPoint>& points2d,
0396     NCollection_Sequence<gp_Pnt>&                     points3d,
0397     NCollection_Sequence<double>&                     errors);
0398 
0399   //! Checks two adjacent edges for intersecting.
0400   //! Remark : Calls the previous method
0401   //! Status : See the function above for details
0402   Standard_EXPORT bool CheckIntersectingEdges(const int num);
0403 
0404   //! Checks i-th and j-th edges for intersecting.
0405   //! Remark : See the previous method for details
0406   Standard_EXPORT bool CheckIntersectingEdges(
0407     const int                                         num1,
0408     const int                                         num2,
0409     NCollection_Sequence<IntRes2d_IntersectionPoint>& points2d,
0410     NCollection_Sequence<gp_Pnt>&                     points3d,
0411     NCollection_Sequence<double>&                     errors);
0412 
0413   //! Checks i-th and j-th edges for intersecting.
0414   //! Remark : Calls previous method.
0415   //! Status : See the function above for details
0416   Standard_EXPORT bool CheckIntersectingEdges(const int num1, const int num2);
0417 
0418   //! Checks if there is a gap in 2d between edges, not comprised by
0419   //! the tolerance of their common vertex.
0420   //! If <Tolerance> is greater than 0. and less than tolerance of
0421   //! the vertex, then this value is used for check.
0422   //! Returns: True if not closed gap was detected
0423   //! p2d1 and p2d2 are the endpoint of <num-1>th edge and start of
0424   //! the <num>th edge in 2d.
0425   //! Status:
0426   //! OK: No edge is lacking (3d and 2d connection)
0427   //! FAIL1: edges have no vertices (at least one of them)
0428   //! FAIL2: edges are neither connected by common vertex, nor have
0429   //! coincided vertices
0430   //! FAIL1: edges have no pcurves
0431   //! DONE1: the gap is detected which cannot be closed by the tolerance
0432   //! of the common vertex (or with value of <Tolerance>)
0433   //! DONE2: is set (together with DONE1) if gap is detected and the
0434   //! vector (p2d2 - p2d1) goes in direction opposite to the pcurves
0435   //! of the edges (if angle is more than 0.9*PI).
0436   Standard_EXPORT bool CheckLacking(const int    num,
0437                                     const double Tolerance,
0438                                     gp_Pnt2d&    p2d1,
0439                                     gp_Pnt2d&    p2d2);
0440 
0441   //! Checks if there is a gap in 2D between edges and not comprised by vertex tolerance
0442   //! The value of SBWD.thepreci is used.
0443   //! Returns: False if no edge should be inserted
0444   //! Status:
0445   //! OK    : No edge is lacking (3d and 2d connection)
0446   //! DONE1 : The vertex tolerance should be increased only (2d gap is
0447   //! small)
0448   //! DONE2 : Edge can be inserted (3d and 2d gaps are large enough)
0449   Standard_EXPORT bool CheckLacking(const int num, const double Tolerance = 0.0);
0450 
0451   //! Checks if wire defines an outer bound on the face
0452   //! Uses ShapeAnalysis::IsOuterBound for analysis
0453   //! If <APIMake> is True uses BRepAPI_MakeWire to build the
0454   //! wire, if False (to be used only when edges share common
0455   //! vertices) uses BRep_Builder to build the wire
0456   Standard_EXPORT bool CheckOuterBound(const bool APIMake = true);
0457 
0458   //! Detects a notch
0459   Standard_EXPORT bool CheckNotchedEdges(const int    num,
0460                                          int&         shortNum,
0461                                          double&      param,
0462                                          const double Tolerance = 0.0);
0463 
0464   //! Checks if wire has parametric area less than precision.
0465   Standard_EXPORT bool CheckSmallArea(const TopoDS_Wire& theWire);
0466 
0467   //! Checks with what orientation <shape> (wire or edge) can be
0468   //! connected to the wire.
0469   //! Tests distances with starting <preci> from <SBWD> (close confusion),
0470   //! but if given <prec> is greater, tests with <prec> (coarse confusion).
0471   //! The smallest found distance can be returned by MinDistance3d
0472   //!
0473   //! Returns: False if status is FAIL (see below)
0474   //! Status:
0475   //! DONE1 : If <shape> follows <SBWD>, direct sense (normal)
0476   //! DONE2 : If <shape> follows <SBWD>, but if reversed
0477   //! DONE3 : If <shape> precedes <SBWD>, direct sense
0478   //! DONE4 : If <shape> precedes <SBWD>, but if reversed
0479   //! FAIL1 : If <shape> is neither an edge nor a wire
0480   //! FAIL2 : If <shape> cannot be connected to <SBWD>
0481   //!
0482   //! DONE5 : To the tail of <SBWD> the <shape> is closer with
0483   //! direct sense
0484   //! DONE6 : To the head of <SBWD> the <shape> is closer with
0485   //! direct sense
0486   //!
0487   //! Remark:   Statuses DONE1 - DONE4, FAIL1 - FAIL2 are basic and
0488   //! describe the nearest connection of the <shape> to <SBWD>.
0489   //! Statuses DONE5 and DONE6 are advanced and are to be used when
0490   //! analyzing with what sense (direct or reversed) the <shape>
0491   //! should be connected to <SBWD>:
0492   //! For tail of <SBWD> if DONE4 is True <shape> should be direct,
0493   //! otherwise reversed.
0494   //! For head of <SBWD> if DONE5 is True <shape> should be direct,
0495   //! otherwise reversed.
0496   Standard_EXPORT bool CheckShapeConnect(const TopoDS_Shape& shape, const double prec = 0.0);
0497 
0498   //! The same as previous CheckShapeConnect but is more advanced.
0499   //! It returns the distances between each end of <sbwd> and each
0500   //! end of <shape>. For example, <tailhead> stores distance
0501   //! between tail of <sbwd> and head of <shape>
0502   //! Remark:  First method CheckShapeConnect calls this one
0503   Standard_EXPORT bool CheckShapeConnect(double&             tailhead,
0504                                          double&             tailtail,
0505                                          double&             headtail,
0506                                          double&             headhead,
0507                                          const TopoDS_Shape& shape,
0508                                          const double        prec = 0.0);
0509 
0510   //! Checks existence of loop on wire and return vertices which are loop vertices
0511   //! (vertices belonging to a few pairs of edges)
0512   Standard_EXPORT bool CheckLoop(
0513     NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& aMapLoopVertices,
0514     NCollection_DataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>&
0515                                                             aMapVertexEdges,
0516     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& aMapSmallEdges,
0517     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>& aMapSeemEdges);
0518 
0519   Standard_EXPORT bool CheckTail(const TopoDS_Edge& theEdge1,
0520                                  const TopoDS_Edge& theEdge2,
0521                                  const double       theMaxSine,
0522                                  const double       theMaxWidth,
0523                                  const double       theMaxTolerance,
0524                                  TopoDS_Edge&       theEdge11,
0525                                  TopoDS_Edge&       theEdge12,
0526                                  TopoDS_Edge&       theEdge21,
0527                                  TopoDS_Edge&       theEdge22);
0528 
0529   bool StatusOrder(const ShapeExtend_Status Status) const;
0530 
0531   bool StatusConnected(const ShapeExtend_Status Status) const;
0532 
0533   bool StatusEdgeCurves(const ShapeExtend_Status Status) const;
0534 
0535   bool StatusDegenerated(const ShapeExtend_Status Status) const;
0536 
0537   bool StatusClosed(const ShapeExtend_Status Status) const;
0538 
0539   bool StatusSmall(const ShapeExtend_Status Status) const;
0540 
0541   bool StatusSelfIntersection(const ShapeExtend_Status Status) const;
0542 
0543   bool StatusLacking(const ShapeExtend_Status Status) const;
0544 
0545   bool StatusGaps3d(const ShapeExtend_Status Status) const;
0546 
0547   bool StatusGaps2d(const ShapeExtend_Status Status) const;
0548 
0549   bool StatusCurveGaps(const ShapeExtend_Status Status) const;
0550 
0551   bool StatusLoop(const ShapeExtend_Status Status) const;
0552 
0553   //! Querying the status of the LAST performed 'Advanced' checking procedure
0554   bool LastCheckStatus(const ShapeExtend_Status Status) const;
0555 
0556   //! Returns the last lowest distance in 3D computed by
0557   //! CheckOrientation, CheckConnected, CheckContinuity3d,
0558   //! CheckVertex, CheckNewVertex
0559   double MinDistance3d() const;
0560 
0561   //! Returns the last lowest distance in 2D-UV computed by
0562   //! CheckContinuity2d
0563   double MinDistance2d() const;
0564 
0565   //! Returns the last maximal distance in 3D computed by
0566   //! CheckOrientation, CheckConnected, CheckContinuity3d,
0567   //! CheckVertex, CheckNewVertex, CheckSameParameter
0568   double MaxDistance3d() const;
0569 
0570   //! Returns the last maximal distance in 2D-UV computed by
0571   //! CheckContinuity2d
0572   double MaxDistance2d() const;
0573 
0574   DEFINE_STANDARD_RTTIEXT(ShapeAnalysis_Wire, Standard_Transient)
0575 
0576 protected:
0577   occ::handle<ShapeExtend_WireData>  myWire;
0578   TopoDS_Face                        myFace;
0579   occ::handle<ShapeAnalysis_Surface> mySurf;
0580   double                             myPrecision;
0581   double                             myMin3d;
0582   double                             myMin2d;
0583   double                             myMax3d;
0584   double                             myMax2d;
0585   int                                myStatusOrder;
0586   int                                myStatusConnected;
0587   int                                myStatusEdgeCurves;
0588   int                                myStatusDegenerated;
0589   int                                myStatusClosed;
0590   int                                myStatusSmall;
0591   int                                myStatusSelfIntersection;
0592   int                                myStatusLacking;
0593   int                                myStatusGaps3d;
0594   int                                myStatusGaps2d;
0595   int                                myStatusCurveGaps;
0596   int                                myStatusLoop;
0597   int                                myStatus;
0598 };
0599 
0600 #include <ShapeAnalysis_Wire.lxx>
0601 
0602 #endif // _ShapeAnalysis_Wire_HeaderFile