0025122: Expose internal static function ComputeDeviation from ShapeAnalysis_Edge.cxx
[occt.git] / src / ShapeAnalysis / ShapeAnalysis_FreeBounds.cdl
1 -- Created on: 1998-06-03
2 -- Created by: Daniel RISSER
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 -- Modified     Mon Sep 14 10:20:25 1998 by Roman LYGIN (rln)
18 --              1. Analysis of actual free bounds of the shells.
19 --              2. Options to extract closed sub-wires out of closed and open
20 --                 wires
21 --              3. Improved algorithm for connecting free edges into wires
22
23
24 class FreeBounds from ShapeAnalysis 
25
26     ---Purpose: This class is intended to output free bounds of the shape
27     --          (free bounds are the wires consisting of edges referenced by the
28     --          only face).
29     --          This class works on two distinct types of shapes when analyzing
30     --          their free bounds:
31     --          1. compound of faces.
32     --            Analyzer of sewing algorithm (BRepAlgo_Sewing) is used for
33     --            for forecasting free bounds that would be obtained after
34     --            performing sewing
35     --          2. compound of shells.
36     --            Actual free bounds (edges shared by the only face in the shell)
37     --            are output in this case. ShapeAnalysis_Shell is used for that.
38     --
39     --          When connecting edges into the wires algorithm tries to build
40     --          wires of maximum length. Two options are provided for a user
41     --          to extract closed sub-contours out of closed and/or open contours.
42     --
43     --          Free bounds are returned as two compounds, one for closed and one
44     --          for open wires.
45     --
46     --          This class also provides some static methods for advanced use:
47     --          connecting edges/wires to wires, extracting closed sub-wires out
48     --          of wires, dispatching wires into compounds for closed and open
49     --          wires.
50     --          NOTE. Ends of the edge or wire mean hereafter their end vertices.
51     
52
53 uses
54     Shape            from TopoDS,
55     Vertex           from TopoDS, 
56     Wire             from TopoDS,
57     Compound         from TopoDS,
58     HSequenceOfShape    from TopTools,
59     DataMapOfShapeShape from TopTools,
60     HArray1OfShape      from TopTools
61     
62 is
63     Create returns  FreeBounds from  ShapeAnalysis;
64         ---Purpose: Empty constructor
65         
66     Create (shape      : Shape from TopoDS; 
67             toler      : Real;
68             splitclosed: Boolean = Standard_False;
69             splitopen  : Boolean = Standard_True) 
70     returns  FreeBounds from  ShapeAnalysis; 
71         ---Purpose: Builds forecasting free bounds of the <shape>. 
72         --          <shape> should be a compound of faces.
73         --          This constructor is to be used for forecasting free edges
74         --          with help of sewing analyzer BRepAlgo_Sewing which is called
75         --          with tolerance <toler>.
76         --          Free edges are connected into wires only when their ends are
77         --          at distance less than <toler>.
78         --          If <splitclosed> is True extracts closed sub-wires out of
79         --          built closed wires.
80         --          If <splitopen> is True extracts closed sub-wires out of
81         --          built open wires.
82         
83     Create (shape      : Shape from TopoDS;
84             splitclosed: Boolean = Standard_False;
85             splitopen  : Boolean = Standard_True;
86             checkinternaledges  : Boolean = Standard_False)
87     returns FreeBounds from ShapeAnalysis;
88         ---Purpose: Builds actual free bounds of the <shape>.
89         --          <shape> should be a compound of shells.
90         --          This constructor is to be used for getting free edges (ones
91         --          referenced by the only face) with help of analyzer
92         --          ShapeAnalysis_Shell.
93         --          Free edges are connected into wires only when they share the
94         --          same vertex.
95         --          If <splitclosed> is True extracts closed sub-wires out of
96         --          built closed wires.
97         --          If <splitopen> is True extracts closed sub-wires out of
98         --          built open wires.
99         
100     GetClosedWires (me) returns Compound from TopoDS; 
101         ---Purpose: Returns compound of closed wires out of free edges.
102         ---C++: inline
103         ---C++: return const &
104      
105     GetOpenWires (me) returns Compound from TopoDS; 
106         ---Purpose: Returns compound of open wires out of free edges.
107         ---C++: inline
108         ---C++: return const &
109         
110
111
112     ---Level: Advanced
113     
114     ConnectEdgesToWires (myclass; edges : in out HSequenceOfShape from TopTools;
115                                   toler : Real;
116                                   shared: Boolean;
117                                   wires : out HSequenceOfShape from TopTools);
118         ---Purpose: Builds sequnce of <wires> out of sequence of not sorted
119         --          <edges>.
120         --          Tries to build wires of maximum length. Building a wire is
121         --          stopped when no edges can be connected to it at its head or
122         --          at its tail.
123         --
124         --          Orientation of the edge can change when connecting.
125         --          If <shared> is True connection is performed only when
126         --          adjacent edges share the same vertex.
127         --          If <shared> is False connection is performed only when
128         --          ends of adjacent edges are at distance less than <toler>.
129         
130     ConnectWiresToWires (myclass; iwires: in out HSequenceOfShape from TopTools;
131                                   toler : Real;
132                                   shared: Boolean;
133                                   owires: out HSequenceOfShape from TopTools);
134
135     ConnectWiresToWires (myclass; iwires: in out HSequenceOfShape from TopTools;
136                                   toler : Real;
137                                   shared: Boolean;
138                                   owires: out HSequenceOfShape from TopTools;
139                                   vertices: out DataMapOfShapeShape
140                                       from TopTools);
141         ---Purpose: Builds sequnce of <owires> out of sequence of not sorted
142         --          <iwires>.
143         --          Tries to build wires of maximum length. Building a wire is
144         --          stopped when no wires can be connected to it at its head or
145         --          at its tail.
146         --
147         --          Orientation of the wire can change when connecting.
148         --          If <shared> is True connection is performed only when
149         --          adjacent wires share the same vertex.
150         --          If <shared> is False connection is performed only when
151         --          ends of adjacent wires are at distance less than <toler>.
152         --          Map <vertices> stores the correspondence between original
153         --          end vertices of the wires and new connecting vertices.
154                                      
155     SplitWires (myclass; wires :     HSequenceOfShape from TopTools;
156                          toler : Real;
157                          shared: Boolean;
158                          closed: out HSequenceOfShape from TopTools;
159                          open  : out HSequenceOfShape from TopTools);
160         ---Purpose: Extracts closed sub-wires out of <wires> and adds them
161         --          to <closed>, open wires remained after extraction are put
162         --          into <open>.
163         --          If <shared> is True extraction is performed only when
164         --          edges share the same vertex.
165         --          If <shared> is False connection is performed only when
166         --          ends of the edges are at distance less than <toler>.
167         
168     DispatchWires (myclass; wires : HSequenceOfShape from TopTools;
169                             closed: in out Compound from TopoDS;
170                             open  : in out Compound from TopoDS);
171         ---Purpose: Dispatches sequence of <wires> into two compounds
172         --          <closed> for closed wires and <open> for open wires.
173         --          If a compound is not empty wires are added into it.
174     
175         
176     ---Level: Internal
177     
178     SplitWires (me: in out) is private;
179     
180
181 fields  
182
183     myWires: Compound from TopoDS; 
184     myEdges: Compound from TopoDS; 
185     
186     myTolerance  : Real;
187     myShared     : Boolean;
188     
189     mySplitClosed: Boolean;
190     mySplitOpen  : Boolean;
191     
192 end FreeBounds;