//----------------------------------------------------------------------------
VVTK_InteractorStyle
-::VVTK_InteractorStyle()
- : myPickingKey( 'P' ),
- myIsMidButtonDown( false ),
- myIsLeftButtonDown( false )
+::VVTK_InteractorStyle():
+ myIsMidButtonDown( false ),
+ myIsLeftButtonDown( false )
{
}
VVTK_InteractorStyle
::OnKeyDown()
{
+
char key = Interactor->GetKeyCode();
- if ( key == myPickingKey ) {
- int x, y;
- Interactor->GetEventPosition( x, y ); // current mouse position (from last mouse move event or any other event)
+
+ if ( key == 'S' || key == 'P') {
+ int aSMWas, x, y;
+ SVTK_Selector* pSelector;
+ //
+ pSelector=GetSelector();
+ aSMWas=pSelector->SelectionMode();
+ //
+ pSelector->SetSelectionMode(NodeSelection);
+ if (key == 'P'){
+ pSelector->SetSelectionMode(CellSelection);
+ }
+ // current mouse position (from last mouse move event or any other event)
+ Interactor->GetEventPosition( x, y );
FindPokedRenderer( x, y ); // calls SetCurrentRenderer
myOtherPoint = myPoint = QPoint(x, y);
- //printf ( "--- myPoint[ %d, %d ], myOtherPoint[ %d, %d ] ---\n", myPoint.x(), myPoint.y(), myOtherPoint.x(), myOtherPoint.y() );
-
+ //printf ( "--- myPoint[ %d, %d ], myOtherPoint[ %d, %d ] ---\n",
+ //myPoint.x(), myPoint.y(), myOtherPoint.x(), myOtherPoint.y() );
+
startOperation(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
onFinishOperation();
startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
+ //
+ pSelector->SetSelectionMode(aSMWas);
}
}