Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-28 09:19:34

0001 // Created on: 2004-03-05
0002 // Created by: Sergey KUUL
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _ShapeFix_IntersectionTool_HeaderFile
0017 #define _ShapeFix_IntersectionTool_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <ShapeFix_DataMapOfShapeBox2d.hxx>
0025 class ShapeBuild_ReShape;
0026 class TopoDS_Edge;
0027 class TopoDS_Vertex;
0028 class TopoDS_Face;
0029 class ShapeExtend_WireData;
0030 class Bnd_Box2d;
0031 class Geom2d_Curve;
0032 
0033 //! Tool for fixing selfintersecting wire
0034 //! and intersecting wires
0035 class ShapeFix_IntersectionTool
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   //! Constructor
0041   Standard_EXPORT ShapeFix_IntersectionTool(const Handle(ShapeBuild_ReShape)& context,
0042                                             const Standard_Real               preci,
0043                                             const Standard_Real               maxtol = 1.0);
0044 
0045   //! Returns context
0046   Handle(ShapeBuild_ReShape) Context() const;
0047 
0048   //! Split edge on two new edges using new vertex "vert"
0049   //! and "param" - parameter for splitting
0050   //! The "face" is necessary for pcurves and using TransferParameterProj
0051   Standard_EXPORT Standard_Boolean SplitEdge(const TopoDS_Edge&   edge,
0052                                              const Standard_Real  param,
0053                                              const TopoDS_Vertex& vert,
0054                                              const TopoDS_Face&   face,
0055                                              TopoDS_Edge&         newE1,
0056                                              TopoDS_Edge&         newE2,
0057                                              const Standard_Real  preci) const;
0058 
0059   //! Cut edge by parameters pend and cut
0060   Standard_EXPORT Standard_Boolean CutEdge(const TopoDS_Edge&  edge,
0061                                            const Standard_Real pend,
0062                                            const Standard_Real cut,
0063                                            const TopoDS_Face&  face,
0064                                            Standard_Boolean&   iscutline) const;
0065 
0066   Standard_EXPORT Standard_Boolean FixSelfIntersectWire(Handle(ShapeExtend_WireData)& sewd,
0067                                                         const TopoDS_Face&            face,
0068                                                         Standard_Integer&             NbSplit,
0069                                                         Standard_Integer&             NbCut,
0070                                                         Standard_Integer& NbRemoved) const;
0071 
0072   Standard_EXPORT Standard_Boolean FixIntersectingWires(TopoDS_Face& face) const;
0073 
0074 protected:
0075 private:
0076   Standard_EXPORT Standard_Boolean SplitEdge1(const Handle(ShapeExtend_WireData)& sewd,
0077                                               const TopoDS_Face&                  face,
0078                                               const Standard_Integer              num,
0079                                               const Standard_Real                 param,
0080                                               const TopoDS_Vertex&                vert,
0081                                               const Standard_Real                 preci,
0082                                               ShapeFix_DataMapOfShapeBox2d&       boxes) const;
0083 
0084   Standard_EXPORT Standard_Boolean SplitEdge2(const Handle(ShapeExtend_WireData)& sewd,
0085                                               const TopoDS_Face&                  face,
0086                                               const Standard_Integer              num,
0087                                               const Standard_Real                 param1,
0088                                               const Standard_Real                 param2,
0089                                               const TopoDS_Vertex&                vert,
0090                                               const Standard_Real                 preci,
0091                                               ShapeFix_DataMapOfShapeBox2d&       boxes) const;
0092 
0093   Standard_EXPORT Standard_Boolean UnionVertexes(const Handle(ShapeExtend_WireData)& sewd,
0094                                                  TopoDS_Edge&                        edge1,
0095                                                  TopoDS_Edge&                        edge2,
0096                                                  const Standard_Integer              num2,
0097                                                  ShapeFix_DataMapOfShapeBox2d&       boxes,
0098                                                  const Bnd_Box2d&                    B2) const;
0099 
0100   Standard_EXPORT Standard_Boolean FindVertAndSplitEdge(const Standard_Real         param1,
0101                                                         const TopoDS_Edge&          edge1,
0102                                                         const TopoDS_Edge&          edge2,
0103                                                         const Handle(Geom2d_Curve)& Crv1,
0104                                                         Standard_Real&              MaxTolVert,
0105                                                         Standard_Integer&           num1,
0106                                                         const Handle(ShapeExtend_WireData)& sewd,
0107                                                         const TopoDS_Face&                  face,
0108                                                         ShapeFix_DataMapOfShapeBox2d&       boxes,
0109                                                         const Standard_Boolean aTmpKey) const;
0110 
0111   Handle(ShapeBuild_ReShape) myContext;
0112   Standard_Real              myPreci;
0113   Standard_Real              myMaxTol;
0114 };
0115 
0116 #include <ShapeFix_IntersectionTool.lxx>
0117 
0118 #endif // _ShapeFix_IntersectionTool_HeaderFile