//createMenu( GAUSS_CREATE_PRS, aMenuId, 10 );
SUIT_Accel* accel = getApp()->accel();
- accel->setActionKey( SUIT_Accel::PanLeft, Key_Left, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::PanRight, Key_Right, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::PanUp, Key_Up, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::PanDown, Key_Down, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::ZoomIn, Key_PageUp, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::ZoomOut, Key_PageDown, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::RotateLeft, CTRL+Key_Left, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::RotateRight, CTRL+Key_Right, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::RotateUp, CTRL+Key_Up, VVTK_Viewer::Type() );
- accel->setActionKey( SUIT_Accel::RotateDown, CTRL+Key_Down, VVTK_Viewer::Type() );
- accel->setActionKey( PlusSpeedIncrementEvent, Key_Plus, VVTK_Viewer::Type() );
- accel->setActionKey( MinusSpeedIncrementEvent,Key_Minus, VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::PanLeft,Key_Left,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::PanRight,Key_Right,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::PanUp,Key_Up,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::PanDown,Key_Down,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::ZoomIn,Key_PageUp,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::ZoomOut,Key_PageDown,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::RotateLeft,CTRL+Key_Left,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::RotateRight,CTRL+Key_Right,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::RotateUp,CTRL+Key_Up,VVTK_Viewer::Type() );
+ accel->setActionKey( SUIT_Accel::RotateDown,CTRL+Key_Down,VVTK_Viewer::Type() );
+ accel->setActionKey( SVTK::PlusSpeedIncrementEvent,Key_Plus,VVTK_Viewer::Type() );
+ accel->setActionKey( SVTK::MinusSpeedIncrementEvent,Key_Minus,VVTK_Viewer::Type() );
connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
VisuGUI_Module
::OnCreateGaussPoints()
{
- CreatePrs3d<VISU::GaussPoints_i,SVTK_Viewer,VisuGUI_GaussPointsDlg,1>(this);
+ CreatePrs3d<VISU::GaussPoints_i,VVTK_Viewer,VisuGUI_GaussPointsDlg,1>(this);
}
void
int val;
if ( pref == "speed_increment" ) {
val = resMgr->integerValue( "VISU", pref, 10 );
- view->FireEvent( SetSpeedIncrementEvent, &val );
+ view->InvokeEvent( SVTK::SetSpeedIncrementEvent, &val );
}
else if ( pref == "spacemouse_func1_btn" ) {
val = resMgr->integerValue( "VISU", pref, 1 );
- view->FireEvent( SetSpaceMouseF1Event, &val );
+ view->InvokeEvent( SVTK::SetSpaceMouseF1Event, &val );
}
else if ( pref == "spacemouse_func2_btn" ) {
val = resMgr->integerValue( "VISU", pref, 2 );
- view->FireEvent( SetSpaceMouseF2Event, &val );
+ view->InvokeEvent( SVTK::SetSpaceMouseF2Event, &val );
}
else if ( pref == "spacemouse_func3_btn" ) {
val = resMgr->integerValue( "VISU", pref, 10 );
- view->FireEvent( SetSpaceMouseF3Event, &val );
+ view->InvokeEvent( SVTK::SetSpaceMouseF3Event, &val );
}
else if ( pref == "spacemouse_func4_btn" ) {
val = resMgr->integerValue( "VISU", pref, 11 );
- view->FireEvent( SetSpaceMouseF4Event, &val );
+ view->InvokeEvent( SVTK::SetSpaceMouseF4Event, &val );
}
else if ( pref == "spacemouse_func5_btn" ) {
val = resMgr->integerValue( "VISU", pref, 9 );
- view->FireEvent( SetSpaceMouseF5Event, &val );
+ view->InvokeEvent( SVTK::SetSpaceMouseF5Event, &val );
}
}
#include "QtxAction.h"
#include <qtoolbar.h>
+#include <qsplitter.h>
+#include <qlayout.h>
+//----------------------------------------------------------------------------
+VVTK_ViewWindow
+::VVTK_ViewWindow(SUIT_Desktop* theDesktop):
+ SVTK_ViewWindow(theDesktop)
+{
+}
//----------------------------------------------------------------------------
+void
VVTK_ViewWindow
-::VVTK_ViewWindow( SUIT_Desktop* theDesktop,
- VVTK_Viewer* theModel )
- : SVTK_ViewWindow( theDesktop, theModel )
+::Initialize(SVTK_ViewModelBase* theModel)
{
- // important! : the default interactor style which is pushed is VVTK
- // see onSwitchIS() for details
- getView()->pushInteractorStyle( VVTK_InteractorStyle::New() );
-
- connect(this,SIGNAL(selectionChanged()),theModel,SLOT(onSelectionChanged()));
-
- // create another toolbar
- myToolBar = new QToolBar(this);
- myToolBar->setCloseMode(QDockWindow::Undocked);
- myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
-
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- // SVTK / VVTK switcher action
- QtxAction* aAction = new QtxAction(tr("MNU_VVTK_SWITCH"), aResMgr->loadPixmap( "VISU", tr( "ICON_VVTK_SWITCH" ) ),
- tr( "MNU_VVTK_SWITCH" ), 0, this, "vvtk/svtk", true);
- aAction->setToggleAction(true); // pressed by default
- aAction->toggle();
- aAction->setStatusTip(tr("DSC_VVTK_SWITCH"));
- connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchIS(bool)));
- aAction->addTo( myToolBar );
+ if(SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr()){
+ QWidget* aWidget = new QWidget(this);
+ setCentralWidget(aWidget);
+
+ QBoxLayout* aLayout = new QVBoxLayout(aWidget);
+ aLayout->setAutoAdd(true);
+ QSplitter* aSplitter = new QSplitter(Qt::Vertical,aWidget);
+
+ // Create SVTK_View (successor of RenderWindowInteractor).
+ myView = new SVTK_View(aSplitter,"SVTK_View",aResourceMgr);
+
+ // important! : the default interactor style which is pushed is VVTK
+ // see onSwitchIS() for details
+ myView->PushInteractorStyle(VVTK_InteractorStyle::New());
+
+ // create another toolbar
+ myToolBar = new QToolBar(myView);
+ myToolBar->setCloseMode(QDockWindow::Undocked);
+ myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+
+ // SVTK / VVTK switcher action
+ QtxAction* aAction = new QtxAction(tr("MNU_VVTK_SWITCH"),
+ aResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_SWITCH" ) ),
+ tr( "MNU_VVTK_SWITCH" ), 0, this, "vvtk/svtk", true);
+ aAction->setToggleAction(true); // pressed by default
+ aAction->toggle();
+ aAction->setStatusTip(tr("DSC_VVTK_SWITCH"));
+ connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchIS(bool)));
+ aAction->addTo( myToolBar );
+
+ SVTK_ViewWindow::Initialize(myView,theModel);
+ }
}
//----------------------------------------------------------------------------
// if SVTK is a current one - pop it (remove from stack), below it there MUST BE
// (logically) a VVTK interactor style.
if ( isVVTK )
- getView()->popInteractorStyle();
+ getView()->PopInteractorStyle();
else
- getView()->pushInteractorStyle( SVTK_InteractorStyle::New() );
+ getView()->PushInteractorStyle( SVTK_InteractorStyle::New() );
}