Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:56

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 
0034 //! Tool for fixing selfintersecting wire
0035 //! and intersecting wires
0036 class ShapeFix_IntersectionTool 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! Constructor
0044   Standard_EXPORT ShapeFix_IntersectionTool(const Handle(ShapeBuild_ReShape)& context, const Standard_Real preci, const Standard_Real maxtol = 1.0);
0045   
0046   //! Returns context
0047     Handle(ShapeBuild_ReShape) Context() const;
0048   
0049   //! Split edge on two new edges using new vertex "vert"
0050   //! and "param" - parameter for splitting
0051   //! The "face" is necessary for pcurves and using TransferParameterProj
0052   Standard_EXPORT Standard_Boolean SplitEdge (const TopoDS_Edge& edge, const Standard_Real param, const TopoDS_Vertex& vert, const TopoDS_Face& face, TopoDS_Edge& newE1, TopoDS_Edge& newE2, const Standard_Real preci) const;
0053   
0054   //! Cut edge by parameters pend and cut
0055   Standard_EXPORT Standard_Boolean CutEdge (const TopoDS_Edge& edge, const Standard_Real pend, const Standard_Real cut, const TopoDS_Face& face, Standard_Boolean& iscutline) const;
0056   
0057   Standard_EXPORT Standard_Boolean FixSelfIntersectWire (Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& face, Standard_Integer& NbSplit, Standard_Integer& NbCut, Standard_Integer& NbRemoved) const;
0058   
0059   Standard_EXPORT Standard_Boolean FixIntersectingWires (TopoDS_Face& face) const;
0060 
0061 
0062 
0063 
0064 protected:
0065 
0066 
0067 
0068 
0069 
0070 private:
0071 
0072   
0073   Standard_EXPORT Standard_Boolean SplitEdge1 (const Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& face, const Standard_Integer num, const Standard_Real param, const TopoDS_Vertex& vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d& boxes) const;
0074   
0075   Standard_EXPORT Standard_Boolean SplitEdge2 (const Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& face, const Standard_Integer num, const Standard_Real param1, const Standard_Real param2, const TopoDS_Vertex& vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d& boxes) const;
0076   
0077   Standard_EXPORT Standard_Boolean UnionVertexes (const Handle(ShapeExtend_WireData)& sewd, TopoDS_Edge& edge1, TopoDS_Edge& edge2, const Standard_Integer num2, ShapeFix_DataMapOfShapeBox2d& boxes, const Bnd_Box2d& B2) const;
0078   
0079   Standard_EXPORT Standard_Boolean FindVertAndSplitEdge (const Standard_Real param1, const TopoDS_Edge& edge1, const TopoDS_Edge& edge2, const Handle(Geom2d_Curve)& Crv1, Standard_Real& MaxTolVert, Standard_Integer& num1, const Handle(ShapeExtend_WireData)& sewd, const TopoDS_Face& face, ShapeFix_DataMapOfShapeBox2d& boxes, const Standard_Boolean aTmpKey) const;
0080 
0081 
0082   Handle(ShapeBuild_ReShape) myContext;
0083   Standard_Real myPreci;
0084   Standard_Real myMaxTol;
0085 
0086 
0087 };
0088 
0089 
0090 #include <ShapeFix_IntersectionTool.lxx>
0091 
0092 
0093 
0094 
0095 
0096 #endif // _ShapeFix_IntersectionTool_HeaderFile