Rename GridPlot to MultiPlot throughout

This commit is contained in:
Gaute Lindkvist 2019-11-13 12:22:50 +01:00
parent a73c7a4b97
commit 8252ab8808
36 changed files with 297 additions and 292 deletions

View File

@ -58,9 +58,9 @@
#include "RimGeoMechView.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimGridPlotWindowCollection.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimMainPlotCollection.h"
#include "RimMultiPlotCollection.h"
#include "RimObservedDataCollection.h"
#include "RimObservedSummaryData.h"
#include "RimOilField.h"
@ -311,7 +311,7 @@ void RiaGuiApplication::loadAndUpdatePlotData()
RimPltPlotCollection* pltColl = nullptr;
RimGridCrossPlotCollection* gcpColl = nullptr;
RimSaturationPressurePlotCollection* sppColl = nullptr;
RimGridPlotWindowCollection* gpwColl = nullptr;
RimMultiPlotCollection* gpwColl = nullptr;
if ( m_project->mainPlotCollection() )
{
@ -362,7 +362,7 @@ void RiaGuiApplication::loadAndUpdatePlotData()
plotCount += pltColl ? pltColl->pltPlots().size() : 0;
plotCount += gcpColl ? gcpColl->gridCrossPlots().size() : 0;
plotCount += sppColl ? sppColl->plots().size() : 0;
plotCount += gpwColl ? gpwColl->gridPlotWindows().size() : 0;
plotCount += gpwColl ? gpwColl->multiPlots().size() : 0;
if ( plotCount > 0 )
{
@ -439,9 +439,9 @@ void RiaGuiApplication::loadAndUpdatePlotData()
if ( gpwColl )
{
for ( const auto& gridPlotWindow : gpwColl->gridPlotWindows() )
for ( const auto& multiPlot : gpwColl->multiPlots() )
{
gridPlotWindow->loadDataAndUpdate();
multiPlot->loadDataAndUpdate();
plotProgress.incrementProgress();
}
}

View File

@ -17,7 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RiaPlotWindowRedrawScheduler.h"
#include "RiuGridPlotWindow.h"
#include "RiuMultiPlotWindow.h"
#include "RiuQwtPlotWidget.h"
#include <QCoreApplication>
@ -40,7 +40,7 @@ RiaPlotWindowRedrawScheduler* RiaPlotWindowRedrawScheduler::instance()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::schedulePlotWindowUpdate( RiuGridPlotWindow* plotWindow )
void RiaPlotWindowRedrawScheduler::schedulePlotWindowUpdate( RiuMultiPlotWindow* plotWindow )
{
m_plotWindowsToUpdate.push_back( plotWindow );
@ -78,10 +78,10 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
//--------------------------------------------------------------------------------------------------
void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
{
std::set<RiuQwtPlotWidget*> updatedPlots;
std::set<RiuGridPlotWindow*> updatedPlotWindows;
std::set<RiuQwtPlotWidget*> updatedPlots;
std::set<RiuMultiPlotWindow*> updatedPlotWindows;
for ( RiuGridPlotWindow* plotWindow : m_plotWindowsToUpdate )
for ( RiuMultiPlotWindow* plotWindow : m_plotWindowsToUpdate )
{
if ( plotWindow && !updatedPlotWindows.count( plotWindow ) )
{

View File

@ -26,7 +26,7 @@
#include <vector>
class RiuGridPlotWindow;
class RiuMultiPlotWindow;
class RiuQwtPlotWidget;
class RiaPlotWindowRedrawScheduler : public QObject
@ -35,7 +35,7 @@ class RiaPlotWindowRedrawScheduler : public QObject
public:
static RiaPlotWindowRedrawScheduler* instance();
void schedulePlotWindowUpdate( RiuGridPlotWindow* plotWindow );
void schedulePlotWindowUpdate( RiuMultiPlotWindow* plotWindow );
void schedulePlotWidgetReplot( RiuQwtPlotWidget* plotWidget );
void clearAllScheduledUpdates();
void performScheduledUpdatesAndReplots();
@ -47,7 +47,7 @@ private:
void startTimer( int msecs );
private:
std::vector<QPointer<RiuQwtPlotWidget>> m_plotWidgetsToReplot;
std::vector<QPointer<RiuGridPlotWindow>> m_plotWindowsToUpdate;
QScopedPointer<QTimer> m_plotWindowUpdateTimer;
std::vector<QPointer<RiuQwtPlotWidget>> m_plotWidgetsToReplot;
std::vector<QPointer<RiuMultiPlotWindow>> m_plotWindowsToUpdate;
QScopedPointer<QTimer> m_plotWindowUpdateTimer;
};

View File

@ -85,7 +85,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.h
${CMAKE_CURRENT_LIST_DIR}/RicNewGridPlotWindowFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.h
)
@ -169,7 +169,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewGridPlotWindowFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.cpp
)

View File

@ -39,11 +39,11 @@
#include "RimGeoMechView.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotDataSet.h"
#include "RimGridPlotWindow.h"
#include "RimGridTimeHistoryCurve.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimIntersection.h"
#include "RimIntersectionBox.h"
#include "RimMultiPlot.h"
#include "RimPerforationInterval.h"
#include "RimPolylinesAnnotation.h"
#include "RimReachCircleAnnotation.h"
@ -110,7 +110,7 @@ bool isDeletable( caf::PdmUiItem* uiItem )
if ( dynamic_cast<RimWellLogCurve*>( uiItem ) ) return true;
if ( dynamic_cast<RimSummaryPlot*>( uiItem ) )
{
RimGridPlotWindow* plotWindow = nullptr;
RimMultiPlot* plotWindow = nullptr;
static_cast<RimSummaryPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
return plotWindow == nullptr;
}
@ -139,7 +139,7 @@ bool isDeletable( caf::PdmUiItem* uiItem )
if ( dynamic_cast<RimPolylinesAnnotation*>( uiItem ) ) return true;
if ( dynamic_cast<RimGridCrossPlot*>( uiItem ) )
{
RimGridPlotWindow* plotWindow = nullptr;
RimMultiPlot* plotWindow = nullptr;
static_cast<RimGridCrossPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
return plotWindow == nullptr;
}

View File

@ -17,13 +17,13 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewGridPlotWindowFeature.h"
#include "RicNewMultiPlotFeature.h"
#include "RiaApplication.h"
#include "RimGridPlotWindow.h"
#include "RimGridPlotWindowCollection.h"
#include "RimMainPlotCollection.h"
#include "RimMultiPlot.h"
#include "RimMultiPlotCollection.h"
#include "RimPlotInterface.h"
#include "RimProject.h"
@ -34,12 +34,12 @@
#include "cvfAssert.h"
RICF_SOURCE_INIT( RicNewGridPlotWindowFeature, "RicNewGridPlotWindowFeature", "createMultiPlot" );
RICF_SOURCE_INIT( RicNewMultiPlotFeature, "RicNewMultiPlotFeature", "createMultiPlot" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicNewGridPlotWindowFeature::RicNewGridPlotWindowFeature()
RicNewMultiPlotFeature::RicNewMultiPlotFeature()
{
CAF_PDM_InitObject( "Create Multi Plot", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_plots, "plots", "Plots", "", "", "" );
@ -48,15 +48,15 @@ RicNewGridPlotWindowFeature::RicNewGridPlotWindowFeature()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicfCommandResponse RicNewGridPlotWindowFeature::execute()
RicfCommandResponse RicNewMultiPlotFeature::execute()
{
RimProject* project = RiaApplication::instance()->project();
RimGridPlotWindowCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
RimProject* project = RiaApplication::instance()->project();
RimMultiPlotCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
RimGridPlotWindow* plotWindow = new RimGridPlotWindow;
plotWindow->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( plotCollection->gridPlotWindows().size() + 1 ) );
RimMultiPlot* plotWindow = new RimMultiPlot;
plotWindow->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( plotCollection->multiPlots().size() + 1 ) );
plotWindow->setAsPlotMdiWindow();
plotCollection->addGridPlotWindow( plotWindow );
plotCollection->addMultiPlot( plotWindow );
if ( !m_plots().empty() )
{
@ -80,11 +80,11 @@ RicfCommandResponse RicNewGridPlotWindowFeature::execute()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewGridPlotWindowFeature::isCommandEnabled()
bool RicNewMultiPlotFeature::isCommandEnabled()
{
RimGridPlotWindowCollection* gridPlotCollection =
caf::SelectionManager::instance()->selectedItemOfType<RimGridPlotWindowCollection>();
if ( gridPlotCollection )
RimMultiPlotCollection* multiPlotCollection =
caf::SelectionManager::instance()->selectedItemOfType<RimMultiPlotCollection>();
if ( multiPlotCollection )
{
return true;
}
@ -100,7 +100,7 @@ bool RicNewGridPlotWindowFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewGridPlotWindowFeature::onActionTriggered( bool isChecked )
void RicNewMultiPlotFeature::onActionTriggered( bool isChecked )
{
m_plots.v().clear();
auto selectedPlots = selectedPlotInterfaces();
@ -114,7 +114,7 @@ void RicNewGridPlotWindowFeature::onActionTriggered( bool isChecked )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewGridPlotWindowFeature::setupActionLook( QAction* actionToSetup )
void RicNewMultiPlotFeature::setupActionLook( QAction* actionToSetup )
{
if ( selectedPlotInterfaces().empty() )
{
@ -131,7 +131,7 @@ void RicNewGridPlotWindowFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimPlotInterface*> RicNewGridPlotWindowFeature::selectedPlotInterfaces()
std::vector<RimPlotInterface*> RicNewMultiPlotFeature::selectedPlotInterfaces()
{
std::vector<caf::PdmUiItem*> uiItems;
caf::SelectionManager::instance()->selectedItems( uiItems );

View File

@ -30,12 +30,12 @@ class RimPlotInterface;
//==================================================================================================
///
//==================================================================================================
class RicNewGridPlotWindowFeature : public caf::CmdFeature, public RicfCommandObject
class RicNewMultiPlotFeature : public caf::CmdFeature, public RicfCommandObject
{
RICF_HEADER_INIT;
public:
RicNewGridPlotWindowFeature();
RicNewMultiPlotFeature();
virtual RicfCommandResponse execute() override;

View File

@ -21,11 +21,11 @@
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RiaGuiApplication.h"
#include "RiuGridPlotWindow.h"
#include "RiuMultiPlotWindow.h"
#include "RiuPlotMainWindow.h"
#include "RiuQwtPlotWidget.h"
#include "RimGridPlotWindow.h"
#include "RimMultiPlot.h"
#include "RimPlotInterface.h"
#include "RimWellLogTrack.h"
@ -50,9 +50,9 @@ bool RicDeleteSubPlotFeature::isCommandEnabled()
size_t plotsSelected = 0;
for ( caf::PdmObject* object : selection )
{
RimGridPlotWindow* gridPlotWindow = nullptr;
object->firstAncestorOrThisOfType( gridPlotWindow );
if ( dynamic_cast<RimPlotInterface*>( object ) && gridPlotWindow )
RimMultiPlot* multiPlot = nullptr;
object->firstAncestorOrThisOfType( multiPlot );
if ( dynamic_cast<RimPlotInterface*>( object ) && multiPlot )
{
plotsSelected++;
}
@ -72,13 +72,13 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
std::vector<caf::PdmObject*> selection;
caf::SelectionManager::instance()->objectsByType( &selection );
std::set<RimGridPlotWindow*> alteredPlotWindows;
std::set<RimMultiPlot*> alteredPlotWindows;
for ( size_t i = 0; i < selection.size(); i++ )
{
RimPlotInterface* plot = dynamic_cast<RimPlotInterface*>( selection[i] );
RimGridPlotWindow* plotWindow = nullptr;
RimMultiPlot* plotWindow = nullptr;
selection[i]->firstAncestorOrThisOfType( plotWindow );
if ( plot && plotWindow )
{
@ -91,7 +91,7 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
}
}
for ( RimGridPlotWindow* plotWindow : alteredPlotWindows )
for ( RimMultiPlot* plotWindow : alteredPlotWindows )
{
plotWindow->uiCapability()->updateConnectedEditors();
}

View File

@ -74,7 +74,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotInterface.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h
@ -137,7 +137,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.h
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.h
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindowCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.h
)
@ -216,7 +216,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPlotInterface.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindow.cpp
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp
@ -279,7 +279,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.cpp
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.cpp
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.cpp
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindowCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -29,7 +29,7 @@
#include "RimGridCrossPlotCollection.h"
#include "RimGridCrossPlotCurve.h"
#include "RimGridCrossPlotDataSet.h"
#include "RimGridPlotWindow.h"
#include "RimMultiPlot.h"
#include "RimPlotAxisProperties.h"
#include "cafPdmUiCheckBoxEditor.h"
@ -430,7 +430,7 @@ void RimGridCrossPlot::removeFromMdiAreaAndCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlot::updateAfterInsertingIntoGridPlotWindow()
void RimGridCrossPlot::updateAfterInsertingIntoMultiPlot()
{
if ( m_plotWidget )
{
@ -763,7 +763,7 @@ void RimGridCrossPlot::setYAxisInverted( bool inverted )
//--------------------------------------------------------------------------------------------------
int RimGridCrossPlot::legendFontSize() const
{
RimGridPlotWindow* plotWindow = nullptr;
RimMultiPlot* plotWindow = nullptr;
this->firstAncestorOrThisOfType( plotWindow );
if ( plotWindow )
{

View File

@ -115,7 +115,7 @@ public:
void removeDataSetLegend( RimGridCrossPlotDataSet* dataSet );
void removeFromMdiAreaAndCollection() override;
void updateAfterInsertingIntoGridPlotWindow() override;
void updateAfterInsertingIntoMultiPlot() override;
int rowSpan() const override;
int colSpan() const override;

View File

@ -71,12 +71,12 @@
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimGridCrossPlotDataSet.h"
#include "RimGridPlotWindowCollection.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimIntersection.h"
#include "RimIntersectionBox.h"
#include "RimIntersectionCollection.h"
#include "RimModeledWellPath.h"
#include "RimMultiPlotCollection.h"
#include "RimObservedSummaryData.h"
#include "RimPerforationCollection.h"
#include "RimPerforationInterval.h"
@ -866,7 +866,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
menuBuilder << "RicDeleteSummaryCaseCollectionFeature";
menuBuilder << "RicCloseObservedDataFeature";
menuBuilder << "RicNewGridPlotWindowFeature";
menuBuilder << "RicNewMultiPlotFeature";
// Work in progress -- End
appendCreateCompletions( menuBuilder, menuBuilder.itemCount() > 0u );

View File

@ -23,7 +23,7 @@
#include "RimFlowPlotCollection.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimGridPlotWindowCollection.h"
#include "RimMultiPlotCollection.h"
#include "RimPltPlotCollection.h"
#include "RimProject.h"
#include "RimRftPlotCollection.h"
@ -85,7 +85,7 @@ RimMainPlotCollection::RimMainPlotCollection()
"" );
m_saturationPressurePlotCollection.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_multiPlotCollection, "RimGridPlotWindowCollection", "Multi Plots", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_multiPlotCollection, "RimMultiPlotCollection", "Multi Plots", "", "", "" );
m_multiPlotCollection.uiCapability()->setUiHidden( true );
m_wellLogPlotCollection = new RimWellLogPlotCollection();
@ -96,7 +96,7 @@ RimMainPlotCollection::RimMainPlotCollection()
m_flowPlotCollection = new RimFlowPlotCollection();
m_gridCrossPlotCollection = new RimGridCrossPlotCollection;
m_saturationPressurePlotCollection = new RimSaturationPressurePlotCollection;
m_multiPlotCollection = new RimGridPlotWindowCollection;
m_multiPlotCollection = new RimMultiPlotCollection;
}
//--------------------------------------------------------------------------------------------------
@ -188,7 +188,7 @@ RimSaturationPressurePlotCollection* RimMainPlotCollection::saturationPressurePl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridPlotWindowCollection* RimMainPlotCollection::multiPlotCollection()
RimMultiPlotCollection* RimMainPlotCollection::multiPlotCollection()
{
return m_multiPlotCollection();
}
@ -261,7 +261,7 @@ void RimMainPlotCollection::updatePlotsWithFormations()
if ( m_multiPlotCollection )
{
for ( RimGridPlotWindow* plotWindow : m_multiPlotCollection->gridPlotWindows() )
for ( RimMultiPlot* plotWindow : m_multiPlotCollection->multiPlots() )
{
plotWindow->loadDataAndUpdate();
}
@ -283,7 +283,7 @@ void RimMainPlotCollection::updatePlotsWithCompletions()
if ( m_multiPlotCollection )
{
for ( RimGridPlotWindow* plotWindow : m_multiPlotCollection->gridPlotWindows() )
for ( RimMultiPlot* plotWindow : m_multiPlotCollection->multiPlots() )
{
plotWindow->loadDataAndUpdate();
}

View File

@ -30,7 +30,7 @@ class RimWellLogPlotCollection;
class RimRftPlotCollection;
class RimPltPlotCollection;
class RimGridCrossPlotCollection;
class RimGridPlotWindowCollection;
class RimMultiPlotCollection;
class RimSummaryPlotCollection;
class RimSummaryCrossPlotCollection;
class RimSummaryPlot;
@ -59,7 +59,7 @@ public:
RimFlowPlotCollection* flowPlotCollection();
RimGridCrossPlotCollection* gridCrossPlotCollection();
RimSaturationPressurePlotCollection* saturationPressurePlotCollection();
RimGridPlotWindowCollection* multiPlotCollection();
RimMultiPlotCollection* multiPlotCollection();
void deleteAllContainedObjects();
void updateCurrentTimeStepInPlots();
@ -84,7 +84,7 @@ private:
caf::PdmChildField<RimFlowPlotCollection*> m_flowPlotCollection;
caf::PdmChildField<RimGridCrossPlotCollection*> m_gridCrossPlotCollection;
caf::PdmChildField<RimSaturationPressurePlotCollection*> m_saturationPressurePlotCollection;
caf::PdmChildField<RimGridPlotWindowCollection*> m_multiPlotCollection;
caf::PdmChildField<RimMultiPlotCollection*> m_multiPlotCollection;
caf::PdmField<bool> m_show;
};

View File

@ -15,7 +15,7 @@
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGridPlotWindow.h"
#include "RimMultiPlot.h"
#include "RimPlotInterface.h"
#include "RiuPlotMainWindow.h"
@ -28,23 +28,23 @@
namespace caf
{
template <>
void RimGridPlotWindow::ColumnCountEnum::setUp()
void RimMultiPlot::ColumnCountEnum::setUp()
{
addItem( RimGridPlotWindow::COLUMNS_1, "1", "1 Column" );
addItem( RimGridPlotWindow::COLUMNS_2, "2", "2 Columns" );
addItem( RimGridPlotWindow::COLUMNS_3, "3", "3 Columns" );
addItem( RimGridPlotWindow::COLUMNS_4, "4", "4 Columns" );
addItem( RimGridPlotWindow::COLUMNS_UNLIMITED, "UNLIMITED", "Unlimited" );
setDefault( RimGridPlotWindow::COLUMNS_2 );
addItem( RimMultiPlot::COLUMNS_1, "1", "1 Column" );
addItem( RimMultiPlot::COLUMNS_2, "2", "2 Columns" );
addItem( RimMultiPlot::COLUMNS_3, "3", "3 Columns" );
addItem( RimMultiPlot::COLUMNS_4, "4", "4 Columns" );
addItem( RimMultiPlot::COLUMNS_UNLIMITED, "UNLIMITED", "Unlimited" );
setDefault( RimMultiPlot::COLUMNS_2 );
}
} // namespace caf
CAF_PDM_SOURCE_INIT( RimGridPlotWindow, "GridPlotWindow" );
CAF_PDM_SOURCE_INIT( RimMultiPlot, "MultiPlot" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridPlotWindow::RimGridPlotWindow()
RimMultiPlot::RimMultiPlot()
{
CAF_PDM_InitObject( "Multi Plot", ":/WellLogPlot16x16.png", "", "" );
@ -64,7 +64,7 @@ RimGridPlotWindow::RimGridPlotWindow()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridPlotWindow::~RimGridPlotWindow()
RimMultiPlot::~RimMultiPlot()
{
removeMdiWindowFromMdiArea();
m_plots.deleteAllChildObjects();
@ -75,7 +75,7 @@ RimGridPlotWindow::~RimGridPlotWindow()
//--------------------------------------------------------------------------------------------------
/// Move-assignment operator. Argument has to be passed with std::move()
//--------------------------------------------------------------------------------------------------
RimGridPlotWindow& RimGridPlotWindow::operator=( RimGridPlotWindow&& rhs )
RimMultiPlot& RimMultiPlot::operator=( RimMultiPlot&& rhs )
{
RimPlotWindow::operator=( std::move( rhs ) );
@ -99,7 +99,7 @@ RimGridPlotWindow& RimGridPlotWindow::operator=( RimGridPlotWindow&& rhs )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QWidget* RimGridPlotWindow::viewWidget()
QWidget* RimMultiPlot::viewWidget()
{
return m_viewer;
}
@ -107,7 +107,7 @@ QWidget* RimGridPlotWindow::viewWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridPlotWindow::isMultiPlotTitleVisible() const
bool RimMultiPlot::isMultiPlotTitleVisible() const
{
return m_showPlotWindowTitle;
}
@ -115,7 +115,7 @@ bool RimGridPlotWindow::isMultiPlotTitleVisible() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::setMultiPlotTitleVisible( bool visible )
void RimMultiPlot::setMultiPlotTitleVisible( bool visible )
{
m_showPlotWindowTitle = visible;
}
@ -123,7 +123,7 @@ void RimGridPlotWindow::setMultiPlotTitleVisible( bool visible )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridPlotWindow::multiPlotTitle() const
QString RimMultiPlot::multiPlotTitle() const
{
return m_plotWindowTitle;
}
@ -131,7 +131,7 @@ QString RimGridPlotWindow::multiPlotTitle() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::setMultiPlotTitle( const QString& title )
void RimMultiPlot::setMultiPlotTitle( const QString& title )
{
m_plotWindowTitle = title;
}
@ -139,7 +139,7 @@ void RimGridPlotWindow::setMultiPlotTitle( const QString& title )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::addPlot( RimPlotInterface* plot )
void RimMultiPlot::addPlot( RimPlotInterface* plot )
{
insertPlot( plot, m_plots.size() );
}
@ -147,7 +147,7 @@ void RimGridPlotWindow::addPlot( RimPlotInterface* plot )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::insertPlot( RimPlotInterface* plot, size_t index )
void RimMultiPlot::insertPlot( RimPlotInterface* plot, size_t index )
{
if ( plot )
{
@ -159,7 +159,7 @@ void RimGridPlotWindow::insertPlot( RimPlotInterface* plot, size_t index )
plot->createPlotWidget();
m_viewer->insertPlot( plot->viewer(), index );
}
plot->updateAfterInsertingIntoGridPlotWindow();
plot->updateAfterInsertingIntoMultiPlot();
onPlotAdditionOrRemoval();
}
@ -168,7 +168,7 @@ void RimGridPlotWindow::insertPlot( RimPlotInterface* plot, size_t index )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::removePlot( RimPlotInterface* plot )
void RimMultiPlot::removePlot( RimPlotInterface* plot )
{
if ( plot )
{
@ -185,15 +185,15 @@ void RimGridPlotWindow::removePlot( RimPlotInterface* plot )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::movePlotsToThis( const std::vector<RimPlotInterface*>& plotsToMove,
RimPlotInterface* plotToInsertAfter )
void RimMultiPlot::movePlotsToThis( const std::vector<RimPlotInterface*>& plotsToMove,
RimPlotInterface* plotToInsertAfter )
{
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
{
RimPlotInterface* plot = plotsToMove[tIdx];
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( plot );
RimGridPlotWindow* srcPlot = nullptr;
RimMultiPlot* srcPlot = nullptr;
pdmObject->firstAncestorOrThisOfType( srcPlot );
if ( srcPlot )
{
@ -220,7 +220,7 @@ void RimGridPlotWindow::movePlotsToThis( const std::vector<RimPlotInterface*>& p
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimGridPlotWindow::plotCount() const
size_t RimMultiPlot::plotCount() const
{
return m_plots.size();
}
@ -228,7 +228,7 @@ size_t RimGridPlotWindow::plotCount() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimGridPlotWindow::plotIndex( const RimPlotInterface* plot ) const
size_t RimMultiPlot::plotIndex( const RimPlotInterface* plot ) const
{
return m_plots.index( toPdmObjectAsserted( plot ) );
}
@ -236,7 +236,7 @@ size_t RimGridPlotWindow::plotIndex( const RimPlotInterface* plot ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimPlotInterface* RimGridPlotWindow::plotByIndex( size_t index ) const
RimPlotInterface* RimMultiPlot::plotByIndex( size_t index ) const
{
return toPlotInterfaceAsserted( m_plots[index] );
}
@ -244,7 +244,7 @@ RimPlotInterface* RimGridPlotWindow::plotByIndex( size_t index ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimPlotInterface*> RimGridPlotWindow::plots() const
std::vector<RimPlotInterface*> RimMultiPlot::plots() const
{
std::vector<RimPlotInterface*> allPlots;
allPlots.reserve( m_plots.size() );
@ -259,7 +259,7 @@ std::vector<RimPlotInterface*> RimGridPlotWindow::plots() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimPlotInterface*> RimGridPlotWindow::visiblePlots() const
std::vector<RimPlotInterface*> RimMultiPlot::visiblePlots() const
{
std::vector<RimPlotInterface*> allPlots;
for ( caf::PdmObject* pdmObject : m_plots() )
@ -276,7 +276,7 @@ std::vector<RimPlotInterface*> RimGridPlotWindow::visiblePlots() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::updateLayout()
void RimMultiPlot::updateLayout()
{
if ( m_showWindow )
{
@ -287,12 +287,12 @@ void RimGridPlotWindow::updateLayout()
//--------------------------------------------------------------------------------------------------
/// Empty default implementation
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::updatePlotNames() {}
void RimMultiPlot::updatePlotNames() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::updatePlotOrderFromGridWidget()
void RimMultiPlot::updatePlotOrderFromGridWidget()
{
std::sort( m_plots.begin(), m_plots.end(), [this]( caf::PdmObject* lhs, caf::PdmObject* rhs ) {
auto indexLhs = m_viewer->indexOfPlotWidget( toPlotInterfaceAsserted( lhs )->viewer() );
@ -306,7 +306,7 @@ void RimGridPlotWindow::updatePlotOrderFromGridWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::setAutoScaleXEnabled( bool enabled )
void RimMultiPlot::setAutoScaleXEnabled( bool enabled )
{
for ( RimPlotInterface* plot : plots() )
{
@ -317,7 +317,7 @@ void RimGridPlotWindow::setAutoScaleXEnabled( bool enabled )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::setAutoScaleYEnabled( bool enabled )
void RimMultiPlot::setAutoScaleYEnabled( bool enabled )
{
for ( RimPlotInterface* plot : plots() )
{
@ -328,7 +328,7 @@ void RimGridPlotWindow::setAutoScaleYEnabled( bool enabled )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimGridPlotWindow::columnCount() const
int RimMultiPlot::columnCount() const
{
if ( m_columnCountEnum() == COLUMNS_UNLIMITED )
{
@ -340,7 +340,7 @@ int RimGridPlotWindow::columnCount() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimGridPlotWindow::columnCountField()
caf::PdmFieldHandle* RimMultiPlot::columnCountField()
{
return &m_columnCountEnum;
}
@ -348,7 +348,7 @@ caf::PdmFieldHandle* RimGridPlotWindow::columnCountField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridPlotWindow::showPlotTitles() const
bool RimMultiPlot::showPlotTitles() const
{
return m_showIndividualPlotTitles;
}
@ -356,7 +356,7 @@ bool RimGridPlotWindow::showPlotTitles() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::zoomAll()
void RimMultiPlot::zoomAll()
{
setAutoScaleXEnabled( true );
setAutoScaleYEnabled( true );
@ -366,7 +366,7 @@ void RimGridPlotWindow::zoomAll()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridPlotWindow::asciiDataForPlotExport() const
QString RimMultiPlot::asciiDataForPlotExport() const
{
QString out = multiPlotTitle() + "\n";
@ -384,7 +384,7 @@ QString RimGridPlotWindow::asciiDataForPlotExport() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::onPlotAdditionOrRemoval()
void RimMultiPlot::onPlotAdditionOrRemoval()
{
updatePlotNames();
updateConnectedEditors();
@ -395,7 +395,7 @@ void RimGridPlotWindow::onPlotAdditionOrRemoval()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QImage RimGridPlotWindow::snapshotWindowContent()
QImage RimMultiPlot::snapshotWindowContent()
{
QImage image;
@ -413,9 +413,9 @@ QImage RimGridPlotWindow::snapshotWindowContent()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QWidget* RimGridPlotWindow::createViewWidget( QWidget* mainWindowParent )
QWidget* RimMultiPlot::createViewWidget( QWidget* mainWindowParent )
{
m_viewer = new RiuGridPlotWindow( this, mainWindowParent );
m_viewer = new RiuMultiPlotWindow( this, mainWindowParent );
recreatePlotWidgets();
return m_viewer;
}
@ -423,7 +423,7 @@ QWidget* RimGridPlotWindow::createViewWidget( QWidget* mainWindowParent )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::deleteViewWidget()
void RimMultiPlot::deleteViewWidget()
{
cleanupBeforeClose();
}
@ -431,7 +431,7 @@ void RimGridPlotWindow::deleteViewWidget()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimGridPlotWindow::userDescriptionField()
caf::PdmFieldHandle* RimMultiPlot::userDescriptionField()
{
return &m_plotWindowTitle;
}
@ -439,9 +439,9 @@ caf::PdmFieldHandle* RimGridPlotWindow::userDescriptionField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
void RimMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
@ -464,7 +464,7 @@ void RimGridPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
void RimMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
uiOrderingForPlotLayout( *titleAndLegendsGroup );
@ -473,7 +473,7 @@ void RimGridPlotWindow::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering )
void RimMultiPlot::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_showPlotWindowTitle );
uiOrdering.add( &m_plotWindowTitle );
@ -485,8 +485,8 @@ void RimGridPlotWindow::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimGridPlotWindow::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
QList<caf::PdmOptionItemInfo> RimMultiPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options = RimPlotWindow::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
@ -519,7 +519,7 @@ QList<caf::PdmOptionItemInfo> RimGridPlotWindow::calculateValueOptions( const ca
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::onLoadDataAndUpdate()
void RimMultiPlot::onLoadDataAndUpdate()
{
updateMdiWindowVisibility();
updatePlotTitleInWidgets();
@ -530,7 +530,7 @@ void RimGridPlotWindow::onLoadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::initAfterRead()
void RimMultiPlot::initAfterRead()
{
RimPlotWindow::initAfterRead();
}
@ -538,7 +538,7 @@ void RimGridPlotWindow::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::updatePlotTitleInWidgets()
void RimMultiPlot::updatePlotTitleInWidgets()
{
if ( m_viewer )
{
@ -551,7 +551,7 @@ void RimGridPlotWindow::updatePlotTitleInWidgets()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::updatePlots()
void RimMultiPlot::updatePlots()
{
if ( m_showWindow )
{
@ -566,7 +566,7 @@ void RimGridPlotWindow::updatePlots()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::updateZoom()
void RimMultiPlot::updateZoom()
{
for ( RimPlotInterface* plot : plots() )
{
@ -577,7 +577,7 @@ void RimGridPlotWindow::updateZoom()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::recreatePlotWidgets()
void RimMultiPlot::recreatePlotWidgets()
{
CVF_ASSERT( m_viewer );
@ -593,7 +593,7 @@ void RimGridPlotWindow::recreatePlotWidgets()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridPlotWindow::hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const
bool RimMultiPlot::hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const
{
if ( fontSettingType == RiaDefines::PLOT_FONT && m_viewer )
{
@ -619,10 +619,10 @@ bool RimGridPlotWindow::hasCustomFontSizes( RiaDefines::FontSettingType fontSett
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridPlotWindow::applyFontSize( RiaDefines::FontSettingType fontSettingType,
int oldFontSize,
int fontSize,
bool forceChange /*= false */ )
bool RimMultiPlot::applyFontSize( RiaDefines::FontSettingType fontSettingType,
int oldFontSize,
int fontSize,
bool forceChange /*= false */ )
{
bool somethingChanged = false;
if ( fontSettingType == RiaDefines::PLOT_FONT && m_viewer )
@ -657,7 +657,7 @@ bool RimGridPlotWindow::applyFontSize( RiaDefines::FontSettingType fontSettingTy
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindow::cleanupBeforeClose()
void RimMultiPlot::cleanupBeforeClose()
{
auto plotVector = plots();
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
@ -675,7 +675,7 @@ void RimGridPlotWindow::cleanupBeforeClose()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimPlotInterface* RimGridPlotWindow::toPlotInterfaceAsserted( caf::PdmObject* pdmObject )
RimPlotInterface* RimMultiPlot::toPlotInterfaceAsserted( caf::PdmObject* pdmObject )
{
RimPlotInterface* plotInterface = dynamic_cast<RimPlotInterface*>( pdmObject );
CAF_ASSERT( plotInterface );
@ -685,7 +685,7 @@ RimPlotInterface* RimGridPlotWindow::toPlotInterfaceAsserted( caf::PdmObject* pd
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RimPlotInterface* RimGridPlotWindow::toPlotInterfaceAsserted( const caf::PdmObject* pdmObject )
const RimPlotInterface* RimMultiPlot::toPlotInterfaceAsserted( const caf::PdmObject* pdmObject )
{
const RimPlotInterface* plotInterface = dynamic_cast<const RimPlotInterface*>( pdmObject );
CAF_ASSERT( plotInterface );
@ -695,7 +695,7 @@ const RimPlotInterface* RimGridPlotWindow::toPlotInterfaceAsserted( const caf::P
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObject* RimGridPlotWindow::toPdmObjectAsserted( RimPlotInterface* plotInterface )
caf::PdmObject* RimMultiPlot::toPdmObjectAsserted( RimPlotInterface* plotInterface )
{
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( plotInterface );
CAF_ASSERT( pdmObject );
@ -705,7 +705,7 @@ caf::PdmObject* RimGridPlotWindow::toPdmObjectAsserted( RimPlotInterface* plotIn
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const caf::PdmObject* RimGridPlotWindow::toPdmObjectAsserted( const RimPlotInterface* plotInterface )
const caf::PdmObject* RimMultiPlot::toPdmObjectAsserted( const RimPlotInterface* plotInterface )
{
const caf::PdmObject* pdmObject = dynamic_cast<const caf::PdmObject*>( plotInterface );
CAF_ASSERT( pdmObject );

View File

@ -18,7 +18,7 @@
#pragma once
#include "RimPlotWindow.h"
#include "RiuGridPlotWindow.h"
#include "RiuMultiPlotWindow.h"
#include "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
@ -34,7 +34,7 @@
class RimPlotInterface;
class RimGridPlotWindow : public RimPlotWindow
class RimMultiPlot : public RimPlotWindow
{
CAF_PDM_HEADER_INIT;
@ -50,10 +50,10 @@ public:
typedef caf::AppEnum<ColumnCount> ColumnCountEnum;
public:
RimGridPlotWindow();
~RimGridPlotWindow() override;
RimMultiPlot();
~RimMultiPlot() override;
RimGridPlotWindow& operator=( RimGridPlotWindow&& rhs );
RimMultiPlot& operator=( RimMultiPlot&& rhs );
QWidget* viewWidget() override;
@ -136,8 +136,8 @@ protected:
caf::PdmField<ColumnCountEnum> m_columnCountEnum;
caf::PdmField<bool> m_showIndividualPlotTitles;
friend class RiuGridPlotWindow;
QPointer<RiuGridPlotWindow> m_viewer;
friend class RiuMultiPlotWindow;
QPointer<RiuMultiPlotWindow> m_viewer;
private:
caf::PdmChildArrayField<caf::PdmObject*> m_plots;

View File

@ -15,62 +15,62 @@
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGridPlotWindowCollection.h"
#include "RimMultiPlotCollection.h"
#include "RiaApplication.h"
#include "RimGridPlotWindow.h"
#include "RimMultiPlot.h"
#include "RimProject.h"
CAF_PDM_SOURCE_INIT( RimGridPlotWindowCollection, "RimGridPlotWindowCollection" );
CAF_PDM_SOURCE_INIT( RimMultiPlotCollection, "RimMultiPlotCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridPlotWindowCollection::RimGridPlotWindowCollection()
RimMultiPlotCollection::RimMultiPlotCollection()
{
CAF_PDM_InitObject( "Multi Plots", ":/WellLogPlot16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault( &m_gridPlotWindows, "GridPlotWindows", "Plots Reports", "", "", "" );
m_gridPlotWindows.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_multiPlots, "MultiPlots", "Plots Reports", "", "", "" );
m_multiPlots.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridPlotWindowCollection::~RimGridPlotWindowCollection() {}
RimMultiPlotCollection::~RimMultiPlotCollection() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindowCollection::deleteAllChildObjects()
void RimMultiPlotCollection::deleteAllChildObjects()
{
m_gridPlotWindows.deleteAllChildObjects();
m_multiPlots.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimGridPlotWindow*> RimGridPlotWindowCollection::gridPlotWindows() const
std::vector<RimMultiPlot*> RimMultiPlotCollection::multiPlots() const
{
return m_gridPlotWindows.childObjects();
return m_multiPlots.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridPlotWindow* RimGridPlotWindowCollection::createGridPlotWindow()
RimMultiPlot* RimMultiPlotCollection::createMultiPlot()
{
RimGridPlotWindow* plot = new RimGridPlotWindow();
RimMultiPlot* plot = new RimMultiPlot();
plot->setAsPlotMdiWindow();
addGridPlotWindow( plot );
addMultiPlot( plot );
return plot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridPlotWindowCollection::addGridPlotWindow( RimGridPlotWindow* plot )
void RimMultiPlotCollection::addMultiPlot( RimMultiPlot* plot )
{
m_gridPlotWindows().push_back( plot );
m_multiPlots().push_back( plot );
}

View File

@ -20,26 +20,26 @@
#include "cafPdmChildArrayField.h"
#include "cafPdmObject.h"
class RimGridPlotWindow;
class RimMultiPlot;
//==================================================================================================
///
///
//==================================================================================================
class RimGridPlotWindowCollection : public caf::PdmObject
class RimMultiPlotCollection : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimGridPlotWindowCollection();
~RimGridPlotWindowCollection() override;
RimMultiPlotCollection();
~RimMultiPlotCollection() override;
void deleteAllChildObjects();
std::vector<RimGridPlotWindow*> gridPlotWindows() const;
RimGridPlotWindow* createGridPlotWindow();
void addGridPlotWindow( RimGridPlotWindow* plot );
std::vector<RimMultiPlot*> multiPlots() const;
RimMultiPlot* createMultiPlot();
void addMultiPlot( RimMultiPlot* plot );
private:
caf::PdmChildArrayField<RimGridPlotWindow*> m_gridPlotWindows;
caf::PdmChildArrayField<RimMultiPlot*> m_multiPlots;
};

View File

@ -1,6 +1,6 @@
#include "RimPlotInterface.h"
#include "RimGridPlotWindow.h"
#include "RimMultiPlot.h"
#include "RimPlotWindow.h"
#include "RiuQwtPlotWidget.h"
@ -42,9 +42,9 @@ bool RimPlotInterface::isStandalonePlot() const
if ( thisPdm )
{
RimGridPlotWindow* gridPlotWindow = nullptr;
thisPdm->firstAncestorOrThisOfType( gridPlotWindow );
return gridPlotWindow == nullptr;
RimMultiPlot* multiPlot = nullptr;
thisPdm->firstAncestorOrThisOfType( multiPlot );
return multiPlot == nullptr;
}
return false;
}
@ -65,7 +65,7 @@ void RimPlotInterface::updatePlotWindowLayout()
const caf::PdmObject* thisPdm = dynamic_cast<const caf::PdmObject*>( this );
CAF_ASSERT( thisPdm );
RimGridPlotWindow* plotWindow;
RimMultiPlot* plotWindow;
thisPdm->firstAncestorOrThisOfType( plotWindow );
if ( plotWindow )
{

View File

@ -104,7 +104,7 @@ public:
virtual void onAxisSelected( int axis, bool toggle ) {}
virtual void removeFromMdiAreaAndCollection() {}
virtual void updateAfterInsertingIntoGridPlotWindow() {}
virtual void updateAfterInsertingIntoMultiPlot() {}
protected:
void updatePlotWindowLayout();

View File

@ -50,12 +50,12 @@
#include "RimGeoMechCase.h"
#include "RimGeoMechModels.h"
#include "RimGridCrossPlotCollection.h"
#include "RimGridPlotWindowCollection.h"
#include "RimGridSummaryCase.h"
#include "RimGridView.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimMainPlotCollection.h"
#include "RimMeasurement.h"
#include "RimMultiPlotCollection.h"
#include "RimObservedDataCollection.h"
#include "RimObservedSummaryData.h"
#include "RimOilField.h"

View File

@ -34,8 +34,8 @@
#include "RimFlowPlotCollection.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimGridPlotWindowCollection.h"
#include "RimMainPlotCollection.h"
#include "RimMultiPlotCollection.h"
#include "RimProject.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryPlot.h"
@ -179,10 +179,10 @@ void RimReloadCaseTools::updateAllPlots()
flowPlotCollection->loadDataAndUpdate();
}
RimGridPlotWindowCollection* gridPlotWindowCollection = project->mainPlotCollection()->multiPlotCollection();
if ( gridPlotWindowCollection )
RimMultiPlotCollection* multiPlotCollection = project->mainPlotCollection()->multiPlotCollection();
if ( multiPlotCollection )
{
for ( RimGridPlotWindow* plotWindow : gridPlotWindowCollection->gridPlotWindows() )
for ( RimMultiPlot* plotWindow : multiPlotCollection->multiPlots() )
{
plotWindow->loadDataAndUpdate();
}

View File

@ -31,7 +31,7 @@
#include "RimWellLogCurveCommonDataSource.h"
#include "RimWellLogTrack.h"
#include "RiuGridPlotWindow.h"
#include "RiuMultiPlotWindow.h"
#include "RiuPlotMainWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "RiuQwtPlotWidget.h"
@ -104,7 +104,7 @@ RimWellLogPlot::RimWellLogPlot()
m_maxAvailableDepth = -HUGE_VAL;
m_commonDataSourceEnabled = true;
m_columnCountEnum = RimGridPlotWindow::COLUMNS_UNLIMITED;
m_columnCountEnum = RimMultiPlot::COLUMNS_UNLIMITED;
setMultiPlotTitleVisible( false );
}
@ -114,7 +114,7 @@ RimWellLogPlot::RimWellLogPlot()
//--------------------------------------------------------------------------------------------------
RimWellLogPlot& RimWellLogPlot::operator=( RimWellLogPlot&& rhs )
{
RimGridPlotWindow::operator=( std::move( rhs ) );
RimMultiPlot::operator=( std::move( rhs ) );
auto dataSource = rhs.m_commonDataSource();
rhs.m_commonDataSource.removeChildObject( dataSource );
@ -181,7 +181,7 @@ void RimWellLogPlot::updateZoom()
m_maxAvailableDepth );
}
RimGridPlotWindow::updateZoom();
RimMultiPlot::updateZoom();
}
//--------------------------------------------------------------------------------------------------
@ -503,7 +503,7 @@ void RimWellLogPlot::onPlotAdditionOrRemoval()
{
calculateAvailableDepthRange();
updateZoom();
RimGridPlotWindow::onPlotAdditionOrRemoval();
RimMultiPlot::onPlotAdditionOrRemoval();
}
//--------------------------------------------------------------------------------------------------
@ -533,7 +533,7 @@ void RimWellLogPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
RimGridPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
RimMultiPlot::fieldChangedByUi( changedField, oldValue, newValue );
if ( changedField == &m_minVisibleDepth || changedField == &m_maxVisibleDepth )
{
@ -599,8 +599,7 @@ void RimWellLogPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
QList<caf::PdmOptionItemInfo> RimWellLogPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options = RimGridPlotWindow::calculateValueOptions( fieldNeedingOptions,
useOptionsOnly );
QList<caf::PdmOptionItemInfo> options = RimMultiPlot::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
if ( fieldNeedingOptions == &m_depthType )
{
@ -633,7 +632,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogPlot::calculateValueOptions( const caf::
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::initAfterRead()
{
RimGridPlotWindow::initAfterRead();
RimMultiPlot::initAfterRead();
updateCommonDataSource();
if ( !m_plotWindowTitle().isEmpty() )
@ -677,7 +676,7 @@ QImage RimWellLogPlot::snapshotWindowContent()
CAF_ASSERT( wellLogViewer );
bool isScrollbarVisible = wellLogViewer->isScrollbarVisible();
wellLogViewer->setScrollbarVisible( false );
image = RimGridPlotWindow::snapshotWindowContent();
image = RimMultiPlot::snapshotWindowContent();
wellLogViewer->setScrollbarVisible( isScrollbarVisible );
}

View File

@ -27,7 +27,7 @@
#include "cafPdmObject.h"
#include "RiaDefines.h"
#include "RimGridPlotWindow.h"
#include "RimMultiPlot.h"
#include "RimWellLogPlotNameConfig.h"
#include <QPointer>
@ -35,7 +35,7 @@
#include <set>
class RimWellLogCurveCommonDataSource;
class RiuGridPlotWindow;
class RiuMultiPlotWindow;
class RimPlotInterface;
class QKeyEvent;
@ -43,7 +43,7 @@ class QKeyEvent;
///
///
//==================================================================================================
class RimWellLogPlot : public RimGridPlotWindow, public RimNameConfigHolderInterface
class RimWellLogPlot : public RimMultiPlot, public RimNameConfigHolderInterface
{
CAF_PDM_HEADER_INIT;

View File

@ -66,8 +66,8 @@
#include "RimWellPltPlot.h"
#include "RimWellRftPlot.h"
#include "RiuGridPlotWindow.h"
#include "RiuMainWindow.h"
#include "RiuMultiPlotWindow.h"
#include "RiuPlotAnnotationTool.h"
#include "RiuPlotMainWindowTools.h"
#include "RiuQwtPlotWidget.h"

View File

@ -32,8 +32,8 @@
#include "RimAsciiDataCurve.h"
#include "RimEnsembleCurveSet.h"
#include "RimEnsembleCurveSetCollection.h"
#include "RimGridPlotWindow.h"
#include "RimGridTimeHistoryCurve.h"
#include "RimMultiPlot.h"
#include "RimPlotAxisProperties.h"
#include "RimProject.h"
#include "RimSummaryCase.h"
@ -1577,7 +1577,7 @@ void RimSummaryPlot::removeFromMdiAreaAndCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::updateAfterInsertingIntoGridPlotWindow()
void RimSummaryPlot::updateAfterInsertingIntoMultiPlot()
{
if ( m_plotWidget )
{
@ -1887,7 +1887,7 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na
//--------------------------------------------------------------------------------------------------
void RimSummaryPlot::updateWindowVisibility()
{
RimGridPlotWindow* plotWindow = nullptr;
RimMultiPlot* plotWindow = nullptr;
this->firstAncestorOrThisOfType( plotWindow );
if ( plotWindow )
{

View File

@ -180,7 +180,7 @@ public:
void removeEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet );
void removeFromMdiAreaAndCollection() override;
void updateAfterInsertingIntoGridPlotWindow() override;
void updateAfterInsertingIntoMultiPlot() override;
int rowSpan() const override;
int colSpan() const override;

View File

@ -51,7 +51,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h
${CMAKE_CURRENT_LIST_DIR}/RiuPickItemInfo.h
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.h
${CMAKE_CURRENT_LIST_DIR}/RiuGridPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.h
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.h
${CMAKE_CURRENT_LIST_DIR}/RiuPlotAnnotationTool.h
@ -139,7 +139,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuPickItemInfo.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuGridPlotWindow.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotWindow.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.cpp
${CMAKE_CURRENT_LIST_DIR}/RiuPlotAnnotationTool.cpp
@ -201,7 +201,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h
${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.h
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.h
${CMAKE_CURRENT_LIST_DIR}/RiuGridPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotWindow.h
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.h
${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.h
${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.h

View File

@ -27,9 +27,9 @@
#include "RimCaseCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseResultCase.h"
#include "RimGridPlotWindow.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimMimeData.h"
#include "RimMultiPlot.h"
#include "RimPlotInterface.h"
#include "RimSummaryCase.h"
#include "RimSummaryCaseCollection.h"
@ -186,7 +186,7 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
itemflags |= Qt::ItemIsDropEnabled;
}
}
else if ( dynamic_cast<RimGridPlotWindow*>( uiItem ) )
else if ( dynamic_cast<RimMultiPlot*>( uiItem ) )
{
if ( RiuTypedPdmObjects<RimPlotInterface>::containsTypedObjects( m_dragItems ) )
{
@ -304,11 +304,11 @@ bool RiuDragDrop::dropMimeData( const QMimeData* data, Qt::DropAction action, in
return handleWellLogPlotTrackDrop( action, draggedObjects, wellLogPlotTrack, row );
}
RimGridPlotWindow* gridPlotWindow;
dropTarget->firstAncestorOrThisOfType( gridPlotWindow );
if ( gridPlotWindow )
RimMultiPlot* multiPlot;
dropTarget->firstAncestorOrThisOfType( multiPlot );
if ( multiPlot )
{
return handleGridPlotWindowDrop( action, draggedObjects, gridPlotWindow, row );
return handleMultiPlotDrop( action, draggedObjects, multiPlot, row );
}
RimSummaryCaseCollection* summaryCaseCollection;
@ -444,7 +444,7 @@ bool RiuDragDrop::handleWellLogPlotTrackDrop( Qt::DropAction action,
{
RimWellLogPlot* wellLogPlot;
trackTarget->firstAncestorOrThisOfType( wellLogPlot );
return handleGridPlotWindowDrop( action, draggedObjects, wellLogPlot, insertAtPosition );
return handleMultiPlotDrop( action, draggedObjects, wellLogPlot, insertAtPosition );
}
}
@ -454,10 +454,10 @@ bool RiuDragDrop::handleWellLogPlotTrackDrop( Qt::DropAction action,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuDragDrop::handleGridPlotWindowDrop( Qt::DropAction action,
caf::PdmObjectGroup& draggedObjects,
RimGridPlotWindow* gridPlotWindow,
int insertAtPosition )
bool RiuDragDrop::handleMultiPlotDrop( Qt::DropAction action,
caf::PdmObjectGroup& draggedObjects,
RimMultiPlot* multiPlot,
int insertAtPosition )
{
std::vector<RimPlotInterface*> plots = RiuTypedPdmObjects<RimPlotInterface>::typedObjectsFromGroup( draggedObjects );
if ( plots.size() > 0 )
@ -467,14 +467,14 @@ bool RiuDragDrop::handleGridPlotWindowDrop( Qt::DropAction action,
RimPlotInterface* insertAfter = nullptr;
if ( insertAtPosition > 0 )
{
auto visibleTracks = gridPlotWindow->visiblePlots();
auto visibleTracks = multiPlot->visiblePlots();
if ( !visibleTracks.empty() )
{
int insertAfterPosition = std::min( insertAtPosition - 1, (int)visibleTracks.size() - 1 );
insertAfter = dynamic_cast<RimPlotInterface*>( visibleTracks[insertAfterPosition] );
}
}
gridPlotWindow->movePlotsToThis( plots, insertAfter );
multiPlot->movePlotsToThis( plots, insertAfter );
return true;
}
}

View File

@ -29,7 +29,7 @@ namespace caf
class PdmObjectHandle;
}
class RimGridPlotWindow;
class RimMultiPlot;
class RimIdenticalGridCaseGroup;
class RimSummaryCaseCollection;
class RimSummaryCaseMainCollection;
@ -65,10 +65,10 @@ private:
caf::PdmObjectGroup& objectGroup,
RimWellLogTrack* wellLogPlotTrack,
int insertAtPosition );
bool handleGridPlotWindowDrop( Qt::DropAction action,
caf::PdmObjectGroup& objectGroup,
RimGridPlotWindow* gridPlotWindow,
int insertAtPosition );
bool handleMultiPlotDrop( Qt::DropAction action,
caf::PdmObjectGroup& objectGroup,
RimMultiPlot* multiPlot,
int insertAtPosition );
bool handleWellLogPlotCurveDrop( Qt::DropAction action,
caf::PdmObjectGroup& objectGroup,
RimWellLogCurve* wellLogPlotCurve );

View File

@ -17,7 +17,7 @@
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiuGridPlotWindow.h"
#include "RiuMultiPlotWindow.h"
#include "RiaApplication.h"
#include "RiaPlotWindowRedrawScheduler.h"
@ -26,7 +26,7 @@
#include "WellLogCommands/RicWellLogPlotTrackFeatureImpl.h"
#include "RimContextCommandBuilder.h"
#include "RimGridPlotWindow.h"
#include "RimMultiPlot.h"
#include "RimWellLogTrack.h"
#include "RiuMainWindow.h"
@ -57,7 +57,7 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuGridPlotWindow::RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget* parent )
RiuMultiPlotWindow::RiuMultiPlotWindow( RimMultiPlot* plotDefinition, QWidget* parent )
: QWidget( parent )
{
Q_ASSERT( plotDefinition );
@ -112,7 +112,12 @@ RiuGridPlotWindow::RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridPlotWindow* RiuGridPlotWindow::ownerPlotDefinition()
RiuMultiPlotWindow::~RiuMultiPlotWindow() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMultiPlot* RiuMultiPlotWindow::ownerPlotDefinition()
{
return m_plotDefinition;
}
@ -120,7 +125,7 @@ RimGridPlotWindow* RiuGridPlotWindow::ownerPlotDefinition()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimViewWindow* RiuGridPlotWindow::ownerViewWindow() const
RimViewWindow* RiuMultiPlotWindow::ownerViewWindow() const
{
return m_plotDefinition;
}
@ -128,7 +133,7 @@ RimViewWindow* RiuGridPlotWindow::ownerViewWindow() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::addPlot( RiuQwtPlotWidget* plotWidget )
void RiuMultiPlotWindow::addPlot( RiuQwtPlotWidget* plotWidget )
{
// Insert the plot to the left of the scroll bar
insertPlot( plotWidget, m_plotWidgets.size() );
@ -137,7 +142,7 @@ void RiuGridPlotWindow::addPlot( RiuQwtPlotWidget* plotWidget )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::insertPlot( RiuQwtPlotWidget* plotWidget, size_t index )
void RiuMultiPlotWindow::insertPlot( RiuQwtPlotWidget* plotWidget, size_t index )
{
plotWidget->setDraggable( true ); // Becomes draggable when added to a grid plot window
m_plotWidgets.insert( static_cast<int>( index ), plotWidget );
@ -171,7 +176,7 @@ void RiuGridPlotWindow::insertPlot( RiuQwtPlotWidget* plotWidget, size_t index )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::removePlot( RiuQwtPlotWidget* plotWidget )
void RiuMultiPlotWindow::removePlot( RiuQwtPlotWidget* plotWidget )
{
if ( !plotWidget ) return;
@ -198,7 +203,7 @@ void RiuGridPlotWindow::removePlot( RiuQwtPlotWidget* plotWidget )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::setPlotTitle( const QString& plotTitle )
void RiuMultiPlotWindow::setPlotTitle( const QString& plotTitle )
{
m_plotTitle->setText( plotTitle );
}
@ -206,7 +211,7 @@ void RiuGridPlotWindow::setPlotTitle( const QString& plotTitle )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::setTitleVisible( bool visible )
void RiuMultiPlotWindow::setTitleVisible( bool visible )
{
m_plotTitle->setVisible( visible );
}
@ -214,7 +219,7 @@ void RiuGridPlotWindow::setTitleVisible( bool visible )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::setSelectionsVisible( bool visible )
void RiuMultiPlotWindow::setSelectionsVisible( bool visible )
{
for ( RiuQwtPlotWidget* plotWidget : m_plotWidgets )
{
@ -232,7 +237,7 @@ void RiuGridPlotWindow::setSelectionsVisible( bool visible )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::setFontSize( int fontSize )
void RiuMultiPlotWindow::setFontSize( int fontSize )
{
QFont font = m_plotTitle->font();
@ -244,7 +249,7 @@ void RiuGridPlotWindow::setFontSize( int fontSize )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RiuGridPlotWindow::fontSize() const
int RiuMultiPlotWindow::fontSize() const
{
return m_plotTitle->font().pointSize() - 1;
}
@ -252,7 +257,7 @@ int RiuGridPlotWindow::fontSize() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RiuGridPlotWindow::indexOfPlotWidget( RiuQwtPlotWidget* plotWidget )
int RiuMultiPlotWindow::indexOfPlotWidget( RiuQwtPlotWidget* plotWidget )
{
return m_plotWidgets.indexOf( plotWidget );
}
@ -260,7 +265,7 @@ int RiuGridPlotWindow::indexOfPlotWidget( RiuQwtPlotWidget* plotWidget )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::scheduleUpdate()
void RiuMultiPlotWindow::scheduleUpdate()
{
RiaPlotWindowRedrawScheduler::instance()->schedulePlotWindowUpdate( this );
}
@ -268,7 +273,7 @@ void RiuGridPlotWindow::scheduleUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::scheduleReplotOfAllPlots()
void RiuMultiPlotWindow::scheduleReplotOfAllPlots()
{
for ( RiuQwtPlotWidget* plotWidget : visiblePlotWidgets() )
{
@ -279,7 +284,7 @@ void RiuGridPlotWindow::scheduleReplotOfAllPlots()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::contextMenuEvent( QContextMenuEvent* event )
void RiuMultiPlotWindow::contextMenuEvent( QContextMenuEvent* event )
{
QMenu menu;
caf::CmdFeatureMenuBuilder menuBuilder;
@ -300,7 +305,7 @@ void RiuGridPlotWindow::contextMenuEvent( QContextMenuEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::keyPressEvent( QKeyEvent* keyEvent )
void RiuMultiPlotWindow::keyPressEvent( QKeyEvent* keyEvent )
{
m_plotDefinition->handleKeyPressEvent( keyEvent );
}
@ -308,7 +313,7 @@ void RiuGridPlotWindow::keyPressEvent( QKeyEvent* keyEvent )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QLabel* RiuGridPlotWindow::createTitleLabel() const
QLabel* RiuMultiPlotWindow::createTitleLabel() const
{
QLabel* plotTitle = new QLabel( "PLOT TITLE HERE", nullptr );
plotTitle->setVisible( m_plotDefinition->isMultiPlotTitleVisible() );
@ -321,7 +326,7 @@ QLabel* RiuGridPlotWindow::createTitleLabel() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::resizeEvent( QResizeEvent* event )
void RiuMultiPlotWindow::resizeEvent( QResizeEvent* event )
{
QWidget::resizeEvent( event );
bool needsUpdate = false;
@ -350,7 +355,7 @@ void RiuGridPlotWindow::resizeEvent( QResizeEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::showEvent( QShowEvent* event )
void RiuMultiPlotWindow::showEvent( QShowEvent* event )
{
QWidget::showEvent( event );
performUpdate();
@ -359,7 +364,7 @@ void RiuGridPlotWindow::showEvent( QShowEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::dragEnterEvent( QDragEnterEvent* event )
void RiuMultiPlotWindow::dragEnterEvent( QDragEnterEvent* event )
{
RiuQwtPlotWidget* source = dynamic_cast<RiuQwtPlotWidget*>( event->source() );
if ( source )
@ -372,7 +377,7 @@ void RiuGridPlotWindow::dragEnterEvent( QDragEnterEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::dragMoveEvent( QDragMoveEvent* event )
void RiuMultiPlotWindow::dragMoveEvent( QDragMoveEvent* event )
{
if ( event->answerRect().intersects( this->geometry() ) )
{
@ -415,7 +420,7 @@ void RiuGridPlotWindow::dragMoveEvent( QDragMoveEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::dragLeaveEvent( QDragLeaveEvent* event )
void RiuMultiPlotWindow::dragLeaveEvent( QDragLeaveEvent* event )
{
setWidgetState( RiuWidgetStyleSheet::DEFAULT );
@ -428,7 +433,7 @@ void RiuGridPlotWindow::dragLeaveEvent( QDragLeaveEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::dropEvent( QDropEvent* event )
void RiuMultiPlotWindow::dropEvent( QDropEvent* event )
{
setWidgetState( RiuWidgetStyleSheet::DEFAULT );
@ -480,7 +485,7 @@ void RiuGridPlotWindow::dropEvent( QDropEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuGridPlotWindow::willAcceptDroppedPlot( const RiuQwtPlotWidget* plotWidget ) const
bool RiuMultiPlotWindow::willAcceptDroppedPlot( const RiuQwtPlotWidget* plotWidget ) const
{
return true;
}
@ -488,7 +493,7 @@ bool RiuGridPlotWindow::willAcceptDroppedPlot( const RiuQwtPlotWidget* plotWidge
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<int, int> RiuGridPlotWindow::rowAndColumnCount( int plotWidgetCount ) const
std::pair<int, int> RiuMultiPlotWindow::rowAndColumnCount( int plotWidgetCount ) const
{
if ( plotWidgetCount == 0 )
{
@ -503,7 +508,7 @@ std::pair<int, int> RiuGridPlotWindow::rowAndColumnCount( int plotWidgetCount )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::onSelectionManagerSelectionChanged( const std::set<int>& changedSelectionLevels )
void RiuMultiPlotWindow::onSelectionManagerSelectionChanged( const std::set<int>& changedSelectionLevels )
{
for ( RiuQwtPlotWidget* plotWidget : m_plotWidgets )
{
@ -529,7 +534,7 @@ void RiuGridPlotWindow::onSelectionManagerSelectionChanged( const std::set<int>&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::setWidgetState( RiuWidgetStyleSheet::StateTag widgetState )
void RiuMultiPlotWindow::setWidgetState( RiuWidgetStyleSheet::StateTag widgetState )
{
m_dropTargetStyleSheet.setWidgetState( m_dropTargetPlaceHolder, widgetState );
}
@ -537,7 +542,7 @@ void RiuGridPlotWindow::setWidgetState( RiuWidgetStyleSheet::StateTag widgetStat
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuGridPlotWindow::showYAxis( int row, int column ) const
bool RiuMultiPlotWindow::showYAxis( int row, int column ) const
{
return true;
}
@ -545,7 +550,7 @@ bool RiuGridPlotWindow::showYAxis( int row, int column ) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::performUpdate()
void RiuMultiPlotWindow::performUpdate()
{
reinsertPlotWidgets();
alignCanvasTops();
@ -554,7 +559,7 @@ void RiuGridPlotWindow::performUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::reinsertPlotWidgets()
void RiuMultiPlotWindow::reinsertPlotWidgets()
{
clearGridLayout();
@ -646,7 +651,7 @@ void RiuGridPlotWindow::reinsertPlotWidgets()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RiuGridPlotWindow::alignCanvasTops()
int RiuMultiPlotWindow::alignCanvasTops()
{
CVF_ASSERT( m_legends.size() == m_plotWidgets.size() );
@ -677,7 +682,7 @@ int RiuGridPlotWindow::alignCanvasTops()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridPlotWindow::clearGridLayout()
void RiuMultiPlotWindow::clearGridLayout()
{
if ( m_gridLayout )
{
@ -701,7 +706,7 @@ void RiuGridPlotWindow::clearGridLayout()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuWidgetStyleSheet RiuGridPlotWindow::createDropTargetStyleSheet()
RiuWidgetStyleSheet RiuMultiPlotWindow::createDropTargetStyleSheet()
{
RiuWidgetStyleSheet styleSheet;
@ -717,7 +722,7 @@ RiuWidgetStyleSheet RiuGridPlotWindow::createDropTargetStyleSheet()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<QPointer<RiuQwtPlotWidget>> RiuGridPlotWindow::visiblePlotWidgets() const
QList<QPointer<RiuQwtPlotWidget>> RiuMultiPlotWindow::visiblePlotWidgets() const
{
QList<QPointer<RiuQwtPlotWidget>> plotWidgets;
for ( QPointer<RiuQwtPlotWidget> plotWidget : m_plotWidgets )
@ -733,7 +738,7 @@ QList<QPointer<RiuQwtPlotWidget>> RiuGridPlotWindow::visiblePlotWidgets() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<QPointer<RiuQwtPlotLegend>> RiuGridPlotWindow::visibleLegends() const
QList<QPointer<RiuQwtPlotLegend>> RiuMultiPlotWindow::visibleLegends() const
{
QList<QPointer<RiuQwtPlotLegend>> legends;
for ( int i = 0; i < m_plotWidgets.size(); ++i )
@ -749,7 +754,7 @@ QList<QPointer<RiuQwtPlotLegend>> RiuGridPlotWindow::visibleLegends() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<QPointer<QLabel>> RiuGridPlotWindow::visibleTitles() const
QList<QPointer<QLabel>> RiuMultiPlotWindow::visibleTitles() const
{
QList<QPointer<QLabel>> subTitles;
for ( int i = 0; i < m_plotWidgets.size(); ++i )
@ -766,7 +771,7 @@ QList<QPointer<QLabel>> RiuGridPlotWindow::visibleTitles() const
///
//--------------------------------------------------------------------------------------------------
std::pair<int, int>
RiuGridPlotWindow::findAvailableRowAndColumn( int startRow, int startColumn, int columnSpan, int columnCount ) const
RiuMultiPlotWindow::findAvailableRowAndColumn( int startRow, int startColumn, int columnSpan, int columnCount ) const
{
int availableRow = startRow;
int availableColumn = startColumn;

View File

@ -35,7 +35,7 @@
#include <map>
class RiaPlotWindowRedrawScheduler;
class RimGridPlotWindow;
class RimMultiPlot;
class RiuQwtPlotLegend;
class RiuQwtPlotWidget;
@ -45,18 +45,19 @@ class QScrollBar;
//==================================================================================================
//
// RiuGridPlotWindow
// RiuMultiPlotWidget
//
//==================================================================================================
class RiuGridPlotWindow : public QWidget, public RiuInterfaceToViewWindow, public caf::SelectionChangedReceiver
class RiuMultiPlotWindow : public QWidget, public RiuInterfaceToViewWindow, public caf::SelectionChangedReceiver
{
Q_OBJECT
public:
RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget* parent = nullptr );
RiuMultiPlotWindow( RimMultiPlot* plotDefinition, QWidget* parent = nullptr );
~RiuMultiPlotWindow() override;
RimGridPlotWindow* ownerPlotDefinition();
RimViewWindow* ownerViewWindow() const override;
RimMultiPlot* ownerPlotDefinition();
RimViewWindow* ownerViewWindow() const override;
void addPlot( RiuQwtPlotWidget* plotWidget );
void insertPlot( RiuQwtPlotWidget* plotWidget, size_t index );
@ -113,17 +114,17 @@ private slots:
virtual void performUpdate();
protected:
QPointer<QVBoxLayout> m_layout;
QPointer<QHBoxLayout> m_plotLayout;
QPointer<QFrame> m_plotWidgetFrame;
QPointer<QGridLayout> m_gridLayout;
QPointer<QLabel> m_plotTitle;
QList<int> m_legendColumns;
QList<QPointer<QLabel>> m_subTitles;
QList<QPointer<RiuQwtPlotLegend>> m_legends;
QList<QPointer<RiuQwtPlotWidget>> m_plotWidgets;
caf::PdmPointer<RimGridPlotWindow> m_plotDefinition;
QPointer<QLabel> m_dropTargetPlaceHolder;
QPointer<QVBoxLayout> m_layout;
QPointer<QHBoxLayout> m_plotLayout;
QPointer<QFrame> m_plotWidgetFrame;
QPointer<QGridLayout> m_gridLayout;
QPointer<QLabel> m_plotTitle;
QList<int> m_legendColumns;
QList<QPointer<QLabel>> m_subTitles;
QList<QPointer<RiuQwtPlotLegend>> m_legends;
QList<QPointer<RiuQwtPlotWidget>> m_plotWidgets;
caf::PdmPointer<RimMultiPlot> m_plotDefinition;
QPointer<QLabel> m_dropTargetPlaceHolder;
RiuWidgetStyleSheet m_dropTargetStyleSheet;

View File

@ -38,8 +38,8 @@
#include "RiuDockWidgetTools.h"
#include "RiuDragDrop.h"
#include "RiuGridPlotWindow.h"
#include "RiuMdiSubWindow.h"
#include "RiuMultiPlotWindow.h"
#include "RiuToolTipMenu.h"
#include "RiuTreeViewEventFilter.h"
#include "RiuWellAllocationPlot.h"
@ -158,7 +158,7 @@ void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
m_wellLogPlotToolBarEditor->clear();
m_summaryPlotToolBarEditor->clear();
m_gridPlotWindowToolBarEditor->clear();
m_multiPlotToolBarEditor->clear();
setWindowTitle( "Plots - ResInsight" );
}
@ -383,8 +383,8 @@ void RiuPlotMainWindow::createToolBars()
m_summaryPlotToolBarEditor = new caf::PdmUiToolBarEditor( "Summary Plot", this );
m_summaryPlotToolBarEditor->hide();
m_gridPlotWindowToolBarEditor = new caf::PdmUiToolBarEditor( "Multi Plot", this );
m_gridPlotWindowToolBarEditor->hide();
m_multiPlotToolBarEditor = new caf::PdmUiToolBarEditor( "Multi Plot", this );
m_multiPlotToolBarEditor->hide();
}
//--------------------------------------------------------------------------------------------------
@ -569,20 +569,20 @@ void RiuPlotMainWindow::updateWellLogPlotToolBar()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::updateGridPlotWindowToolBar()
void RiuPlotMainWindow::updateMultiPlotToolBar()
{
RimGridPlotWindow* plotWindow = dynamic_cast<RimGridPlotWindow*>( m_activePlotViewWindow.p() );
RimMultiPlot* plotWindow = dynamic_cast<RimMultiPlot*>( m_activePlotViewWindow.p() );
if ( plotWindow )
{
std::vector<caf::PdmFieldHandle*> toolBarFields = {plotWindow->columnCountField()};
m_gridPlotWindowToolBarEditor->setFields( toolBarFields );
m_gridPlotWindowToolBarEditor->updateUi();
m_gridPlotWindowToolBarEditor->show();
m_multiPlotToolBarEditor->setFields( toolBarFields );
m_multiPlotToolBarEditor->updateUi();
m_multiPlotToolBarEditor->show();
}
else
{
m_gridPlotWindowToolBarEditor->clear();
m_gridPlotWindowToolBarEditor->hide();
m_multiPlotToolBarEditor->clear();
m_multiPlotToolBarEditor->hide();
}
refreshToolbars();
}
@ -592,9 +592,9 @@ void RiuPlotMainWindow::updateGridPlotWindowToolBar()
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::updateSummaryPlotToolBar( bool forceUpdateUi )
{
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>( m_activePlotViewWindow.p() );
RimGridPlotWindow* gridPlotWindow = dynamic_cast<RimGridPlotWindow*>( m_activePlotViewWindow.p() );
if ( gridPlotWindow )
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>( m_activePlotViewWindow.p() );
RimMultiPlot* multiPlot = dynamic_cast<RimMultiPlot*>( m_activePlotViewWindow.p() );
if ( multiPlot )
{
summaryPlot = caf::SelectionManager::instance()->selectedItemOfType<RimSummaryPlot>();
}
@ -717,7 +717,7 @@ void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
updateWellLogPlotToolBar();
updateSummaryPlotToolBar();
updateGridPlotWindowToolBar();
updateMultiPlotToolBar();
}
//--------------------------------------------------------------------------------------------------

View File

@ -80,7 +80,7 @@ public:
void addToTemporaryWidgets( QWidget* widget );
void updateWellLogPlotToolBar();
void updateGridPlotWindowToolBar();
void updateMultiPlotToolBar();
void updateSummaryPlotToolBar( bool forceUpdateUi = false );
void setFocusToLineEditInSummaryToolBar();
@ -121,7 +121,7 @@ private:
QMenu* m_windowMenu;
caf::PdmUiToolBarEditor* m_wellLogPlotToolBarEditor;
caf::PdmUiToolBarEditor* m_gridPlotWindowToolBarEditor;
caf::PdmUiToolBarEditor* m_multiPlotToolBarEditor;
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;

View File

@ -15,7 +15,7 @@
///
//--------------------------------------------------------------------------------------------------
RiuWellLogPlot::RiuWellLogPlot( RimWellLogPlot* plotDefinition, QWidget* parent )
: RiuGridPlotWindow( plotDefinition, parent )
: RiuMultiPlotWindow( plotDefinition, parent )
{
m_trackScrollBar = new QScrollBar( nullptr );
m_trackScrollBar->setOrientation( Qt::Vertical );

View File

@ -17,12 +17,12 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiuGridPlotWindow.h"
#include "RiuMultiPlotWindow.h"
class RiuQwtPlotWidget;
class RimWellLogPlot;
class RiuWellLogPlot : public RiuGridPlotWindow
class RiuWellLogPlot : public RiuMultiPlotWindow
{
Q_OBJECT
public: