Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:15:03

0001 // Created on: 1995-12-12
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1995-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 _BRepCheck_Wire_HeaderFile
0018 #define _BRepCheck_Wire_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <BRepCheck_Status.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 #include <NCollection_List.hxx>
0026 #include <TopTools_ShapeMapHasher.hxx>
0027 #include <NCollection_IndexedDataMap.hxx>
0028 #include <BRepCheck_Result.hxx>
0029 class TopoDS_Wire;
0030 class TopoDS_Shape;
0031 class TopoDS_Face;
0032 class TopoDS_Edge;
0033 
0034 class BRepCheck_Wire : public BRepCheck_Result
0035 {
0036 
0037 public:
0038   Standard_EXPORT BRepCheck_Wire(const TopoDS_Wire& W);
0039 
0040   //! if <ContextShape> is a face, consequently checks
0041   //! SelfIntersect(), Closed(), Orientation() and
0042   //! Closed2d until faulty is found
0043   Standard_EXPORT void InContext(const TopoDS_Shape& ContextShape) override;
0044 
0045   //! checks that the wire is not empty and "connex".
0046   //! Called by constructor
0047   Standard_EXPORT void Minimum() override;
0048 
0049   //! Does nothing
0050   Standard_EXPORT void Blind() override;
0051 
0052   //! Checks if the oriented edges of the wire give a
0053   //! closed wire. If the wire is closed, returns
0054   //! BRepCheck_NoError. Warning: if the first and
0055   //! last edge are infinite, the wire will be
0056   //! considered as a closed one. If <Update> is set to
0057   //! true, registers the status in the list.
0058   //! May return (and registers):
0059   //! **BRepCheck_NotConnected, if wire is not
0060   //! topologically closed
0061   //! **BRepCheck_RedundantEdge, if an edge is in wire
0062   //! more than 3 times or in case of 2 occurrences if
0063   //! not with FORWARD and REVERSED orientation.
0064   //! **BRepCheck_NoError
0065   Standard_EXPORT BRepCheck_Status Closed(const bool Update = false);
0066 
0067   //! Checks if edges of the wire give a wire closed in
0068   //! 2d space.
0069   //! Returns BRepCheck_NoError, or BRepCheck_NotClosed
0070   //! If <Update> is set to true, registers the
0071   //! status in the list.
0072   Standard_EXPORT BRepCheck_Status Closed2d(const TopoDS_Face& F, const bool Update = false);
0073 
0074   //! Checks if the oriented edges of the wire are
0075   //! correctly oriented. An internal call is made to
0076   //! the method Closed. If no face exists, call the
0077   //! method with a null face (TopoDS_face()). If
0078   //! <Update> is set to true, registers the
0079   //! status in the list.
0080   //! May return (and registers):
0081   //! BRepCheck_InvalidDegeneratedFlag,
0082   //! BRepCheck_BadOrientationOfSubshape,
0083   //! BRepCheck_NotClosed,
0084   //! BRepCheck_NoError
0085   Standard_EXPORT BRepCheck_Status Orientation(const TopoDS_Face& F, const bool Update = false);
0086 
0087   //! Checks if the wire intersect itself on the face
0088   //! <F>. <E1> and <E2> are the first intersecting
0089   //! edges found. <E2> may be a null edge when a
0090   //! self-intersecting edge is found.If <Update> is set
0091   //! to true, registers the status in the
0092   //! list.
0093   //! May return (and register):
0094   //! BRepCheck_EmptyWire,
0095   //! BRepCheck_SelfIntersectingWire,
0096   //! BRepCheck_NoCurveOnSurface,
0097   //! BRepCheck_NoError
0098   Standard_EXPORT BRepCheck_Status SelfIntersect(const TopoDS_Face& F,
0099                                                  TopoDS_Edge&       E1,
0100                                                  TopoDS_Edge&       E2,
0101                                                  const bool         Update = false);
0102 
0103   //! report SelfIntersect() check would be (is) done
0104   Standard_EXPORT bool GeometricControls() const;
0105 
0106   //! set SelfIntersect() to be checked
0107   Standard_EXPORT void GeometricControls(const bool B);
0108 
0109   //! Sets status of Wire;
0110   Standard_EXPORT void SetStatus(const BRepCheck_Status theStatus);
0111 
0112   DEFINE_STANDARD_RTTIEXT(BRepCheck_Wire, BRepCheck_Result)
0113 
0114 private:
0115   bool             myCdone;
0116   BRepCheck_Status myCstat;
0117   NCollection_IndexedDataMap<TopoDS_Shape, NCollection_List<TopoDS_Shape>, TopTools_ShapeMapHasher>
0118        myMapVE;
0119   bool myGctrl;
0120 };
0121 
0122 #endif // _BRepCheck_Wire_HeaderFile