#include <OCCViewer_Utilities.h>
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewFrame.h>
+
#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
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) ) );
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();
anAISContext->Display( aTrihedron );
anAISContext->Deactivate( aTrihedron );
}
-
+ */
viewBase->addWidget( aViewWin );
// Coordinates
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 );
}
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 =
return HYDROGUI_InputPanel::eventFilter( theObj, theEvent );
}
+
+Handle(AIS_Trihedron) HYDROGUI_ViewerDlg::trihedron()
+{
+ return Handle(AIS_Trihedron)();
+}