Mon, 10/01/2007 - 12:35
Forums:
Hello everyone,
I need some help. I have a drawn box and when a move the mouse over the box i want to take the face over the mouse cursor like a TopoDS_Face.I am using this source
Handle_StdSelect_ViewerSelector3d hSelector = m_pAISContext->MainSelector();
hSelector->Init();
while (hSelector->More())
{
TopoDS_Shape myFace =(TopoDS_Shape&)Handle(AIS_Shape)::DownCast( hSelector->Picked()->Selectable() )->Shape();
....
....
But myFace is not the face under the mouse cursor but the whole box
How i can get not the whole box under the mouse cursor but only the face?
Thanks in advanced
Wed, 11/23/2016 - 11:52
Hello,
I have the same problem, i would like to get the TopoDS_Face of the TopoDS_Shape Object direct under the mouse pointer. I can not seem to be able to find the solution to this problem. Has anybody got ideas on how to solve it?
Wed, 11/23/2016 - 12:09
As far as I know this functionality is marked as deprecated. So some kind of workaround is needed in this case.
Wed, 11/23/2016 - 12:14
Which functionality? Do you have some methodname or classname, something i could use, even if it is deprecated?
Wed, 11/23/2016 - 12:21
Try out AIS_InteractiveContext::DetectedCurrentShape().
Wed, 11/23/2016 - 12:24
A more generic code is as follows:
// ctx is your AIS_InteractiveContext
ctx->InitSelected();
while (ctx->MoreSelected())
{
TopoDS_Shape sh = ctx->SelectedShape();
...
ctx->NextSelected();
}
Wed, 11/23/2016 - 13:07
Thanks, i have tried to do it totaly different way, not through AIS. As a side note - i had to set the Standard Mode to select only Faces (ctx->ActivateStandardMode(4)).