resources/occ_view_style_switch.png \
resources/occ_view_zooming_style_switch.png \
resources/occ_view_maximized.png \
- resources/occ_view_minimized.png
+ resources/occ_view_minimized.png \
+ resources/occ_view_sync.png
nodist_salomeres_DATA = \
OCCViewer_images.qm \
#include <SUIT_Tools.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_MessageBox.h>
+#include <SUIT_Application.h>
#include <QtxActionToolMgr.h>
#include <QtxMultiAction.h>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QApplication>
+#include <QMenu>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
myCubeAxesDlg->initialize();
}
+OCCViewer_ViewWindow* OCCViewer_ViewWindow::getView( const int mode ) const
+{
+ return mode == get2dMode() ? const_cast<OCCViewer_ViewWindow*>( this ) : 0;
+}
+
/*!
\brief Detect viewer operation according the the mouse button pressed
and key modifiers used.
aAction->setStatusTip(tr("DSC_MINIMIZE_VIEW"));
connect(aAction, SIGNAL(triggered()), this, SLOT(onMaximizedView()));
toolMgr()->registerAction( aAction, MaximizedId );
+
+ // Synchronize view
+ aAction = new QtxAction(tr("MNU_SYNCHRONIZE_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_SYNC" ) ),
+ tr( "MNU_SYNCHRONIZE_VIEW" ), 0, this );
+ aAction->setStatusTip(tr("DSC_SYNCHRONIZE_VIEW"));
+ aAction->setMenu( new QMenu( this ) );
+ connect(aAction->menu(), SIGNAL(aboutToShow()), this, SLOT(updateSyncViews()));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(onSynchronizeView()));
+ toolMgr()->registerAction( aAction, SynchronizeId );
}
/*!
#endif
toolMgr()->append( AmbientId, tid );
- toolMgr()->append( MaximizedId, tid);
+ toolMgr()->append( MaximizedId, tid );
+ toolMgr()->append( SynchronizeId, tid );
}
/*!
\brief Restore view parameters.
\param anItem view parameters
*/
-void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem )
+void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool baseParamsOnly )
{
Handle(V3d_View) aView3d = myViewPort->getView();
aView3d->SetEye( anItem.eyeX, anItem.eyeY, anItem.eyeZ );
aView3d->SetProj( anItem.projX, anItem.projY, anItem.projZ );
aView3d->SetAxialScale( anItem.scaleX, anItem.scaleY, anItem.scaleZ );
- myModel->setTrihedronShown( anItem.isVisible );
- myModel->setTrihedronSize( anItem.size );
+
+ if ( !baseParamsOnly ) {
+
+ myModel->setTrihedronShown( anItem.isVisible );
+ myModel->setTrihedronSize( anItem.size );
#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
- // graduated trihedron
- bool anIsVisible = anItem.gtIsVisible;
- OCCViewer_AxisWidget::AxisData anAxisData[3];
- anAxisData[0].DrawName = anItem.gtDrawNameX;
- anAxisData[1].DrawName = anItem.gtDrawNameZ;
- anAxisData[2].DrawName = anItem.gtDrawNameZ;
- anAxisData[0].Name = anItem.gtNameX;
- anAxisData[1].Name = anItem.gtNameZ;
- anAxisData[2].Name = anItem.gtNameZ;
- anAxisData[0].NameColor = QColor( anItem.gtNameColorRX,
- anItem.gtNameColorGX,
- anItem.gtNameColorBX );
- anAxisData[1].NameColor = QColor( anItem.gtNameColorRY,
- anItem.gtNameColorGY,
- anItem.gtNameColorBY );
- anAxisData[2].NameColor = QColor( anItem.gtNameColorRZ,
- anItem.gtNameColorGZ,
- anItem.gtNameColorBZ );
- anAxisData[0].DrawValues = anItem.gtDrawValuesX;
- anAxisData[1].DrawValues = anItem.gtDrawValuesY;
- anAxisData[2].DrawValues = anItem.gtDrawValuesZ;
- anAxisData[0].NbValues = anItem.gtNbValuesX;
- anAxisData[1].NbValues = anItem.gtNbValuesY;
- anAxisData[2].NbValues = anItem.gtNbValuesZ;
- anAxisData[0].Offset = anItem.gtOffsetX;
- anAxisData[1].Offset = anItem.gtOffsetY;
- anAxisData[2].Offset = anItem.gtOffsetZ;
- anAxisData[0].Color = QColor( anItem.gtColorRX,
- anItem.gtColorGX,
- anItem.gtColorBX );
- anAxisData[1].Color = QColor( anItem.gtColorRY,
- anItem.gtColorGY,
- anItem.gtColorBY );
- anAxisData[2].Color = QColor( anItem.gtColorRZ,
- anItem.gtColorGZ,
- anItem.gtColorBZ );
- anAxisData[0].DrawTickmarks = anItem.gtDrawTickmarksX;
- anAxisData[1].DrawTickmarks = anItem.gtDrawTickmarksY;
- anAxisData[2].DrawTickmarks = anItem.gtDrawTickmarksZ;
- anAxisData[0].TickmarkLength = anItem.gtTickmarkLengthX;
- anAxisData[1].TickmarkLength = anItem.gtTickmarkLengthY;
- anAxisData[2].TickmarkLength = anItem.gtTickmarkLengthZ;
-
- myCubeAxesDlg->SetData( anIsVisible, anAxisData );
- myCubeAxesDlg->ApplyData( aView3d );
+ // graduated trihedron
+ bool anIsVisible = anItem.gtIsVisible;
+ OCCViewer_AxisWidget::AxisData anAxisData[3];
+ anAxisData[0].DrawName = anItem.gtDrawNameX;
+ anAxisData[1].DrawName = anItem.gtDrawNameZ;
+ anAxisData[2].DrawName = anItem.gtDrawNameZ;
+ anAxisData[0].Name = anItem.gtNameX;
+ anAxisData[1].Name = anItem.gtNameZ;
+ anAxisData[2].Name = anItem.gtNameZ;
+ anAxisData[0].NameColor = QColor( anItem.gtNameColorRX,
+ anItem.gtNameColorGX,
+ anItem.gtNameColorBX );
+ anAxisData[1].NameColor = QColor( anItem.gtNameColorRY,
+ anItem.gtNameColorGY,
+ anItem.gtNameColorBY );
+ anAxisData[2].NameColor = QColor( anItem.gtNameColorRZ,
+ anItem.gtNameColorGZ,
+ anItem.gtNameColorBZ );
+ anAxisData[0].DrawValues = anItem.gtDrawValuesX;
+ anAxisData[1].DrawValues = anItem.gtDrawValuesY;
+ anAxisData[2].DrawValues = anItem.gtDrawValuesZ;
+ anAxisData[0].NbValues = anItem.gtNbValuesX;
+ anAxisData[1].NbValues = anItem.gtNbValuesY;
+ anAxisData[2].NbValues = anItem.gtNbValuesZ;
+ anAxisData[0].Offset = anItem.gtOffsetX;
+ anAxisData[1].Offset = anItem.gtOffsetY;
+ anAxisData[2].Offset = anItem.gtOffsetZ;
+ anAxisData[0].Color = QColor( anItem.gtColorRX,
+ anItem.gtColorGX,
+ anItem.gtColorBX );
+ anAxisData[1].Color = QColor( anItem.gtColorRY,
+ anItem.gtColorGY,
+ anItem.gtColorBY );
+ anAxisData[2].Color = QColor( anItem.gtColorRZ,
+ anItem.gtColorGZ,
+ anItem.gtColorBZ );
+ anAxisData[0].DrawTickmarks = anItem.gtDrawTickmarksX;
+ anAxisData[1].DrawTickmarks = anItem.gtDrawTickmarksY;
+ anAxisData[2].DrawTickmarks = anItem.gtDrawTickmarksZ;
+ anAxisData[0].TickmarkLength = anItem.gtTickmarkLengthX;
+ anAxisData[1].TickmarkLength = anItem.gtTickmarkLengthY;
+ anAxisData[2].TickmarkLength = anItem.gtTickmarkLengthZ;
+
+ myCubeAxesDlg->SetData( anIsVisible, anAxisData );
+ myCubeAxesDlg->ApplyData( aView3d );
#endif
+ } // if ( !baseParamsOnly )
+
myRestoreFlag = 0;
}
{
myViewAspects = aViewList;
}
+
+/*!
+ "Synchronize View" action slot.
+*/
+void OCCViewer_ViewWindow::onSynchronizeView()
+{
+ QAction* a = qobject_cast<QAction*>( sender() );
+ if ( a ) {
+ int id = a->data().toInt();
+ if ( id != 0 ) {
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( !app ) return;
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( getViewManager()->getType(), wmlist );
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist ) {
+ OCCViewer_ViewWindow* occVW = dynamic_cast<OCCViewer_ViewWindow*>( vw );
+ if ( !occVW ) continue;
+ // list only compatible types
+ OCCViewer_ViewWindow* subWindow = occVW->getView( get2dMode() );
+ if ( subWindow && subWindow->getId() == id && subWindow != this ) {
+ // perform synchronization
+ performRestoring( subWindow->getViewParams(), true );
+ }
+ }
+ }
+
+ if ( a != toolMgr()->action( SynchronizeId ) )
+ toolMgr()->action( SynchronizeId )->setData( id );
+ }
+ }
+}
+
+/*!
+ Update list of available view for the "Synchronize View" action
+*/
+void OCCViewer_ViewWindow::updateSyncViews()
+{
+ QAction* anAction = toolMgr()->action( SynchronizeId );
+ if ( anAction && anAction->menu() ) {
+ anAction->menu()->clear();
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( app ) {
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( getViewManager()->getType(), wmlist );
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist ) {
+ OCCViewer_ViewWindow* occVW = dynamic_cast<OCCViewer_ViewWindow*>( vw );
+ if ( !occVW || occVW == this ) continue;
+ // list only compatible types
+ OCCViewer_ViewWindow* subWindow = occVW->getView( get2dMode() );
+ if ( subWindow && subWindow != this ) {
+ QAction* a = anAction->menu()->addAction( occVW->windowTitle() );
+ a->setData( subWindow->getId() );
+ connect( a, SIGNAL( triggered() ), this, SLOT( onSynchronizeView() ) );
+ }
+ }
+ }
+ }
+ if ( anAction->menu()->actions().isEmpty() ) {
+ anAction->menu()->addAction( tr( "MNU_SYNC_NO_VIEW" ) );
+ }
+ }
+}
FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId,
ResetId, CloneId, ClippingId, MemId, RestoreId,
TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId,
- SwitchInteractionStyleId, SwitchZoomingStyleId, MaximizedId, UserId };
+ SwitchInteractionStyleId, SwitchZoomingStyleId, MaximizedId, SynchronizeId, UserId };
enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE,
PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
OCCViewer_ViewWindow(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel);
virtual ~OCCViewer_ViewWindow();
+ virtual OCCViewer_ViewWindow* getView( const int ) const;
+
virtual OCCViewer_ViewPort3d* getViewPort();
virtual bool eventFilter(QObject* watched, QEvent* e);
- virtual void performRestoring( const viewAspect& );
+ virtual void performRestoring( const viewAspect&, bool = false );
virtual void initLayout();
virtual void onMaximizedView();
+ virtual void onSynchronizeView();
+ virtual void updateSyncViews();
+
signals:
void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
void vpTransformationFinished(OCCViewer_ViewWindow::OperationType type);
<source>ICON_OCCVIEWER_MINIMIZE</source>
<translation>occ_view_minimized.png</translation>
</message>
+ <message>
+ <source>ICON_OCCVIEWER_SYNC</source>
+ <translation>occ_view_sync.png</translation>
+ </message>
</context>
</TS>
<source>DSC_MINIMIZE_VIEW</source>
<translation>Minimize view</translation>
</message>
+ <message>
+ <source>DSC_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize view</translation>
+ </message>
<message>
<source>MNU_MAXIMIZE_VIEW</source>
<translation>Maximize</translation>
<source>MNU_MINIMIZE_VIEW</source>
<translation>Minimize</translation>
</message>
+ <message>
+ <source>MNU_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize</translation>
+ </message>
+ <message>
+ <source>MNU_SYNC_NO_VIEW</source>
+ <translation>[ No appropriate view ]</translation>
+ </message>
</context>
<context>
<name>OCCViewer_CreateRestoreViewDlg</name>
SUIT_ShortcutMgr* shortcutMgr() const;
//! Puts the message to the status bar
- void putInfo ( const QString&, const int = 0 );
+ void putInfo ( const QString&, const int = 0 );
//! Invokes application-specific "Open/Save File" dialog and returns the selected file name.
- virtual QString getFileName( bool open, const QString& initial, const QString& filters,
- const QString& caption, QWidget* parent ) = 0;
+ virtual QString getFileName( bool open, const QString& initial, const QString& filters,
+ const QString& caption, QWidget* parent ) = 0;
//! Invokes application-specific "Select Directory" dialog and returns the selected directory name.
- virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0;
+ virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0;
- virtual int viewManagerId ( const SUIT_ViewManager* ) const = 0;
+ virtual int viewManagerId ( const SUIT_ViewManager* ) const = 0;
+ virtual void viewManagers( const QString&, QList<SUIT_ViewManager*>& ) const = 0;
signals:
void applicationClosed( SUIT_Application* );
resources/vtk_view_recording_start.png \
resources/vtk_view_recording_play.png \
resources/vtk_view_recording_pause.png \
- resources/vtk_view_recording_stop.png
+ resources/vtk_view_recording_stop.png \
+ resources/vtk_view_sync.png
nodist_salomeres_DATA = \
SVTK_msg_en.qm \
#include "SALOME_Actor.h"
+#include <QMenu>
#include <QToolBar>
#include <QEvent>
#include <QXmlStreamWriter>
#include "SUIT_ResourceMgr.h"
#include "SUIT_Accel.h"
#include "SUIT_OverrideCursor.h"
+#include "SUIT_ViewManager.h"
#include "QtxActionToolMgr.h"
#include "QtxMultiAction.h"
/*!
The method restores visual parameters of this view from a formated string
*/
-void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
+void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters, bool baseParamsOnly )
{
double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
scale[1] = aAttr.value("Y").toString().toDouble();
scale[2] = aAttr.value("Z").toString().toDouble();
//printf("#### ViewScale %f; %f; %f\n", scale[0], scale[1], scale[2]);
- } else if (aReader.name() == "DisplayCubeAxis") {
- if (aAttr.value("Show") == "0")
- gradAxesActor->VisibilityOff();
- else
- gradAxesActor->VisibilityOn();
- } else if (aReader.name() == "GraduatedAxis") {
- if(aAttr.value("Axis") == "X")
- setGradAxisVisualParams(aReader, gradAxesActor->GetXAxisActor2D());
- else if(aAttr.value("Axis") == "Y")
- setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
- else if(aAttr.value("Axis") == "Z")
- setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
- } else if (aReader.name() == "Trihedron") {
- if (aAttr.value("isShown") == "0")
- GetTrihedron()->VisibilityOff();
- else
- GetTrihedron()->VisibilityOn();
- SetTrihedronSize(aAttr.value("Size").toString().toDouble());
+ }
+ else if (aReader.name() == "DisplayCubeAxis") {
+ if ( !baseParamsOnly ) {
+ if (aAttr.value("Show") == "0")
+ gradAxesActor->VisibilityOff();
+ else
+ gradAxesActor->VisibilityOn();
+ }
+ }
+ else if (aReader.name() == "GraduatedAxis") {
+ if ( !baseParamsOnly ) {
+ if(aAttr.value("Axis") == "X")
+ setGradAxisVisualParams(aReader, gradAxesActor->GetXAxisActor2D());
+ else if(aAttr.value("Axis") == "Y")
+ setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
+ else if(aAttr.value("Axis") == "Z")
+ setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
+ }
+ }
+ else if (aReader.name() == "Trihedron") {
+ if ( !baseParamsOnly ) {
+ if (aAttr.value("isShown") == "0")
+ GetTrihedron()->VisibilityOff();
+ else
+ GetTrihedron()->VisibilityOn();
+ SetTrihedronSize(aAttr.value("Size").toString().toDouble());
+ }
}
}
}
camera->SetViewUp( viewUp );
camera->SetParallelScale( parScale );
SetScale( scale );
- } else {
+ }
+ else {
QStringList paramsLst = parameters.split( '*' );
if ( paramsLst.size() >= nNormalParams ) {
// 'reading' list of parameters
SetScale( scale );
// apply graduated axes parameters
- SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
- if ( gradAxesActor && paramsLst.size() == nAllParams ) {
- int i = nNormalParams+1, j = i + nGradAxisParams - 1;
- ::setGradAxisVisualParams( gradAxesActor->GetXAxisActor2D(), parameters.section( '*', i, j ) );
- i = j + 1; j += nGradAxisParams;
- ::setGradAxisVisualParams( gradAxesActor->GetYAxisActor2D(), parameters.section( '*', i, j ) );
- i = j + 1; j += nGradAxisParams;
- ::setGradAxisVisualParams( gradAxesActor->GetZAxisActor2D(), parameters.section( '*', i, j ) );
+ if ( !baseParamsOnly ) {
+ SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
+ if ( gradAxesActor && paramsLst.size() == nAllParams ) {
+ int i = nNormalParams+1, j = i + nGradAxisParams - 1;
+ ::setGradAxisVisualParams( gradAxesActor->GetXAxisActor2D(), parameters.section( '*', i, j ) );
+ i = j + 1; j += nGradAxisParams;
+ ::setGradAxisVisualParams( gradAxesActor->GetYAxisActor2D(), parameters.section( '*', i, j ) );
+ i = j + 1; j += nGradAxisParams;
+ ::setGradAxisVisualParams( gradAxesActor->GetZAxisActor2D(), parameters.section( '*', i, j ) );
- if ( paramsLst[13].toUShort() )
- gradAxesActor->VisibilityOn();
- else
- gradAxesActor->VisibilityOff();
- } else if ( paramsLst.size() == nAllParams ) {
- if ( paramsLst[90].toUShort() )
- GetTrihedron()->VisibilityOn();
- else
- GetTrihedron()->VisibilityOff();
+ if ( paramsLst[13].toUShort() )
+ gradAxesActor->VisibilityOn();
+ else
+ gradAxesActor->VisibilityOff();
+ }
+ else if ( paramsLst.size() == nAllParams ) {
+ if ( paramsLst[90].toUShort() )
+ GetTrihedron()->VisibilityOn();
+ else
+ GetTrihedron()->VisibilityOff();
- SetTrihedronSize(paramsLst[91].toDouble());
+ SetTrihedronSize(paramsLst[91].toDouble());
+ }
}
}
}
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewParameters(bool)));
mgr->registerAction( anAction, ViewParametersId );
+ // Synchronize View
+ anAction = new QtxAction(tr("MNU_SYNCHRONIZE_VIEW"),
+ theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SYNCHRONIZE" ) ),
+ tr( "MNU_SYNCHRONIZE_VIEW" ), 0, this);
+ anAction->setStatusTip(tr("DSC_SYNCHRONIZE_VIEW"));
+ anAction->setMenu( new QMenu( this ) );
+ connect(anAction->menu(), SIGNAL(aboutToShow()), this, SLOT(updateSyncViews()));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onSynchronizeView()));
+ mgr->registerAction( anAction, SynchronizeId );
+
// Switch between interaction styles
anAction = new QtxAction(tr("MNU_SVTK_STYLE_SWITCH"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
mgr->append( GraduatedAxes, myToolBar );
mgr->append( ViewParametersId, myToolBar );
+ mgr->append( SynchronizeId, myToolBar );
+
mgr->append( toolMgr()->separator(), myToolBar );
+
mgr->append( ParallelModeId, myToolBar );
mgr->append( ProjectionModeId, myToolBar );
emit Hide( theEvent );
}
+/*!
+ "Synchronize View" action slot.
+*/
+void SVTK_ViewWindow::onSynchronizeView()
+{
+ QAction* a = qobject_cast<QAction*>( sender() );
+ if ( a ) {
+ int id = a->data().toInt();
+ if ( id != 0 ) {
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( !app ) return;
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( getViewManager()->getType(), wmlist );
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist ) {
+ SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( vw );
+ if ( vtkVW && vtkVW->getId() == id && vtkVW != this ) {
+ // perform synchronization
+ doSetVisualParameters( vtkVW->getVisualParameters(), true );
+ }
+ }
+ }
+
+ if ( a != toolMgr()->action( SynchronizeId ) )
+ toolMgr()->action( SynchronizeId )->setData( id );
+ }
+ }
+}
+
+/*!
+ Update list of available view for the "Synchronize View" action
+*/
+void SVTK_ViewWindow::updateSyncViews()
+{
+ QAction* anAction = toolMgr()->action( SynchronizeId );
+ if ( anAction && anAction->menu() ) {
+ anAction->menu()->clear();
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if ( app ) {
+ QList<SUIT_ViewManager*> wmlist;
+ app->viewManagers( getViewManager()->getType(), wmlist );
+ foreach( SUIT_ViewManager* wm, wmlist ) {
+ QVector<SUIT_ViewWindow*> vwlist = wm->getViews();
+ foreach ( SUIT_ViewWindow* vw, vwlist ) {
+ SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( vw );
+ if ( !vtkVW || vtkVW == this ) continue;
+ QAction* a = anAction->menu()->addAction( vtkVW->windowTitle() );
+ a->setData( vtkVW->getId() );
+ connect( a, SIGNAL( triggered() ), this, SLOT( onSynchronizeView() ) );
+ }
+ }
+ }
+ if ( anAction->menu()->actions().isEmpty() ) {
+ anAction->menu()->addAction( tr( "MNU_SYNC_NO_VIEW" ) );
+ }
+ }
+}
void onPauseRecording();
void onStopRecording();
+ void onSynchronizeView();
+ void updateSyncViews();
+
signals:
void selectionChanged();
void actorAdded(VTKViewer_Actor*);
virtual void Initialize(SVTK_View* theView,
SVTK_ViewModelBase* theModel);
- void doSetVisualParameters( const QString& );
+ void doSetVisualParameters( const QString&, bool = false );
void SetEventDispatcher(vtkObject* theDispatcher);
QImage dumpViewContent();
ChangeRotationPointId, RotationId,
FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, ResetId,
ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
- ParallelModeId, ProjectionModeId, ViewParametersId, SwitchInteractionStyleId,
+ ParallelModeId, ProjectionModeId, ViewParametersId, SynchronizeId, SwitchInteractionStyleId,
SwitchZoomingStyleId,
StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
<source>ICON_SVTK_RECORDING_STOP</source>
<translation>vtk_view_recording_stop.png</translation>
</message>
+ <message>
+ <source>ICON_SVTK_SYNCHRONIZE</source>
+ <translation>vtk_view_sync.png</translation>
+ </message>
</context>
</TS>
<source>DSC_VIEWPARAMETERS_VIEW</source>
<translation>Change the parameters of the view</translation>
</message>
+ <message>
+ <source>MNU_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize</translation>
+ </message>
+ <message>
+ <source>DSC_SYNCHRONIZE_VIEW</source>
+ <translation>Synchronize view</translation>
+ </message>
+ <message>
+ <source>MNU_SYNC_NO_VIEW</source>
+ <translation>[ No appropriate view ]</translation>
+ </message>
<message>
<source>MNU_SVTK_PARALLEL_MODE</source>
<translation>Orthogonal Mode</translation>