X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ViewerDlg.cxx;h=43a017d36e66e0b8ae1724a36ea9dff5480d3903;hb=a53349567d67f4df0ef737798a25c24d9dc8f08e;hp=e2ca565f2da7ce901772232303c9733f336748c8;hpb=065b0e007bb1d8d2b4962cfea24d3d476522e028;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx b/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx index e2ca565f..43a017d3 100644 --- a/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ViewerDlg.cxx @@ -1,12 +1,8 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -34,7 +30,9 @@ #include #include #include + #include +#include #include #include @@ -54,7 +52,7 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); myViewManager = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 ); - OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( false ); + OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( true ); aViewer->setBackground( OCCViewer_ViewFrame::TOP_LEFT, aResMgr->backgroundValue( "OCCViewer", "xz_background", aViewer->background(OCCViewer_ViewFrame::TOP_LEFT) ) ); @@ -74,8 +72,11 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin myViewManager->setViewModel( aViewer );// custom view model, which extends SALOME_View interface + aViewer->enableMultiselection( false ); + SUIT_ViewWindow* aViewWin = myViewManager->createViewWindow(); aViewer->setStaticTrihedronDisplayed( false ); + /* Handle(AIS_Trihedron) aTrihedron = HYDROGUI_AISTrihedron::createTrihedron( aResMgr->doubleValue( "3DViewer", "trihedron_size", aViewer->trihedronSize() ) ); Handle(AIS_InteractiveContext) anAISContext = aViewer->getAISContext(); @@ -84,7 +85,7 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin anAISContext->Display( aTrihedron ); anAISContext->Deactivate( aTrihedron ); } - + */ viewBase->addWidget( aViewWin ); // Coordinates @@ -104,14 +105,26 @@ HYDROGUI_ViewerDlg::HYDROGUI_ViewerDlg( HYDROGUI_Module* theModule, const QStrin HYDROGUI_ViewerDlg::~HYDROGUI_ViewerDlg() { + myViewManager->closeAllViews(); delete myViewManager; } bool HYDROGUI_ViewerDlg::event( QEvent* e ) { if ( e->type() == QEvent::Polish ) + { 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->Deactivate( aTrihedron ); + } + } + return HYDROGUI_InputPanel::event( e ); } @@ -131,6 +144,18 @@ OCCViewer_ViewManager* HYDROGUI_ViewerDlg::viewManager() const return myViewManager; } +SUIT_SelectionMgr* HYDROGUI_ViewerDlg::selectionMgr() const +{ + SUIT_SelectionMgr* aSelMgr = 0; + if ( module() ) + { + LightApp_Application* app = module()->getApp(); + if ( app ) + aSelMgr = app->selectionMgr(); + } + return aSelMgr; +} + void HYDROGUI_ViewerDlg::onMouseMove( SUIT_ViewWindow* theViewWindow, QMouseEvent* theEvent ) { OCCViewer_ViewWindow* anOCCViewWindow = @@ -158,3 +183,8 @@ bool HYDROGUI_ViewerDlg::eventFilter( QObject* theObj, QEvent* theEvent ) return HYDROGUI_InputPanel::eventFilter( theObj, theEvent ); } + +Handle(AIS_Trihedron) HYDROGUI_ViewerDlg::trihedron() +{ + return Handle(AIS_Trihedron)(); +}