mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Partial revert of 38e0b150
This commit is contained in:
parent
9f927e74f3
commit
a925c0f29e
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "RimGridPlotWindow.h"
|
#include "RimGridPlotWindow.h"
|
||||||
#include "RimPlotInterface.h"
|
#include "RimPlotInterface.h"
|
||||||
#include "RimWellLogTrack.h"
|
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
@ -47,18 +46,13 @@ bool RicDeleteSubPlotFeature::isCommandEnabled()
|
|||||||
|
|
||||||
if ( selection.size() > 0 )
|
if ( selection.size() > 0 )
|
||||||
{
|
{
|
||||||
size_t plotsSelected = 0;
|
RimGridPlotWindow* wellLogPlot = nullptr;
|
||||||
for ( caf::PdmObject* object : selection )
|
selection[0]->firstAncestorOrThisOfType( wellLogPlot );
|
||||||
|
if ( dynamic_cast<RimPlotInterface*>( selection[0] ) && wellLogPlot && wellLogPlot->plotCount() > 1 )
|
||||||
{
|
{
|
||||||
RimGridPlotWindow* gridPlotWindow = nullptr;
|
return true;
|
||||||
object->firstAncestorOrThisOfType( gridPlotWindow );
|
|
||||||
if ( dynamic_cast<RimPlotInterface*>( object ) && gridPlotWindow )
|
|
||||||
{
|
|
||||||
plotsSelected++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return plotsSelected == selection.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -72,6 +66,7 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
std::vector<caf::PdmObject*> selection;
|
std::vector<caf::PdmObject*> selection;
|
||||||
caf::SelectionManager::instance()->objectsByType( &selection );
|
caf::SelectionManager::instance()->objectsByType( &selection );
|
||||||
|
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
|
||||||
std::set<RimGridPlotWindow*> alteredWellLogPlots;
|
std::set<RimGridPlotWindow*> alteredWellLogPlots;
|
||||||
|
|
||||||
for ( size_t i = 0; i < selection.size(); i++ )
|
for ( size_t i = 0; i < selection.size(); i++ )
|
||||||
@ -80,7 +75,7 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
RimGridPlotWindow* wellLogPlot = nullptr;
|
RimGridPlotWindow* wellLogPlot = nullptr;
|
||||||
selection[i]->firstAncestorOrThisOfType( wellLogPlot );
|
selection[i]->firstAncestorOrThisOfType( wellLogPlot );
|
||||||
if ( plot && wellLogPlot )
|
if ( plot && wellLogPlot && wellLogPlot->plotCount() > 1 )
|
||||||
{
|
{
|
||||||
alteredWellLogPlots.insert( wellLogPlot );
|
alteredWellLogPlots.insert( wellLogPlot );
|
||||||
wellLogPlot->removePlot( plot );
|
wellLogPlot->removePlot( plot );
|
||||||
@ -93,6 +88,11 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
for ( RimGridPlotWindow* wellLogPlot : alteredWellLogPlots )
|
for ( RimGridPlotWindow* wellLogPlot : alteredWellLogPlots )
|
||||||
{
|
{
|
||||||
|
RiuGridPlotWindow* viewWidget = dynamic_cast<RiuGridPlotWindow*>( wellLogPlot->viewWidget() );
|
||||||
|
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredWidth() );
|
||||||
|
// TODO: add back with virtual methods
|
||||||
|
// wellLogPlot->calculateAvailableDepthRange();
|
||||||
|
// wellLogPlot->updateDepthZoom();
|
||||||
wellLogPlot->uiCapability()->updateConnectedEditors();
|
wellLogPlot->uiCapability()->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -102,32 +102,7 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicDeleteSubPlotFeature::setupActionLook( QAction* actionToSetup )
|
void RicDeleteSubPlotFeature::setupActionLook( QAction* actionToSetup )
|
||||||
{
|
{
|
||||||
QString actionText;
|
actionToSetup->setText( "Delete Track" );
|
||||||
std::vector<caf::PdmObject*> selection;
|
|
||||||
caf::SelectionManager::instance()->objectsByType( &selection );
|
|
||||||
|
|
||||||
size_t tracksSelected = 0u;
|
|
||||||
for ( caf::PdmObject* object : selection )
|
|
||||||
{
|
|
||||||
if ( dynamic_cast<RimWellLogTrack*>( object ) )
|
|
||||||
{
|
|
||||||
tracksSelected++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( tracksSelected == selection.size() )
|
|
||||||
{
|
|
||||||
actionText = "Delete Track";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
actionText = "Delete Plot";
|
|
||||||
}
|
|
||||||
if ( selection.size() > 1u )
|
|
||||||
{
|
|
||||||
actionText += "s";
|
|
||||||
}
|
|
||||||
|
|
||||||
actionToSetup->setText( actionText );
|
|
||||||
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
|
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
|
||||||
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Delete );
|
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Delete );
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,11 @@ void RicNewWellLogPlotTrackFeature::onActionTriggered( bool isChecked )
|
|||||||
RimWellLogTrack* plotTrack = new RimWellLogTrack;
|
RimWellLogTrack* plotTrack = new RimWellLogTrack;
|
||||||
wellLogPlot->addPlot( plotTrack );
|
wellLogPlot->addPlot( plotTrack );
|
||||||
plotTrack->setDescription( QString( "Track %1" ).arg( wellLogPlot->plotCount() ) );
|
plotTrack->setDescription( QString( "Track %1" ).arg( wellLogPlot->plotCount() ) );
|
||||||
|
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
|
||||||
|
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( wellLogPlot->viewWidget() );
|
||||||
RicWellLogTools::addWellLogExtractionCurve( plotTrack, nullptr, nullptr, nullptr, nullptr, -1, true );
|
RicWellLogTools::addWellLogExtractionCurve( plotTrack, nullptr, nullptr, nullptr, nullptr, -1, true );
|
||||||
|
|
||||||
|
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredWidth() );
|
||||||
wellLogPlot->updateConnectedEditors();
|
wellLogPlot->updateConnectedEditors();
|
||||||
wellLogPlot->loadDataAndUpdate();
|
wellLogPlot->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h
|
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.h
|
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindowCollection.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -279,7 +278,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindowCollection.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "RimFlowPlotCollection.h"
|
#include "RimFlowPlotCollection.h"
|
||||||
#include "RimGridCrossPlot.h"
|
#include "RimGridCrossPlot.h"
|
||||||
#include "RimGridCrossPlotCollection.h"
|
#include "RimGridCrossPlotCollection.h"
|
||||||
#include "RimGridPlotWindowCollection.h"
|
|
||||||
#include "RimPltPlotCollection.h"
|
#include "RimPltPlotCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimRftPlotCollection.h"
|
#include "RimRftPlotCollection.h"
|
||||||
@ -85,9 +84,6 @@ RimMainPlotCollection::RimMainPlotCollection()
|
|||||||
"" );
|
"" );
|
||||||
m_saturationPressurePlotCollection.uiCapability()->setUiHidden( true );
|
m_saturationPressurePlotCollection.uiCapability()->setUiHidden( true );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_combinationPlotCollection, "RimGridPlotWindowCollection", "Combination Plots", "", "", "" );
|
|
||||||
m_combinationPlotCollection.uiCapability()->setUiHidden( true );
|
|
||||||
|
|
||||||
m_wellLogPlotCollection = new RimWellLogPlotCollection();
|
m_wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||||
m_rftPlotCollection = new RimRftPlotCollection();
|
m_rftPlotCollection = new RimRftPlotCollection();
|
||||||
m_pltPlotCollection = new RimPltPlotCollection();
|
m_pltPlotCollection = new RimPltPlotCollection();
|
||||||
@ -184,14 +180,6 @@ RimSaturationPressurePlotCollection* RimMainPlotCollection::saturationPressurePl
|
|||||||
return m_saturationPressurePlotCollection();
|
return m_saturationPressurePlotCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RimGridPlotWindowCollection* RimMainPlotCollection::combinationPlotCollection()
|
|
||||||
{
|
|
||||||
return m_combinationPlotCollection();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -205,7 +193,6 @@ void RimMainPlotCollection::deleteAllContainedObjects()
|
|||||||
m_gridCrossPlotCollection->deleteAllChildObjects();
|
m_gridCrossPlotCollection->deleteAllChildObjects();
|
||||||
m_flowPlotCollection()->closeDefaultPlotWindowAndDeletePlots();
|
m_flowPlotCollection()->closeDefaultPlotWindowAndDeletePlots();
|
||||||
m_saturationPressurePlotCollection()->deleteAllChildObjects();
|
m_saturationPressurePlotCollection()->deleteAllChildObjects();
|
||||||
m_combinationPlotCollection()->deleteAllChildObjects();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -257,14 +244,6 @@ void RimMainPlotCollection::updatePlotsWithFormations()
|
|||||||
crossPlot->loadDataAndUpdate();
|
crossPlot->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_combinationPlotCollection )
|
|
||||||
{
|
|
||||||
for ( RimGridPlotWindow* plotWindow : m_combinationPlotCollection->gridPlotWindows() )
|
|
||||||
{
|
|
||||||
plotWindow->loadDataAndUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -279,14 +258,6 @@ void RimMainPlotCollection::updatePlotsWithCompletions()
|
|||||||
wellLogPlot->loadDataAndUpdate();
|
wellLogPlot->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_combinationPlotCollection )
|
|
||||||
{
|
|
||||||
for ( RimGridPlotWindow* plotWindow : m_combinationPlotCollection->gridPlotWindows() )
|
|
||||||
{
|
|
||||||
plotWindow->loadDataAndUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -30,7 +30,6 @@ class RimWellLogPlotCollection;
|
|||||||
class RimRftPlotCollection;
|
class RimRftPlotCollection;
|
||||||
class RimPltPlotCollection;
|
class RimPltPlotCollection;
|
||||||
class RimGridCrossPlotCollection;
|
class RimGridCrossPlotCollection;
|
||||||
class RimGridPlotWindowCollection;
|
|
||||||
class RimSummaryPlotCollection;
|
class RimSummaryPlotCollection;
|
||||||
class RimSummaryCrossPlotCollection;
|
class RimSummaryCrossPlotCollection;
|
||||||
class RimSummaryPlot;
|
class RimSummaryPlot;
|
||||||
@ -59,7 +58,6 @@ public:
|
|||||||
RimFlowPlotCollection* flowPlotCollection();
|
RimFlowPlotCollection* flowPlotCollection();
|
||||||
RimGridCrossPlotCollection* gridCrossPlotCollection();
|
RimGridCrossPlotCollection* gridCrossPlotCollection();
|
||||||
RimSaturationPressurePlotCollection* saturationPressurePlotCollection();
|
RimSaturationPressurePlotCollection* saturationPressurePlotCollection();
|
||||||
RimGridPlotWindowCollection* combinationPlotCollection();
|
|
||||||
|
|
||||||
void deleteAllContainedObjects();
|
void deleteAllContainedObjects();
|
||||||
void updateCurrentTimeStepInPlots();
|
void updateCurrentTimeStepInPlots();
|
||||||
@ -83,7 +81,6 @@ private:
|
|||||||
caf::PdmChildField<RimFlowPlotCollection*> m_flowPlotCollection;
|
caf::PdmChildField<RimFlowPlotCollection*> m_flowPlotCollection;
|
||||||
caf::PdmChildField<RimGridCrossPlotCollection*> m_gridCrossPlotCollection;
|
caf::PdmChildField<RimGridCrossPlotCollection*> m_gridCrossPlotCollection;
|
||||||
caf::PdmChildField<RimSaturationPressurePlotCollection*> m_saturationPressurePlotCollection;
|
caf::PdmChildField<RimSaturationPressurePlotCollection*> m_saturationPressurePlotCollection;
|
||||||
caf::PdmChildField<RimGridPlotWindowCollection*> m_combinationPlotCollection;
|
|
||||||
|
|
||||||
caf::PdmField<bool> m_show;
|
caf::PdmField<bool> m_show;
|
||||||
};
|
};
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
#include "RimGeoMechCase.h"
|
#include "RimGeoMechCase.h"
|
||||||
#include "RimGeoMechModels.h"
|
#include "RimGeoMechModels.h"
|
||||||
#include "RimGridCrossPlotCollection.h"
|
#include "RimGridCrossPlotCollection.h"
|
||||||
#include "RimGridPlotWindowCollection.h"
|
|
||||||
#include "RimGridSummaryCase.h"
|
#include "RimGridSummaryCase.h"
|
||||||
#include "RimGridView.h"
|
#include "RimGridView.h"
|
||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
@ -1304,10 +1303,6 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
|
|||||||
{
|
{
|
||||||
itemCollection->add( mainPlotCollection->saturationPressurePlotCollection() );
|
itemCollection->add( mainPlotCollection->saturationPressurePlotCollection() );
|
||||||
}
|
}
|
||||||
if ( mainPlotCollection->combinationPlotCollection() )
|
|
||||||
{
|
|
||||||
itemCollection->add( mainPlotCollection->combinationPlotCollection() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiTreeOrdering.add( m_plotTemplateFolderItem() );
|
uiTreeOrdering.add( m_plotTemplateFolderItem() );
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "RimFlowPlotCollection.h"
|
#include "RimFlowPlotCollection.h"
|
||||||
#include "RimGridCrossPlot.h"
|
#include "RimGridCrossPlot.h"
|
||||||
#include "RimGridCrossPlotCollection.h"
|
#include "RimGridCrossPlotCollection.h"
|
||||||
#include "RimGridPlotWindowCollection.h"
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCaseMainCollection.h"
|
#include "RimSummaryCaseMainCollection.h"
|
||||||
@ -177,14 +176,5 @@ void RimReloadCaseTools::updateAllPlots()
|
|||||||
{
|
{
|
||||||
flowPlotCollection->loadDataAndUpdate();
|
flowPlotCollection->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
RimGridPlotWindowCollection* gridPlotWindowCollection = project->mainPlotCollection()->combinationPlotCollection();
|
|
||||||
if ( gridPlotWindowCollection )
|
|
||||||
{
|
|
||||||
for ( RimGridPlotWindow* plotWindow : gridPlotWindowCollection->gridPlotWindows() )
|
|
||||||
{
|
|
||||||
plotWindow->loadDataAndUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,8 @@ RiuGridPlotWindow::RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget
|
|||||||
m_plotLayout->addWidget( m_plotWidgetFrame, 1 );
|
m_plotLayout->addWidget( m_plotWidgetFrame, 1 );
|
||||||
|
|
||||||
m_gridLayout = new QGridLayout( m_plotWidgetFrame );
|
m_gridLayout = new QGridLayout( m_plotWidgetFrame );
|
||||||
m_gridLayout->setContentsMargins( 1, 1, 1, 1 );
|
m_gridLayout->setMargin( 0 );
|
||||||
m_gridLayout->setSpacing( 1 );
|
m_gridLayout->setSpacing( 2 );
|
||||||
|
|
||||||
QPalette newPalette( palette() );
|
QPalette newPalette( palette() );
|
||||||
newPalette.setColor( QPalette::Background, Qt::white );
|
newPalette.setColor( QPalette::Background, Qt::white );
|
||||||
@ -96,13 +96,6 @@ RiuGridPlotWindow::RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget
|
|||||||
|
|
||||||
new RiuPlotObjectPicker( m_plotTitle, m_plotDefinition );
|
new RiuPlotObjectPicker( m_plotTitle, m_plotDefinition );
|
||||||
|
|
||||||
m_dropTargetPlaceHolder = new QLabel( "Drag plots here" );
|
|
||||||
m_dropTargetPlaceHolder->setAlignment( Qt::AlignCenter );
|
|
||||||
m_dropTargetPlaceHolder->setObjectName(
|
|
||||||
QString( "%1" ).arg( reinterpret_cast<uint64_t>( m_dropTargetPlaceHolder.data() ) ) );
|
|
||||||
m_dropTargetStyleSheet = createDropTargetStyleSheet();
|
|
||||||
m_dropTargetStyleSheet.applyToWidget( m_dropTargetPlaceHolder );
|
|
||||||
|
|
||||||
this->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::MinimumExpanding );
|
this->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::MinimumExpanding );
|
||||||
|
|
||||||
setFocusPolicy( Qt::StrongFocus );
|
setFocusPolicy( Qt::StrongFocus );
|
||||||
@ -112,8 +105,6 @@ RiuGridPlotWindow::RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget
|
|||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
int defaultFontSize = RiaFontCache::pointSizeFromFontSizeEnum( app->preferences()->defaultPlotFontSize() );
|
int defaultFontSize = RiaFontCache::pointSizeFromFontSizeEnum( app->preferences()->defaultPlotFontSize() );
|
||||||
setFontSize( defaultFontSize );
|
setFontSize( defaultFontSize );
|
||||||
|
|
||||||
this->setObjectName( QString( "%1" ).arg( reinterpret_cast<uint64_t>( this ) ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -211,6 +202,28 @@ void RiuGridPlotWindow::setPlotTitle( const QString& plotTitle )
|
|||||||
m_plotTitle->setText( plotTitle );
|
m_plotTitle->setText( plotTitle );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int RiuGridPlotWindow::preferredWidth() const
|
||||||
|
{
|
||||||
|
int titleWidth = 0;
|
||||||
|
if ( m_plotTitle && m_plotTitle->isVisible() )
|
||||||
|
{
|
||||||
|
titleWidth = m_plotTitle->width();
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QPointer<RiuQwtPlotWidget>> visiblePlotWidgets = this->visiblePlotWidgets();
|
||||||
|
auto rowAndColumnCount = this->rowAndColumnCount( visiblePlotWidgets.size() );
|
||||||
|
|
||||||
|
int sumColumnWidths = 0;
|
||||||
|
for ( int visibleIndex = 0; visibleIndex < rowAndColumnCount.second; ++visibleIndex )
|
||||||
|
{
|
||||||
|
sumColumnWidths += visiblePlotWidgets[visibleIndex]->width();
|
||||||
|
}
|
||||||
|
return std::max( titleWidth, sumColumnWidths );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -377,10 +390,8 @@ void RiuGridPlotWindow::showEvent( QShowEvent* event )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuGridPlotWindow::dragEnterEvent( QDragEnterEvent* event )
|
void RiuGridPlotWindow::dragEnterEvent( QDragEnterEvent* event )
|
||||||
{
|
{
|
||||||
RiuQwtPlotWidget* source = dynamic_cast<RiuQwtPlotWidget*>( event->source() );
|
if ( this->geometry().contains( event->pos() ) )
|
||||||
if ( source )
|
|
||||||
{
|
{
|
||||||
setWidgetState( RiuWidgetStyleSheet::DRAG_TARGET_INTO );
|
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,13 +401,11 @@ void RiuGridPlotWindow::dragEnterEvent( QDragEnterEvent* event )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuGridPlotWindow::dragMoveEvent( QDragMoveEvent* event )
|
void RiuGridPlotWindow::dragMoveEvent( QDragMoveEvent* event )
|
||||||
{
|
{
|
||||||
if ( event->answerRect().intersects( this->geometry() ) )
|
if ( this->geometry().contains( event->pos() ) )
|
||||||
{
|
{
|
||||||
RiuQwtPlotWidget* source = dynamic_cast<RiuQwtPlotWidget*>( event->source() );
|
RiuQwtPlotWidget* source = dynamic_cast<RiuQwtPlotWidget*>( event->source() );
|
||||||
if ( source )
|
if ( source )
|
||||||
{
|
{
|
||||||
setWidgetState( RiuWidgetStyleSheet::DRAG_TARGET_INTO );
|
|
||||||
|
|
||||||
QRect originalGeometry = source->geometry();
|
QRect originalGeometry = source->geometry();
|
||||||
QPoint offset = source->dragStartPosition();
|
QPoint offset = source->dragStartPosition();
|
||||||
QRect newRect( event->pos() - offset, originalGeometry.size() );
|
QRect newRect( event->pos() - offset, originalGeometry.size() );
|
||||||
@ -422,10 +431,11 @@ void RiuGridPlotWindow::dragMoveEvent( QDragMoveEvent* event )
|
|||||||
{
|
{
|
||||||
int insertAfterIndex = insertBeforeIndex - 1;
|
int insertAfterIndex = insertBeforeIndex - 1;
|
||||||
visiblePlotWidgets[insertAfterIndex]->setWidgetState( RiuWidgetStyleSheet::DRAG_TARGET_AFTER );
|
visiblePlotWidgets[insertAfterIndex]->setWidgetState( RiuWidgetStyleSheet::DRAG_TARGET_AFTER );
|
||||||
}
|
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -433,8 +443,6 @@ void RiuGridPlotWindow::dragMoveEvent( QDragMoveEvent* event )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuGridPlotWindow::dragLeaveEvent( QDragLeaveEvent* event )
|
void RiuGridPlotWindow::dragLeaveEvent( QDragLeaveEvent* event )
|
||||||
{
|
{
|
||||||
setWidgetState( RiuWidgetStyleSheet::DEFAULT );
|
|
||||||
|
|
||||||
for ( int tIdx = 0; tIdx < m_plotWidgets.size(); ++tIdx )
|
for ( int tIdx = 0; tIdx < m_plotWidgets.size(); ++tIdx )
|
||||||
{
|
{
|
||||||
m_plotWidgets[tIdx]->setWidgetState( RiuWidgetStyleSheet::DEFAULT );
|
m_plotWidgets[tIdx]->setWidgetState( RiuWidgetStyleSheet::DEFAULT );
|
||||||
@ -446,8 +454,6 @@ void RiuGridPlotWindow::dragLeaveEvent( QDragLeaveEvent* event )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuGridPlotWindow::dropEvent( QDropEvent* event )
|
void RiuGridPlotWindow::dropEvent( QDropEvent* event )
|
||||||
{
|
{
|
||||||
setWidgetState( RiuWidgetStyleSheet::DEFAULT );
|
|
||||||
|
|
||||||
for ( int tIdx = 0; tIdx < m_plotWidgets.size(); ++tIdx )
|
for ( int tIdx = 0; tIdx < m_plotWidgets.size(); ++tIdx )
|
||||||
{
|
{
|
||||||
m_plotWidgets[tIdx]->setWidgetState( RiuWidgetStyleSheet::DEFAULT );
|
m_plotWidgets[tIdx]->setWidgetState( RiuWidgetStyleSheet::DEFAULT );
|
||||||
@ -527,14 +533,6 @@ void RiuGridPlotWindow::onSelectionManagerSelectionChanged( const std::set<int>&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuGridPlotWindow::setWidgetState( RiuWidgetStyleSheet::StateTag widgetState )
|
|
||||||
{
|
|
||||||
m_dropTargetStyleSheet.setWidgetState( m_dropTargetPlaceHolder, widgetState );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -591,16 +589,6 @@ void RiuGridPlotWindow::reinsertPlotWidgetsAndScrollbar()
|
|||||||
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
||||||
QList<QPointer<RiuQwtPlotLegend>> legends = this->visibleLegends();
|
QList<QPointer<RiuQwtPlotLegend>> legends = this->visibleLegends();
|
||||||
|
|
||||||
if ( plotWidgets.empty() )
|
|
||||||
{
|
|
||||||
m_gridLayout->addWidget( m_dropTargetPlaceHolder, 0, 0 );
|
|
||||||
m_dropTargetPlaceHolder->setVisible( true );
|
|
||||||
m_scrollBar->setVisible( false );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_dropTargetPlaceHolder->setVisible( false );
|
|
||||||
|
|
||||||
auto rowAndColumnCount = this->rowAndColumnCount( plotWidgets.size() );
|
auto rowAndColumnCount = this->rowAndColumnCount( plotWidgets.size() );
|
||||||
|
|
||||||
for ( int visibleIndex = 0; visibleIndex < plotWidgets.size(); ++visibleIndex )
|
for ( int visibleIndex = 0; visibleIndex < plotWidgets.size(); ++visibleIndex )
|
||||||
@ -648,8 +636,7 @@ void RiuGridPlotWindow::reinsertPlotWidgetsAndScrollbar()
|
|||||||
}
|
}
|
||||||
m_gridLayout->addLayout( m_scrollBarLayout, 1, rowAndColumnCount.second, rowAndColumnCount.first * 2 - 1, 1 );
|
m_gridLayout->addLayout( m_scrollBarLayout, 1, rowAndColumnCount.second, rowAndColumnCount.first * 2 - 1, 1 );
|
||||||
m_gridLayout->setColumnStretch( rowAndColumnCount.second, 0 );
|
m_gridLayout->setColumnStretch( rowAndColumnCount.second, 0 );
|
||||||
m_scrollBar->setVisible( true );
|
m_scrollBar->setVisible( plotWidgets.size() > 0 );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -675,22 +662,6 @@ void RiuGridPlotWindow::clearGridLayout()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RiuWidgetStyleSheet RiuGridPlotWindow::createDropTargetStyleSheet()
|
|
||||||
{
|
|
||||||
RiuWidgetStyleSheet styleSheet;
|
|
||||||
|
|
||||||
styleSheet.set( "background-color", "white" );
|
|
||||||
styleSheet.set( "border", "1px solid black" );
|
|
||||||
styleSheet.set( "font-size", "14pt" );
|
|
||||||
styleSheet.state( RiuWidgetStyleSheet::DRAG_TARGET_INTO ).set( "border", "1px solid lime" );
|
|
||||||
styleSheet.state( RiuWidgetStyleSheet::DRAG_TARGET_INTO ).set( "background-color", "#DDFFDD" );
|
|
||||||
|
|
||||||
return styleSheet;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "RiuInterfaceToViewWindow.h"
|
#include "RiuInterfaceToViewWindow.h"
|
||||||
#include "RiuWidgetStyleSheet.h"
|
|
||||||
|
|
||||||
#include "cafPdmPointer.h"
|
#include "cafPdmPointer.h"
|
||||||
#include "cafSelectionChangedReceiver.h"
|
#include "cafSelectionChangedReceiver.h"
|
||||||
@ -65,6 +64,7 @@ public:
|
|||||||
void removePlot( RiuQwtPlotWidget* plotWidget );
|
void removePlot( RiuQwtPlotWidget* plotWidget );
|
||||||
|
|
||||||
void setPlotTitle( const QString& plotTitle );
|
void setPlotTitle( const QString& plotTitle );
|
||||||
|
int preferredWidth() const;
|
||||||
|
|
||||||
void setTitleVisible( bool visible );
|
void setTitleVisible( bool visible );
|
||||||
void setScrollbarVisible( bool visible );
|
void setScrollbarVisible( bool visible );
|
||||||
@ -95,7 +95,6 @@ protected:
|
|||||||
|
|
||||||
virtual void onSelectionManagerSelectionChanged( const std::set<int>& changedSelectionLevels ) override;
|
virtual void onSelectionManagerSelectionChanged( const std::set<int>& changedSelectionLevels ) override;
|
||||||
|
|
||||||
void setWidgetState( RiuWidgetStyleSheet::StateTag widgetState );
|
|
||||||
private slots:
|
private slots:
|
||||||
void performUpdate();
|
void performUpdate();
|
||||||
|
|
||||||
@ -103,7 +102,6 @@ private:
|
|||||||
void alignCanvasTopsAndScrollbar();
|
void alignCanvasTopsAndScrollbar();
|
||||||
void reinsertPlotWidgetsAndScrollbar();
|
void reinsertPlotWidgetsAndScrollbar();
|
||||||
void clearGridLayout();
|
void clearGridLayout();
|
||||||
RiuWidgetStyleSheet createDropTargetStyleSheet();
|
|
||||||
|
|
||||||
QList<QPointer<RiuQwtPlotWidget>> visiblePlotWidgets() const;
|
QList<QPointer<RiuQwtPlotWidget>> visiblePlotWidgets() const;
|
||||||
QList<QPointer<RiuQwtPlotLegend>> visibleLegends() const;
|
QList<QPointer<RiuQwtPlotLegend>> visibleLegends() const;
|
||||||
@ -120,9 +118,6 @@ protected:
|
|||||||
QList<int> m_legendColumns;
|
QList<int> m_legendColumns;
|
||||||
QList<QPointer<RiuQwtPlotWidget>> m_plotWidgets;
|
QList<QPointer<RiuQwtPlotWidget>> m_plotWidgets;
|
||||||
caf::PdmPointer<RimGridPlotWindow> m_plotDefinition;
|
caf::PdmPointer<RimGridPlotWindow> m_plotDefinition;
|
||||||
QPointer<QLabel> m_dropTargetPlaceHolder;
|
|
||||||
|
|
||||||
RiuWidgetStyleSheet m_dropTargetStyleSheet;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class RiaPlotWindowRedrawScheduler;
|
friend class RiaPlotWindowRedrawScheduler;
|
||||||
|
@ -630,9 +630,17 @@ void RiuPlotMainWindow::addViewer( QWidget* viewer, const RimMdiWindowGeometry&
|
|||||||
subWindowSize = QSize( windowsGeometry.width, windowsGeometry.height );
|
subWindowSize = QSize( windowsGeometry.width, windowsGeometry.height );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
RiuGridPlotWindow* wellLogPlot = dynamic_cast<RiuGridPlotWindow*>( viewer );
|
||||||
|
if ( wellLogPlot )
|
||||||
|
{
|
||||||
|
subWindowSize = QSize( wellLogPlot->preferredWidth(), m_mdiArea->height() );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
subWindowSize = QSize( 400, 400 );
|
subWindowSize = QSize( 400, 400 );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
addViewerToMdiArea( m_mdiArea, viewer, subWindowPos, subWindowSize );
|
addViewerToMdiArea( m_mdiArea, viewer, subWindowPos, subWindowSize );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user