dearhpc Sat, 01/19/2008 - 16:20 Forums: Other usage issuesHow to get the selected vertex on TopAbs_VERTEX mode? Seth Jackson Thu, 01/24/2008 - 21:07 hi. to get a selected vertex, or any other topods, try something like this: TopoDS_Shape getSelectedVertex( Handle_AIS_InteractiveContext& theContext ) { TopoDS_Shape shape; theContext->InitSelected(); if ( type == TopAbs_VERTEX ) { while( theContext->MoreSelected() ) { shape = theContext->SelectedShape(); if ( shape.ShapeType() == TopAbs_VERTEX ) return shape; theContext->NextSelected(); } } shape.Nullify(); return shape; } Log in to post comments Seth Jackson Thu, 01/24/2008 - 21:09 sorry, i forgot that i use 'type' there too... it should read more like: ( Handle_AIS_InteractiveContext& theContext, TopAbs_ShapeEnum type ) but really that test is unnecessary. Log in to post comments
Thu, 01/24/2008 - 21:07
hi. to get a selected vertex, or any other topods, try something like this:
TopoDS_Shape getSelectedVertex( Handle_AIS_InteractiveContext& theContext )
{
TopoDS_Shape shape;
theContext->InitSelected();
if ( type == TopAbs_VERTEX )
{
while( theContext->MoreSelected() )
{
shape = theContext->SelectedShape();
if ( shape.ShapeType() == TopAbs_VERTEX )
return shape;
theContext->NextSelected();
}
}
shape.Nullify();
return shape;
}
Thu, 01/24/2008 - 21:09
sorry, i forgot that i use 'type' there too...
it should read more like:
( Handle_AIS_InteractiveContext& theContext, TopAbs_ShapeEnum type )
but really that test is unnecessary.