#include <CurveCreator_Widget.h>
#include <CurveCreator_ICurve.hxx>
-#include <OCCViewer_ViewWidget.h>
#include <OCCViewer_ViewPort3d.h>
#include <OCCViewer_Utilities.h>
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewFrame.h>
+#include <LightApp_Application.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
myEditorWidget = new CurveCreator_Widget( this, NULL );
addWidget( myEditorWidget, 3 );
- myViewWidget = new OCCViewer_ViewWidget( this, false );
- OCCViewer_ViewPort3d* aViewPort = myViewWidget->getViewPort();
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- if ( aResMgr )
- aViewPort->setBackground( aResMgr->backgroundValue( "OCCViewer", "background",
- Qtx::BackgroundData( Qt::black ) ) );
- OCCViewer_Utilities::setViewWidget2DMode( myViewWidget, OCCViewer_ViewWidget::XZPlane );
- addWidget( myViewWidget, 4 );
-
- //myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this );
- //addWidget( myAddElementBox, 2 );
+ OCCViewer_ViewManager* aViewMgr = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
+ myViewer = new OCCViewer_Viewer( true );
- //QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox );
- //anAddElementLayout->setMargin( 0 );
- //anAddElementLayout->setSpacing( 5 );
+ 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();
+ addWidget( aViewWin, 4 );
+ myEditorWidget->setOCCViewer( myViewer );
connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) );
connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
-
- //myAddElementBox->hide();
-
- myEditorWidget->setOCCViewWidget( myViewWidget );
}
HYDROGUI_ProfileDlg::~HYDROGUI_ProfileDlg()
{
}
-void HYDROGUI_ProfileDlg::processStartedSubOperation( QWidget* theWidget )
-{
- //myEditorWidget->setEnabled( false );
-
- //QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
- //anAddElementLayout->addWidget( theWidget );
-
- //theWidget->show();
- //myAddElementBox->show();
-}
-
-void HYDROGUI_ProfileDlg::processFinishedSubOperation( QWidget* theWidget )
-{
- /*myEditorWidget->setEnabled( true );
-
- QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
- anAddElementLayout->removeWidget( theWidget );
-
- theWidget->hide();
- myAddElementBox->hide();*/
-}
-
void HYDROGUI_ProfileDlg::reset()
{
myEditorWidget->reset();
Handle(AIS_InteractiveContext) HYDROGUI_ProfileDlg::getAISContext()
{
- return myViewWidget->getAISContext();
+ return myViewer->getAISContext();
}
void HYDROGUI_ProfileDlg::setProfileName( const QString& theName )