b311480e |
1 | -- Created on: 1995-05-02 |
2 | -- Created by: Jing Cheng MEI |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class FindContigousEdges from BRepOffsetAPI |
24 | |
25 | ---Purpose: Provides methods to identify contigous boundaries |
26 | -- for continuity control (C0, C1, ...) |
27 | -- |
28 | -- Use this function as following: |
29 | -- - create an object |
30 | -- - default tolerance 1.E-06 |
31 | -- - with analysis of degenerated faces on |
32 | -- - define if necessary a new tolerance |
33 | -- - set if necessary analysis of degenerated shapes off |
34 | -- - add shapes to be controlled -> Add |
35 | -- - compute -> Perfom |
36 | -- - output couples of connected edges for control |
37 | -- - output the problems if any |
38 | |
39 | uses |
40 | Edge from TopoDS, |
41 | Shape from TopoDS, |
42 | ListOfShape from TopTools, |
43 | Sewing from BRepBuilderAPI |
44 | |
45 | raises |
46 | OutOfRange from Standard, |
47 | NoSuchObject from Standard |
48 | |
49 | |
50 | is |
51 | Create(tolerance: Real = 1.0e-06; -- tolerance of connexity |
52 | option: Boolean = Standard_True) -- option for analysis of degenerated shapes |
53 | ---Purpose: Initializes an algorithm for identifying contiguous edges |
54 | -- on shapes with tolerance as the tolerance of contiguity |
55 | -- (defaulted to 1.0e-6). This tolerance value is used to |
56 | -- determine whether two edges or sections of edges are coincident. |
57 | -- Use the function Add to define the shapes to be checked. |
58 | -- Set option to false. This argument (defaulted to true) will |
59 | -- serve in subsequent software releases for performing an |
60 | -- analysis of degenerated shapes. |
61 | returns FindContigousEdges from BRepOffsetAPI; |
62 | |
63 | Init(me: in out; tolerance: Real; option: Boolean); |
64 | ---Purpose: Initializes this algorithm for identifying contiguous edges |
65 | -- on shapes using the tolerance of contiguity tolerance. |
66 | -- This tolerance value is used to determine whether two |
67 | -- edges or sections of edges are coincident. |
68 | -- Use the function Add to define the shapes to be checked. |
69 | -- Sets <option> to false. |
70 | |
71 | Add(me: in out; shape: Shape from TopoDS); |
72 | ---Purpose: Adds the shape shape to the list of shapes to be |
73 | -- checked by this algorithm. |
74 | -- Once all the shapes to be checked have been added, |
75 | -- use the function Perform to find the contiguous edges |
76 | -- and the function ContigousEdge to return these edges. |
77 | |
78 | Perform(me: in out); |
79 | ---Purpose: Finds coincident parts of edges of two or more shapes |
80 | -- added to this algorithm and breaks down these edges |
81 | -- into contiguous and non-contiguous sections on copies |
82 | -- of the initial shapes. |
83 | -- The function ContigousEdge returns contiguous |
84 | -- edges. The function Modified can be used to return |
85 | -- modified copies of the initial shapes where one or more |
86 | -- edges were broken down into contiguous and non-contiguous sections. |
87 | -- Warning |
88 | -- This function must be used once all the shapes to be |
89 | -- checked have been added. It is not possible to add |
90 | -- further shapes subsequently and then to repeat the call to Perform. |
91 | NbEdges(me) returns Integer; |
92 | ---Purpose: Gives the number of edges (free edges + contigous |
93 | -- edges + multiple edge) |
94 | |
95 | NbContigousEdges(me) returns Integer; |
96 | ---Purpose: Returns the number of contiguous edges found by the |
97 | -- function Perform on the shapes added to this algorithm. |
98 | |
99 | ContigousEdge(me; index: Integer) returns Edge from TopoDS |
100 | ---Purpose: Returns the contiguous edge of index index found by |
101 | -- the function Perform on the shapes added to this algorithm. |
102 | -- Exceptions |
103 | -- Standard_OutOfRange if: |
104 | -- - index is less than 1, or |
105 | -- - index is greater than the number of contiguous |
106 | -- edges found by the function Perform on the shapes added to this algorithm. |
107 | ---C++: return const & |
108 | raises |
109 | OutOfRange from Standard; |
110 | |
111 | ContigousEdgeCouple(me; index: Integer) returns ListOfShape from TopTools |
112 | ---Purpose: Returns a list of edges coincident with the contiguous |
113 | -- edge of index index found by the function Perform. |
114 | -- There are as many edges in the list as there are faces |
115 | -- adjacent to this contiguous edge. |
116 | -- Exceptions |
117 | -- Standard_OutOfRange if: |
118 | -- - index is less than 1, or |
119 | -- - index is greater than the number of contiguous edges |
120 | -- found by the function Perform on the shapes added to this algorithm. |
121 | ---C++: return const & |
122 | raises |
123 | OutOfRange from Standard; |
124 | |
125 | SectionToBoundary(me; section: Edge from TopoDS) returns Edge from TopoDS |
126 | ---Purpose: Returns the edge on the initial shape, of which the |
127 | -- modified copy contains the edge section. |
128 | -- section is coincident with a contiguous edge found by |
129 | -- the function Perform. Use the function |
130 | -- ContigousEdgeCouple to obtain a valid section. |
131 | -- This information is useful for verification purposes, since |
132 | -- it provides a means of determining the surface to which |
133 | -- the contiguous edge belongs. |
134 | -- Exceptions |
135 | -- Standard_NoSuchObject if section is not coincident |
136 | -- with a contiguous edge. Use the function |
137 | -- ContigousEdgeCouple to obtain a valid section. |
138 | ---C++: return const & |
139 | raises |
140 | NoSuchObject from Standard; |
141 | |
142 | NbDegeneratedShapes(me) returns Integer; |
143 | ---Purpose: Gives the number of degenerated shapes |
144 | |
145 | DegeneratedShape(me; index: Integer) returns Shape from TopoDS |
146 | ---Purpose: Gives a degenerated shape |
147 | ---C++: return const & |
148 | raises |
149 | OutOfRange from Standard; |
150 | -- raised if index < 1 or > NbDegeneratedShapes |
151 | |
152 | IsDegenerated(me; shape: Shape from TopoDS) returns Boolean; |
153 | ---Purpose: Indicates if a input shape is degenerated |
154 | |
155 | IsModified(me; shape: Shape from TopoDS) returns Boolean; |
156 | ---Purpose: Returns true if the copy of the initial shape shape was |
157 | -- modified by the function Perform (i.e. if one or more of |
158 | -- its edges was broken down into contiguous and non-contiguous sections). |
159 | -- Warning |
160 | -- Returns false if shape is not one of the initial shapes |
161 | -- added to this algorithm. |
162 | |
163 | Modified(me; shape: Shape from TopoDS) returns Shape from TopoDS |
164 | ---Purpose: Gives a modifieded shape |
165 | -- Raises NoSuchObject if shape has not been modified |
166 | ---C++: return const & |
167 | raises |
168 | NoSuchObject from Standard; |
169 | |
170 | Dump(me); |
171 | ---Purpose: Dump properties of resulting shape. |
172 | |
173 | fields |
174 | mySewing : Sewing from BRepBuilderAPI; |
175 | |
176 | end FindContigousEdges; |