0024153: Adding OpenCL to OCCT prerequisites
[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-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22 #define GER61351                //GG_171199     Enable to set an object RGB color
23 //                                                instead a restricted object NameOfColor.
24
25 #include <AIS_Plane.ixx>
26
27 #include <TColgp_Array1OfPnt.hxx>
28 #include <TColgp_HArray1OfPnt.hxx>
29
30 #include <Precision.hxx>
31 #include <gp_Pnt.hxx>
32 #include <ElSLib.hxx>
33
34 #include <Graphic3d_ArrayOfQuadrangles.hxx>
35 #include <Graphic3d_Group.hxx>
36 #include <Prs3d_Drawer.hxx>
37 #include <Prs3d_LineAspect.hxx>
38 #include <Prs3d_PlaneAspect.hxx>
39 #include <Prs3d_DatumAspect.hxx>
40 #include <Prs3d_ShadingAspect.hxx>
41 #include <StdPrs_Plane.hxx>
42 #include <StdPrs_ShadedSurface.hxx>
43
44 #include <Geom_Plane.hxx>
45 #include <GeomAdaptor_Surface.hxx>
46
47 #include <Aspect_TypeOfLine.hxx>
48 #include <Graphic3d_AspectLine3d.hxx>
49 #include <Graphic3d_Structure.hxx>
50 #include <Graphic3d_MaterialAspect.hxx>
51 #include <Graphic3d_AspectFillArea3d.hxx>
52
53 #include <DsgPrs_XYZPlanePresentation.hxx>
54 #include <DsgPrs_ShadedPlanePresentation.hxx>
55 #include <UnitsAPI.hxx>
56
57 #include <SelectBasics_EntityOwner.hxx>
58 #include <SelectMgr_EntityOwner.hxx>
59 #include <Select3D_SensitiveFace.hxx>
60 #include <StdPrs_ShadedShape.hxx>
61
62 #include <AIS_Drawer.hxx>
63
64 #include <TCollection_AsciiString.hxx>
65
66 //=======================================================================
67 //function : AIS_Plane
68 //purpose  : 
69 //=======================================================================
70 AIS_Plane::AIS_Plane(const Handle(Geom_Plane)& aComponent,
71                      const Standard_Boolean aCurrentMode):
72 myComponent(aComponent),
73 myCenter(gp_Pnt(0.,0.,0.)),
74 myCurrentMode(aCurrentMode),
75 myAutomaticPosition(Standard_True),
76 myTypeOfPlane(AIS_TOPL_Unknown),
77 myIsXYZPlane(Standard_False)
78 {
79   InitDrawerAttributes();
80 }
81
82 //=======================================================================
83 //function : AIS_Plane 
84 //purpose  : avec une position
85 //=======================================================================
86 AIS_Plane::AIS_Plane(const Handle(Geom_Plane)& aComponent,
87                      const gp_Pnt& aCenter,
88                      const Standard_Boolean aCurrentMode):
89 myComponent(aComponent),
90 myCenter(aCenter),
91 myCurrentMode(aCurrentMode),
92 myAutomaticPosition(Standard_True),
93 myTypeOfPlane(AIS_TOPL_Unknown),
94 myIsXYZPlane(Standard_False)
95 {
96   InitDrawerAttributes();
97 }
98
99 //=======================================================================
100 //function : AIS_Plane
101 //purpose  : 
102 //=======================================================================
103 AIS_Plane::AIS_Plane(const Handle(Geom_Plane)& aComponent,
104                                const gp_Pnt& aCenter,
105                                const gp_Pnt& aPmin,
106                                const gp_Pnt& aPmax,
107                                const Standard_Boolean aCurrentMode):
108 myComponent(aComponent),
109 myCenter(aCenter),
110 myPmin(aPmin),
111 myPmax(aPmax),
112 myCurrentMode(aCurrentMode),
113 myAutomaticPosition(Standard_False),
114 myTypeOfPlane(AIS_TOPL_Unknown),
115 myIsXYZPlane(Standard_False)
116 {
117   InitDrawerAttributes();
118   SetHilightMode(0);
119 }
120
121 //=======================================================================
122 //function : AIS_Plane
123 //purpose  : XYPlane, XZPlane, YZPlane
124 //=======================================================================
125 AIS_Plane::AIS_Plane(const Handle(Geom_Axis2Placement)& aComponent,
126                      const AIS_TypeOfPlane aPlaneType,
127                      const Standard_Boolean aCurrentMode):
128 myAx2(aComponent),
129 myCurrentMode(aCurrentMode),
130 myAutomaticPosition(Standard_True),
131 myTypeOfPlane(aPlaneType),
132 myIsXYZPlane(Standard_True)
133 {
134   InitDrawerAttributes();
135   ComputeFields();
136   SetHilightMode(0);
137
138 }
139
140
141 //=======================================================================
142 //function : SetComponent
143 //purpose  : 
144 //=======================================================================
145
146 void AIS_Plane::SetComponent(const Handle(Geom_Plane)& aComponent)
147 {
148   myComponent = aComponent;
149   myTypeOfPlane = AIS_TOPL_Unknown;
150   myIsXYZPlane = Standard_False;
151   //myCenter = gp_Pnt(0.,0.,0.);
152   myAutomaticPosition = Standard_True;
153 }
154
155 //=======================================================================
156 //function : Type
157 //purpose  : 
158 //=======================================================================
159
160 AIS_KindOfInteractive AIS_Plane::Type() const 
161 {return AIS_KOI_Datum;}
162
163
164 //=======================================================================
165 //function : Signature
166 //purpose  : 
167 //=======================================================================
168
169 Standard_Integer AIS_Plane::Signature() const 
170 {return 7;}
171
172
173 //=======================================================================
174 //function : Axis2Placement
175 //purpose  : 
176 //=======================================================================
177
178 Handle(Geom_Axis2Placement) AIS_Plane::Axis2Placement()
179 {
180   Handle(Geom_Axis2Placement) Bid;
181   return IsXYZPlane() ? myAx2:Bid;
182 }
183 //=======================================================================
184 //function : SetAxis2Placement
185 //purpose  : 
186 //=======================================================================
187
188  void AIS_Plane::SetAxis2Placement(const Handle(Geom_Axis2Placement)& aComponent,
189                                    const AIS_TypeOfPlane aPlaneType)
190 {
191   myTypeOfPlane = aPlaneType;
192   myIsXYZPlane = Standard_True;
193   myAx2= aComponent;
194   myAutomaticPosition = Standard_True;
195   ComputeFields();
196 }
197
198 //=======================================================================
199 //function : PlaneAttributes
200 //purpose  : 
201 //=======================================================================
202 Standard_Boolean AIS_Plane::PlaneAttributes(Handle(Geom_Plane)& aComponent,
203                                             gp_Pnt& aCenter,
204                                             gp_Pnt& aPmin,
205                                             gp_Pnt& aPmax)
206 {
207   Standard_Boolean aStatus (Standard_False);
208   if (!myAutomaticPosition){
209     aComponent = myComponent;
210     aCenter = myCenter;
211     aPmin = myPmin;
212     aPmax = myPmax;
213     aStatus = Standard_True;
214   }
215   return aStatus;
216 }
217
218 //=======================================================================
219 //function : SetPlaneAttributes
220 //purpose  : 
221 //=======================================================================
222 void AIS_Plane::SetPlaneAttributes(const Handle(Geom_Plane)& aComponent,
223                               const gp_Pnt& aCenter,
224                               const gp_Pnt& aPmin,
225                               const gp_Pnt& aPmax)
226 {
227   myAutomaticPosition = Standard_False;
228   myComponent = aComponent;
229   myCenter = aCenter;
230   myPmin = aPmin;
231   myPmax = aPmax;
232   myTypeOfPlane = AIS_TOPL_Unknown;
233   myIsXYZPlane = Standard_False;
234 }
235
236 //=======================================================================
237 //function : Compute
238 //purpose  : 
239 //=======================================================================
240 void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
241                         const Handle(Prs3d_Presentation)& aPresentation, 
242                         const Standard_Integer aMode)
243 {
244   aPresentation->Clear();
245
246   ComputeFields();
247   aPresentation->SetInfiniteState(myInfiniteState);
248   myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(myCurrentMode == 0? 1 : 3);
249
250   switch (aMode)
251   {
252     case 0:
253     {
254       if (!myIsXYZPlane)
255       {
256         ComputeFrame();
257         const Handle(Geom_Plane)& pl = myComponent;
258         const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
259         GeomAdaptor_Surface surf(thegoodpl);
260         StdPrs_Plane::Add(aPresentation,surf,myDrawer);
261       }
262       else
263         DsgPrs_XYZPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
264       break;
265     }
266     case 1:
267     {
268       if (!myIsXYZPlane)
269       {
270         ComputeFrame();
271         Handle(Prs3d_PlaneAspect) theaspect = myDrawer->PlaneAspect();
272         Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
273         TheGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
274         gp_Pnt p1;
275         const Standard_Real Xmax = 0.5*Standard_Real(theaspect->PlaneXLength());
276         const Standard_Real Ymax = 0.5*Standard_Real(theaspect->PlaneYLength());
277
278         Handle(Graphic3d_ArrayOfQuadrangles) aQuads = new Graphic3d_ArrayOfQuadrangles(4);
279
280         myComponent->D0(-Xmax,Ymax,p1);
281         aQuads->AddVertex(p1);
282         myComponent->D0(Xmax,Ymax,p1);
283         aQuads->AddVertex(p1);
284         myComponent->D0(Xmax,-Ymax,p1);
285         aQuads->AddVertex(p1);
286         myComponent->D0(-Xmax,-Ymax,p1);
287         aQuads->AddVertex(p1);
288
289         TheGroup->AddPrimitiveArray(aQuads);
290       }
291       else
292         DsgPrs_ShadedPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
293       break;
294     }
295   }
296 }
297
298 void AIS_Plane::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
299 {
300   PrsMgr_PresentableObject::Compute(aProjector, aTransformation, aPresentation);
301 }
302
303 //=======================================================================
304 //function : ComputeSelection
305 //purpose  : 
306 //=======================================================================
307 void AIS_Plane::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
308                                     const Standard_Integer)
309 {
310   aSelection->Clear();
311   Handle(SelectMgr_EntityOwner) eown = new SelectMgr_EntityOwner(this,10);
312   Handle(Select3D_SensitiveFace) sfac;
313
314   if (!myIsXYZPlane){
315
316     Handle(TColgp_HArray1OfPnt) harr = new TColgp_HArray1OfPnt(1,5);
317     TColgp_Array1OfPnt& arr = harr->ChangeArray1();
318     Standard_Real lx = myDrawer->PlaneAspect()->PlaneXLength()/2.;
319     Standard_Real ly = myDrawer->PlaneAspect()->PlaneYLength()/2.;
320     const Handle(Geom_Plane)& pl = myComponent;
321     const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
322     
323     thegoodpl->D0(lx,ly,arr(1));
324     thegoodpl->D0(lx,-ly,arr(2));
325     thegoodpl->D0(-lx,-ly,arr(3));
326     thegoodpl->D0(-lx,ly,arr(4));
327     arr(5) = arr(1);
328     sfac = new Select3D_SensitiveFace(eown,harr,Select3D_TOS_BOUNDARY);
329
330   }
331   else {
332     Handle(TColgp_HArray1OfPnt) harr1 = new TColgp_HArray1OfPnt(1,4);
333     TColgp_Array1OfPnt& arr1 = harr1->ChangeArray1();
334     
335     arr1(1) = myCenter;
336     arr1(2) = myPmin;
337     arr1(3) = myPmax;
338     arr1(4) = myCenter;
339     sfac = new Select3D_SensitiveFace(eown,harr1,Select3D_TOS_BOUNDARY);
340
341   }
342     aSelection->Add(sfac);
343 }
344
345
346
347
348 //=======================================================================
349 //function : SetSize
350 //purpose  : 
351 //=======================================================================
352 void AIS_Plane::SetSize(const Standard_Real aLength)
353 {
354   SetSize(aLength,aLength);
355 }
356
357 void AIS_Plane::SetSize(const Standard_Real aXLength,
358                         const Standard_Real aYLength)
359 {
360   //if the plane already has a proper color or size, 
361   //there is already a specific PlaneAspect and DatumAspect 
362     
363   Handle(Prs3d_PlaneAspect) PA; 
364   Handle(Prs3d_DatumAspect) DA;
365
366   PA = myDrawer->PlaneAspect();
367   DA = myDrawer->DatumAspect();
368
369   Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
370   if(myDrawer->Link()->PlaneAspect() == PA){
371     yenavaitPA = Standard_False;
372     PA = new Prs3d_PlaneAspect();}
373   if(myDrawer->Link()->DatumAspect() == DA){
374     yenavaitDA = Standard_False;
375     DA = new Prs3d_DatumAspect();
376   }
377   
378   PA->SetPlaneLength(aXLength,aYLength);
379   DA->SetAxisLength(aXLength,aYLength,aXLength);
380   
381   if(!yenavaitPA)
382     myDrawer->SetPlaneAspect(PA);
383   if(!yenavaitDA)
384     myDrawer->SetDatumAspect(DA);
385   
386   
387   myHasOwnSize = Standard_True;
388   Update();
389   UpdateSelection();
390 }
391
392
393 //=======================================================================
394 //function : UnsetSize
395 //purpose  : If there is a color, the size is restaured from the drawer of the context...
396 //=======================================================================
397 void AIS_Plane::UnsetSize()
398 {
399   
400   if(!myHasOwnSize) return;
401   if(!hasOwnColor){
402     myDrawer->PlaneAspect().Nullify();
403     myDrawer->DatumAspect().Nullify();
404   }
405   else{
406     const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
407     const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
408
409     myDrawer->PlaneAspect()->SetPlaneLength(PA->PlaneXLength(),PA->PlaneYLength());
410     myDrawer->DatumAspect()->SetAxisLength(DA->FirstAxisLength(),
411                                            DA->SecondAxisLength(),
412                                            DA->ThirdAxisLength());
413   }
414   
415   myHasOwnSize = Standard_False;
416   Update();
417   UpdateSelection();
418
419 }
420
421 //=======================================================================
422 //function : Size
423 //purpose  : 
424 //=======================================================================
425
426 Standard_Boolean AIS_Plane::Size(Standard_Real& X,Standard_Real& Y) const 
427 {
428   X = myDrawer->PlaneAspect()->PlaneXLength();
429   Y = myDrawer->PlaneAspect()->PlaneYLength();
430   return Abs(X-Y)<=Precision::Confusion();
431 }
432
433
434 //=======================================================================
435 //function : SetColor
436 //purpose  : 
437 //=======================================================================
438
439
440 void AIS_Plane::SetColor(const Quantity_NameOfColor aCol)
441 #ifdef GER61351
442 {
443   SetColor(Quantity_Color(aCol));
444 }
445
446 void AIS_Plane::SetColor(const Quantity_Color &aCol)
447 #endif
448 {
449   // if the plane already has its proper size, there is an already created planeaspect 
450 //  Standard_Boolean yenadeja = hasOwnColor || myHasOwnSize;
451   Handle(Prs3d_PlaneAspect) PA; 
452   Handle(Prs3d_DatumAspect) DA;
453
454   PA = myDrawer->PlaneAspect();
455   DA = myDrawer->DatumAspect();
456
457   Standard_Boolean yenavaitPA(Standard_True),yenavaitDA(Standard_True);
458   if(myDrawer->Link()->PlaneAspect() == PA){
459     yenavaitPA = Standard_False;
460     PA = new Prs3d_PlaneAspect();}
461   if(myDrawer->Link()->DatumAspect() == DA){
462     yenavaitDA = Standard_False;
463     DA = new Prs3d_DatumAspect();
464   }
465   
466   PA->EdgesAspect()->SetColor(aCol);
467   DA->FirstAxisAspect()->SetColor(aCol);
468   DA->SecondAxisAspect()->SetColor(aCol);
469   DA->ThirdAxisAspect()->SetColor(aCol);
470
471   if(!yenavaitPA)
472     myDrawer->SetPlaneAspect(PA);
473   if(!yenavaitDA)
474     myDrawer->SetDatumAspect(DA);
475
476   myDrawer->ShadingAspect()->SetColor(aCol);
477   
478   hasOwnColor=Standard_True;
479   myOwnColor = aCol;
480 }
481 //=======================================================================
482 //function : SetColor
483 //purpose  : 
484 //=======================================================================
485 void AIS_Plane::UnsetColor()
486 {
487   if(!hasOwnColor) return;
488   if(!myHasOwnSize){
489     myDrawer->PlaneAspect().Nullify();
490     myDrawer->DatumAspect().Nullify();
491   }
492   else{
493     const Handle(Prs3d_PlaneAspect)& PA = myDrawer->Link()->PlaneAspect();
494 //    const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
495     Quantity_Color C;Aspect_TypeOfLine T;Standard_Real W;
496     PA->EdgesAspect()->Aspect()->Values(C,T,W);
497     Quantity_NameOfColor Col = C.Name();
498     myDrawer->PlaneAspect()->EdgesAspect()->SetColor(Col);
499     
500     myDrawer->DatumAspect()->FirstAxisAspect()->SetColor(Col);
501     myDrawer->DatumAspect()->SecondAxisAspect()->SetColor(Col);
502     myDrawer->DatumAspect()->ThirdAxisAspect()->SetColor(Col);
503   }
504  
505  
506   hasOwnColor=Standard_False;
507
508 }
509
510 //=======================================================================
511 //function : ComputeFrame
512 //purpose  : 
513 //=======================================================================
514 void AIS_Plane::ComputeFrame()
515 {
516
517   const Handle(Geom_Plane)& pl = myComponent;
518   Standard_Real U,V;
519
520   if (myAutomaticPosition) {
521     ElSLib::Parameters(pl->Pln(),myCenter,U,V);
522     pl->D0 (U, V, myCenter);     
523   }
524   else {
525     const Handle(Geom_Plane)& thegoodpl = 
526       Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
527     ElSLib::Parameters(thegoodpl->Pln(),myPmin,U,V);
528     
529     U = 2.4*Abs(U);
530     V = 2.4*Abs(V);
531     if (U < 10*Precision::Confusion()) U=0.1;
532     if (V < 10*Precision::Confusion()) V=0.1;
533     SetSize(U,V);
534     myDrawer->PlaneAspect()->SetPlaneLength(U,V);
535   }
536 }
537
538 //=======================================================================
539 //function : Compute
540 //purpose  : to avoid warning
541 //=======================================================================
542 void AIS_Plane::Compute(const Handle(Prs3d_Projector)&, 
543                            const Handle(Prs3d_Presentation)&)
544 {
545 }
546
547 //=======================================================================
548 //function : ComputeFields
549 //purpose  : 
550 //=======================================================================
551 void AIS_Plane::ComputeFields()
552 {
553   if (myIsXYZPlane){
554     Handle (Prs3d_DatumAspect) DA = myDrawer->DatumAspect();
555
556     gp_Pnt Orig = myAx2->Ax2().Location();
557     gp_Dir oX = myAx2->Ax2().XDirection();
558     gp_Dir oY = myAx2->Ax2().YDirection();
559     gp_Dir oZ = myAx2->Ax2().Direction();
560     myCenter = Orig;
561     Standard_Real xo,yo,zo,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4=0,y4=0,z4=0;
562     Standard_Real x5=0,y5=0,z5=0;
563     Orig.Coord(xo,yo,zo);
564     oX.Coord(x1,y1,z1);
565     oY.Coord(x2,y2,z2);
566     oZ.Coord(x3,y3,z3);
567     Standard_Real DS1 = DA->FirstAxisLength();
568     Standard_Real DS2 = DA->SecondAxisLength();
569     Standard_Real DS3 = DA->ThirdAxisLength();
570 //    gp_Pnt aPt2,aPt3;
571
572     switch (myTypeOfPlane) {
573     case AIS_TOPL_XYPlane:
574       {
575         gp_Pln XYP(0,0,1,0);
576         myComponent = new Geom_Plane(XYP);
577         x4=xo+x1*DS1; y4=yo+y1*DS1; z4=zo+z1*DS1;
578         x5=xo+x2*DS2; y5=yo+y2*DS2; z5=zo+z2*DS2;
579         break;
580       }
581     case AIS_TOPL_XZPlane:
582       {
583         gp_Pln XZP(0,1,0,0);
584         myComponent = new Geom_Plane(XZP);
585         x4=xo+x1*DS1; y4=yo+y1*DS1; z4=zo+z1*DS1;
586         x5=xo+x3*DS3; y5=yo+y3*DS3; z5=zo+z3*DS3;
587         break;
588       }
589     case AIS_TOPL_YZPlane:
590       {
591         gp_Pln XZP(1,0,0,0);
592         myComponent = new Geom_Plane(XZP);
593         x4=xo+x2*DS2; y4=yo+y2*DS2; z4=zo+z2*DS2;
594         x5=xo+x3*DS3; y5=yo+y3*DS3; z5=zo+z3*DS3;
595         break;
596       }
597     default:
598       break;
599     }
600     myPmin.SetCoord(x4,y4,z4);
601     myPmax.SetCoord(x5,y5,z5);
602   }
603
604 }
605 //=======================================================================
606 //function : InitDrawerAttributes
607 //purpose  : 
608 //=======================================================================
609
610 void AIS_Plane::InitDrawerAttributes()
611 {
612
613   Handle(Prs3d_ShadingAspect) shasp = new Prs3d_ShadingAspect();
614   shasp->SetMaterial(Graphic3d_NOM_PLASTIC);
615   shasp->SetColor(Quantity_NOC_GRAY40);
616   myDrawer->SetShadingAspect(shasp);
617   Handle(Graphic3d_AspectFillArea3d) asf = shasp->Aspect();
618   Graphic3d_MaterialAspect asp = asf->FrontMaterial();
619   asp.SetTransparency(0.8);
620   asf->SetFrontMaterial(asp);
621   asf->SetBackMaterial(asp);
622
623
624 }
625
626 //=======================================================================
627 //function : AcceptDisplayMode
628 //purpose  : 
629 //=======================================================================
630
631 Standard_Boolean  AIS_Plane::
632 AcceptDisplayMode(const Standard_Integer aMode) const
633 {return aMode == 0;}
634
635
636 //=======================================================================
637 //function : SetContext
638 //purpose  : 
639 //=======================================================================
640
641 void AIS_Plane::SetContext(const Handle(AIS_InteractiveContext)& Ctx)
642 {
643   AIS_InteractiveObject::SetContext(Ctx);
644   ComputeFields();
645
646 }