- CurveCreator_ICurve::SectionToPointList::const_iterator
- aPIt = thePoints.begin(), aPLast = thePoints.end();
- CurveCreator_ICurve::SectionToPoint aSToPoint;
- for( int i=0; aPIt != aPLast; aPIt++, i++ )
- {
- gp_Pnt aPntToSelect;
- CurveCreator_UtilsICurve::getPoint( myCurve, aPIt->first, aPIt->second, aPntToSelect );
- aPntsToSelect[i] = aPntToSelect;
- }
-
-
- //ASL: we switch off automatic highlight to improve performance of selection
- ic->SetAutomaticHilight( Standard_False );
-
- Handle_SelectMgr_Selection aSelection = anAISShape->Selection( AIS_Shape::SelectionMode( TopAbs_VERTEX ) );
- for( aSelection->Init(); aSelection->More(); aSelection->Next() )
- {
- Handle_SelectBasics_SensitiveEntity aSenEntity = aSelection->Sensitive();
- Handle_Select3D_SensitivePoint aSenPnt = Handle_Select3D_SensitivePoint::DownCast( aSenEntity );
-
- gp_Pnt anOwnerPnt = aSenPnt->Point();
- Handle_SelectMgr_EntityOwner anOwner = Handle_SelectMgr_EntityOwner::DownCast( aSenPnt->OwnerId() );
-
-
- CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
- aLast = thePoints.end();
- bool isFound = false;
- for( int i=0; i<aSize; i++ )
- {
- bool isIntersect = fabs( aPntsToSelect[i].X() - anOwnerPnt.X() ) < LOCAL_SELECTION_TOLERANCE &&
- fabs( aPntsToSelect[i].Y() - anOwnerPnt.Y() ) < LOCAL_SELECTION_TOLERANCE;
- if( isIntersect )
- {
- ic->AddOrRemoveSelected( anOwner, Standard_False );
- break;
- }
- }
- }
- }
-
- /*ASL: std::vector<TopoDS_Vertex>::const_iterator aVecIt = aVetexVec.begin(), aVecLast = aVetexVec.end();
- CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
- aLast = thePoints.end();
- int aSize = aVetexVec.size();
- CurveCreator_ICurve::SectionToPoint aSToPoint;
- int anAddedSize = 0;
- for( ; anIt != aLast; anIt++ ) {
- aSToPoint = *anIt;
-
- for ( aVecIt = aVetexVec.begin(); aVecIt != aVecLast; aVecIt++ )
- {
- TopoDS_Vertex aVertex = TopoDS::Vertex( *aVecIt );
- if ( isIntersectVertexToPoint( aVertex, aSToPoint ) ) {
- ic->AddOrRemoveSelected( aVertex, Standard_False );
- isSelectedVertex = true;
- anAddedSize++;
- }
- }
- }*/
-
- //ASL: we switch on again automatic highlight (otherwise selection will not be shown)
- // and call HilightPicked to draw selected owners
- ic->SetAutomaticHilight( Standard_True );
- ic->LocalContext()->HilightPicked( Standard_True );
-
- //ic->UpdateCurrentViewer();
- if ( !isSelectedVertex )
- setObjectsSelected( aListToSelect );