- AIS_ListOfInteractive aDisplayedList;
- ic->DisplayedObjects( aDisplayedList );
- ic->ClearSelected( Standard_False );
-
- CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
- aLast = thePoints.end();
- CurveCreator_ICurve::SectionToPoint aSToPoint;
- bool isSelectedVertex = false;
- for( ; anIt != aLast; anIt++ ) {
- aSToPoint = *anIt;
- for ( AIS_ListIteratorOfListOfInteractive it( aDisplayedList ); it.More(); it.Next() )
- {
- Handle(AIS_InteractiveObject) anAIS = it.Value();
- if ( anAIS.IsNull() )
- continue;
- Handle(AIS_Point) anAISPoint = Handle(AIS_Point)::DownCast( anAIS );
- if ( !anAISPoint.IsNull() ) {
- TopoDS_Vertex aVertex = TopoDS::Vertex( anAISPoint->Vertex() );
- if ( isIntersectVertexToPoint( aVertex, aSToPoint ) )
- aListToSelect.Append( anAIS );
- }
- else {
- Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast( anAIS );
- if ( anAISShape.IsNull() )
- continue;
- const TopoDS_Shape& aShape = anAISShape->Shape();
- TopExp_Explorer aExpV( aShape, TopAbs_VERTEX);
- for ( ; aExpV.More(); aExpV.Next() )
- {
- const TopoDS_Vertex& aVertex = TopoDS::Vertex( aExpV.Current() );
- if ( isIntersectVertexToPoint( aVertex, aSToPoint ) ) {
- ic->AddOrRemoveSelected( aVertex, Standard_False );
- isSelectedVertex = true;
- }
- }
- }
- }
- }
- ic->UpdateCurrentViewer();
- if ( !isSelectedVertex )
- setObjectsSelected( aListToSelect );