b311480e |
1 | -- Created on: 1995-12-12 |
2 | -- Created by: Jacques GOUSSARD |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
b311480e |
16 | |
7fd59977 |
17 | -- modified by eap Fri Dec 21 12:17:40 2001 (bug OCC35) |
18 | -- Closed2d() added |
19 | |
20 | |
21 | class Wire from BRepCheck inherits Result from BRepCheck |
22 | |
23 | ---Purpose: |
24 | |
25 | uses Shape from TopoDS, |
26 | Face from TopoDS, |
27 | Wire from TopoDS, |
28 | Edge from TopoDS, |
29 | IndexedDataMapOfShapeListOfShape from TopTools, |
30 | Status from BRepCheck |
31 | |
32 | is |
33 | |
34 | Create(W: Wire from TopoDS) |
35 | |
36 | returns mutable Wire from BRepCheck; |
37 | |
38 | |
39 | InContext(me: mutable; ContextShape: Shape from TopoDS); |
40 | ---Purpose: if <ContextShape> is a face, consequently checks |
41 | -- SelfIntersect(), Closed(), Orientation() and |
42 | -- Closed2d until faulty is found |
43 | |
44 | Minimum(me: mutable); |
45 | ---Purpose: checks that the wire is not empty and "connex". |
46 | -- Called by constructor |
47 | |
48 | Blind(me: mutable); |
49 | ---Purpose: Does nothing |
50 | |
51 | |
52 | |
53 | Closed(me: mutable; Update: Boolean from Standard = Standard_False) |
54 | ---Purpose: Checks if the oriented edges of the wire give a |
55 | -- closed wire. If the wire is closed, returns |
56 | -- BRepCheck_NoError. Warning : if the first and |
57 | -- last edge are infinite, the wire will be |
58 | -- considered as a closed one. If <Update> is set to |
59 | -- Standard_True, registers the status in the list. |
60 | -- May return (and registers): |
61 | -- **BRepCheck_NotConnected, if wire is not |
62 | -- topologically closed |
63 | -- **BRepCheck_RedundantEdge, if an edge is in wire |
64 | -- more than 3 times or in case of 2 occurences if |
65 | -- not with FORWARD and REVERSED orientation. |
66 | -- **BRepCheck_NoError |
67 | returns Status from BRepCheck |
68 | is static; |
69 | |
70 | Closed2d(me: mutable; F : Face from TopoDS; |
71 | Update: Boolean from Standard = Standard_False) |
72 | ---Purpose: Checks if edges of the wire give a wire closed in |
73 | -- 2d space. |
74 | -- Returns BRepCheck_NoError, or BRepCheck_NotClosed |
75 | -- If <Update> is set to Standard_True, registers the |
76 | -- status in the list. |
77 | returns Status from BRepCheck |
78 | is static; |
79 | |
80 | Orientation(me: mutable; F : Face from TopoDS; |
81 | Update: Boolean from Standard = Standard_False) |
82 | ---Purpose: Checks if the oriented edges of the wire are |
83 | -- correctly oriented. An internal call is made to |
84 | -- the method Closed. If no face exists, call the |
85 | -- method with a null face (TopoDS_face()). If |
86 | -- <Update> is set to Standard_True, registers the |
87 | -- status in the list. |
88 | -- May return (and registers): |
89 | -- BRepCheck_InvalidDegeneratedFlag, |
90 | -- BRepCheck_BadOrientationOfSubshape, |
91 | -- BRepCheck_NotClosed, |
92 | -- BRepCheck_NoError |
93 | returns Status from BRepCheck |
94 | is static; |
95 | |
96 | SelfIntersect(me: mutable; F : Face from TopoDS; |
97 | E1,E2 : out Edge from TopoDS; |
98 | Update: Boolean from Standard = Standard_False) |
99 | |
100 | ---Purpose: Checks if the wire intersect itself on the face |
101 | -- <F>. <E1> and <E2> are the first intersecting |
102 | -- edges found. <E2> may be a null edge when a |
103 | -- self-intersecting edge is found.If <Update> is set |
104 | -- to Standard_True, registers the status in the |
105 | -- list. |
106 | -- May return (and register): |
107 | -- BRepCheck_EmptyWire, |
108 | -- BRepCheck_SelfIntersectingWire, |
109 | -- BRepCheck_NoCurveOnSurface, |
110 | -- BRepCheck_NoError |
111 | returns Status from BRepCheck |
112 | is static; |
113 | |
114 | |
115 | |
116 | GeometricControls(me) |
117 | ---Purpose: report SelfIntersect() check would be (is) done |
118 | returns Boolean from Standard |
119 | is static; |
120 | |
121 | GeometricControls(me: mutable; B: Boolean from Standard) |
122 | ---Purpose: set SelfIntersect() to be checked |
123 | is static; |
124 | |
125 | |
126 | |
127 | fields |
128 | |
129 | -- myNbori : Integer from Standard; -- not used (eap) |
130 | myCdone : Boolean from Standard; -- Closed() or Oriented() is done |
131 | myCstat : Status from BRepCheck; -- result of Closed() or Oriented() |
132 | myMapVE : IndexedDataMapOfShapeListOfShape from TopTools; |
133 | myGctrl : Boolean from Standard; -- do check SelfIntersect() or not |
134 | |
135 | end Wire; |
136 | |
137 | |
138 | |