
Thu, 02/15/2007 - 19:20
Hi everybody!
I'm using VC++ with OCC. I'm developing a function into XXXView::OnMouseMove() event.
I have a shape displayed and my intention is that when I mouse over the shape and hilight it,then a point is displayed.
And when unhilight the shape by mouse out, then erase the point.
I'm doing this:
//Global vars
Handle_AIS_InteractiveObject sh;
bool lock=false;
XXXView::OnMouseMove(...)
{
...
sh=myAISContext()->DetectedInteractive();
if(!lock)myAISContext()->Hilight(sh);
gp_Pnt G =XXX;
TopoDS_Vertex vtx = BRepBuilderAPI_MakeVertex(G);
Handle(AIS_Shape) Vtx = new AIS_Shape(vtx);
if(myAISContext()->IsHilighted(sh))
{
myAISContext()->Display(Vtx);
myAISContext()->Unhilight(sh);
lock=true;
}
else myAISContext()->Erase(Vtx);
...
}
The displaying of the point is ok, but in the erasing it doesn't do anything.
Could someone help me, please?
Thanks a lot.
Best regards,
Jose Manuel
Fri, 02/16/2007 - 01:34
try myAISContext()->Remove(Vtx);
Pete
Fri, 02/16/2007 - 10:25
Hi Pete,
Thanks a lot for your help. I'm afraid it doesn't work properly but thank you again anyway.
Sincerely,
Jose Manuel