For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

AIS_Trihedron: hilighting in the wrong place

Alexander Tsvyashchenko's picture
Forums: 

Hello All,

There seems to be the bug in AIS_Trihedron implementation when using it as follows:

1) Position of trihedron is changed dynamically
by changing Geom_Axis2Placement object trihedron references to and calling Redisplay() for InteractiveContext that trihedron is located in.

2) Selection mode is 3 (so, planes are selected, though the issue seems to happen for any selection mode but 0).

When using trihedron like that it appears that when plane of trihedron was selected or highlighted at least once by the user, it will be displayed at the same place it was initially selected / hilighted during all next selections / hilightings, even if trihedron was moved already.

After some debugging it seems that the root of the problem is that AIS_Trihedron besides maintaining its own presentation also keeps list of AIS_InteractiveObjects (such as planes and axes) - but presentations of these objects seem to be never updated.

I was able to fix this issue by forcing update of children objects in trihedron's Compute function, the patch is attached.

I'm not sure it's the best way of doing that, but it seems at least to solve the problem.

Any comments are welcome!

--- AIS/AIS_Trihedron.cxx.old 2007-07-19 22:02:12.161125000 +0300
+++ AIS/AIS_Trihedron.cxx 2007-07-19 21:45:38.645500000 +0300
@@ -237,6 +237,9 @@
switch(aMode){
case 0:
DsgPrs_DatumPrs::Add(aPresentation,myComponent->Ax2(),myDrawer);
+ // We need to explicitly update our shapes as noone else will do this ...
+ for(Standard_Integer i=0;i + myShapes[i]->SetToUpdate(aMode);
break;
case 1:
break;