b311480e |
1 | -- Created on: 2000-11-16 |
2 | -- Created by: Peter KURNEV |
3 | -- Copyright (c) 2000-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. |
19 | |
7fd59977 |
20 | |
21 | |
22 | class Tools from BOPTools |
23 | |
24 | ---Purpose: |
25 | --- The class contains handy static functions |
26 | --- dealing with the topology |
27 | |
28 | uses |
29 | Pnt from gp , |
30 | |
31 | Shape from TopoDS, |
32 | Vertex from TopoDS, |
33 | Edge from TopoDS, |
34 | Face from TopoDS, |
35 | |
36 | Range from IntTools, |
37 | Context from IntTools, |
38 | Curve from IntTools, |
39 | |
40 | PaveBlock from BOPTools, |
41 | |
42 | IndexedMapOfShape from TopTools |
43 | |
44 | is |
45 | |
46 | |
47 | |
48 | MakeNewVertex (myclass; |
49 | aP1 : Pnt from gp; |
50 | aTol: Real from Standard; |
51 | aNewVertex:out Vertex from TopoDS); |
52 | ---Purpose: |
53 | --- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol> |
54 | --- |
55 | MakeNewVertex (myclass; |
56 | aV1,aV2: Vertex from TopoDS; |
57 | aNewVertex:out Vertex from TopoDS); |
58 | ---Purpose: |
59 | --- Make a vertex using couple of vertices <aV1, aV2> |
60 | --- |
61 | MakeNewVertex (myclass; |
62 | aE1: Edge from TopoDS; |
63 | aP1: Real from Standard; |
64 | aE2: Edge from TopoDS; |
65 | aP2: Real from Standard; |
66 | aNewVertex:out Vertex from TopoDS); |
67 | ---Purpose: |
68 | --- Make a vertex in place of intersection between two edges |
69 | --- <aE1, aE2> with parameters <aP1, aP2> |
70 | --- |
71 | MakeNewVertex (myclass; |
72 | aE1: Edge from TopoDS; |
73 | aP1: Real from Standard; |
74 | aF2: Face from TopoDS; |
75 | aNewVertex:out Vertex from TopoDS); |
76 | ---Purpose: |
77 | --- Make a vertex in place of intersection between the edge <aE1> |
78 | --- with parameter <aP1> and the face <aF2> |
79 | --- |
80 | PointOnEdge (myclass; |
81 | aEdge: Edge from TopoDS; |
82 | aPrm: Real from Standard; |
83 | aP:out Pnt from gp); |
84 | ---Purpose: |
85 | --- Compute a 3D-point on the edge <aEdge> at parameter <aPrm> |
86 | --- |
87 | MakeSplitEdge (myclass; |
88 | aE1: Edge from TopoDS; |
89 | aV1: Vertex from TopoDS; |
90 | aP1: Real from Standard; |
91 | aV2: Vertex from TopoDS; |
92 | aP2: Real from Standard; |
93 | aNewEdge:out Edge from TopoDS); |
94 | ---Purpose: |
95 | --- Make the edge from base edge <aE1> and two vertices <aV1,aV2> |
96 | --- at parameters <aP1,aP2> |
97 | --- |
98 | MakeSectEdge (myclass; |
99 | aIC: Curve from IntTools; |
100 | aV1: Vertex from TopoDS; |
101 | aP1: Real from Standard; |
102 | aV2: Vertex from TopoDS; |
103 | aP2: Real from Standard; |
104 | aNewEdge:out Edge from TopoDS); |
105 | ---Purpose: |
106 | --- Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2> |
107 | --- at parameters <aP1,aP2> |
108 | --- |
109 | UpdateVertex (myclass; |
110 | aIC: Curve from IntTools; |
111 | aT : Real from Standard; |
112 | aV : Vertex from TopoDS); |
113 | ---Purpose: |
114 | --- Update the tolerance value for vertex <aV> |
115 | --- taking into account the fact that <aV> lays on |
116 | --- the curve <aIC> |
117 | --- |
118 | UpdateVertex (myclass; |
119 | aE : Edge from TopoDS; |
120 | aT : Real from Standard; |
121 | aV : Vertex from TopoDS); |
122 | ---Purpose: |
123 | --- Update the tolerance value for vertex <aV> |
124 | --- taking into account the fact that <aV> lays on |
125 | --- the edge <aE> |
126 | --- |
127 | UpdateVertex (myclass; |
128 | aVF : Vertex from TopoDS; |
129 | aVN : Vertex from TopoDS); |
130 | ---Purpose: |
131 | --- Update the tolerance value for vertex <aVN> |
132 | --- taking into account the fact that <aVN> should |
133 | --- cover tolerance zone of <aVF> |
134 | --- |
135 | IsBlocksCoinside(myclass; |
136 | aPB1: PaveBlock from BOPTools; |
137 | aPB2: PaveBlock from BOPTools) |
138 | returns Boolean from Standard; |
139 | ---Purpose: |
140 | --- Returns TRUE if PaveBlocks <aPB1>,<aPB2> coinside in 3D |
141 | --- taking into account corresp. tolerances' values of vertices, |
142 | --- edges |
143 | --- |
144 | IsBlockInOnFace(myclass; |
145 | aPB : PaveBlock from BOPTools; |
146 | aF : Face from TopoDS; |
4f189102 |
147 | aContext: Context from IntTools) |
7fd59977 |
148 | returns Boolean from Standard; |
149 | ---Purpose: |
150 | --- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e |
151 | --- the <PB> is IN or ON in 2D of <aF> |
152 | --- |
153 | MapShapes (myclass; |
154 | aS : Shape from TopoDS; |
155 | aM :out IndexedMapOfShape from TopTools); |
156 | ---Purpose: |
157 | --- Get a Map <aM> containing the shape itself and all its subshapes |
158 | --- |
159 | CorrectRange (myclass; |
160 | aE1: Edge from TopoDS; |
161 | aE2: Edge from TopoDS; |
162 | aSR: Range from IntTools; |
163 | aNewSR:out Range from IntTools); |
164 | ---Purpose: |
165 | --- Correct shrunk range <aSR> taking into account 3D-curve |
166 | --- resolution and corresp. tolerances' values of <aE1>, <aE2> |
167 | --- |
168 | CorrectRange (myclass; |
169 | aE: Edge from TopoDS; |
170 | aF: Face from TopoDS; |
171 | aSR: Range from IntTools; |
172 | aNewSR:out Range from IntTools); |
173 | ---Purpose: |
174 | --- Correct shrunk range <aSR> taking into account 3D-curve |
175 | --- resolution and corresp. tolerances' values of <aE>, <aF> |
176 | --- |
177 | CopySource (myclass; |
178 | aSourceShape: Shape from TopoDS; |
179 | aDestShape:out Shape from TopoDS); |
180 | ---Purpose: |
181 | --- Make a copy of <aSourceShape> |
182 | --- |
183 | |
184 | end Tools; |