b311480e |
1 | // Created on: 1997-03-04 |
2 | // Created by: Jean-Pierre COMBE |
3 | // Copyright (c) 1997-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 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
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. |
7fd59977 |
16 | |
17 | #include <Standard_NotImplemented.hxx> |
18 | |
19 | #include <AIS_OffsetDimension.ixx> |
20 | |
21 | #include <AIS.hxx> |
7fd59977 |
22 | #include <BRepBuilderAPI_Transform.hxx> |
23 | #include <BRepAdaptor_Surface.hxx> |
24 | #include <BRep_Tool.hxx> |
25 | #include <DsgPrs_OffsetPresentation.hxx> |
26 | #include <ElCLib.hxx> |
27 | #include <ElSLib.hxx> |
28 | #include <GeomAbs_SurfaceType.hxx> |
29 | #include <Graphic3d_Structure.hxx> |
30 | #include <Precision.hxx> |
31 | #include <Prs3d_ArrowAspect.hxx> |
32 | #include <Prs3d_Drawer.hxx> |
a6eb515f |
33 | #include <Prs3d_DimensionAspect.hxx> |
7fd59977 |
34 | #include <Prs3d_LineAspect.hxx> |
35 | #include <Select3D_SensitiveBox.hxx> |
36 | #include <Select3D_SensitiveSegment.hxx> |
37 | #include <SelectMgr_EntityOwner.hxx> |
38 | #include <StdPrs_WFDeflectionShape.hxx> |
39 | #include <TColStd_Array2OfReal.hxx> |
40 | #include <TCollection_ExtendedString.hxx> |
41 | #include <TopExp_Explorer.hxx> |
42 | #include <TopoDS.hxx> |
43 | #include <TopoDS_Vertex.hxx> |
44 | #include <gce_MakeLin.hxx> |
45 | #include <gp_Ax1.hxx> |
46 | #include <gp_Ax2.hxx> |
47 | #include <gp_Ax3.hxx> |
48 | #include <gp_Lin.hxx> |
49 | #include <gp_Pln.hxx> |
50 | #include <gp_Pnt.hxx> |
51 | #include <gp_Trsf.hxx> |
52 | #include <gp_Vec.hxx> |
53 | |
54 | //======================================================================= |
55 | //function : AIS_OffsetDimension |
56 | //purpose : |
57 | //======================================================================= |
58 | AIS_OffsetDimension::AIS_OffsetDimension(const TopoDS_Shape& FistShape, |
59 | const TopoDS_Shape& SecondShape, |
60 | const Standard_Real aVal, |
61 | const TCollection_ExtendedString& aText) |
62 | :AIS_Relation(), |
63 | myFAttach(0.,0.,0.), |
64 | mySAttach(0.,0.,0.) |
65 | { |
66 | myFShape = FistShape; |
67 | mySShape = SecondShape; |
68 | mySymbolPrs = DsgPrs_AS_BOTHAR; |
69 | myVal = aVal; |
70 | myText = aText; |
71 | //myArrowSize = fabs (myVal/5.); |
72 | myArrowSize = fabs (myVal/10.0); |
73 | if (myArrowSize > 30.) myArrowSize = 30.; |
74 | if (myArrowSize < 15.) myArrowSize = 15.; |
75 | //cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl; |
76 | } |
77 | |
78 | //======================================================================= |
79 | //function : Compute |
80 | //purpose : |
81 | //======================================================================= |
82 | void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&, |
83 | const Handle(Prs3d_Presentation)& aprs, |
84 | const Standard_Integer) |
85 | { |
86 | aprs->Clear(); |
87 | |
88 | //cout << endl << "This is strange Offset Dimension!" << endl; |
89 | |
90 | gp_Trsf aInvertTrsf = myRelativePos; |
91 | //myArrowSize = fabs (myVal/5.); |
92 | myArrowSize = fabs (myVal/10.0); |
93 | if (myArrowSize > 30.) myArrowSize = 30.; |
94 | if (myArrowSize < 15.) myArrowSize = 15.; |
95 | //cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl; |
96 | |
97 | BRepAdaptor_Surface surf1(TopoDS::Face(myFShape)); |
98 | BRepAdaptor_Surface surf2(TopoDS::Face(mySShape)); |
99 | |
100 | if (surf1.GetType() == GeomAbs_Cylinder || |
101 | surf1.GetType() == GeomAbs_Cone || |
102 | surf1.GetType() == GeomAbs_Torus) { |
103 | if (surf2.GetType() == GeomAbs_Cylinder || |
104 | surf2.GetType() == GeomAbs_Cone || |
105 | surf2.GetType() == GeomAbs_Torus) { |
106 | ComputeTwoAxesOffset(aprs, aInvertTrsf); |
107 | } else { |
108 | ComputeAxeFaceOffset(aprs, aInvertTrsf); |
109 | } |
110 | } |
111 | else { |
112 | //myDirAttach : oriente de myFShape vers mySShape |
113 | gp_Pln aPln = surf1.Plane(); |
114 | gp_Pnt aPnt = aPln.Location(); |
115 | |
116 | gp_Pln bPln = surf2.Plane(); |
117 | |
118 | Standard_Real uPnt, vPnt; |
119 | ElSLib::Parameters (bPln , aPnt , uPnt, vPnt); |
120 | gp_Pnt bPnt = ElSLib::Value (uPnt, vPnt, bPln); |
121 | if (aPnt.IsEqual(bPnt,Precision::Confusion())) { |
122 | gp_Ax1 aAx1 = aPln.Axis(); |
123 | myDirAttach = aAx1.Direction(); |
124 | } else { |
125 | gp_Vec aVec (aPnt,bPnt); |
126 | myDirAttach.SetCoord(aVec.X(),aVec.Y(),aVec.Z()); |
127 | } |
128 | ComputeTwoFacesOffset(aprs, aInvertTrsf); |
129 | } |
130 | } |
131 | |
132 | |
133 | //======================================================================= |
134 | //function : Compute |
135 | //purpose : to avoid warning at compilation (SUN) |
136 | //======================================================================= |
137 | void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, |
138 | const Handle(Prs3d_Presentation)& /*aPresentation*/) |
139 | { |
140 | // Standard_NotImplemented::Raise("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation)"); |
141 | // PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; |
142 | } |
143 | |
7fd59977 |
144 | void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector, |
145 | const Handle(Geom_Transformation)& aTransformation, |
146 | const Handle(Prs3d_Presentation)& aPresentation) |
147 | { |
148 | // Standard_NotImplemented::Raise("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)"); |
149 | PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; |
150 | } |
151 | |
152 | //======================================================================= |
153 | //function : ComputeSelection |
154 | //purpose : |
155 | //======================================================================= |
156 | void AIS_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, |
157 | const Standard_Integer) |
158 | { |
159 | //myArrowSize = fabs (myVal/5.); |
160 | myArrowSize = fabs (myVal/10.0); |
161 | if (myArrowSize > 30.) myArrowSize = 30.; |
162 | if (myArrowSize < 15.) myArrowSize = 15.; |
163 | //cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl; |
164 | gp_Pnt myTFAttach = myFAttach.Transformed (myRelativePos); |
165 | gp_Pnt myTSAttach = mySAttach.Transformed (myRelativePos); |
166 | gp_Dir myTDirAttach = myDirAttach.Transformed (myRelativePos); |
167 | gp_Dir myTDirAttach2 = myDirAttach2.Transformed (myRelativePos); |
168 | gp_Pnt Tcurpos = myPosition.Transformed (myRelativePos);; |
169 | |
170 | gp_Lin L1 (myTFAttach,myTDirAttach); |
171 | gp_Lin L2 (myTSAttach,myTDirAttach2); |
172 | gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,Tcurpos),L1); |
173 | gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,Tcurpos),L2); |
174 | gp_Lin L3; |
175 | |
176 | Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); |
177 | |
178 | if (!Proj1.IsEqual(Proj2,Precision::Confusion())) { |
179 | L3 = gce_MakeLin(Proj1,Proj2); |
180 | } |
181 | else { // cas ou la dimension est nulle |
182 | if (!Proj1.IsEqual(Tcurpos,Precision::Confusion())) { |
183 | gp_Vec v3 (Proj1,Tcurpos); |
184 | gp_Dir d3 (v3); |
185 | L3 = gce_MakeLin(Proj1,d3); |
186 | } else { |
187 | L3 = gce_MakeLin(Proj1,myTDirAttach); |
188 | } |
189 | |
190 | // Text |
191 | Standard_Real size(Min(myVal/100.+1.e-6,myArrowSize+1.e-6)); |
192 | Handle( Select3D_SensitiveBox ) box = new Select3D_SensitiveBox( own, |
193 | Tcurpos.X(), |
194 | Tcurpos.Y(), |
195 | Tcurpos.Z(), |
196 | Tcurpos.X() + size, |
197 | Tcurpos.Y() + size, |
198 | Tcurpos.Z() + size); |
199 | aSel->Add(box); |
200 | } |
201 | |
202 | Standard_Real parmin,parmax,parcur; |
203 | parmin = ElCLib::Parameter(L3,Proj1); |
204 | parmax = parmin; |
205 | |
206 | parcur = ElCLib::Parameter(L3,Proj2); |
207 | parmin = Min(parmin,parcur); |
208 | parmax = Max(parmax,parcur); |
209 | |
210 | parcur = ElCLib::Parameter(L3,Tcurpos); |
211 | parmin = Min(parmin,parcur); |
212 | parmax = Max(parmax,parcur); |
213 | |
214 | gp_Pnt PointMin = ElCLib::Value(parmin,L3); |
215 | gp_Pnt PointMax = ElCLib::Value(parmax,L3); |
216 | |
217 | Handle(Select3D_SensitiveSegment) seg; |
218 | if (!PointMin.IsEqual(PointMax,Precision::Confusion())) { |
219 | seg = new Select3D_SensitiveSegment(own, |
220 | PointMin, |
221 | PointMax); |
222 | aSel->Add(seg); |
223 | } |
224 | |
225 | if (!myTFAttach.IsEqual(Proj1,Precision::Confusion())) { |
226 | seg = new Select3D_SensitiveSegment(own, |
227 | myTFAttach, |
228 | Proj1); |
229 | aSel->Add(seg); |
230 | } |
231 | if (!myTSAttach.IsEqual(Proj2,Precision::Confusion())) { |
232 | seg = new Select3D_SensitiveSegment(own, |
233 | myTSAttach, |
234 | Proj2); |
235 | aSel->Add(seg); |
236 | } |
237 | } |
238 | |
239 | //======================================================================= |
240 | //function : ComputeTwoAxesOffset |
241 | //purpose : |
242 | //======================================================================= |
243 | void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)& aprs, |
244 | const gp_Trsf& aTrsf) |
245 | { |
246 | BRepAdaptor_Surface surf1(TopoDS::Face(myFShape)); |
247 | BRepAdaptor_Surface surf2(TopoDS::Face(mySShape)); |
248 | |
249 | gp_Ax1 Ax1Surf1, Ax1Surf2; |
250 | |
251 | if (surf1.GetType() == GeomAbs_Cylinder) { |
252 | gp_Cylinder aCyl= surf1.Cylinder(); |
253 | Ax1Surf1 = aCyl.Axis(); |
254 | } else if (surf1.GetType() == GeomAbs_Cone) { |
255 | gp_Cone aCone= surf1.Cone(); |
256 | Ax1Surf1 = aCone.Axis(); |
257 | } else if (surf1.GetType() == GeomAbs_Torus) { |
258 | gp_Torus aTore= surf1.Torus(); |
259 | Ax1Surf1 = aTore.Axis(); |
260 | } |
261 | Standard_Real FirstUParam = surf1.FirstUParameter(); |
262 | Standard_Real FirstVParam = surf1.FirstVParameter(); |
263 | Standard_Real LastVParam = surf1.LastVParameter(); |
264 | gp_Pnt P1First = surf1.Value(FirstUParam,FirstVParam); |
265 | gp_Pnt P1Last = surf1.Value(FirstUParam,LastVParam); |
266 | |
267 | |
268 | if (surf2.GetType() == GeomAbs_Cylinder) { |
269 | gp_Cylinder aCyl= surf2.Cylinder(); |
270 | Ax1Surf2 = aCyl.Axis(); |
271 | } else if (surf2.GetType() == GeomAbs_Cone) { |
272 | gp_Cone aCone= surf2.Cone(); |
273 | Ax1Surf2 = aCone.Axis(); |
274 | } else if (surf2.GetType() == GeomAbs_Torus) { |
275 | gp_Torus aTore= surf2.Torus(); |
276 | Ax1Surf2 = aTore.Axis(); |
277 | } |
278 | FirstUParam = surf2.FirstUParameter(); |
279 | FirstVParam = surf2.FirstVParameter(); |
280 | LastVParam = surf2.LastVParameter(); |
281 | gp_Pnt P2First = surf2.Value(FirstUParam,FirstVParam); |
282 | gp_Pnt P2Last = surf2.Value(FirstUParam,LastVParam); |
283 | |
284 | |
285 | |
286 | myFAttach = Ax1Surf1.Location(); |
287 | mySAttach = Ax1Surf2.Location(); |
288 | myDirAttach = Ax1Surf1.Direction(); |
289 | myDirAttach2 = myDirAttach; |
290 | gp_Pnt curpos; |
291 | gp_Lin aProjLine = gce_MakeLin(myFAttach,myDirAttach); |
292 | |
293 | if (myAutomaticPosition) { |
294 | curpos.SetX ( (myFAttach.X() + mySAttach.X()) /2. + 0.01); |
295 | curpos.SetY ( (myFAttach.Y() + mySAttach.Y()) /2. + 0.01); |
296 | curpos.SetZ ( (myFAttach.Z() + mySAttach.Z()) /2. + 0.01); |
297 | // + 0.01 pour eviter un raise de ComputeSelection... |
298 | |
299 | myPosition = curpos; |
300 | } |
301 | else { |
302 | curpos = myPosition; |
303 | } |
304 | |
305 | curpos = ElCLib::Value(ElCLib::Parameter(aProjLine,curpos),aProjLine); |
306 | // on projette pour la presentation |
307 | |
308 | gp_Pnt P1FirstProj = ElCLib::Value(ElCLib::Parameter(aProjLine,P1First),aProjLine); |
309 | gp_Pnt P1LastProj = ElCLib::Value(ElCLib::Parameter(aProjLine,P1Last),aProjLine); |
310 | if (P1FirstProj.Distance(curpos) > P1LastProj.Distance(curpos)) |
311 | myFAttach = P1FirstProj; |
312 | else |
313 | myFAttach = P1LastProj; |
314 | |
315 | gp_Pnt P2FirstProj = ElCLib::Value(ElCLib::Parameter(aProjLine,P2First),aProjLine); |
316 | gp_Pnt P2LastProj = ElCLib::Value(ElCLib::Parameter(aProjLine,P2Last),aProjLine); |
317 | if (P2FirstProj.Distance(curpos) > P2LastProj.Distance(curpos)) |
318 | mySAttach = P2FirstProj; |
319 | else |
320 | mySAttach = P2LastProj; |
321 | |
322 | |
a6eb515f |
323 | Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); |
324 | Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect(); |
7fd59977 |
325 | //cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl; |
326 | arr->SetLength(myArrowSize); |
a6eb515f |
327 | arr = la->ArrowAspect(); |
7fd59977 |
328 | arr->SetLength(myArrowSize); |
329 | |
330 | gp_Pnt myTFAttach = myFAttach.Transformed (aTrsf); |
331 | gp_Pnt myTSAttach = mySAttach.Transformed (aTrsf); |
332 | gp_Dir myTDirAttach = myDirAttach.Transformed (aTrsf); |
333 | gp_Dir myTDirAttach2 = myTDirAttach; |
334 | gp_Pnt Tcurpos = curpos.Transformed (aTrsf); |
335 | |
336 | if (myIsSetBndBox) |
337 | Tcurpos = AIS::TranslatePointToBound( Tcurpos, myDirAttach, myBndBox ); |
338 | |
339 | DsgPrs_OffsetPresentation::AddAxes(aprs, |
340 | myDrawer, |
341 | myText, |
342 | myTFAttach, |
343 | myTSAttach, |
344 | myTDirAttach, |
345 | myTDirAttach2, |
346 | Tcurpos); |
347 | |
348 | BRepBuilderAPI_Transform transform1 (myFShape, aTrsf, Standard_True); |
349 | TopoDS_Shape myTFShape = transform1.Shape(); |
350 | BRepBuilderAPI_Transform transform2 (mySShape, aTrsf, Standard_True); |
351 | TopoDS_Shape myTSShape = transform2.Shape(); |
352 | |
353 | StdPrs_WFDeflectionShape::Add(aprs, myTFShape, myDrawer); |
354 | StdPrs_WFDeflectionShape::Add(aprs, myTSShape, myDrawer); |
355 | } |
356 | |
357 | //======================================================================= |
358 | //function : ComputeTwoFacesOffset |
359 | //purpose : |
360 | //======================================================================= |
361 | void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)& aprs, |
362 | const gp_Trsf& aTrsf) |
363 | { |
364 | gp_Dir norm1 = myDirAttach; |
365 | gp_Pnt curpos; |
366 | gp_Ax2 myax2; |
367 | if (myAutomaticPosition && ! myIsSetBndBox) { |
368 | TopExp_Explorer explo(myFShape,TopAbs_VERTEX); |
369 | if (explo.More()) { |
370 | TopoDS_Vertex vertref = TopoDS::Vertex(explo.Current()); |
371 | myFAttach = BRep_Tool::Pnt(vertref); |
372 | gp_Vec trans = norm1.XYZ()*fabs(myVal/2); |
373 | gp_Ax2 ax2(myFAttach,norm1); |
374 | myDirAttach = ax2.XDirection(); |
375 | curpos = myFAttach.Translated(trans); |
376 | if (myVal <= Precision::Confusion()) { |
377 | gp_Vec vecnorm1 = norm1.XYZ()*.001; |
378 | curpos.Translate(vecnorm1); |
379 | } |
380 | myPosition = curpos; |
381 | myax2 = ax2; |
382 | } |
383 | } |
384 | else { |
385 | if (myAutomaticPosition && myIsSetBndBox) |
386 | { |
387 | Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; |
388 | myBndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax ); |
389 | myPosition.SetCoord( aXmax, aYmax, aZmax ); |
390 | } |
391 | |
392 | curpos = myPosition; |
393 | myFAttach = AIS::Nearest(myFShape,curpos); |
394 | if (myFAttach.Distance(curpos) <= Precision::Confusion()) { |
395 | gp_Ax2 ax2(myFAttach,norm1); |
396 | myDirAttach = ax2.XDirection(); |
397 | myax2 = ax2; |
398 | } |
399 | else { |
400 | gp_Dir orient(myFAttach.XYZ()-curpos.XYZ()); |
401 | gp_Ax2 ax2(myFAttach,norm1); |
402 | if (orient.Angle(norm1) <= Precision::Angular()) { |
403 | myDirAttach = ax2.XDirection(); |
404 | } |
405 | else { |
406 | gp_Dir adir = norm1 ^ orient; |
407 | myDirAttach = adir ^ norm1; |
408 | } |
409 | myax2 = ax2; |
410 | } |
411 | } |
412 | // en attendant mieux |
413 | mySAttach = AIS::Nearest(mySShape,curpos); |
414 | gp_Ax3 anax3 (myax2); |
415 | gp_Pln apln (anax3); |
416 | |
417 | //gp_Pnt proj2; |
418 | Standard_Real u2,v2, uatt, vatt; |
419 | ElSLib::Parameters (apln , mySAttach, uatt,vatt); |
420 | ElSLib::Parameters (apln , curpos , u2,v2); |
421 | |
422 | if (uatt== u2 && vatt == v2) { |
423 | myDirAttach2 = myDirAttach; |
424 | } else { |
425 | gp_Vec avec (ElSLib::Value (uatt,vatt, apln) , ElSLib::Value (u2,v2, apln)); |
426 | myDirAttach2.SetCoord (avec.X(),avec.Y(),avec.Z()); |
427 | } |
428 | |
a6eb515f |
429 | Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); |
430 | Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect(); |
7fd59977 |
431 | //cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl; |
432 | arr->SetLength(myArrowSize); |
a6eb515f |
433 | arr = la->ArrowAspect(); |
7fd59977 |
434 | arr->SetLength(myArrowSize); |
435 | |
436 | gp_Pnt myTFAttach = myFAttach.Transformed (aTrsf); |
437 | gp_Pnt myTSAttach = mySAttach.Transformed (aTrsf); |
438 | gp_Dir myTDirAttach = myDirAttach.Transformed (aTrsf); |
439 | gp_Dir myTDirAttach2 = myDirAttach2.Transformed (aTrsf); |
440 | gp_Pnt Tcurpos = curpos.Transformed (aTrsf); |
441 | |
442 | /* |
443 | if (myIsSetBndBox) |
444 | { |
445 | BRepAdaptor_Surface surf1(TopoDS::Face(myFShape)); |
446 | Tcurpos = AIS::TranslatePointToBound( Tcurpos, surf1.Plane().XAxis().Direction(), myBndBox ); |
447 | } |
448 | */ |
449 | DsgPrs_OffsetPresentation::Add(aprs, |
450 | myDrawer, |
451 | myText, |
452 | myTFAttach, |
453 | myTSAttach, |
454 | myTDirAttach, |
455 | myTDirAttach2, |
456 | Tcurpos); |
457 | |
458 | |
459 | BRepBuilderAPI_Transform transform1 (myFShape, aTrsf, Standard_True); |
460 | TopoDS_Shape myTFShape = transform1.Shape(); |
461 | BRepBuilderAPI_Transform transform2 (mySShape, aTrsf, Standard_True); |
462 | TopoDS_Shape myTSShape = transform2.Shape(); |
463 | |
464 | StdPrs_WFDeflectionShape::Add(aprs, myTFShape, myDrawer); |
465 | StdPrs_WFDeflectionShape::Add(aprs, myTSShape, myDrawer); |
466 | |
467 | } |
468 | |
469 | //======================================================================= |
470 | //function : ComputeAxeFaceOffset |
471 | //purpose : |
472 | //======================================================================= |
473 | void AIS_OffsetDimension::ComputeAxeFaceOffset(const Handle(Prs3d_Presentation)& aprs, |
474 | const gp_Trsf& aTrsf) |
475 | { |
476 | BRepBuilderAPI_Transform transform1 (myFShape, aTrsf, Standard_True); |
477 | TopoDS_Shape myTFShape = transform1.Shape(); |
478 | BRepBuilderAPI_Transform transform2 (mySShape, aTrsf, Standard_True); |
479 | TopoDS_Shape myTSShape = transform2.Shape(); |
480 | |
481 | StdPrs_WFDeflectionShape::Add(aprs, myTFShape, myDrawer); |
482 | StdPrs_WFDeflectionShape::Add(aprs, myTSShape, myDrawer); |
483 | } |
484 | |