0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / ShapeFix / ShapeFix_FreeBounds.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _ShapeFix_FreeBounds_HeaderFile
18 #define _ShapeFix_FreeBounds_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TopoDS_Compound.hxx>
25 #include <TopoDS_Shape.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Real.hxx>
28 class TopoDS_Shape;
29 class TopoDS_Compound;
30
31
32 //! This class is intended to output free bounds of the shape
33 //! (free bounds are the wires consisting of edges referenced by the
34 //! only face).
35 //! For building free bounds it uses ShapeAnalysis_FreeBounds class.
36 //! This class complements it with the feature to reduce the number
37 //! of open wires.
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
41 //! open wires
42 //! 2. making closed wire out of several open wires
43 //!
44 //! The connecting open wires is performed with a user-given
45 //! tolerance.
46 //!
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
51 //! be modified.
52 //!
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 
56 {
57 public:
58
59   DEFINE_STANDARD_ALLOC
60
61   
62   //! Empty constructor
63   Standard_EXPORT ShapeFix_FreeBounds();
64   
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);
72   
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);
77   
78   //! Returns compound of closed wires out of free edges.
79     const TopoDS_Compound& GetClosedWires() const;
80   
81   //! Returns compound of open wires out of free edges.
82     const TopoDS_Compound& GetOpenWires() const;
83   
84   //! Returns modified source shape.
85     const TopoDS_Shape& GetShape() const;
86
87
88
89
90 protected:
91
92
93
94
95
96 private:
97
98   
99   Standard_EXPORT Standard_Boolean Perform();
100
101
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;
110
111
112 };
113
114
115 #include <ShapeFix_FreeBounds.lxx>
116
117
118
119
120
121 #endif // _ShapeFix_FreeBounds_HeaderFile