mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Drawstyle and Faults control Toolbuttons
p4#: 21335
This commit is contained in:
parent
759a17337b
commit
cd24e77557
@ -1305,3 +1305,75 @@ void RimReservoirView::updateDisplayModelForWellResults()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimReservoirView::setMeshOnlyDrawstyle()
|
||||
{
|
||||
if (surfaceMode == FAULTS || meshMode == FAULTS_MESH)
|
||||
{
|
||||
surfaceMode = NO_SURFACE;
|
||||
meshMode = FAULTS_MESH;
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceMode = NO_SURFACE;
|
||||
meshMode = FULL_MESH;
|
||||
}
|
||||
updateDisplayModelVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimReservoirView::setMeshSurfDrawstyle()
|
||||
{
|
||||
if (surfaceMode == FAULTS || meshMode == FAULTS_MESH)
|
||||
{
|
||||
surfaceMode = FAULTS;
|
||||
meshMode = FAULTS_MESH;
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceMode = SURFACE;
|
||||
meshMode = FULL_MESH;
|
||||
}
|
||||
updateDisplayModelVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimReservoirView::setSurfOnlyDrawstyle()
|
||||
{
|
||||
if (surfaceMode == FAULTS || meshMode == FAULTS_MESH)
|
||||
{
|
||||
surfaceMode = FAULTS;
|
||||
meshMode = NO_MESH;
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceMode = SURFACE;
|
||||
meshMode = NO_MESH;
|
||||
}
|
||||
updateDisplayModelVisibility();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimReservoirView::setShowFaultsOnly(bool showFaults)
|
||||
{
|
||||
if (showFaults)
|
||||
{
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode = FAULTS;
|
||||
if (meshMode() != NO_MESH) meshMode = FAULTS_MESH;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (surfaceMode() != NO_SURFACE) surfaceMode = SURFACE;
|
||||
if (meshMode() != NO_MESH) meshMode = FULL_MESH;
|
||||
}
|
||||
updateDisplayModelVisibility();
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,7 @@ public:
|
||||
caf::PdmField<int> maximumFrameRate;
|
||||
caf::PdmField<bool> animationMode;
|
||||
|
||||
|
||||
// Access internal objects
|
||||
RimReservoirCellResultsStorage* currentGridCellResults();
|
||||
RigActiveCellInfo* currentActiveCellInfo();
|
||||
@ -135,6 +136,12 @@ public:
|
||||
void updateViewerWidgetWindowTitle();
|
||||
void setDefaultView();
|
||||
|
||||
void setMeshOnlyDrawstyle();
|
||||
void setMeshSurfDrawstyle();
|
||||
void setSurfOnlyDrawstyle();
|
||||
void setShowFaultsOnly(bool showFaults);
|
||||
|
||||
|
||||
// Picking info
|
||||
bool pickInfo(size_t gridIndex, size_t cellIndex, const cvf::Vec3d& point, QString* pickInfoText) const;
|
||||
void appendCellResultInfo(size_t gridIndex, size_t cellIndex, QString* resultInfoText) ;
|
||||
|
@ -37,6 +37,7 @@
|
||||
<file>SnapShot.png</file>
|
||||
<file>SnapShotSave.png</file>
|
||||
<file>SnapShotSaveViews.png</file>
|
||||
<file>draw_style_faults_24x24.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/Shader/">
|
||||
<file>fs_CellFace.glsl</file>
|
||||
|
BIN
ApplicationCode/Resources/draw_style_faults_24x24.png
Normal file
BIN
ApplicationCode/Resources/draw_style_faults_24x24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -116,6 +116,7 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
|
||||
slotRefreshFileActions();
|
||||
slotRefreshEditActions();
|
||||
refreshAnimationActions();
|
||||
refreshDrawStyleActions();
|
||||
setPdmRoot(RiaApplication::instance()->project());
|
||||
}
|
||||
|
||||
@ -239,6 +240,29 @@ void RiuMainWindow::createActions()
|
||||
// Help actions
|
||||
m_aboutAction = new QAction("&About", this);
|
||||
connect(m_aboutAction, SIGNAL(triggered()), SLOT(slotAbout()));
|
||||
|
||||
// Draw style actions
|
||||
m_dsActionGroup = new QActionGroup(this);
|
||||
|
||||
m_drawStyleLinesAction = new QAction(QIcon(":/draw_style_lines_24x24.png"), "&Mesh Only", this);
|
||||
//connect(m_drawStyleLinesAction, SIGNAL(triggered()), SLOT(slotDrawStyleLines()));
|
||||
m_dsActionGroup->addAction(m_drawStyleLinesAction);
|
||||
|
||||
m_drawStyleLinesSolidAction = new QAction(QIcon(":/draw_style_meshlines_24x24.png"), "Mesh And Surfaces", this);
|
||||
//connect(m_drawStyleLinesSolidAction, SIGNAL(triggered()), SLOT(slotDrawStyleLinesSolid()));
|
||||
m_dsActionGroup->addAction(m_drawStyleLinesSolidAction);
|
||||
|
||||
m_drawStyleSurfOnlyAction = new QAction(QIcon(":/draw_style_surface_24x24.png"), "&Surface Only", this);
|
||||
//connect(m_drawStyleSurfOnlyAction, SIGNAL(triggered()), SLOT(slotDrawStyleSurfOnly()));
|
||||
m_dsActionGroup->addAction(m_drawStyleSurfOnlyAction);
|
||||
|
||||
|
||||
connect(m_dsActionGroup, SIGNAL(triggered(QAction*)), SLOT(slotDrawStyleChanged(QAction*)));
|
||||
|
||||
m_drawStyleToggleFaultsAction = new QAction( QIcon(":/draw_style_faults_24x24.png"), "&Show Faults Only", this);
|
||||
m_drawStyleToggleFaultsAction->setCheckable(true);
|
||||
connect(m_drawStyleToggleFaultsAction, SIGNAL(toggled(bool)), SLOT(slotToggleFaultsAction(bool)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -346,6 +370,12 @@ void RiuMainWindow::createToolBars()
|
||||
m_viewToolBar->addAction(m_viewFromWest);
|
||||
m_viewToolBar->addAction(m_viewFromAbove);
|
||||
m_viewToolBar->addAction(m_viewFromBelow);
|
||||
m_viewToolBar->addSeparator();
|
||||
m_viewToolBar->addAction(m_drawStyleLinesAction);
|
||||
m_viewToolBar->addAction(m_drawStyleLinesSolidAction);
|
||||
m_viewToolBar->addAction(m_drawStyleSurfOnlyAction);
|
||||
m_viewToolBar->addAction(m_drawStyleToggleFaultsAction);
|
||||
|
||||
|
||||
// Create animation toolbar
|
||||
m_animationToolBar = new caf::AnimationToolBar("Animation", this);
|
||||
@ -353,6 +383,7 @@ void RiuMainWindow::createToolBars()
|
||||
//connect(m_animationToolBar, SIGNAL(signalFrameRateChanged(double)), SLOT(slotFramerateChanged(double)));
|
||||
|
||||
refreshAnimationActions();
|
||||
refreshDrawStyleActions();
|
||||
}
|
||||
|
||||
|
||||
@ -1043,6 +1074,7 @@ void RiuMainWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
|
||||
}
|
||||
|
||||
refreshAnimationActions();
|
||||
refreshDrawStyleActions();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1168,7 +1200,7 @@ void RiuMainWindow::slotCurrentChanged(const QModelIndex & current, const QModel
|
||||
if (rimReservoirView != activeReservoirView)
|
||||
{
|
||||
RiaApplication::instance()->setActiveReservoirView(rimReservoirView);
|
||||
|
||||
refreshDrawStyleActions();
|
||||
// Set focus in MDI area to this window if it exists
|
||||
if (rimReservoirView->viewer())
|
||||
{
|
||||
@ -1320,3 +1352,57 @@ void RiuMainWindow::slotOpenMultipleCases()
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotDrawStyleChanged(QAction* activatedAction)
|
||||
{
|
||||
if (!RiaApplication::instance()->activeReservoirView()) return;
|
||||
|
||||
if (activatedAction == m_drawStyleLinesAction)
|
||||
{
|
||||
RiaApplication::instance()->activeReservoirView()->setMeshOnlyDrawstyle();
|
||||
}
|
||||
else if (activatedAction == m_drawStyleLinesSolidAction)
|
||||
{
|
||||
RiaApplication::instance()->activeReservoirView()->setMeshSurfDrawstyle();
|
||||
}
|
||||
else if (activatedAction == m_drawStyleSurfOnlyAction)
|
||||
{
|
||||
RiaApplication::instance()->activeReservoirView()->setSurfOnlyDrawstyle();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotToggleFaultsAction(bool showFaults)
|
||||
{
|
||||
if (!RiaApplication::instance()->activeReservoirView()) return;
|
||||
|
||||
RiaApplication::instance()->activeReservoirView()->setShowFaultsOnly(showFaults);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::refreshDrawStyleActions()
|
||||
{
|
||||
bool enable = RiaApplication::instance()->activeReservoirView() != NULL;
|
||||
|
||||
m_drawStyleLinesAction->setEnabled(enable);
|
||||
m_drawStyleLinesSolidAction->setEnabled(enable);
|
||||
m_drawStyleSurfOnlyAction->setEnabled(enable);
|
||||
|
||||
m_drawStyleToggleFaultsAction->setEnabled(enable);
|
||||
|
||||
if (enable)
|
||||
{
|
||||
m_drawStyleToggleFaultsAction->blockSignals(true);
|
||||
m_drawStyleToggleFaultsAction->setChecked( RiaApplication::instance()->activeReservoirView()->meshMode == RimReservoirView::FAULTS_MESH
|
||||
|| RiaApplication::instance()->activeReservoirView()->surfaceMode == RimReservoirView::FAULTS);
|
||||
m_drawStyleToggleFaultsAction->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ class QComboBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QItemSelection;
|
||||
class QActionGroup;
|
||||
|
||||
class RiuViewer;
|
||||
class RiuResultInfoPanel;
|
||||
@ -185,6 +186,9 @@ private slots:
|
||||
void slotViewFromBelow();
|
||||
void slotZoomAll();
|
||||
|
||||
void slotDrawStyleChanged(QAction* activatedAction);
|
||||
void slotToggleFaultsAction(bool);
|
||||
|
||||
// Debug slots
|
||||
void slotRefreshDebugActions();
|
||||
void slotUseShaders(bool enable);
|
||||
@ -223,6 +227,13 @@ private:
|
||||
caf::PdmObject* m_pdmRoot;
|
||||
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
||||
|
||||
QActionGroup* m_dsActionGroup;
|
||||
QAction* m_drawStyleToggleFaultsAction;
|
||||
QAction* m_drawStyleLinesAction;
|
||||
QAction* m_drawStyleLinesSolidAction;
|
||||
QAction* m_drawStyleSurfOnlyAction;
|
||||
void refreshDrawStyleActions();
|
||||
|
||||
std::vector<QPointer<QDockWidget> > additionalProjectTrees;
|
||||
std::vector<QPointer<QDockWidget> > additionalPropertyEditors;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user