#include <CurveCreator_Widget.h>
#include <CurveCreator_ICurve.hxx>
-#include <OCCViewer_ViewModel.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>
#include <QGroupBox>
#include <QHBoxLayout>
anAddElementLayout->setMargin( 0 );
anAddElementLayout->setSpacing( 5 );
+
+ OCCViewer_ViewManager* aViewMgr = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
+ myViewer = 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();
+ 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*) ) );
{
}
-void HYDROGUI_ProfileDlg::setOCCViewer( OCCViewer_Viewer* theViewer )
-{
- myEditorWidget->setOCCViewer( theViewer );
-}
-
-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 )
+void HYDROGUI_ProfileDlg::reset()
{
- myEditorWidget->setEnabled( true );
-
- QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
- anAddElementLayout->removeWidget( theWidget );
-
- theWidget->hide();
- myAddElementBox->hide();
+ myEditorWidget->reset();
}
-void HYDROGUI_ProfileDlg::reset()
+Handle(AIS_InteractiveContext) HYDROGUI_ProfileDlg::getAISContext()
{
+ return myViewer->getAISContext();
}
void HYDROGUI_ProfileDlg::setProfileName( const QString& theName )
return myName->text();
}
-void HYDROGUI_ProfileDlg::setCurve( CurveCreator_ICurve* theCurve )
+void HYDROGUI_ProfileDlg::setProfile( CurveCreator_ICurve* theProfile )
{
- myEditorWidget->setCurve( theCurve );
+ myEditorWidget->setCurve( theProfile );
}
QList<int> HYDROGUI_ProfileDlg::getSelectedSections()
{
return myEditorWidget->removeEnabled();
}
+
+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();
+}