b311480e |
1 | -- Created on: 2001-05-03 |
2 | -- Created by: Michael SAZONOV |
3 | -- Copyright (c) 2001-2012 OPEN CASCADE SAS |
4 | -- |
5 | -- The content of this file is subject to the Open CASCADE Technology Public |
6 | -- License Version 6.5 (the "License"). You may not use the content of this file |
7 | -- except in compliance with the License. Please obtain a copy of the License |
8 | -- at http://www.opencascade.org and read it completely before using this file. |
9 | -- |
10 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | -- |
13 | -- The Original Code and all software distributed under the License is |
14 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | -- Initial Developer hereby disclaims all such warranties, including without |
16 | -- limitation, any warranties of merchantability, fitness for a particular |
17 | -- purpose or non-infringement. Please see the License for the specific terms |
18 | -- and conditions governing the rights and limitations under the License. |
7fd59977 |
19 | |
20 | class Glue from QANewModTopOpe inherits BooleanOperation from BRepAlgoAPI |
21 | |
22 | ---Purpose: Perform the gluing topological operation. |
23 | |
24 | uses |
25 | Boolean from Standard, |
26 | Pnt from gp, |
27 | Shape from TopoDS, |
28 | Vertex from TopoDS, |
29 | Edge from TopoDS, |
30 | Face from TopoDS, |
31 | ListOfShape from TopTools, |
32 | State from TopAbs, |
33 | Substitution from BRepTools, |
34 | MapOfShape from TopTools, |
35 | DataMapOfShapeShape from TopTools, |
36 | DataMapOfShapeListOfShape from TopTools, |
37 | IndexedDataMapOfShapeListOfShape from TopTools |
38 | |
39 | is |
40 | |
41 | Create (theS1,theS2 : Shape from TopoDS; |
42 | theAllowCutting: Boolean from Standard = Standard_False; |
43 | thePerformNow: Boolean from Standard = Standard_True) |
44 | returns Glue from QANewModTopOpe; |
45 | ---Purpose: Defines 2 operands. |
46 | -- If one of operands is Solid and another is Shell and Shell |
47 | -- goes inside Solid, the <allowCutting> determines what to do: |
48 | -- if True, Shell is cut by Solid during the operation; |
49 | -- if False, Null shape is returned, IsDone() returns False. |
50 | -- If <thePerformNow> is False then does not compute immediately. |
51 | ---Level: Public |
52 | |
53 | Build (me: in out) |
54 | is redefined static; |
55 | ---Purpose: Computation; is usefull when Create was called with thePerformNow |
56 | -- being False |
57 | ---Level: Public |
58 | |
59 | Generated (me: in out; theS : Shape from TopoDS) |
60 | returns ListOfShape from TopTools is redefined static; |
61 | ---Purpose: Returns the list of shapes generated from the |
62 | -- shape <theS>. |
63 | ---C++: return const & |
64 | ---Level: Public |
65 | |
66 | Modified (me: in out; theS : Shape from TopoDS) |
67 | returns ListOfShape from TopTools is redefined static; |
68 | ---Purpose: Returns the list of shapes modified from the shape |
69 | -- <theS>. |
70 | ---C++: return const & |
71 | ---Level: Public |
72 | |
73 | IsDeleted (me: in out; theS : Shape from TopoDS) |
74 | returns Boolean from Standard is redefined static; |
75 | ---Purpose: Returns True if the shape <theS> existed in one of operands |
76 | -- and is absent in the result. |
77 | ---Level: Public |
78 | |
79 | HasGenerated (me) |
80 | returns Boolean from Standard |
81 | is redefined; |
82 | ---Purpose: Returns True if there is at leat one generated shape |
83 | ---Level: Public |
84 | |
85 | HasModified (me) |
86 | returns Boolean from Standard |
87 | is redefined; |
88 | ---Purpose: Returns True if there is at leat one modified shape |
89 | ---Level: Public |
90 | |
91 | HasDeleted (me) |
92 | returns Boolean from Standard |
93 | is redefined; |
94 | ---Purpose: Returns True if there is at leat one deleted shape |
95 | ---Level: Public |
96 | |
97 | |
98 | |
99 | ------------------ |
100 | -- Private methods |
101 | ------------------ |
102 | |
103 | PerformShellWire (me: in out) is private; |
104 | ---Purpose: Performs gluing Shell-Wire |
105 | ---Level: Private |
106 | |
107 | PerformVertex (me: in out) is private; |
108 | ---Purpose: Performs gluing Solid-Vertex and Shell-Vertex |
109 | ---Level: Private |
110 | |
111 | PerformShell (me: in out) is private; |
112 | ---Purpose: Performs gluing Solid-Shell and Shell-Shell |
113 | ---Level: Private |
114 | |
115 | PerformWires (me: in out) is private; |
116 | ---Purpose: Performs gluing Wire-Wire |
117 | ---Level: Private |
118 | |
119 | SubstitudeSDFaces(me: in out; |
120 | theFirstSDFace : Shape from TopoDS; |
121 | theSecondSDFace : Shape from TopoDS; |
122 | theNewSolid1 : in out Shape from TopoDS; |
123 | theNewSolid2 : in out Shape from TopoDS; |
124 | theMapOfChangedFaces: in out DataMapOfShapeListOfShape from TopTools) |
125 | ---Purpose: This function performs gluing operation of same domain |
126 | -- faces theFirstSDFace and theSecondSDFace on shapes |
127 | -- theNewSolid1 and theNewSolid2 and returns them. |
128 | -- theMapOfChangedFaces contains changed faces as keys and |
129 | -- lists of their splits as items. |
130 | ---Level: Private |
131 | returns Boolean from Standard |
132 | is private; |
133 | |
134 | PerformSDFaces (me: in out) is private; |
135 | ---Purpose: Performs gluing between same domain faces of object and tool |
136 | ---Level: Private |
137 | |
138 | CutFace (me: in out; theFace: Face from TopoDS; |
139 | theListSE: ListOfShape from TopTools) |
140 | returns Boolean from Standard is private; |
141 | ---Purpose: For the case Solid-Shell, <aFace> is from Shell. |
142 | -- Splits <theFace> onto faces by section edges <theListSE> and |
143 | -- add <theFace> for substitution by list of faces which are "out" |
144 | -- of Solid |
145 | ---Level: Private |
146 | |
147 | ClassifyFace (me: in; theFace: Face from TopoDS; |
148 | theListSE: ListOfShape from TopTools) |
149 | returns State from TopAbs is private; |
150 | ---Purpose: For the case Solid-Shell, <theFace> is a split of Shell's face. |
151 | -- Returns the state of <theFace> relatively Solid. |
152 | ---Level: Private |
153 | |
154 | SectionInsideFace (me: in out; theFace: Face from TopoDS; |
155 | theListSE: ListOfShape from TopTools; |
156 | theShapeNum: Integer from Standard; |
157 | theGenEdges: MapOfShape from TopTools) |
158 | is private; |
159 | ---Purpose: Inserts "internal" elements (wires, edges, vertices) computed |
160 | -- from a list of section edges <theListSE> into <theFace>. |
161 | ---Level: Private |
162 | |
163 | ------------------ |
164 | -- Utilities |
165 | ------------------ |
166 | ProjPointOnEdge (myclass; thePnt: Pnt from gp; theEdge: Edge from TopoDS; |
167 | thePar, theDist: out Real from Standard) |
168 | returns Boolean from Standard; |
169 | |
170 | InsertVertexInEdge (myclass; theEdge: Edge from TopoDS; |
171 | theVer: Vertex from TopoDS; |
172 | thePar: Real from Standard; |
173 | theNewEdge: out Edge from TopoDS); |
174 | |
175 | SplitEdgeByVertex (myclass; theEdge: Edge from TopoDS; |
176 | theVer: Vertex from TopoDS; |
177 | thePar: Real from Standard; |
178 | theListE: out ListOfShape from TopTools); |
179 | |
180 | CompareVertices (myclass; theV1, theV2: Vertex from TopoDS; |
181 | theDist: out Real from Standard) |
182 | returns Boolean from Standard; |
183 | |
184 | FindWireOrUpdateMap (myclass; theWire: Shape from TopoDS; |
185 | theMapELW: in out IndexedDataMapOfShapeListOfShape from TopTools) |
186 | returns Shape from TopoDS is private; |
187 | ---C++: return const & |
188 | |
189 | fields |
190 | |
191 | myCompleted: Boolean from Standard; |
192 | myAllowCutting: Boolean from Standard; |
193 | mySubst : Substitution from BRepTools; |
194 | -- Map: section edge => list of all faces-ancestors from corresponding shape |
195 | myMapSEdgeFaces1: DataMapOfShapeListOfShape from TopTools; |
196 | myMapSEdgeFaces2: DataMapOfShapeListOfShape from TopTools; |
197 | -- Map: section edge => face crossed by this edge (i.e., edge lies |
198 | -- inside the face, not on boundary) |
199 | myMapSEdgeCrossFace1: DataMapOfShapeShape from TopTools; |
200 | myMapSEdgeCrossFace2: DataMapOfShapeShape from TopTools; |
201 | -- Map: internal edge => list of internal wires containing this edge; |
202 | -- it is to share wires |
203 | myMapEdgeWires: IndexedDataMapOfShapeListOfShape from TopTools; |
204 | myEdgesToLeave: MapOfShape from TopTools; |
205 | myMapModif: DataMapOfShapeListOfShape from TopTools; |
206 | myMapGener: DataMapOfShapeListOfShape from TopTools; |
207 | |
208 | end Glue; |