7fd59977 |
1 | -- File: TopOpeBRepBuild_Tools.cdl |
2 | -- Created: Tue Nov 2 15:21:24 1999 |
3 | -- Author: Peter KURNEV |
4 | -- <pkv@irinox.nnov.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 1999 |
6 | |
7 | |
8 | class Tools from TopOpeBRepBuild |
9 | |
10 | ---Purpose: Auxiliary methods used in TopOpeBRepBuild_Builder1 class |
11 | |
12 | uses |
13 | |
14 | Shape from TopoDS, |
15 | Face from TopoDS, |
16 | Wire from TopoDS, |
17 | Edge from TopoDS, |
18 | |
19 | Vec from gp, |
20 | |
21 | State from TopAbs, |
22 | ShapeEnum from TopAbs, |
23 | |
24 | IndexedDataMapOfShapeListOfShape from TopTools, |
25 | IndexedMapOfShape from TopTools, |
26 | MapOfShape from TopTools, |
27 | |
28 | DataMapOfShapeState from TopOpeBRepDS, |
29 | IndexedDataMapOfShapeWithState from TopOpeBRepDS, |
30 | IndexedMapOfOrientedShape from TopTools, |
31 | IndexedDataMapOfShapeShape from TopTools, |
32 | ShapeClassifier from TopOpeBRepTool |
33 | |
34 | |
35 | is |
36 | DumpMapOfShapeWithState (myclass; |
37 | iP:Integer from Standard; |
38 | aMapOfShapeWithState: IndexedDataMapOfShapeWithState from TopOpeBRepDS); |
39 | |
40 | FindState (myclass; |
41 | aVertex: Shape from TopoDS; |
42 | aState : State from TopAbs; |
43 | aShapeEnum:ShapeEnum from TopAbs; |
44 | aMapVertexEdges:IndexedDataMapOfShapeListOfShape from TopTools; |
45 | aMapProcessedVertices:out MapOfShape from TopTools; |
46 | aMapVs:out DataMapOfShapeState from TopOpeBRepDS); |
47 | PropagateState (myclass; |
48 | aSplEdgesState:DataMapOfShapeState from TopOpeBRepDS; |
49 | anEdgesToRestMap:IndexedMapOfShape from TopTools; |
50 | aShapeEnum1:ShapeEnum from TopAbs; |
51 | aShapeEnum2:ShapeEnum from TopAbs; |
52 | aShapeClassifier:in out ShapeClassifier from TopOpeBRepTool; |
53 | aMapOfShapeWithState:out IndexedDataMapOfShapeWithState from TopOpeBRepDS; |
54 | anUnkStateShapes:MapOfShape from TopTools); |
55 | |
56 | FindStateThroughVertex (myclass; |
57 | aShape :Shape from TopoDS; |
58 | aShapeClassifier:in out ShapeClassifier from TopOpeBRepTool; |
59 | aMapOfShapeWithState:out IndexedDataMapOfShapeWithState from TopOpeBRepDS; |
60 | anAvoidSubshMap: MapOfShape from TopTools) |
61 | returns State from TopAbs; |
62 | |
63 | PropagateStateForWires (myclass; |
64 | aFacesToRestMap:IndexedMapOfShape from TopTools; |
65 | aMapOfShapeWithState:out IndexedDataMapOfShapeWithState from TopOpeBRepDS); |
66 | |
67 | SpreadStateToChild (myclass; |
68 | aShape:Shape from TopoDS; |
69 | aState:State from TopAbs; |
70 | aMapOfShapeWithState:out IndexedDataMapOfShapeWithState from TopOpeBRepDS); |
71 | |
72 | FindState1 (myclass; |
73 | anEdge:Shape from TopoDS; |
74 | aState:State from TopAbs; |
75 | aMapEdgesFaces:IndexedDataMapOfShapeListOfShape from TopTools; |
76 | aMapProcessedVertices:out MapOfShape from TopTools; |
77 | aMapVs:out DataMapOfShapeState from TopOpeBRepDS); |
78 | |
79 | FindState2 (myclass; |
80 | anEdge:Shape from TopoDS; |
81 | aState:State from TopAbs; |
82 | aMapEdgesFaces:IndexedDataMapOfShapeListOfShape from TopTools; |
83 | aMapProcessedEdges:out MapOfShape from TopTools; |
84 | aMapVs:out DataMapOfShapeState from TopOpeBRepDS); |
85 | |
86 | GetAdjacentFace (myclass; |
87 | aFaceObj:Shape from TopoDS; |
88 | anEObj :Shape from TopoDS; |
89 | anEdgeFaceMap:IndexedDataMapOfShapeListOfShape from TopTools; |
90 | anAdjFaceObj :out Shape from TopoDS) |
91 | returns Boolean from Standard; |
92 | |
93 | GetNormalToFaceOnEdge (myclass; |
94 | aFObj :Face from TopoDS; |
95 | anEdgeObj:Edge from TopoDS; |
96 | aDirNormal:out Vec from gp); |
97 | |
98 | GetNormalInNearestPoint(myclass; aFace : Face from TopoDS; |
99 | anEdge : Edge from TopoDS; |
100 | aNormal: out Vec from gp); |
101 | ---Purpose: This function used to compute normal in point which is located |
102 | --- near the point with param UV (used for computation of normals where the normal in the point UV equal to zero). |
103 | |
104 | |
105 | GetTangentToEdgeEdge (myclass; |
106 | aFObj :Face from TopoDS; |
107 | anEdgeObj:Edge from TopoDS; |
108 | aOriEObj :Edge from TopoDS; |
109 | aTangent :out Vec from gp) |
110 | returns Boolean from Standard; |
111 | |
112 | GetTangentToEdge (myclass; |
113 | anEdgeObj:Edge from TopoDS; |
114 | aTangent:out Vec from gp) |
115 | returns Boolean from Standard; |
116 | |
117 | UpdatePCurves (myclass; |
118 | aWire : Wire from TopoDS; |
119 | fromFace : Face from TopoDS; |
120 | toFace : Face from TopoDS); |
121 | ---Purpose : Recompute PCurves of the all edges from the wire on the <toFace> |
122 | |
123 | UpdateEdgeOnPeriodicalFace(myclass; |
124 | aEdgeToUpdate : Edge from TopoDS; |
125 | OldFace : Face from TopoDS; |
126 | NewFace : Face from TopoDS); |
127 | ---Purpose : recompute PCurves of the closing (SIM , with 2 PCurves) edge on the NewFace |
128 | |
129 | UpdateEdgeOnFace(myclass; |
130 | aEdgeToUpdate : Edge from TopoDS; |
131 | OldFace : Face from TopoDS; |
132 | NewFace : Face from TopoDS); |
133 | ---Purpose : recompute PCurve of the edge on the NewFace |
134 | |
135 | IsDegEdgesTheSame (myclass; |
136 | anE1: Shape from TopoDS; |
137 | anE2: Shape from TopoDS) |
138 | returns Boolean from Standard; |
139 | |
140 | NormalizeFace(myclass; oldFace : Shape from TopoDS; |
141 | corrFace : out Shape from TopoDS); |
142 | ---Purpose : test if <oldFace> does not contain INTERNAL or EXTERNAL edges |
143 | --- and remove such edges in case of its presence. The result is stored in <corrFace> |
144 | |
145 | CorrectFace2d(myclass; oldFace : Shape from TopoDS; |
146 | corrFace : out Shape from TopoDS; |
147 | aSourceShapes: IndexedMapOfOrientedShape from TopTools; |
148 | aMapOfCorrect2dEdges:out IndexedDataMapOfShapeShape from TopTools); |
149 | ---Purpose: test if UV representation of <oldFace> is good (i.e. face is closed in 2d). |
150 | -- if face is not closed , this method will try to close such face and will |
151 | -- return corrected edges in the <aMapOfCorrect2dEdges>. Parameter <aSourceShapes> |
152 | -- used to fix the edge (or wires) which should be correct (Corrector used it as a start shapes). |
153 | -- NOTE : Parameter corrFace doesn't mean anything. If you want to use this method , rebuild resulting face |
154 | -- after by yourself using corrected edges. |
155 | |
156 | --modified by NIZNHY-PKV Fri Feb 11 17:20:08 2000 from |
157 | ------------------------------------------------------------ |
158 | -- Tools to correct tolerances Fri Feb 11 17:20:08 NIZNHY-PKV |
159 | CorrectTolerances (myclass; |
160 | aS: Shape from TopoDS; |
161 | aTolMax: Real from Standard =0.0001); |
162 | |
163 | CorrectCurveOnSurface (myclass; |
164 | aS: Shape from TopoDS; |
165 | aTolMax: Real from Standard =0.0001); |
166 | |
167 | CorrectPointOnCurve (myclass; |
168 | aS: Shape from TopoDS; |
169 | aTolMax: Real from Standard =0.0001); |
170 | |
171 | --modified by NIZNHY-PKV Fri Feb 11 17:20:20 2000 to |
172 | |
173 | CheckFaceClosed2d (myclass; |
174 | theFace: Face from TopoDS) |
175 | returns Boolean from Standard; |
176 | ---Purpose: Checks if <theFace> has the properly closed in 2D boundary(ies) |
177 | |
178 | end Tools; |