mouse buttons pressed simultaneously.</center>
<hr>
+\image html image111.png
+\n <center><b>Zooming style switch</b> - allows to switch between standard
+(zooming at the center of the view) and advanced (zooming at the current cursor
+position) zooming styles.</center>
+<hr>
+
\image html image88.png
\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
<hr>
with the left button, translation with the right and zoom with both
pressed in the same time.</li>
</ul>
+<li><b>Zooming mode</b> - this option allows to choose a zooming mode.</li>
+<ul>
+<li><b>Relative to the view's center</b> - allows to zoom the view
+relatively to its center.</li>
+<li><b>Relative to the cursor</b> - allows to zoom the view
+relatively to the current cursor position..</li>
+</ul>
<li><b>[+]/[-] Speed Increment</b> - defines the number of units by
which the speed increases or respectively decreases after pressing [+]
or [-] keyboard buttons.</li>
mouse buttons pressed simultaneously.</center>
<hr>
+\image html image111.png
+\n <center><b>Zooming style switch</b> - allows to switch between standard
+(zooming at the center of the view) and advanced (zooming at the current cursor
+position) zooming styles. The second mode is available only for parallel
+(non-perspective) view's mode.</center>
+<hr>
+
\image html image88.png
\n <center><b>Show/Hide Trihedron</b> - shows or hides coordinate axes.</center>
<hr>
v = resMgr->integerValue( "OCCViewer", "iso_number_v", v );
vm->setIsos( u, v );
vm->setInteractionStyle( resMgr->integerValue( "OCCViewer", "navigation_mode", vm->interactionStyle() ) );
+ vm->setZoomingStyle( resMgr->integerValue( "OCCViewer", "zooming_mode", vm->zoomingStyle() ) );
viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface
new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr );
}
resMgr->booleanValue( "VTKViewer", "relative_size", vm->trihedronRelative() ) );
vm->setStaticTrihedronVisible( resMgr->booleanValue( "VTKViewer", "show_static_trihedron", vm->isStaticTrihedronVisible() ) );
vm->setInteractionStyle( resMgr->integerValue( "VTKViewer", "navigation_mode", vm->interactionStyle() ) );
+ vm->setZoomingStyle( resMgr->integerValue( "VTKViewer", "zooming_mode", vm->zoomingStyle() ) );
vm->setIncrementalSpeed( resMgr->integerValue( "VTKViewer", "speed_value", vm->incrementalSpeed() ),
resMgr->integerValue( "VTKViewer", "speed_mode", vm->incrementalSpeedMode() ) );
vm->setSpacemouseButtons( resMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", vm->spacemouseBtn(1) ),
pref->setItemProperty( "strings", aStyleModeList, occStyleMode );
pref->setItemProperty( "indexes", aModeIndexesList, occStyleMode );
+ int occZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), occGroup,
+ LightApp_Preferences::Selector, "OCCViewer", "zooming_mode" );
+ QStringList aZoomingStyleModeList;
+ aZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CENTER") );
+ aZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CURSOR") );
+
+ pref->setItemProperty( "strings", aZoomingStyleModeList, occZoomingStyleMode );
+ pref->setItemProperty( "indexes", aModeIndexesList, occZoomingStyleMode );
+
// VTK Viewer
int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
pref->setItemProperty( "columns", 2, vtkGen );
pref->setItemProperty( "strings", aStyleModeList, vtkStyleMode );
pref->setItemProperty( "indexes", aModeIndexesList, vtkStyleMode );
- pref->addPreference( "", vtkGroup, LightApp_Preferences::Space );
+ int vtkZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), vtkGen,
+ LightApp_Preferences::Selector, "VTKViewer", "zooming_mode" );
+
+ pref->setItemProperty( "strings", aZoomingStyleModeList, vtkZoomingStyleMode );
+ pref->setItemProperty( "indexes", aModeIndexesList, vtkZoomingStyleMode );
int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
LightApp_Preferences::IntSpin, "VTKViewer", "speed_value" );
}
#endif
+#ifndef DISABLE_OCCVIEWER
+ if ( sec == QString( "OCCViewer" ) && param == QString( "zooming_mode" ) )
+ {
+ int mode = resMgr->integerValue( "OCCViewer", "zooming_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+ viewManagers( OCCViewer_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
+ continue;
+
+ OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
+ occVM->setZoomingStyle( mode );
+ }
+ }
+#endif
+
#ifndef DISABLE_VTKVIEWER
if ( sec == QString( "VTKViewer" ) && (param == QString( "trihedron_size" ) || param == QString( "relative_size" )) )
{
}
#endif
+#ifndef DISABLE_VTKVIEWER
+ if ( sec == QString( "VTKViewer" ) && param == QString( "zooming_mode" ) )
+ {
+ int mode = resMgr->integerValue( "VTKViewer", "zooming_mode", 0 );
+ QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+ viewManagers( SVTK_Viewer::Type(), lst );
+ QListIterator<SUIT_ViewManager*> it( lst );
+ while ( it.hasNext() )
+ {
+ SUIT_ViewModel* vm = it.next()->getViewModel();
+ if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+ continue;
+
+ SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+ if( vtkVM ) vtkVM->setZoomingStyle( mode );
+ }
+#endif
+ }
+#endif
+
#ifndef DISABLE_VTKVIEWER
if ( sec == QString( "VTKViewer" ) && param == QString( "show_static_trihedron" ) )
{
<parameter name="iso_number_v" value="1" />
<parameter name="trihedron_size" value="100" />
<parameter name="navigation_mode" value="0" />
+ <parameter name="zooming_mode" value="0" />
</section>
<section name="VTKViewer" >
<!-- VTK viewer preferences -->
<parameter name="relative_size" value="true" />
<parameter name="use_advanced_selection_algorithm" value="true" />
<parameter name="navigation_mode" value="0" />
+ <parameter name="zooming_mode" value="0" />
<parameter name="speed_value" value="10" />
<parameter name="speed_mode" value="0" />
<parameter name="show_static_trihedron" value="true" />
<source>PREF_KEYFREE_STYLE</source>
<translation>Keyboard free style</translation>
</message>
+ <message>
+ <source>PREF_ZOOMING</source>
+ <translation>Zooming:</translation>
+ </message>
+ <message>
+ <source>PREF_ZOOMING_AT_CENTER</source>
+ <translation>Relative to the view's center</translation>
+ </message>
+ <message>
+ <source>PREF_ZOOMING_AT_CURSOR</source>
+ <translation>Relative to the cursor</translation>
+ </message>
<message>
<source>PREF_INCREMENTAL_SPEED</source>
<translation>Speed increment:</translation>
resources/occ_view_top.png \
resources/occ_view_triedre.png \
resources/occ_view_zoom.png \
- resources/occ_view_rotation_point.png
+ resources/occ_view_rotation_point.png \
+ resources/occ_view_style_switch.png \
+ resources/occ_view_zooming_style_switch.png
nodist_salomeres_DATA = \
OCCViewer_images.qm \
// set interaction style to standard
myInteractionStyle = 0;
+ // set zooming style to standard
+ myZoomingStyle = 0;
+
// selection
mySelectionEnabled = true;
myMultiSelectionEnabled = true;
view->initLayout();
view->initSketchers();
view->setInteractionStyle( interactionStyle() );
+ view->setZoomingStyle( zoomingStyle() );
OCCViewer_ViewPort3d* vp3d = view->getViewPort();
if ( vp3d )
}
}
+/*!
+ \return zooming style
+*/
+int OCCViewer_Viewer::zoomingStyle() const
+{
+ return myZoomingStyle;
+}
+
+/*!
+ Sets zooming style: 0 - standard, 1 - advanced (at cursor)
+ \param theStyle - new zooming style
+*/
+void OCCViewer_Viewer::setZoomingStyle( const int theStyle )
+{
+ myZoomingStyle = theStyle;
+ //!! To be done for view windows
+ if ( !myViewManager )
+ return;
+
+ QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
+ for ( int i = 0; i < (int)wins.count(); i++ )
+ {
+ OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+ if ( win )
+ win->setZoomingStyle( theStyle );
+ }
+}
+
/*!
Sets selection enabled status
\param isEnabled - new status
int interactionStyle() const;
void setInteractionStyle( const int );
+ int zoomingStyle() const;
+ void setZoomingStyle( const int );
+
void enableSelection(bool isEnabled);
bool isSelectionEnabled() const { return mySelectionEnabled; }
viewAspectList myViewAspects;
int myInteractionStyle;
+ int myZoomingStyle;
bool mySelectionEnabled;
bool myMultiSelectionEnabled;
myScale( 1.0 ),
myDegenerated( true ),
myAnimate( false ),
- myBusy( true )
+ myBusy( true ),
+ myIsAdvancedZoomingEnabled( false )
{
selectVisualId();
activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
}
+/*!
+ Inits 'zoom' transformation. [ protected ]
+*/
+void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
+{
+ if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
+ activeView()->StartZoomAtPoint( x, y );
+}
+
/*!
Called at 'zoom' transformation. [ virtual protected ]
*/
// as OCCT respects a sign of only dx,
// but we want both signes to be taken into account
//activeView()->Zoom( x0, y0, x, y );
- activeView()->Zoom( x0 + y0, 0, x + y, 0 );
+ if ( isAdvancedZoomingEnabled() )
+ activeView()->ZoomAtPoint( x0, y0, x, y );
+ else
+ activeView()->Zoom( x0 + y0, 0, x + y, 0 );
}
}
virtual void pan( int , int );
virtual void setCenter( int , int );
virtual void fitRect( const QRect& );
+ virtual void startZoomAtPoint( int, int );
virtual void zoom( int, int, int, int );
virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true );
virtual void endRotation();
bool isBusy() {return myBusy;} // check that View Port is fully initialized
+ void setAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
+ bool isAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
+
protected:
// EVENTS
virtual void paintEvent( QPaintEvent* );
bool myAnimate;
bool myBusy;
double myScale;
+ bool myIsAdvancedZoomingEnabled;
};
#ifdef WIN32
break;
case ZOOMVIEW:
- if ( theEvent->button() == Qt::LeftButton )
+ if ( theEvent->button() == Qt::LeftButton ) {
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
emit vpTransformationStarted ( ZOOMVIEW );
+ }
break;
case PANVIEW:
- if ( aSwitchToZoom )
+ if ( aSwitchToZoom ) {
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
activateZoom();
+ }
else if ( theEvent->button() == Qt::LeftButton )
emit vpTransformationStarted ( PANVIEW );
break;
case ROTATE:
- if ( aSwitchToZoom )
+ if ( aSwitchToZoom ) {
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
activateZoom();
+ }
else if ( theEvent->button() == Qt::LeftButton ) {
myViewPort->startRotation(myStartX, myStartY, myCurrPointType, mySelectedPoint);
emit vpTransformationStarted ( ROTATE );
/* Try to activate a transformation */
switch ( getButtonState(theEvent, anInteractionStyle) ) {
case ZOOMVIEW:
- activateZoom();
+ myViewPort->startZoomAtPoint( myStartX, myStartY );
+ activateZoom();
break;
case PANVIEW:
activatePanning();
toolMgr()->registerAction( aAction, AmbientId );
// Switch between interaction styles
- aAction = new QtxAction(tr("MNU_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
+ aAction = new QtxAction(tr("MNU_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_STYLE_SWITCH" ) ),
tr( "MNU_STYLE_SWITCH" ), 0, this);
aAction->setStatusTip(tr("DSC_STYLE_SWITCH"));
aAction->setCheckable(true);
connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
toolMgr()->registerAction( aAction, SwitchInteractionStyleId );
+
+ // Switch between zooming styles
+ aAction = new QtxAction(tr("MNU_ZOOMING_STYLE_SWITCH"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_ZOOMING_STYLE_SWITCH" ) ),
+ tr( "MNU_ZOOMING_STYLE_SWITCH" ), 0, this);
+ aAction->setStatusTip(tr("DSC_ZOOMING_STYLE_SWITCH"));
+ aAction->setCheckable(true);
+ connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchZoomingStyle(bool)));
+ toolMgr()->registerAction( aAction, SwitchZoomingStyleId );
}
/*!
toolMgr()->append( DumpId, tid );
toolMgr()->append( SwitchInteractionStyleId, tid );
+ toolMgr()->append( SwitchZoomingStyleId, tid );
if( myModel->trihedronActivated() )
toolMgr()->append( TrihedronShowId, tid );
a->setChecked( on );
}
+/*!
+ \brief Toogles advanced zooming style (relatively to the cursor position) on/off
+*/
+void OCCViewer_ViewWindow::onSwitchZoomingStyle( bool on )
+{
+ myViewPort->setAdvancedZoomingEnabled( on );
+
+ // update action state if method is called outside
+ QtxAction* a = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
+ if ( a->isChecked() != on )
+ a->setChecked( on );
+}
+
/*!
\brief Get current interaction style
\return interaction style
onSwitchInteractionStyle( theStyle == (int)SUIT_ViewModel::KEY_FREE );
}
+/*!
+ \brief Get current zooming style
+ \return zooming style
+*/
+int OCCViewer_ViewWindow::zoomingStyle() const
+{
+ return myViewPort->isAdvancedZoomingEnabled() ? 1 : 0;
+}
+
+/*!
+ \brief Set current zooming style
+ \param theStyle zooming style
+*/
+void OCCViewer_ViewWindow::setZoomingStyle( const int theStyle )
+{
+ onSwitchZoomingStyle( theStyle == 1 );
+}
+
/*!
\brief Dump view window contents to the pixmap.
\return pixmap containing all scene rendered in the window
enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
ChangeRotationPointId, RotationId,
FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId,
- TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId, SwitchInteractionStyleId };
+ TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId, SwitchInteractionStyleId, SwitchZoomingStyleId };
enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE,
PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
int interactionStyle() const;
void setInteractionStyle( const int );
+ int zoomingStyle() const;
+ void setZoomingStyle( const int );
+
void setTransformEnabled( const OperationType, const bool );
bool transformEnabled( const OperationType ) const;
void onTrihedronShow();
void setRestoreFlag();
void onSwitchInteractionStyle( bool on );
+ void onSwitchZoomingStyle( bool on );
void activateSetRotationGravity();
void activateSetRotationSelected( double theX, double theY, double theZ );
<source>ICON_OCCVIEWER_STYLE_SWITCH</source>
<translation>occ_view_style_switch.png</translation>
</message>
+ <message>
+ <source>ICON_OCCVIEWER_ZOOMING_STYLE_SWITCH</source>
+ <translation>occ_view_zooming_style_switch.png</translation>
+ </message>
</context>
</TS>
<source>MNU_STYLE_SWITCH</source>
<translation>Interaction style switch</translation>
</message>
+ <message>
+ <source>DSC_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zooming style switch</translation>
+ </message>
+ <message>
+ <source>MNU_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zooming style switch</translation>
+ </message>
<message>
<source>OCC_IMAGE_FILES</source>
<translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
resources/vtk_view_perspective.png \
resources/vtk_view_parameters.png \
resources/vtk_view_style_switch.png \
+ resources/vtk_view_zooming_style_switch.png \
resources/vtk_view_recording_start.png \
resources/vtk_view_recording_play.png \
resources/vtk_view_recording_pause.png \
myControllerIncrement(SVTK_ControllerIncrement::New()),
myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
myHighlightSelectionPointActor(SVTK_Actor::New()),
- myRectBand(0)
+ myRectBand(0),
+ myIsAdvancedZoomingEnabled(false)
{
myPointPicker->Delete();
double zoomFactor = pow((double)1.1, dxf + dyf);
vtkCamera *aCam = GetCurrentRenderer()->GetActiveCamera();
- if (aCam->GetParallelProjection())
+ if (aCam->GetParallelProjection()) {
+ int x0 = 0, y0 = 0, x1 = 0, y1 = 0;
+ if( IsAdvancedZoomingEnabled() ) { // zoom relatively to the cursor
+ int* aSize = GetCurrentRenderer()->GetRenderWindow()->GetSize();
+ int w = aSize[0];
+ int h = aSize[1];
+ x0 = w / 2;
+ y0 = h / 2;
+ x1 = myOtherPoint.x();
+ y1 = h - myOtherPoint.y();
+ TranslateView( x0, y0, x1, y1 );
+ }
aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
+ if( IsAdvancedZoomingEnabled() )
+ TranslateView( x1, y1, x0, y0 );
+ }
else{
aCam->Dolly(zoomFactor); // Move camera in/out along projection direction
GetCurrentRenderer()->ResetCameraClippingRange();
int CurrentState() const { return State; }
+ void SetAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
+ bool IsAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
+
protected:
SVTK_InteractorStyle();
~SVTK_InteractorStyle();
bool myBBFirstCheck;
QRubberBand* myRectBand; //!< selection rectangle rubber band
+
+ bool myIsAdvancedZoomingEnabled;
};
#ifdef WIN32
myIncrementMode = 0;
myProjMode = 0;
myStyle = 0;
+ myZoomingStyle = 0;
mySpaceBtn[0] = 1;
mySpaceBtn[1] = 2;
mySpaceBtn[2] = 9;
aViewWindow->SetStaticTrihedronVisible( isStaticTrihedronVisible() );
aViewWindow->SetProjectionMode( projectionMode() );
aViewWindow->SetInteractionStyle( interactionStyle() );
+ aViewWindow->SetZoomingStyle( zoomingStyle() );
aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
}
}
+/*!
+ \return zooming style
+*/
+int SVTK_Viewer::zoomingStyle() const
+{
+ return myZoomingStyle;
+}
+
+/*!
+ Sets zooming style: 0 - standard, 1 - advanced (at cursor)
+ \param theStyle - new zooming style
+*/
+void SVTK_Viewer::setZoomingStyle( const int theStyle )
+{
+ myZoomingStyle = theStyle;
+
+ if (SUIT_ViewManager* aViewManager = getViewManager()) {
+ QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+ for ( uint i = 0; i < aViews.count(); i++ )
+ {
+ if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+ aView->SetZoomingStyle( theStyle );
+ }
+ }
+}
+
/*!
\return incremental speed value
*/
//! Sets interaction style
void setInteractionStyle( const int );
+ //! Gets zooming style
+ int zoomingStyle() const;
+
+ //! Sets zooming style
+ void setZoomingStyle( const int );
+
//! Get incremental speed (see #SVTK_InteractorStyle::ControllerIncrement)
int incrementalSpeed() const;
int myIncrementMode;
int myProjMode;
int myStyle;
+ int myZoomingStyle;
int mySpaceBtn[3];
};
myViewParameterDlg = new SVTK_ViewParameterDlg
( getAction( ViewParametersId ), this, "SVTK_ViewParameterDlg" );
- SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
- myInteractor->PushInteractorStyle(aStyle);
- aStyle->Delete();
+ myDefaultInteractorStyle = SVTK_InteractorStyle::New();
+ myInteractor->PushInteractorStyle(myDefaultInteractorStyle);
+ myDefaultInteractorStyle->Delete();
myRecorder = SVTK_Recorder::New();
onSwitchInteractionStyle( theStyle==1 );
}
+/*!
+ Sets actual zooming style
+ \param theStyle - type of zooming style ( 0 - standard, 1 - advanced (at cursor) )
+*/
+void SVTK_ViewWindow::SetZoomingStyle(const int theStyle)
+{
+ onSwitchZoomingStyle( theStyle==1 );
+}
+
/*!
Switches "keyboard free" interaction style on/off
*/
if ( a->isChecked() != theOn ) a->setChecked( theOn );
}
+/*!
+ Toogles advanced zooming style (relatively to the cursor position) on/off
+*/
+void SVTK_ViewWindow::onSwitchZoomingStyle( bool theOn )
+{
+ if( myDefaultInteractorStyle.GetPointer() )
+ myDefaultInteractorStyle->SetAdvancedZoomingEnabled( theOn );
+ if( myKeyFreeInteractorStyle.GetPointer() )
+ myKeyFreeInteractorStyle->SetAdvancedZoomingEnabled( theOn );
+
+ // update action state if method is called outside
+ QtxAction* a = getAction( SwitchZoomingStyleId );
+ if ( a->isChecked() != theOn )
+ a->setChecked( theOn );
+}
+
/*!
Sets incremental speed
\param theValue - new incremental speed
*/
void SVTK_ViewWindow::onPerspectiveMode()
{
+ bool anIsParallelMode = toolMgr()->action( ParallelModeId )->isChecked();
+
+ // advanced zooming is not available in perspective mode
+ if( QtxAction* anAction = getAction( SwitchZoomingStyleId ) )
+ anAction->setEnabled( anIsParallelMode );
+
vtkCamera* aCamera = getRenderer()->GetActiveCamera();
- aCamera->SetParallelProjection(toolMgr()->action( ParallelModeId )->isChecked());
+ aCamera->SetParallelProjection(anIsParallelMode);
GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
}
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchInteractionStyle(bool)));
mgr->registerAction( anAction, SwitchInteractionStyleId );
+ // Switch between zomming styles
+ anAction = new QtxAction(tr("MNU_SVTK_ZOOMING_STYLE_SWITCH"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ZOOMING_STYLE_SWITCH" ) ),
+ tr( "MNU_SVTK_ZOOMING_STYLE_SWITCH" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SVTK_ZOOMING_STYLE_SWITCH"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchZoomingStyle(bool)));
+ mgr->registerAction( anAction, SwitchZoomingStyleId );
+
// Start recording
myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
mgr->append( DumpId, myToolBar );
mgr->append( SwitchInteractionStyleId, myToolBar );
+ mgr->append( SwitchZoomingStyleId, myToolBar );
mgr->append( ViewTrihedronId, myToolBar );
QtxMultiAction* aScaleAction = new QtxMultiAction( this );
class SVTK_UpdateRateDlg;
class SVTK_CubeAxesDlg;
class SVTK_SetRotationPointDlg;
+class SVTK_InteractorStyle;
class SVTK_KeyFreeInteractorStyle;
class SVTK_ViewParameterDlg;
class SVTK_Recorder;
//! Redirect the request to #SVTK_MainWindow::SetInteractionStyle
virtual void SetInteractionStyle( const int );
+ //! Redirect the request to #SVTK_MainWindow::SetZoomingStyle
+ virtual void SetZoomingStyle( const int );
+
//! Redirect the request to #SVTK_MainWindow::SetSpacemouseButtons
virtual void SetSpacemouseButtons( const int, const int, const int );
void onViewParameters(bool theIsActivate);
void onSwitchInteractionStyle(bool theOn);
+ void onSwitchZoomingStyle(bool theOn);
void onStartRecording();
void onPlayRecording();
FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId,
ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
+ SwitchZoomingStyleId,
StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
SVTK_ViewModelBase* myModel;
SVTK_RenderWindowInteractor* myInteractor;
+ vtkSmartPointer<SVTK_InteractorStyle> myDefaultInteractorStyle;
vtkSmartPointer<SVTK_KeyFreeInteractorStyle> myKeyFreeInteractorStyle;
QString myVisualParams; // used for delayed setting of view parameters
<source>ICON_SVTK_STYLE_SWITCH</source>
<translation>vtk_view_style_switch.png</translation>
</message>
+ <message>
+ <source>ICON_SVTK_ZOOMING_STYLE_SWITCH</source>
+ <translation>vtk_view_zooming_style_switch.png</translation>
+ </message>
<message>
<source>ICON_SVTK_RECORDING_START</source>
<translation>vtk_view_recording_start.png</translation>
<source>MNU_SVTK_STYLE_SWITCH</source>
<translation>Interaction Style Switch</translation>
</message>
+ <message>
+ <source>DSC_SVTK_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zooming style switch</translation>
+ </message>
+ <message>
+ <source>MNU_SVTK_ZOOMING_STYLE_SWITCH</source>
+ <translation>Zomming style switch</translation>
+ </message>
</context>
<context>
<name>SVTK_FontWidget</name>
<parameter name="iso_number_v" value="1" />
<parameter name="trihedron_size" value="100" />
<parameter name="navigation_mode" value="0"/>
+ <parameter name="zooming_mode" value="0" />
</section>
<section name="VTKViewer" >
<!-- VTK viewer preferences -->
<parameter name="group_names_transparency" value="0.5"/>
<parameter name="projection_mode" value="0"/>
<parameter name="navigation_mode" value="0"/>
+ <parameter name="zooming_mode" value="0" />
<parameter name="speed_mode" value="0"/>
<parameter name="speed_value" value="10"/>
<parameter name="show_static_trihedron" value="true" />