0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / AIS / AIS_Plane.cxx
1 // Created on: 1995-08-02
2 // Created by: Arnaud BOUZY/Odile Olivier
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <AIS_Plane.hxx>
18
19 #include <AIS_InteractiveContext.hxx>
20 #include <Aspect_TypeOfLine.hxx>
21 #include <DsgPrs_ShadedPlanePresentation.hxx>
22 #include <DsgPrs_XYZPlanePresentation.hxx>
23 #include <ElSLib.hxx>
24 #include <Geom_Axis2Placement.hxx>
25 #include <Geom_Plane.hxx>
26 #include <GeomAdaptor_Surface.hxx>
27 #include <gp_Pnt.hxx>
28 #include <Graphic3d_ArrayOfQuadrangles.hxx>
29 #include <Graphic3d_AspectFillArea3d.hxx>
30 #include <Graphic3d_AspectLine3d.hxx>
31 #include <Graphic3d_Group.hxx>
32 #include <Graphic3d_MaterialAspect.hxx>
33 #include <Graphic3d_Structure.hxx>
34 #include <Poly_Triangulation.hxx>
35 #include <Precision.hxx>
36 #include <Prs3d_DatumAspect.hxx>
37 #include <Prs3d_Drawer.hxx>
38 #include <Prs3d_LineAspect.hxx>
39 #include <Prs3d_PlaneAspect.hxx>
40 #include <Prs3d_Presentation.hxx>
41 #include <Prs3d_ShadingAspect.hxx>
42 #include <Quantity_Color.hxx>
43 #include <Select3D_SensitiveTriangulation.hxx>
44 #include <SelectMgr_EntityOwner.hxx>
45 #include <Standard_Type.hxx>
46 #include <StdPrs_Plane.hxx>
47 #include <StdPrs_ShadedShape.hxx>
48 #include <StdPrs_ShadedSurface.hxx>
49 #include <TColgp_Array1OfPnt.hxx>
50 #include <TColgp_HArray1OfPnt.hxx>
51 #include <TCollection_AsciiString.hxx>
52 #include <UnitsAPI.hxx>
53
54 IMPLEMENT_STANDARD_RTTIEXT(AIS_Plane,AIS_InteractiveObject)
55
56 //=======================================================================
57 //function : AIS_Plane
58 //purpose  : 
59 //=======================================================================
60 AIS_Plane::AIS_Plane(const Handle(Geom_Plane)& aComponent,
61                      const Standard_Boolean aCurrentMode):
62 myComponent(aComponent),
63 myCenter(gp_Pnt(0.,0.,0.)),
64 myCurrentMode(aCurrentMode),
65 myAutomaticPosition(Standard_True),
66 myTypeOfPlane(AIS_TOPL_Unknown),
67 myIsXYZPlane(Standard_False),
68 myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
69 {
70   InitDrawerAttributes();
71 }
72
73 //=======================================================================
74 //function : AIS_Plane 
75 //purpose  : avec une position
76 //=======================================================================
77 AIS_Plane::AIS_Plane(const Handle(Geom_Plane)& aComponent,
78                      const gp_Pnt& aCenter,
79                      const Standard_Boolean aCurrentMode):
80 myComponent(aComponent),
81 myCenter(aCenter),
82 myCurrentMode(aCurrentMode),
83 myAutomaticPosition(Standard_True),
84 myTypeOfPlane(AIS_TOPL_Unknown),
85 myIsXYZPlane(Standard_False),
86 myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
87 {
88   InitDrawerAttributes();
89 }
90
91 //=======================================================================
92 //function : AIS_Plane
93 //purpose  : 
94 //=======================================================================
95 AIS_Plane::AIS_Plane(const Handle(Geom_Plane)& aComponent,
96                                const gp_Pnt& aCenter,
97                                const gp_Pnt& aPmin,
98                                const gp_Pnt& aPmax,
99                                const Standard_Boolean aCurrentMode):
100 myComponent(aComponent),
101 myCenter(aCenter),
102 myPmin(aPmin),
103 myPmax(aPmax),
104 myCurrentMode(aCurrentMode),
105 myAutomaticPosition(Standard_False),
106 myTypeOfPlane(AIS_TOPL_Unknown),
107 myIsXYZPlane(Standard_False),
108 myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
109 {
110   InitDrawerAttributes();
111 }
112
113 //=======================================================================
114 //function : AIS_Plane
115 //purpose  : XYPlane, XZPlane, YZPlane
116 //=======================================================================
117 AIS_Plane::AIS_Plane(const Handle(Geom_Axis2Placement)& aComponent,
118                      const AIS_TypeOfPlane aPlaneType,
119                      const Standard_Boolean aCurrentMode):
120 myAx2(aComponent),
121 myCurrentMode(aCurrentMode),
122 myAutomaticPosition(Standard_True),
123 myTypeOfPlane(aPlaneType),
124 myIsXYZPlane(Standard_True),
125 myTypeOfSensitivity (Select3D_TOS_BOUNDARY)
126 {
127   InitDrawerAttributes();
128   ComputeFields();
129 }
130
131
132 //=======================================================================
133 //function : SetComponent
134 //purpose  : 
135 //=======================================================================
136
137 void AIS_Plane::SetComponent(const Handle(Geom_Plane)& aComponent)
138 {
139   myComponent = aComponent;
140   myTypeOfPlane = AIS_TOPL_Unknown;
141   myIsXYZPlane = Standard_False;
142   //myCenter = gp_Pnt(0.,0.,0.);
143   myAutomaticPosition = Standard_True;
144 }
145
146 //=======================================================================
147 //function : Axis2Placement
148 //purpose  : 
149 //=======================================================================
150
151 Handle(Geom_Axis2Placement) AIS_Plane::Axis2Placement()
152 {
153   Handle(Geom_Axis2Placement) Bid;
154   return IsXYZPlane() ? myAx2:Bid;
155 }
156 //=======================================================================
157 //function : SetAxis2Placement
158 //purpose  : 
159 //=======================================================================
160
161  void AIS_Plane::SetAxis2Placement(const Handle(Geom_Axis2Placement)& aComponent,
162                                    const AIS_TypeOfPlane aPlaneType)
163 {
164   myTypeOfPlane = aPlaneType;
165   myIsXYZPlane = Standard_True;
166   myAx2= aComponent;
167   myAutomaticPosition = Standard_True;
168   ComputeFields();
169 }
170
171 //=======================================================================
172 //function : PlaneAttributes
173 //purpose  : 
174 //=======================================================================
175 Standard_Boolean AIS_Plane::PlaneAttributes(Handle(Geom_Plane)& aComponent,
176                                             gp_Pnt& aCenter,
177                                             gp_Pnt& aPmin,
178                                             gp_Pnt& aPmax)
179 {
180   Standard_Boolean aStatus (Standard_False);
181   if (!myAutomaticPosition){
182     aComponent = myComponent;
183     aCenter = myCenter;
184     aPmin = myPmin;
185     aPmax = myPmax;
186     aStatus = Standard_True;
187   }
188   return aStatus;
189 }
190
191 //=======================================================================
192 //function : SetPlaneAttributes
193 //purpose  : 
194 //=======================================================================
195 void AIS_Plane::SetPlaneAttributes(const Handle(Geom_Plane)& aComponent,
196                               const gp_Pnt& aCenter,
197                               const gp_Pnt& aPmin,
198                               const gp_Pnt& aPmax)
199 {
200   myAutomaticPosition = Standard_False;
201   myComponent = aComponent;
202   myCenter = aCenter;
203   myPmin = aPmin;
204   myPmax = aPmax;
205   myTypeOfPlane = AIS_TOPL_Unknown;
206   myIsXYZPlane = Standard_False;
207 }
208
209 //=======================================================================
210 //function : Compute
211 //purpose  :
212 //=======================================================================
213 void AIS_Plane::Compute (const Handle(PrsMgr_PresentationManager)& ,
214                          const Handle(Prs3d_Presentation)& thePrs,
215                          const Standard_Integer theMode)
216 {
217   ComputeFields();
218   thePrs->SetInfiniteState (myInfiniteState);
219   myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(myCurrentMode == 0? 1 : 3);
220
221   switch (theMode)
222   {
223     case 0:
224     {
225       if (!myIsXYZPlane)
226       {
227         ComputeFrame();
228         const Handle(Geom_Plane)& pl = myComponent;
229         Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
230         GeomAdaptor_Surface surf(thegoodpl);
231         StdPrs_Plane::Add (thePrs, surf, myDrawer);
232       }
233       else
234       {
235         DsgPrs_XYZPlanePresentation::Add (thePrs, myDrawer, myCenter, myPmin, myPmax);
236       }
237       break;
238     }
239     case 1:
240     {
241       if (!myIsXYZPlane)
242       {
243         ComputeFrame();
244         Handle(Prs3d_PlaneAspect) anAspect = myDrawer->PlaneAspect();
245         Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
246         aGroup->SetPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
247         gp_Pnt p1;
248         const Standard_Real Xmax = 0.5*Standard_Real(anAspect->PlaneXLength());
249         const Standard_Real Ymax = 0.5*Standard_Real(anAspect->PlaneYLength());
250
251         Handle(Graphic3d_ArrayOfQuadrangles) aQuads = new Graphic3d_ArrayOfQuadrangles(4);
252
253         myComponent->D0(-Xmax,Ymax,p1);
254         aQuads->AddVertex(p1);
255         myComponent->D0(Xmax,Ymax,p1);
256         aQuads->AddVertex(p1);
257         myComponent->D0(Xmax,-Ymax,p1);
258         aQuads->AddVertex(p1);
259         myComponent->D0(-Xmax,-Ymax,p1);
260         aQuads->AddVertex(p1);
261
262         aGroup->AddPrimitiveArray (aQuads);
263       }
264       else
265       {
266         DsgPrs_ShadedPlanePresentation::Add (thePrs, myDrawer, myCenter, myPmin, myPmax);
267       }
268       break;
269     }
270   }
271 }
272
273 //=======================================================================
274 //function : ComputeSelection
275 //purpose  : 
276 //=======================================================================
277 void AIS_Plane::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer /*theMode*/)
278 {
279   theSelection->Clear();
280   Handle(SelectMgr_EntityOwner) aSensitiveOwner = new SelectMgr_EntityOwner (this, 10);
281   Handle(Poly_Triangulation) aSensitivePoly;
282
283   if (!myIsXYZPlane)
284   {
285     // plane representing rectangle
286     Standard_Real aLengthX = myDrawer->PlaneAspect()->PlaneXLength() / 2.0;
287     Standard_Real aLengthY = myDrawer->PlaneAspect()->PlaneYLength() / 2.0;
288     Handle(Geom_Plane) aPlane = 
289       Handle(Geom_Plane)::DownCast (myComponent->Translated (myComponent->Location(), myCenter));
290
291     TColgp_Array1OfPnt aRectanglePoints (1, 4);
292     aPlane->D0 ( aLengthX,  aLengthY, aRectanglePoints.ChangeValue (1));
293     aPlane->D0 ( aLengthX, -aLengthY, aRectanglePoints.ChangeValue (2));
294     aPlane->D0 (-aLengthX, -aLengthY, aRectanglePoints.ChangeValue (3));
295     aPlane->D0 (-aLengthX,  aLengthY, aRectanglePoints.ChangeValue (4));
296
297     Poly_Array1OfTriangle aTriangles (1, 2);
298     aTriangles.ChangeValue (1) = Poly_Triangle (1, 2, 3);
299     aTriangles.ChangeValue (2) = Poly_Triangle (1, 3, 4);
300
301     aSensitivePoly = new Poly_Triangulation (aRectanglePoints, aTriangles);
302   }
303   else
304   {
305     // plane representing triangle
306     TColgp_Array1OfPnt aTrianglePoints (1, 3);
307     aTrianglePoints.ChangeValue (1) = myCenter;
308     aTrianglePoints.ChangeValue (2) = myPmin;
309     aTrianglePoints.ChangeValue (3) = myPmax;
310
311     Poly_Array1OfTriangle aTriangles (1, 1);
312     aTriangles.ChangeValue (1) = Poly_Triangle(1, 2, 3);
313
314     aSensitivePoly = new Poly_Triangulation (aTrianglePoints, aTriangles);
315   }
316
317   Standard_Boolean isSensitiveInterior = myTypeOfSensitivity == Select3D_TOS_INTERIOR;
318
319   Handle(Select3D_SensitiveTriangulation) aSensitive =
320     new Select3D_SensitiveTriangulation (aSensitiveOwner,
321                                          aSensitivePoly,
322                                          TopLoc_Location(),
323                                          isSensitiveInterior);
324
325   theSelection->Add(aSensitive);
326 }
327
328 //=======================================================================
329 //function : SetSize
330 //purpose  : 
331 //=======================================================================
332 void AIS_Plane::SetSize(const Standard_Real aLength)
333 {
334   SetSize(aLength,aLength);
335 }
336
337 void AIS_Plane::SetSize(const Standard_Real aXLength,
338                         const Standard_Real aYLength)
339 {
340   //if the plane already has a proper color or size, 
341   //there is already a specific PlaneAspect and DatumAspect 
342     
343   Handle(Prs3d_PlaneAspect) PA; 
344   Handle(Prs3d_DatumAspect) DA;
345
346   PA = myDrawer->PlaneAspect();
347   DA = myDrawer->DatumAspect();
348
349   Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
350   if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
351     yenavaitPA = Standard_False;
352     PA = new Prs3d_PlaneAspect();}
353   if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
354     yenavaitDA = Standard_False;
355     DA = new Prs3d_DatumAspect();
356   }
357   
358   PA->SetPlaneLength(aXLength,aYLength);
359   DA->SetAxisLength(aXLength,aYLength,aXLength);
360   
361   if(!yenavaitPA)
362     myDrawer->SetPlaneAspect(PA);
363   if(!yenavaitDA)
364     myDrawer->SetDatumAspect(DA);
365   
366   
367   myHasOwnSize = Standard_True;
368   SetToUpdate();
369   UpdatePresentations();
370   UpdateSelection();
371 }
372
373
374 //=======================================================================
375 //function : UnsetSize
376 //purpose  : If there is a color, the size is restaured from the drawer of the context...
377 //=======================================================================
378 void AIS_Plane::UnsetSize()
379 {
380   
381   if(!myHasOwnSize) return;
382   if(!hasOwnColor)
383   {
384     myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
385     myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
386   }
387   else{
388     const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
389                                                                new Prs3d_PlaneAspect();
390     const Handle(Prs3d_DatumAspect) DA = myDrawer->HasLink() ? myDrawer->Link()->DatumAspect() :
391                                                                new Prs3d_DatumAspect();
392
393     myDrawer->PlaneAspect()->SetPlaneLength(PA->PlaneXLength(),PA->PlaneYLength());
394     myDrawer->DatumAspect()->SetAxisLength(DA->AxisLength(Prs3d_DatumParts_XAxis),
395                                            DA->AxisLength(Prs3d_DatumParts_YAxis),
396                                            DA->AxisLength(Prs3d_DatumParts_ZAxis));
397   }
398   
399   myHasOwnSize = Standard_False;
400   SetToUpdate();
401   UpdatePresentations();
402   UpdateSelection();
403
404 }
405
406 //=======================================================================
407 //function : Size
408 //purpose  : 
409 //=======================================================================
410
411 Standard_Boolean AIS_Plane::Size(Standard_Real& X,Standard_Real& Y) const 
412 {
413   X = myDrawer->PlaneAspect()->PlaneXLength();
414   Y = myDrawer->PlaneAspect()->PlaneYLength();
415   return Abs(X-Y)<=Precision::Confusion();
416 }
417
418 //=======================================================================
419 //function : SetColor
420 //purpose  : 
421 //=======================================================================
422 void AIS_Plane::SetColor(const Quantity_Color &aCol)
423 {
424   // if the plane already has its proper size, there is an already created planeaspect 
425 //  Standard_Boolean yenadeja = hasOwnColor || myHasOwnSize;
426   Handle(Prs3d_PlaneAspect) PA; 
427   Handle(Prs3d_DatumAspect) DA;
428
429   PA = myDrawer->PlaneAspect();
430   DA = myDrawer->DatumAspect();
431
432   Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
433   if(myDrawer->HasLink() && myDrawer->Link()->PlaneAspect() == PA){
434     yenavaitPA = Standard_False;
435     PA = new Prs3d_PlaneAspect();}
436   if(myDrawer->HasLink() && myDrawer->Link()->DatumAspect() == DA){
437     yenavaitDA = Standard_False;
438     DA = new Prs3d_DatumAspect();
439   }
440   
441   PA->EdgesAspect()->SetColor(aCol);
442   DA->LineAspect(Prs3d_DatumParts_XAxis)->SetColor(aCol);
443   DA->LineAspect(Prs3d_DatumParts_YAxis)->SetColor(aCol);
444   DA->LineAspect(Prs3d_DatumParts_ZAxis)->SetColor(aCol);
445
446   if(!yenavaitPA)
447     myDrawer->SetPlaneAspect(PA);
448   if(!yenavaitDA)
449     myDrawer->SetDatumAspect(DA);
450
451   myDrawer->ShadingAspect()->SetColor(aCol);
452   
453   hasOwnColor=Standard_True;
454   myDrawer->SetColor (aCol);
455 }
456 //=======================================================================
457 //function : SetColor
458 //purpose  : 
459 //=======================================================================
460 void AIS_Plane::UnsetColor()
461 {
462   if(!hasOwnColor) return;
463   if(!myHasOwnSize)
464   {
465     myDrawer->SetPlaneAspect (Handle(Prs3d_PlaneAspect)());
466     myDrawer->SetDatumAspect (Handle(Prs3d_DatumAspect)());
467   }
468   else{
469     const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
470                                                                new Prs3d_PlaneAspect();
471     Quantity_Color Col = PA->EdgesAspect()->Aspect()->Color();
472     myDrawer->PlaneAspect()->EdgesAspect()->SetColor(Col);
473     
474     myDrawer->DatumAspect()->LineAspect(Prs3d_DatumParts_XAxis)->SetColor(Col);
475     myDrawer->DatumAspect()->LineAspect(Prs3d_DatumParts_YAxis)->SetColor(Col);
476     myDrawer->DatumAspect()->LineAspect(Prs3d_DatumParts_ZAxis)->SetColor(Col);
477   }
478  
479  
480   hasOwnColor=Standard_False;
481
482 }
483
484 //=======================================================================
485 //function : ComputeFrame
486 //purpose  : 
487 //=======================================================================
488 void AIS_Plane::ComputeFrame()
489 {
490
491   const Handle(Geom_Plane)& pl = myComponent;
492   Standard_Real U,V;
493
494   if (myAutomaticPosition) {
495     ElSLib::Parameters(pl->Pln(),myCenter,U,V);
496     pl->D0 (U, V, myCenter);     
497   }
498   else {
499     Handle(Geom_Plane) thegoodpl (Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter)));
500     ElSLib::Parameters(thegoodpl->Pln(),myPmin,U,V);
501     
502     U = 2.4*Abs(U);
503     V = 2.4*Abs(V);
504     if (U < 10*Precision::Confusion()) U=0.1;
505     if (V < 10*Precision::Confusion()) V=0.1;
506     SetSize(U,V);
507     myDrawer->PlaneAspect()->SetPlaneLength(U,V);
508   }
509 }
510
511 //=======================================================================
512 //function : ComputeFields
513 //purpose  : 
514 //=======================================================================
515 void AIS_Plane::ComputeFields()
516 {
517   if (myIsXYZPlane){
518     Handle (Prs3d_DatumAspect) DA = myDrawer->DatumAspect();
519
520     gp_Pnt Orig = myAx2->Ax2().Location();
521     gp_Dir oX = myAx2->Ax2().XDirection();
522     gp_Dir oY = myAx2->Ax2().YDirection();
523     gp_Dir oZ = myAx2->Ax2().Direction();
524     myCenter = Orig;
525     Standard_Real xo,yo,zo,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4=0,y4=0,z4=0;
526     Standard_Real x5=0,y5=0,z5=0;
527     Orig.Coord(xo,yo,zo);
528     oX.Coord(x1,y1,z1);
529     oY.Coord(x2,y2,z2);
530     oZ.Coord(x3,y3,z3);
531     Standard_Real DS1 = DA->AxisLength(Prs3d_DatumParts_XAxis);
532     Standard_Real DS2 = DA->AxisLength(Prs3d_DatumParts_YAxis);
533     Standard_Real DS3 = DA->AxisLength(Prs3d_DatumParts_ZAxis);
534 //    gp_Pnt aPt2,aPt3;
535
536     switch (myTypeOfPlane) {
537     case AIS_TOPL_XYPlane:
538       {
539         gp_Pln XYP(0,0,1,0);
540         myComponent = new Geom_Plane(XYP);
541         x4=xo+x1*DS1; y4=yo+y1*DS1; z4=zo+z1*DS1;
542         x5=xo+x2*DS2; y5=yo+y2*DS2; z5=zo+z2*DS2;
543         break;
544       }
545     case AIS_TOPL_XZPlane:
546       {
547         gp_Pln XZP(0,1,0,0);
548         myComponent = new Geom_Plane(XZP);
549         x4=xo+x1*DS1; y4=yo+y1*DS1; z4=zo+z1*DS1;
550         x5=xo+x3*DS3; y5=yo+y3*DS3; z5=zo+z3*DS3;
551         break;
552       }
553     case AIS_TOPL_YZPlane:
554       {
555         gp_Pln XZP(1,0,0,0);
556         myComponent = new Geom_Plane(XZP);
557         x4=xo+x2*DS2; y4=yo+y2*DS2; z4=zo+z2*DS2;
558         x5=xo+x3*DS3; y5=yo+y3*DS3; z5=zo+z3*DS3;
559         break;
560       }
561     default:
562       break;
563     }
564     myPmin.SetCoord(x4,y4,z4);
565     myPmax.SetCoord(x5,y5,z5);
566   }
567
568 }
569 //=======================================================================
570 //function : InitDrawerAttributes
571 //purpose  : 
572 //=======================================================================
573
574 void AIS_Plane::InitDrawerAttributes()
575 {
576   Handle(Prs3d_ShadingAspect) shasp = new Prs3d_ShadingAspect();
577   shasp->SetMaterial(Graphic3d_NameOfMaterial_Plastified);
578   shasp->SetColor(Quantity_NOC_GRAY40);
579   myDrawer->SetShadingAspect(shasp);
580   Handle(Graphic3d_AspectFillArea3d) asf = shasp->Aspect();
581   Graphic3d_MaterialAspect asp = asf->FrontMaterial();
582   asp.SetTransparency (0.8f);
583   asf->SetFrontMaterial(asp);
584   asf->SetBackMaterial(asp);
585 }
586
587 //=======================================================================
588 //function : AcceptDisplayMode
589 //purpose  : 
590 //=======================================================================
591
592 Standard_Boolean  AIS_Plane::
593 AcceptDisplayMode(const Standard_Integer aMode) const
594 {return aMode == 0;}
595
596
597 //=======================================================================
598 //function : SetContext
599 //purpose  : 
600 //=======================================================================
601
602 void AIS_Plane::SetContext(const Handle(AIS_InteractiveContext)& Ctx)
603 {
604   AIS_InteractiveObject::SetContext(Ctx);
605   ComputeFields();
606
607 }