vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
//
Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
- bool isShift = theSelectionEvent->myIsShift;
+ bool anIsShift = theSelectionEvent->myIsShift;
+ if( !anIsShift ) {
+ mySelector->RemoveIObject( this );
+ }
float x = theSelectionEvent->myX;
float y = theSelectionEvent->myY;
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) {
int anObjId = GetNodeObjId( aVtkId );
if( anObjId >= 0 ) {
- if( mySelector->IsSelected( myIO ) )
- mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
- else {
- if( !isShift ) {
- mySelector->ClearIObjects();
- }
- mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
- mySelector->AddIObject( this );
- }
+ mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
+ mySelector->AddIObject( this );
}
}
break;
int anObjId = GetElemObjId( aVtkId );
if( anObjId >= 0 ) {
if ( CheckDimensionId(aSelectionMode,this,anObjId) ) {
- if( mySelector->IsSelected( myIO ) )
- mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
- else {
- if( !isShift ) {
- mySelector->ClearIObjects();
- }
- mySelector->AddOrRemoveIndex( myIO, anObjId, isShift );
- mySelector->AddIObject( this );
- }
+ mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift );
+ mySelector->AddIObject( this );
}
}
}
if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) {
int anObjId = GetElemObjId( aVtkId );
if( anObjId >= 0 ) {
- if( !isShift ) {
- mySelector->ClearIObjects();
- }
int anEdgeId = GetEdgeId(this,myCellPicker.GetPointer(),anObjId);
if( anEdgeId < 0 ) {
mySelector->AddOrRemoveIndex( myIO, anObjId, false );
}
case ActorSelection :
{
- if( mySelector->IsSelected( myIO ) && isShift )
+ if( mySelector->IsSelected( myIO ) && anIsShift )
mySelector->RemoveIObject( this );
else {
- if( !isShift ) {
- mySelector->ClearIObjects();
- }
mySelector->AddIObject( this );
}
break;
}
if( !anIndexes.IsEmpty() ) {
- mySelector->AddOrRemoveIndex( myIO, anIndexes, true );
+ mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
mySelector->AddIObject( this );
anIndexes.Clear();
}
float aPnt[3];
float* aBounds = GetBounds();
- bool picked = true;
+ bool anIsPicked = true;
for( int i = 0; i <= 1; i++ ) {
for( int j = 2; j <= 3; j++ ) {
for( int k = 4; k <= 5; k++ ) {
aRenderer->GetDisplayPoint( aPnt );
if( aPnt[0] < x1 || aPnt[0] > x2 || aPnt[1] < y1 || aPnt[1] > y2 ) {
- picked = false;
+ anIsPicked = false;
break;
}
}
}
}
- if( picked )
+ if( anIsPicked )
mySelector->AddIObject(this);
break;
}
}
}
- mySelector->AddOrRemoveIndex( myIO, anIndexes, true );
+ mySelector->AddOrRemoveIndex( myIO, anIndexes, anIsShift );
mySelector->AddIObject( this );
}
default: