1 // Created on: 1998-09-16
2 // Created by: Roman LYGIN <rln@nnov.matra-dtv.fr>
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _ShapeFix_FreeBounds_HeaderFile
18 #define _ShapeFix_FreeBounds_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TopoDS_Compound.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Real.hxx>
29 class TopoDS_Compound;
32 //! This class is intended to output free bounds of the shape
33 //! (free bounds are the wires consisting of edges referenced by the
35 //! For building free bounds it uses ShapeAnalysis_FreeBounds class.
36 //! This class complements it with the feature to reduce the number
38 //! This reduction is performed with help of connecting several
39 //! adjacent open wires one to another what can lead to:
40 //! 1. making an open wire with greater length out of several
42 //! 2. making closed wire out of several open wires
44 //! The connecting open wires is performed with a user-given
47 //! When connecting several open wires into one wire their previous
48 //! end vertices are replaced with new connecting vertices. After
49 //! that all the edges in the shape sharing previous vertices inside
50 //! the shape are updated with new vertices. Thus source shape can
53 //! Since interface of this class is the same as one of
54 //! ShapeAnalysis_FreeBounds refer to its CDL for details.
55 class ShapeFix_FreeBounds
63 Standard_EXPORT ShapeFix_FreeBounds();
65 //! Builds forecasting free bounds of the <shape> and connects
66 //! open wires with tolerance <closetoler>.
67 //! <shape> should be a compound of faces.
68 //! Tolerance <closetoler> should be greater than tolerance
69 //! <sewtoler> used for initializing sewing analyzer, otherwise
70 //! connection of open wires is not performed.
71 Standard_EXPORT ShapeFix_FreeBounds(const TopoDS_Shape& shape, const Standard_Real sewtoler, const Standard_Real closetoler, const Standard_Boolean splitclosed, const Standard_Boolean splitopen);
73 //! Builds actual free bounds of the <shape> and connects
74 //! open wires with tolerance <closetoler>.
75 //! <shape> should be a compound of shells.
76 Standard_EXPORT ShapeFix_FreeBounds(const TopoDS_Shape& shape, const Standard_Real closetoler, const Standard_Boolean splitclosed, const Standard_Boolean splitopen);
78 //! Returns compound of closed wires out of free edges.
79 const TopoDS_Compound& GetClosedWires() const;
81 //! Returns compound of open wires out of free edges.
82 const TopoDS_Compound& GetOpenWires() const;
84 //! Returns modified source shape.
85 const TopoDS_Shape& GetShape() const;
99 Standard_EXPORT Standard_Boolean Perform();
102 TopoDS_Compound myWires;
103 TopoDS_Compound myEdges;
104 TopoDS_Shape myShape;
105 Standard_Boolean myShared;
106 Standard_Real mySewToler;
107 Standard_Real myCloseToler;
108 Standard_Boolean mySplitClosed;
109 Standard_Boolean mySplitOpen;
115 #include <ShapeFix_FreeBounds.lxx>
121 #endif // _ShapeFix_FreeBounds_HeaderFile