#include <QLineEdit>
#include <QMouseEvent>
-HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
+HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool isSplitter, bool dispTrihedron )
+: HYDROGUI_InputPanel( theModule, theTitle, true, isSplitter )
{
- QWidget* viewMain = new QWidget( mainFrame() );
- QVBoxLayout* viewBase = new QVBoxLayout( viewMain );
- viewBase->setMargin( 0 );
-
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- myViewManager = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
- OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( true );
+#ifndef TEST_MODE
+ SUIT_Study* aStudy = theModule ? theModule->application()->activeStudy() : 0;
+#else
+ SUIT_Study* aStudy = 0;
+#endif
+ myViewManager = new OCCViewer_ViewManager( aStudy, 0 );
+ bool IsChainedPan = aResMgr->booleanValue( "HYDRO", "chained_panning" );
+ myViewManager->setChainedOperations(IsChainedPan);
+ OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( dispTrihedron );
aViewer->setBackground( OCCViewer_ViewFrame::TOP_LEFT,
aResMgr->backgroundValue( "OCCViewer", "xz_background", aViewer->background(OCCViewer_ViewFrame::TOP_LEFT) ) );
myViewManager->setViewModel( aViewer );// custom view model, which extends SALOME_View interface
- aViewer->enableMultiselection( false );
+ //aViewer->enableMultiselection( false );
SUIT_ViewWindow* aViewWin = myViewManager->createViewWindow();
aViewer->setStaticTrihedronDisplayed( false );
anAISContext->Deactivate( aTrihedron );
}
*/
- viewBase->addWidget( aViewWin );
+ addWidget( aViewWin, 1 );
// Coordinates
connect( myViewManager, SIGNAL( mouseMove( SUIT_ViewWindow*, QMouseEvent* ) ),
aViewFrame->getViewPort()->installEventFilter( this );
}
- myCoordLabel = new QLabel( viewMain );
- viewBase->addWidget( myCoordLabel );
+ myCoordLabel = new QLabel( mainFrame() );
+ addWidget( myCoordLabel, 0 );
}
HYDROGUI_ViewerDlg::~HYDROGUI_ViewerDlg()
{
if ( e->type() == QEvent::Polish )
{
- addWidget( myCoordLabel->parentWidget(), 4 );
+ //addWidget( myCoordLabel->parentWidget(), 4 );
Handle(AIS_Trihedron) aTrihedron = trihedron();
Handle(AIS_InteractiveContext) anAISContext = getAISContext();
if ( !anAISContext.IsNull() && !aTrihedron.IsNull() )
{
viewer()->setTrihedronShown( false );
- anAISContext->Display( aTrihedron );
+ anAISContext->Display( aTrihedron, true );
anAISContext->Deactivate( aTrihedron );
}
}
SUIT_SelectionMgr* HYDROGUI_ViewerDlg::selectionMgr() const
{
+#ifdef TEST_MODE
+ static SUIT_SelectionMgr* mgr = new SUIT_SelectionMgr();
+ return mgr;
+#else
SUIT_SelectionMgr* aSelMgr = 0;
if ( module() )
{
aSelMgr = app->selectionMgr();
}
return aSelMgr;
+#endif
}
void HYDROGUI_ViewerDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEvent* theEvent )