anAddElementLayout->setMargin( 0 );
anAddElementLayout->setSpacing( 5 );
-
- OCCViewer_ViewManager* aViewMgr = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
- myViewer = new OCCViewer_Viewer( true );
+ myViewManager = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
+ OCCViewer_Viewer* aViewer = new OCCViewer_Viewer( true );
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- myViewer->setBackground( OCCViewer_ViewFrame::TOP_LEFT,
- aResMgr->backgroundValue( "OCCViewer", "xz_background", myViewer->background(OCCViewer_ViewFrame::TOP_LEFT) ) );
- myViewer->setBackground( OCCViewer_ViewFrame::TOP_RIGHT,
- aResMgr->backgroundValue( "OCCViewer", "yz_background", myViewer->background(OCCViewer_ViewFrame::TOP_RIGHT) ) );
- myViewer->setBackground( OCCViewer_ViewFrame::BOTTOM_LEFT,
- aResMgr->backgroundValue( "OCCViewer", "xy_background", myViewer->background(OCCViewer_ViewFrame::BOTTOM_LEFT) ) );
- myViewer->setBackground( OCCViewer_ViewFrame::BOTTOM_RIGHT,
- aResMgr->backgroundValue( "OCCViewer", "background", myViewer->background(OCCViewer_ViewFrame::MAIN_VIEW) ) );
-
- myViewer->setTrihedronSize( aResMgr->doubleValue( "3DViewer", "trihedron_size", myViewer->trihedronSize() ),
- aResMgr->booleanValue( "3DViewer", "relative_size", myViewer->trihedronRelative() ));
- myViewer->setInteractionStyle( aResMgr->integerValue( "3DViewer", "navigation_mode", myViewer->interactionStyle() ) );
- myViewer->setZoomingStyle( aResMgr->integerValue( "3DViewer", "zooming_mode", myViewer->zoomingStyle() ) );
- myViewer->enablePreselection( aResMgr->booleanValue( "OCCViewer", "enable_preselection", myViewer->isPreselectionEnabled() ) );
- myViewer->enableSelection( aResMgr->booleanValue( "OCCViewer", "enable_selection", myViewer->isSelectionEnabled() ) );
-
- aViewMgr->setViewModel( myViewer );// custom view model, which extends SALOME_View interface
- SUIT_ViewWindow* aViewWin = aViewMgr->createViewWindow();
+ aViewer->setBackground( OCCViewer_ViewFrame::TOP_LEFT,
+ aResMgr->backgroundValue( "OCCViewer", "xz_background", aViewer->background(OCCViewer_ViewFrame::TOP_LEFT) ) );
+ aViewer->setBackground( OCCViewer_ViewFrame::TOP_RIGHT,
+ aResMgr->backgroundValue( "OCCViewer", "yz_background", aViewer->background(OCCViewer_ViewFrame::TOP_RIGHT) ) );
+ aViewer->setBackground( OCCViewer_ViewFrame::BOTTOM_LEFT,
+ aResMgr->backgroundValue( "OCCViewer", "xy_background", aViewer->background(OCCViewer_ViewFrame::BOTTOM_LEFT) ) );
+ aViewer->setBackground( OCCViewer_ViewFrame::BOTTOM_RIGHT,
+ aResMgr->backgroundValue( "OCCViewer", "background", aViewer->background(OCCViewer_ViewFrame::MAIN_VIEW) ) );
+
+ aViewer->setTrihedronSize( aResMgr->doubleValue( "3DViewer", "trihedron_size", aViewer->trihedronSize() ),
+ aResMgr->booleanValue( "3DViewer", "relative_size", aViewer->trihedronRelative() ));
+ aViewer->setInteractionStyle( aResMgr->integerValue( "3DViewer", "navigation_mode", aViewer->interactionStyle() ) );
+ aViewer->setZoomingStyle( aResMgr->integerValue( "3DViewer", "zooming_mode", aViewer->zoomingStyle() ) );
+ aViewer->enablePreselection( aResMgr->booleanValue( "OCCViewer", "enable_preselection", aViewer->isPreselectionEnabled() ) );
+ aViewer->enableSelection( aResMgr->booleanValue( "OCCViewer", "enable_selection", aViewer->isSelectionEnabled() ) );
+
+ myViewManager->setViewModel( aViewer );// custom view model, which extends SALOME_View interface
+ SUIT_ViewWindow* aViewWin = myViewManager->createViewWindow();
addWidget( aViewWin, 4 );
- myEditorWidget->setOCCViewer( myViewer );
+ myEditorWidget->setOCCViewer( aViewer );
connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) );
HYDROGUI_ProfileDlg::~HYDROGUI_ProfileDlg()
{
+ delete myViewManager;
}
void HYDROGUI_ProfileDlg::reset()
Handle(AIS_InteractiveContext) HYDROGUI_ProfileDlg::getAISContext()
{
- return myViewer->getAISContext();
+ OCCViewer_Viewer* aViewer = (OCCViewer_Viewer*)myViewManager->getViewModel();
+ return aViewer ? aViewer->getAISContext() : 0;
}
void HYDROGUI_ProfileDlg::setProfileName( const QString& theName )