mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Further refactoring
This commit is contained in:
parent
3dd4cb505b
commit
85d683634c
@ -43,7 +43,7 @@
|
|||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
#include "RimIntersection.h"
|
#include "RimIntersection.h"
|
||||||
#include "RimIntersectionBox.h"
|
#include "RimIntersectionBox.h"
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPerforationInterval.h"
|
#include "RimPerforationInterval.h"
|
||||||
#include "RimPolylinesAnnotation.h"
|
#include "RimPolylinesAnnotation.h"
|
||||||
#include "RimReachCircleAnnotation.h"
|
#include "RimReachCircleAnnotation.h"
|
||||||
@ -110,7 +110,7 @@ bool isDeletable( caf::PdmUiItem* uiItem )
|
|||||||
if ( dynamic_cast<RimWellLogCurve*>( uiItem ) ) return true;
|
if ( dynamic_cast<RimWellLogCurve*>( uiItem ) ) return true;
|
||||||
if ( dynamic_cast<RimSummaryPlot*>( uiItem ) )
|
if ( dynamic_cast<RimSummaryPlot*>( uiItem ) )
|
||||||
{
|
{
|
||||||
RimMultiPlot* plotWindow = nullptr;
|
RimMultiPlotWindow* plotWindow = nullptr;
|
||||||
static_cast<RimSummaryPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
|
static_cast<RimSummaryPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
|
||||||
return plotWindow == nullptr;
|
return plotWindow == nullptr;
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ bool isDeletable( caf::PdmUiItem* uiItem )
|
|||||||
if ( dynamic_cast<RimPolylinesAnnotation*>( uiItem ) ) return true;
|
if ( dynamic_cast<RimPolylinesAnnotation*>( uiItem ) ) return true;
|
||||||
if ( dynamic_cast<RimGridCrossPlot*>( uiItem ) )
|
if ( dynamic_cast<RimGridCrossPlot*>( uiItem ) )
|
||||||
{
|
{
|
||||||
RimMultiPlot* plotWindow = nullptr;
|
RimMultiPlotWindow* plotWindow = nullptr;
|
||||||
static_cast<RimGridCrossPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
|
static_cast<RimGridCrossPlot*>( uiItem )->firstAncestorOrThisOfType( plotWindow );
|
||||||
return plotWindow == nullptr;
|
return plotWindow == nullptr;
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
#include "RimMainPlotCollection.h"
|
#include "RimMainPlotCollection.h"
|
||||||
#include "RimMultiPlot.h"
|
|
||||||
#include "RimMultiPlotCollection.h"
|
#include "RimMultiPlotCollection.h"
|
||||||
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPlot.h"
|
#include "RimPlot.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ RicfCommandResponse RicNewMultiPlotFeature::execute()
|
|||||||
RimProject* project = RiaApplication::instance()->project();
|
RimProject* project = RiaApplication::instance()->project();
|
||||||
RimMultiPlotCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
|
RimMultiPlotCollection* plotCollection = project->mainPlotCollection()->multiPlotCollection();
|
||||||
|
|
||||||
RimMultiPlot* plotWindow = new RimMultiPlot;
|
RimMultiPlotWindow* plotWindow = new RimMultiPlotWindow;
|
||||||
plotWindow->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( plotCollection->multiPlots().size() + 1 ) );
|
plotWindow->setMultiPlotTitle( QString( "Multi Plot %1" ).arg( plotCollection->multiPlots().size() + 1 ) );
|
||||||
plotWindow->setAsPlotMdiWindow();
|
plotWindow->setAsPlotMdiWindow();
|
||||||
plotCollection->addMultiPlot( plotWindow );
|
plotCollection->addMultiPlot( plotWindow );
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "RiuPlotMainWindow.h"
|
#include "RiuPlotMainWindow.h"
|
||||||
#include "RiuQwtPlotWidget.h"
|
#include "RiuQwtPlotWidget.h"
|
||||||
|
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPlotWindow.h"
|
#include "RimPlotWindow.h"
|
||||||
#include "RimWellLogTrack.h"
|
#include "RimWellLogTrack.h"
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ bool RicDeleteSubPlotFeature::isCommandEnabled()
|
|||||||
size_t plotsSelected = 0;
|
size_t plotsSelected = 0;
|
||||||
for ( caf::PdmObject* object : selection )
|
for ( caf::PdmObject* object : selection )
|
||||||
{
|
{
|
||||||
RimMultiPlot* multiPlot = nullptr;
|
RimMultiPlotWindow* multiPlot = nullptr;
|
||||||
object->firstAncestorOrThisOfType( multiPlot );
|
object->firstAncestorOrThisOfType( multiPlot );
|
||||||
if ( dynamic_cast<RimPlotWindow*>( object ) && multiPlot )
|
if ( dynamic_cast<RimPlotWindow*>( object ) && multiPlot )
|
||||||
{
|
{
|
||||||
@ -72,11 +72,11 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
std::vector<RimPlot*> selection;
|
std::vector<RimPlot*> selection;
|
||||||
caf::SelectionManager::instance()->objectsByType( &selection );
|
caf::SelectionManager::instance()->objectsByType( &selection );
|
||||||
std::set<RimMultiPlot*> alteredPlotWindows;
|
std::set<RimMultiPlotWindow*> alteredPlotWindows;
|
||||||
|
|
||||||
for ( RimPlot* plot : selection )
|
for ( RimPlot* plot : selection )
|
||||||
{
|
{
|
||||||
RimMultiPlot* plotWindow = nullptr;
|
RimMultiPlotWindow* plotWindow = nullptr;
|
||||||
plot->firstAncestorOrThisOfType( plotWindow );
|
plot->firstAncestorOrThisOfType( plotWindow );
|
||||||
if ( plot && plotWindow )
|
if ( plot && plotWindow )
|
||||||
{
|
{
|
||||||
@ -89,7 +89,7 @@ void RicDeleteSubPlotFeature::onActionTriggered( bool isChecked )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( RimMultiPlot* plotWindow : alteredPlotWindows )
|
for ( RimMultiPlotWindow* plotWindow : alteredPlotWindows )
|
||||||
{
|
{
|
||||||
plotWindow->uiCapability()->updateConnectedEditors();
|
plotWindow->uiCapability()->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ class Project(PdmObject):
|
|||||||
|
|
||||||
def plots(self):
|
def plots(self):
|
||||||
"""Get a list of all plots belonging to a project"""
|
"""Get a list of all plots belonging to a project"""
|
||||||
pdm_objects = self.descendants("RimPlot")
|
pdm_objects = self.descendants("RimPlotWindow")
|
||||||
plot_list = []
|
plot_list = []
|
||||||
for pdm_object in pdm_objects:
|
for pdm_object in pdm_objects:
|
||||||
plot_list.append(Plot(pdm_object))
|
plot_list.append(Plot(pdm_object))
|
||||||
|
@ -74,7 +74,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimPlot.h
|
${CMAKE_CURRENT_LIST_DIR}/RimPlot.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h
|
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.h
|
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotWindow.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h
|
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h
|
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h
|
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h
|
||||||
@ -216,7 +216,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimPlot.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimPlot.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotWindow.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp
|
||||||
|
@ -102,6 +102,7 @@ RimWellAllocationPlot::RimWellAllocationPlot()
|
|||||||
m_accumulatedWellFlowPlot->setDepthType( RiaDefines::CONNECTION_NUMBER );
|
m_accumulatedWellFlowPlot->setDepthType( RiaDefines::CONNECTION_NUMBER );
|
||||||
m_accumulatedWellFlowPlot->setLegendsVisible( false );
|
m_accumulatedWellFlowPlot->setLegendsVisible( false );
|
||||||
m_accumulatedWellFlowPlot->uiCapability()->setUiIconFromResourceString( ":/WellFlowPlot16x16.png" );
|
m_accumulatedWellFlowPlot->uiCapability()->setUiIconFromResourceString( ":/WellFlowPlot16x16.png" );
|
||||||
|
m_accumulatedWellFlowPlot->setAcceptDrops( false );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_totalWellAllocationPlot, "TotalWellFlowPlot", "Total Well Flow", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_totalWellAllocationPlot, "TotalWellFlowPlot", "Total Well Flow", "", "", "" );
|
||||||
m_totalWellAllocationPlot.uiCapability()->setUiHidden( true );
|
m_totalWellAllocationPlot.uiCapability()->setUiHidden( true );
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "RimGridCrossPlotCollection.h"
|
#include "RimGridCrossPlotCollection.h"
|
||||||
#include "RimGridCrossPlotCurve.h"
|
#include "RimGridCrossPlotCurve.h"
|
||||||
#include "RimGridCrossPlotDataSet.h"
|
#include "RimGridCrossPlotDataSet.h"
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPlotAxisProperties.h"
|
#include "RimPlotAxisProperties.h"
|
||||||
|
|
||||||
#include "cafPdmUiCheckBoxEditor.h"
|
#include "cafPdmUiCheckBoxEditor.h"
|
||||||
@ -380,32 +380,17 @@ void RimGridCrossPlot::removeDataSetLegend( RimGridCrossPlotDataSet* dataSet )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGridCrossPlot::removeFromMdiAreaAndCollection()
|
void RimGridCrossPlot::doRemoveFromCollection()
|
||||||
{
|
{
|
||||||
RimGridCrossPlotCollection* crossPlotCollection = nullptr;
|
RimGridCrossPlotCollection* crossPlotCollection = nullptr;
|
||||||
this->firstAncestorOrThisOfType( crossPlotCollection );
|
this->firstAncestorOrThisOfType( crossPlotCollection );
|
||||||
if ( crossPlotCollection )
|
if ( crossPlotCollection )
|
||||||
{
|
{
|
||||||
crossPlotCollection->removeGridCrossPlot( this );
|
crossPlotCollection->removeGridCrossPlot( this );
|
||||||
this->revokeMdiWindowStatus();
|
|
||||||
crossPlotCollection->updateAllRequiredEditors();
|
crossPlotCollection->updateAllRequiredEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimGridCrossPlot::updateAfterInsertingIntoMultiPlot()
|
|
||||||
{
|
|
||||||
if ( m_plotWidget )
|
|
||||||
{
|
|
||||||
m_plotWidget->setTitle( "" );
|
|
||||||
m_plotWidget->setInternalQwtLegendVisible( false );
|
|
||||||
}
|
|
||||||
updateAxes();
|
|
||||||
updateLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -574,9 +559,12 @@ void RimGridCrossPlot::updateCurveNamesAndPlotTitle()
|
|||||||
m_crossPlotDataSets[i]->updateCurveNames( i, m_crossPlotDataSets.size() );
|
m_crossPlotDataSets[i]->updateCurveNames( i, m_crossPlotDataSets.size() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_plotWidget && isMdiWindow() )
|
if ( m_plotWidget )
|
||||||
{
|
{
|
||||||
m_plotWidget->setTitle( this->createAutoName() );
|
if ( isMdiWindow() )
|
||||||
|
{
|
||||||
|
m_plotWidget->setTitle( this->createAutoName() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateMdiWindowTitle();
|
updateMdiWindowTitle();
|
||||||
}
|
}
|
||||||
@ -747,7 +735,7 @@ bool RimGridCrossPlot::applyFontSize( RiaDefines::FontSettingType fontSettingTyp
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGridCrossPlot::performLayoutUpdate()
|
void RimGridCrossPlot::doUpdateLayout()
|
||||||
{
|
{
|
||||||
updateLegend();
|
updateLegend();
|
||||||
updatePlot();
|
updatePlot();
|
||||||
|
@ -94,7 +94,7 @@ public:
|
|||||||
int fontSize,
|
int fontSize,
|
||||||
bool forceChange = false ) override;
|
bool forceChange = false ) override;
|
||||||
|
|
||||||
void updateLegend();
|
void updateLegend() override;
|
||||||
|
|
||||||
void updateZoomInQwt() override;
|
void updateZoomInQwt() override;
|
||||||
void updateZoomFromQwt() override;
|
void updateZoomFromQwt() override;
|
||||||
@ -107,9 +107,6 @@ public:
|
|||||||
void addOrUpdateDataSetLegend( RimGridCrossPlotDataSet* dataSet );
|
void addOrUpdateDataSetLegend( RimGridCrossPlotDataSet* dataSet );
|
||||||
void removeDataSetLegend( RimGridCrossPlotDataSet* dataSet );
|
void removeDataSetLegend( RimGridCrossPlotDataSet* dataSet );
|
||||||
|
|
||||||
void removeFromMdiAreaAndCollection() override;
|
|
||||||
void updateAfterInsertingIntoMultiPlot() override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWidget* createViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
QWidget* createViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
||||||
void deleteViewWidget() override;
|
void deleteViewWidget() override;
|
||||||
@ -141,10 +138,11 @@ protected:
|
|||||||
std::set<RimPlotAxisPropertiesInterface*> allPlotAxes() const;
|
std::set<RimPlotAxisPropertiesInterface*> allPlotAxes() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void performLayoutUpdate() override;
|
void doUpdateLayout() override;
|
||||||
|
|
||||||
void cleanupBeforeClose();
|
void cleanupBeforeClose();
|
||||||
|
|
||||||
|
void doRemoveFromCollection() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<bool> m_showInfoBox;
|
caf::PdmField<bool> m_showInfoBox;
|
||||||
caf::PdmField<bool> m_showLegend_OBSOLETE;
|
caf::PdmField<bool> m_showLegend_OBSOLETE;
|
||||||
|
@ -261,7 +261,7 @@ void RimMainPlotCollection::updatePlotsWithFormations()
|
|||||||
|
|
||||||
if ( m_multiPlotCollection )
|
if ( m_multiPlotCollection )
|
||||||
{
|
{
|
||||||
for ( RimMultiPlot* plotWindow : m_multiPlotCollection->multiPlots() )
|
for ( RimMultiPlotWindow* plotWindow : m_multiPlotCollection->multiPlots() )
|
||||||
{
|
{
|
||||||
plotWindow->loadDataAndUpdate();
|
plotWindow->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ void RimMainPlotCollection::updatePlotsWithCompletions()
|
|||||||
|
|
||||||
if ( m_multiPlotCollection )
|
if ( m_multiPlotCollection )
|
||||||
{
|
{
|
||||||
for ( RimMultiPlot* plotWindow : m_multiPlotCollection->multiPlots() )
|
for ( RimMultiPlotWindow* plotWindow : m_multiPlotCollection->multiPlots() )
|
||||||
{
|
{
|
||||||
plotWindow->loadDataAndUpdate();
|
plotWindow->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "RimMultiPlotCollection.h"
|
#include "RimMultiPlotCollection.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimMultiPlotCollection, "RimMultiPlotCollection" );
|
CAF_PDM_SOURCE_INIT( RimMultiPlotCollection, "RimMultiPlotCollection" );
|
||||||
@ -50,7 +50,7 @@ void RimMultiPlotCollection::deleteAllChildObjects()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RimMultiPlot*> RimMultiPlotCollection::multiPlots() const
|
std::vector<RimMultiPlotWindow*> RimMultiPlotCollection::multiPlots() const
|
||||||
{
|
{
|
||||||
return m_multiPlots.childObjects();
|
return m_multiPlots.childObjects();
|
||||||
}
|
}
|
||||||
@ -58,9 +58,9 @@ std::vector<RimMultiPlot*> RimMultiPlotCollection::multiPlots() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMultiPlot* RimMultiPlotCollection::createMultiPlot()
|
RimMultiPlotWindow* RimMultiPlotCollection::createMultiPlot()
|
||||||
{
|
{
|
||||||
RimMultiPlot* plot = new RimMultiPlot();
|
RimMultiPlotWindow* plot = new RimMultiPlotWindow();
|
||||||
plot->setAsPlotMdiWindow();
|
plot->setAsPlotMdiWindow();
|
||||||
|
|
||||||
addMultiPlot( plot );
|
addMultiPlot( plot );
|
||||||
@ -70,7 +70,7 @@ RimMultiPlot* RimMultiPlotCollection::createMultiPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlotCollection::addMultiPlot( RimMultiPlot* plot )
|
void RimMultiPlotCollection::addMultiPlot( RimMultiPlotWindow* plot )
|
||||||
{
|
{
|
||||||
m_multiPlots().push_back( plot );
|
m_multiPlots().push_back( plot );
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
|
|
||||||
class RimMultiPlot;
|
class RimMultiPlotWindow;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -36,10 +36,10 @@ public:
|
|||||||
|
|
||||||
void deleteAllChildObjects();
|
void deleteAllChildObjects();
|
||||||
|
|
||||||
std::vector<RimMultiPlot*> multiPlots() const;
|
std::vector<RimMultiPlotWindow*> multiPlots() const;
|
||||||
RimMultiPlot* createMultiPlot();
|
RimMultiPlotWindow* createMultiPlot();
|
||||||
void addMultiPlot( RimMultiPlot* plot );
|
void addMultiPlot( RimMultiPlotWindow* plot );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmChildArrayField<RimMultiPlot*> m_multiPlots;
|
caf::PdmChildArrayField<RimMultiPlotWindow*> m_multiPlots;
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// for more details.
|
// for more details.
|
||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
|
|
||||||
#include "RimPlot.h"
|
#include "RimPlot.h"
|
||||||
|
|
||||||
@ -29,23 +29,24 @@
|
|||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
template <>
|
template <>
|
||||||
void RimMultiPlot::ColumnCountEnum::setUp()
|
void RimMultiPlotWindow::ColumnCountEnum::setUp()
|
||||||
{
|
{
|
||||||
addItem( RimMultiPlot::COLUMNS_1, "1", "1 Column" );
|
addItem( RimMultiPlotWindow::COLUMNS_1, "1", "1 Column" );
|
||||||
addItem( RimMultiPlot::COLUMNS_2, "2", "2 Columns" );
|
addItem( RimMultiPlotWindow::COLUMNS_2, "2", "2 Columns" );
|
||||||
addItem( RimMultiPlot::COLUMNS_3, "3", "3 Columns" );
|
addItem( RimMultiPlotWindow::COLUMNS_3, "3", "3 Columns" );
|
||||||
addItem( RimMultiPlot::COLUMNS_4, "4", "4 Columns" );
|
addItem( RimMultiPlotWindow::COLUMNS_4, "4", "4 Columns" );
|
||||||
addItem( RimMultiPlot::COLUMNS_UNLIMITED, "UNLIMITED", "Unlimited" );
|
addItem( RimMultiPlotWindow::COLUMNS_UNLIMITED, "UNLIMITED", "Unlimited" );
|
||||||
setDefault( RimMultiPlot::COLUMNS_2 );
|
setDefault( RimMultiPlotWindow::COLUMNS_2 );
|
||||||
}
|
}
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimMultiPlot, "MultiPlot" );
|
CAF_PDM_SOURCE_INIT( RimMultiPlotWindow, "MultiPlot" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMultiPlot::RimMultiPlot()
|
RimMultiPlotWindow::RimMultiPlotWindow()
|
||||||
|
: m_acceptDrops( true )
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "Multi Plot", ":/WellLogPlot16x16.png", "", "" );
|
CAF_PDM_InitObject( "Multi Plot", ":/WellLogPlot16x16.png", "", "" );
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ RimMultiPlot::RimMultiPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMultiPlot::~RimMultiPlot()
|
RimMultiPlotWindow::~RimMultiPlotWindow()
|
||||||
{
|
{
|
||||||
removeMdiWindowFromMdiArea();
|
removeMdiWindowFromMdiArea();
|
||||||
m_plots.deleteAllChildObjects();
|
m_plots.deleteAllChildObjects();
|
||||||
@ -76,7 +77,7 @@ RimMultiPlot::~RimMultiPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Move-assignment operator. Argument has to be passed with std::move()
|
/// Move-assignment operator. Argument has to be passed with std::move()
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMultiPlot& RimMultiPlot::operator=( RimMultiPlot&& rhs )
|
RimMultiPlotWindow& RimMultiPlotWindow::operator=( RimMultiPlotWindow&& rhs )
|
||||||
{
|
{
|
||||||
RimPlotWindow::operator=( std::move( rhs ) );
|
RimPlotWindow::operator=( std::move( rhs ) );
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ RimMultiPlot& RimMultiPlot::operator=( RimMultiPlot&& rhs )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QWidget* RimMultiPlot::viewWidget()
|
QWidget* RimMultiPlotWindow::viewWidget()
|
||||||
{
|
{
|
||||||
return m_viewer;
|
return m_viewer;
|
||||||
}
|
}
|
||||||
@ -104,7 +105,7 @@ QWidget* RimMultiPlot::viewWidget()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimMultiPlot::description() const
|
QString RimMultiPlotWindow::description() const
|
||||||
{
|
{
|
||||||
return multiPlotTitle();
|
return multiPlotTitle();
|
||||||
}
|
}
|
||||||
@ -112,7 +113,7 @@ QString RimMultiPlot::description() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimMultiPlot::isMultiPlotTitleVisible() const
|
bool RimMultiPlotWindow::isMultiPlotTitleVisible() const
|
||||||
{
|
{
|
||||||
return m_showPlotWindowTitle;
|
return m_showPlotWindowTitle;
|
||||||
}
|
}
|
||||||
@ -120,7 +121,7 @@ bool RimMultiPlot::isMultiPlotTitleVisible() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::setMultiPlotTitleVisible( bool visible )
|
void RimMultiPlotWindow::setMultiPlotTitleVisible( bool visible )
|
||||||
{
|
{
|
||||||
m_showPlotWindowTitle = visible;
|
m_showPlotWindowTitle = visible;
|
||||||
}
|
}
|
||||||
@ -128,7 +129,7 @@ void RimMultiPlot::setMultiPlotTitleVisible( bool visible )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimMultiPlot::multiPlotTitle() const
|
QString RimMultiPlotWindow::multiPlotTitle() const
|
||||||
{
|
{
|
||||||
return m_plotWindowTitle;
|
return m_plotWindowTitle;
|
||||||
}
|
}
|
||||||
@ -136,7 +137,7 @@ QString RimMultiPlot::multiPlotTitle() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::setMultiPlotTitle( const QString& title )
|
void RimMultiPlotWindow::setMultiPlotTitle( const QString& title )
|
||||||
{
|
{
|
||||||
m_plotWindowTitle = title;
|
m_plotWindowTitle = title;
|
||||||
}
|
}
|
||||||
@ -144,7 +145,7 @@ void RimMultiPlot::setMultiPlotTitle( const QString& title )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::addPlot( RimPlot* plot )
|
void RimMultiPlotWindow::addPlot( RimPlot* plot )
|
||||||
{
|
{
|
||||||
insertPlot( plot, m_plots.size() );
|
insertPlot( plot, m_plots.size() );
|
||||||
}
|
}
|
||||||
@ -152,7 +153,7 @@ void RimMultiPlot::addPlot( RimPlot* plot )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::insertPlot( RimPlot* plot, size_t index )
|
void RimMultiPlotWindow::insertPlot( RimPlot* plot, size_t index )
|
||||||
{
|
{
|
||||||
if ( plot )
|
if ( plot )
|
||||||
{
|
{
|
||||||
@ -164,7 +165,7 @@ void RimMultiPlot::insertPlot( RimPlot* plot, size_t index )
|
|||||||
plot->createPlotWidget();
|
plot->createPlotWidget();
|
||||||
m_viewer->insertPlot( plot->viewer(), index );
|
m_viewer->insertPlot( plot->viewer(), index );
|
||||||
}
|
}
|
||||||
plot->updateAfterInsertingIntoMultiPlot();
|
plot->setLegendsVisible( false );
|
||||||
|
|
||||||
onPlotAdditionOrRemoval();
|
onPlotAdditionOrRemoval();
|
||||||
}
|
}
|
||||||
@ -173,7 +174,7 @@ void RimMultiPlot::insertPlot( RimPlot* plot, size_t index )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::removePlot( RimPlot* plot )
|
void RimMultiPlotWindow::removePlot( RimPlot* plot )
|
||||||
{
|
{
|
||||||
if ( plot )
|
if ( plot )
|
||||||
{
|
{
|
||||||
@ -190,23 +191,11 @@ void RimMultiPlot::removePlot( RimPlot* plot )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::movePlotsToThis( const std::vector<RimPlot*>& plotsToMove, RimPlot* plotToInsertAfter )
|
void RimMultiPlotWindow::movePlotsToThis( const std::vector<RimPlot*>& plotsToMove, RimPlot* plotToInsertAfter )
|
||||||
{
|
{
|
||||||
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
|
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
|
||||||
{
|
{
|
||||||
RimPlot* plot = plotsToMove[tIdx];
|
plotsToMove[tIdx]->removeFromMdiAreaAndCollection();
|
||||||
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( plot );
|
|
||||||
|
|
||||||
RimMultiPlot* srcPlot = nullptr;
|
|
||||||
pdmObject->firstAncestorOrThisOfType( srcPlot );
|
|
||||||
if ( srcPlot )
|
|
||||||
{
|
|
||||||
srcPlot->removePlot( plot );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
plot->removeFromMdiAreaAndCollection();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t insertionStartIndex = 0;
|
size_t insertionStartIndex = 0;
|
||||||
@ -224,7 +213,7 @@ void RimMultiPlot::movePlotsToThis( const std::vector<RimPlot*>& plotsToMove, Ri
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
size_t RimMultiPlot::plotCount() const
|
size_t RimMultiPlotWindow::plotCount() const
|
||||||
{
|
{
|
||||||
return m_plots.size();
|
return m_plots.size();
|
||||||
}
|
}
|
||||||
@ -232,7 +221,7 @@ size_t RimMultiPlot::plotCount() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
size_t RimMultiPlot::plotIndex( const RimPlot* plot ) const
|
size_t RimMultiPlotWindow::plotIndex( const RimPlot* plot ) const
|
||||||
{
|
{
|
||||||
return m_plots.index( plot );
|
return m_plots.index( plot );
|
||||||
}
|
}
|
||||||
@ -240,7 +229,7 @@ size_t RimMultiPlot::plotIndex( const RimPlot* plot ) const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimPlot* RimMultiPlot::plotByIndex( size_t index ) const
|
RimPlot* RimMultiPlotWindow::plotByIndex( size_t index ) const
|
||||||
{
|
{
|
||||||
return m_plots[index];
|
return m_plots[index];
|
||||||
}
|
}
|
||||||
@ -248,7 +237,7 @@ RimPlot* RimMultiPlot::plotByIndex( size_t index ) const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RimPlot*> RimMultiPlot::plots() const
|
std::vector<RimPlot*> RimMultiPlotWindow::plots() const
|
||||||
{
|
{
|
||||||
return m_plots.childObjects();
|
return m_plots.childObjects();
|
||||||
}
|
}
|
||||||
@ -256,7 +245,7 @@ std::vector<RimPlot*> RimMultiPlot::plots() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RimPlot*> RimMultiPlot::visiblePlots() const
|
std::vector<RimPlot*> RimMultiPlotWindow::visiblePlots() const
|
||||||
{
|
{
|
||||||
std::vector<RimPlot*> allVisiblePlots;
|
std::vector<RimPlot*> allVisiblePlots;
|
||||||
for ( RimPlot* plot : m_plots() )
|
for ( RimPlot* plot : m_plots() )
|
||||||
@ -272,7 +261,7 @@ std::vector<RimPlot*> RimMultiPlot::visiblePlots() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::performLayoutUpdate()
|
void RimMultiPlotWindow::doUpdateLayout()
|
||||||
{
|
{
|
||||||
if ( m_showWindow )
|
if ( m_showWindow )
|
||||||
{
|
{
|
||||||
@ -283,12 +272,12 @@ void RimMultiPlot::performLayoutUpdate()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Empty default implementation
|
/// Empty default implementation
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::updatePlotNames() {}
|
void RimMultiPlotWindow::updatePlotNames() {}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::updatePlotOrderFromGridWidget()
|
void RimMultiPlotWindow::updatePlotOrderFromGridWidget()
|
||||||
{
|
{
|
||||||
std::sort( m_plots.begin(), m_plots.end(), [this]( RimPlot* lhs, RimPlot* rhs ) {
|
std::sort( m_plots.begin(), m_plots.end(), [this]( RimPlot* lhs, RimPlot* rhs ) {
|
||||||
auto indexLhs = m_viewer->indexOfPlotWidget( lhs->viewer() );
|
auto indexLhs = m_viewer->indexOfPlotWidget( lhs->viewer() );
|
||||||
@ -302,7 +291,7 @@ void RimMultiPlot::updatePlotOrderFromGridWidget()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::setAutoScaleXEnabled( bool enabled )
|
void RimMultiPlotWindow::setAutoScaleXEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
for ( RimPlot* plot : plots() )
|
for ( RimPlot* plot : plots() )
|
||||||
{
|
{
|
||||||
@ -313,7 +302,7 @@ void RimMultiPlot::setAutoScaleXEnabled( bool enabled )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::setAutoScaleYEnabled( bool enabled )
|
void RimMultiPlotWindow::setAutoScaleYEnabled( bool enabled )
|
||||||
{
|
{
|
||||||
for ( RimPlot* plot : plots() )
|
for ( RimPlot* plot : plots() )
|
||||||
{
|
{
|
||||||
@ -324,7 +313,7 @@ void RimMultiPlot::setAutoScaleYEnabled( bool enabled )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
int RimMultiPlot::columnCount() const
|
int RimMultiPlotWindow::columnCount() const
|
||||||
{
|
{
|
||||||
if ( m_columnCountEnum() == COLUMNS_UNLIMITED )
|
if ( m_columnCountEnum() == COLUMNS_UNLIMITED )
|
||||||
{
|
{
|
||||||
@ -336,7 +325,7 @@ int RimMultiPlot::columnCount() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
caf::PdmFieldHandle* RimMultiPlot::columnCountField()
|
caf::PdmFieldHandle* RimMultiPlotWindow::columnCountField()
|
||||||
{
|
{
|
||||||
return &m_columnCountEnum;
|
return &m_columnCountEnum;
|
||||||
}
|
}
|
||||||
@ -344,7 +333,7 @@ caf::PdmFieldHandle* RimMultiPlot::columnCountField()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimMultiPlot::showPlotTitles() const
|
bool RimMultiPlotWindow::showPlotTitles() const
|
||||||
{
|
{
|
||||||
return m_showIndividualPlotTitles;
|
return m_showIndividualPlotTitles;
|
||||||
}
|
}
|
||||||
@ -352,7 +341,7 @@ bool RimMultiPlot::showPlotTitles() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::zoomAll()
|
void RimMultiPlotWindow::zoomAll()
|
||||||
{
|
{
|
||||||
setAutoScaleXEnabled( true );
|
setAutoScaleXEnabled( true );
|
||||||
setAutoScaleYEnabled( true );
|
setAutoScaleYEnabled( true );
|
||||||
@ -362,7 +351,7 @@ void RimMultiPlot::zoomAll()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QString RimMultiPlot::asciiDataForPlotExport() const
|
QString RimMultiPlotWindow::asciiDataForPlotExport() const
|
||||||
{
|
{
|
||||||
QString out = multiPlotTitle() + "\n";
|
QString out = multiPlotTitle() + "\n";
|
||||||
|
|
||||||
@ -380,7 +369,7 @@ QString RimMultiPlot::asciiDataForPlotExport() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::onPlotAdditionOrRemoval()
|
void RimMultiPlotWindow::onPlotAdditionOrRemoval()
|
||||||
{
|
{
|
||||||
updatePlotNames();
|
updatePlotNames();
|
||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
@ -391,7 +380,23 @@ void RimMultiPlot::onPlotAdditionOrRemoval()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QImage RimMultiPlot::snapshotWindowContent()
|
void RimMultiPlotWindow::setAcceptDrops( bool acceptDrops )
|
||||||
|
{
|
||||||
|
m_acceptDrops = acceptDrops;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimMultiPlotWindow::acceptDrops() const
|
||||||
|
{
|
||||||
|
return m_acceptDrops;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QImage RimMultiPlotWindow::snapshotWindowContent()
|
||||||
{
|
{
|
||||||
QImage image;
|
QImage image;
|
||||||
|
|
||||||
@ -409,7 +414,7 @@ QImage RimMultiPlot::snapshotWindowContent()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QWidget* RimMultiPlot::createViewWidget( QWidget* mainWindowParent )
|
QWidget* RimMultiPlotWindow::createViewWidget( QWidget* mainWindowParent )
|
||||||
{
|
{
|
||||||
m_viewer = new RiuMultiPlotWindow( this, mainWindowParent );
|
m_viewer = new RiuMultiPlotWindow( this, mainWindowParent );
|
||||||
recreatePlotWidgets();
|
recreatePlotWidgets();
|
||||||
@ -419,7 +424,7 @@ QWidget* RimMultiPlot::createViewWidget( QWidget* mainWindowParent )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::deleteViewWidget()
|
void RimMultiPlotWindow::deleteViewWidget()
|
||||||
{
|
{
|
||||||
cleanupBeforeClose();
|
cleanupBeforeClose();
|
||||||
}
|
}
|
||||||
@ -427,7 +432,7 @@ void RimMultiPlot::deleteViewWidget()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
caf::PdmFieldHandle* RimMultiPlot::userDescriptionField()
|
caf::PdmFieldHandle* RimMultiPlotWindow::userDescriptionField()
|
||||||
{
|
{
|
||||||
return &m_plotWindowTitle;
|
return &m_plotWindowTitle;
|
||||||
}
|
}
|
||||||
@ -435,9 +440,9 @@ caf::PdmFieldHandle* RimMultiPlot::userDescriptionField()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
void RimMultiPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue )
|
const QVariant& newValue )
|
||||||
{
|
{
|
||||||
RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
||||||
|
|
||||||
@ -460,7 +465,7 @@ void RimMultiPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
void RimMultiPlotWindow::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||||
{
|
{
|
||||||
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||||
uiOrderingForPlotLayout( uiConfigName, *titleAndLegendsGroup );
|
uiOrderingForPlotLayout( uiConfigName, *titleAndLegendsGroup );
|
||||||
@ -469,7 +474,7 @@ void RimMultiPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& u
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
void RimMultiPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||||
{
|
{
|
||||||
uiOrdering.add( &m_showPlotWindowTitle );
|
uiOrdering.add( &m_showPlotWindowTitle );
|
||||||
uiOrdering.add( &m_plotWindowTitle );
|
uiOrdering.add( &m_plotWindowTitle );
|
||||||
@ -481,8 +486,8 @@ void RimMultiPlot::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrde
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QList<caf::PdmOptionItemInfo> RimMultiPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
QList<caf::PdmOptionItemInfo> RimMultiPlotWindow::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||||
bool* useOptionsOnly )
|
bool* useOptionsOnly )
|
||||||
{
|
{
|
||||||
QList<caf::PdmOptionItemInfo> options = RimPlotWindow::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
|
QList<caf::PdmOptionItemInfo> options = RimPlotWindow::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
|
||||||
|
|
||||||
@ -515,7 +520,7 @@ QList<caf::PdmOptionItemInfo> RimMultiPlot::calculateValueOptions( const caf::Pd
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::onLoadDataAndUpdate()
|
void RimMultiPlotWindow::onLoadDataAndUpdate()
|
||||||
{
|
{
|
||||||
updateMdiWindowVisibility();
|
updateMdiWindowVisibility();
|
||||||
updatePlotTitleInWidgets();
|
updatePlotTitleInWidgets();
|
||||||
@ -526,7 +531,7 @@ void RimMultiPlot::onLoadDataAndUpdate()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::initAfterRead()
|
void RimMultiPlotWindow::initAfterRead()
|
||||||
{
|
{
|
||||||
RimPlotWindow::initAfterRead();
|
RimPlotWindow::initAfterRead();
|
||||||
}
|
}
|
||||||
@ -534,7 +539,7 @@ void RimMultiPlot::initAfterRead()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::updatePlotTitleInWidgets()
|
void RimMultiPlotWindow::updatePlotTitleInWidgets()
|
||||||
{
|
{
|
||||||
if ( m_viewer )
|
if ( m_viewer )
|
||||||
{
|
{
|
||||||
@ -547,7 +552,7 @@ void RimMultiPlot::updatePlotTitleInWidgets()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::updatePlots()
|
void RimMultiPlotWindow::updatePlots()
|
||||||
{
|
{
|
||||||
if ( m_showWindow )
|
if ( m_showWindow )
|
||||||
{
|
{
|
||||||
@ -562,7 +567,7 @@ void RimMultiPlot::updatePlots()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::updateZoom()
|
void RimMultiPlotWindow::updateZoom()
|
||||||
{
|
{
|
||||||
for ( RimPlot* plot : plots() )
|
for ( RimPlot* plot : plots() )
|
||||||
{
|
{
|
||||||
@ -573,7 +578,7 @@ void RimMultiPlot::updateZoom()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::recreatePlotWidgets()
|
void RimMultiPlotWindow::recreatePlotWidgets()
|
||||||
{
|
{
|
||||||
CVF_ASSERT( m_viewer );
|
CVF_ASSERT( m_viewer );
|
||||||
|
|
||||||
@ -589,7 +594,7 @@ void RimMultiPlot::recreatePlotWidgets()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimMultiPlot::hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const
|
bool RimMultiPlotWindow::hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const
|
||||||
{
|
{
|
||||||
if ( fontSettingType == RiaDefines::PLOT_FONT && m_viewer )
|
if ( fontSettingType == RiaDefines::PLOT_FONT && m_viewer )
|
||||||
{
|
{
|
||||||
@ -615,10 +620,10 @@ bool RimMultiPlot::hasCustomFontSizes( RiaDefines::FontSettingType fontSettingTy
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimMultiPlot::applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
bool RimMultiPlotWindow::applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
||||||
int oldFontSize,
|
int oldFontSize,
|
||||||
int fontSize,
|
int fontSize,
|
||||||
bool forceChange /*= false */ )
|
bool forceChange /*= false */ )
|
||||||
{
|
{
|
||||||
bool somethingChanged = false;
|
bool somethingChanged = false;
|
||||||
if ( fontSettingType == RiaDefines::PLOT_FONT && m_viewer )
|
if ( fontSettingType == RiaDefines::PLOT_FONT && m_viewer )
|
||||||
@ -653,7 +658,7 @@ bool RimMultiPlot::applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimMultiPlot::cleanupBeforeClose()
|
void RimMultiPlotWindow::cleanupBeforeClose()
|
||||||
{
|
{
|
||||||
auto plotVector = plots();
|
auto plotVector = plots();
|
||||||
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
class RimPlot;
|
class RimPlot;
|
||||||
|
|
||||||
class RimMultiPlot : public RimPlotWindow
|
class RimMultiPlotWindow : public RimPlotWindow
|
||||||
{
|
{
|
||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
@ -50,10 +50,10 @@ public:
|
|||||||
using ColumnCountEnum = caf::AppEnum<ColumnCount>;
|
using ColumnCountEnum = caf::AppEnum<ColumnCount>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RimMultiPlot();
|
RimMultiPlotWindow();
|
||||||
~RimMultiPlot() override;
|
~RimMultiPlotWindow() override;
|
||||||
|
|
||||||
RimMultiPlot& operator=( RimMultiPlot&& rhs );
|
RimMultiPlotWindow& operator=( RimMultiPlotWindow&& rhs );
|
||||||
|
|
||||||
QWidget* viewWidget() override;
|
QWidget* viewWidget() override;
|
||||||
|
|
||||||
@ -90,6 +90,8 @@ public:
|
|||||||
|
|
||||||
QString asciiDataForPlotExport() const;
|
QString asciiDataForPlotExport() const;
|
||||||
virtual void onPlotAdditionOrRemoval();
|
virtual void onPlotAdditionOrRemoval();
|
||||||
|
void setAcceptDrops( bool acceptDrops );
|
||||||
|
bool acceptDrops() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QImage snapshotWindowContent() override;
|
QImage snapshotWindowContent() override;
|
||||||
@ -124,7 +126,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void cleanupBeforeClose();
|
void cleanupBeforeClose();
|
||||||
void performLayoutUpdate() override;
|
void doUpdateLayout() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField<bool> m_showPlotWindowTitle;
|
caf::PdmField<bool> m_showPlotWindowTitle;
|
||||||
@ -137,4 +139,6 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmChildArrayField<RimPlot*> m_plots;
|
caf::PdmChildArrayField<RimPlot*> m_plots;
|
||||||
|
|
||||||
|
bool m_acceptDrops;
|
||||||
};
|
};
|
@ -1,6 +1,6 @@
|
|||||||
#include "RimPlot.h"
|
#include "RimPlot.h"
|
||||||
|
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPlotWindow.h"
|
#include "RimPlotWindow.h"
|
||||||
|
|
||||||
#include "RiuQwtPlotWidget.h"
|
#include "RiuQwtPlotWidget.h"
|
||||||
@ -35,6 +35,11 @@ RimPlot::RimPlot()
|
|||||||
CAF_PDM_InitFieldNoDefault( &m_colSpan, "ColSpan", "Col Span", "", "", "" );
|
CAF_PDM_InitFieldNoDefault( &m_colSpan, "ColSpan", "Col Span", "", "", "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimPlot::~RimPlot() {}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -75,6 +80,40 @@ void RimPlot::setColSpan( RowOrColSpan colSpan )
|
|||||||
m_colSpan = colSpan;
|
m_colSpan = colSpan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimPlot::removeFromMdiAreaAndCollection()
|
||||||
|
{
|
||||||
|
if ( isMdiWindow() )
|
||||||
|
{
|
||||||
|
revokeMdiWindowStatus();
|
||||||
|
}
|
||||||
|
doRemoveFromCollection();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimPlot::updateAfterInsertingIntoMultiPlot()
|
||||||
|
{
|
||||||
|
updateLegend();
|
||||||
|
updateAxes();
|
||||||
|
updateLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||||
|
{
|
||||||
|
if ( !isMdiWindow() )
|
||||||
|
{
|
||||||
|
uiOrdering.add( &m_rowSpan );
|
||||||
|
uiOrdering.add( &m_colSpan );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -82,7 +121,6 @@ void RimPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const Q
|
|||||||
{
|
{
|
||||||
if ( changedField == &m_colSpan || changedField == &m_rowSpan )
|
if ( changedField == &m_colSpan || changedField == &m_rowSpan )
|
||||||
{
|
{
|
||||||
onRowOrColSpanChange();
|
|
||||||
updateParentLayout();
|
updateParentLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,10 @@ class RiuQwtPlotWidget;
|
|||||||
class RimPlotCurve;
|
class RimPlotCurve;
|
||||||
class QwtPlotCurve;
|
class QwtPlotCurve;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
class RimPlot : public RimPlotWindow
|
class RimPlot : public RimPlotWindow
|
||||||
{
|
{
|
||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
@ -50,7 +54,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RimPlot();
|
RimPlot();
|
||||||
virtual ~RimPlot() = default;
|
virtual ~RimPlot();
|
||||||
|
|
||||||
// Real implementations
|
// Real implementations
|
||||||
void createPlotWidget();
|
void createPlotWidget();
|
||||||
@ -58,6 +62,8 @@ public:
|
|||||||
RowOrColSpan colSpan() const;
|
RowOrColSpan colSpan() const;
|
||||||
void setRowSpan( RowOrColSpan rowSpan );
|
void setRowSpan( RowOrColSpan rowSpan );
|
||||||
void setColSpan( RowOrColSpan colSpan );
|
void setColSpan( RowOrColSpan colSpan );
|
||||||
|
void removeFromMdiAreaAndCollection();
|
||||||
|
void updateAfterInsertingIntoMultiPlot();
|
||||||
|
|
||||||
// Pure virtual interface methods
|
// Pure virtual interface methods
|
||||||
virtual RiuQwtPlotWidget* viewer() = 0;
|
virtual RiuQwtPlotWidget* viewer() = 0;
|
||||||
@ -66,6 +72,7 @@ public:
|
|||||||
virtual void setAutoScaleYEnabled( bool enabled ) = 0;
|
virtual void setAutoScaleYEnabled( bool enabled ) = 0;
|
||||||
virtual void updateAxes() = 0;
|
virtual void updateAxes() = 0;
|
||||||
|
|
||||||
|
virtual void updateLegend() = 0;
|
||||||
virtual void updateZoomInQwt() = 0;
|
virtual void updateZoomInQwt() = 0;
|
||||||
virtual void updateZoomFromQwt() = 0;
|
virtual void updateZoomFromQwt() = 0;
|
||||||
|
|
||||||
@ -77,17 +84,14 @@ public:
|
|||||||
|
|
||||||
virtual void onAxisSelected( int axis, bool toggle ) = 0;
|
virtual void onAxisSelected( int axis, bool toggle ) = 0;
|
||||||
|
|
||||||
// TODO: Refactor
|
|
||||||
virtual void removeFromMdiAreaAndCollection() {}
|
|
||||||
virtual void updateAfterInsertingIntoMultiPlot() {}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue ) override;
|
const QVariant& newValue ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void onRowOrColSpanChange() {}
|
virtual void doRemoveFromCollection() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField<RowOrColSpanEnum> m_rowSpan;
|
caf::PdmField<RowOrColSpanEnum> m_rowSpan;
|
||||||
|
@ -132,7 +132,7 @@ void RimPlotWindow::setLegendFontSize( int fontSize )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimPlotWindow::updateLayout()
|
void RimPlotWindow::updateLayout()
|
||||||
{
|
{
|
||||||
performLayoutUpdate();
|
doUpdateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -233,7 +233,7 @@ void RimPlotWindow::setId( int id )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimPlotWindow::assignIdIfNecessary()
|
void RimPlotWindow::assignIdIfNecessary()
|
||||||
{
|
{
|
||||||
if ( m_id == -1 )
|
if ( m_id == -1 && isMdiWindow() )
|
||||||
{
|
{
|
||||||
RiaApplication::instance()->project()->assignPlotIdToPlotWindow( this );
|
RiaApplication::instance()->project()->assignPlotIdToPlotWindow( this );
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,14 @@
|
|||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
|
|
||||||
class RimProject;
|
class RimProject;
|
||||||
class QwtPlotCurve;
|
|
||||||
|
|
||||||
|
class QwtPlotCurve;
|
||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
class RimPlotWindow : public RimViewWindow
|
class RimPlotWindow : public RimViewWindow
|
||||||
{
|
{
|
||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
@ -64,7 +68,7 @@ protected:
|
|||||||
void uiOrderingForLegendSettings( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
void uiOrderingForLegendSettings( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void performLayoutUpdate() {}
|
virtual void doUpdateLayout() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class RimProject;
|
friend class RimProject;
|
||||||
@ -73,7 +77,7 @@ private:
|
|||||||
void assignIdIfNecessary() final;
|
void assignIdIfNecessary() final;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField<int> m_id;
|
caf::PdmField<int> m_id;
|
||||||
caf::PdmField<bool> m_showPlotLegends;
|
caf::PdmField<bool> m_showPlotLegends;
|
||||||
caf::PdmField<bool> m_plotLegendsHorizontal;
|
caf::PdmField<bool> m_plotLegendsHorizontal;
|
||||||
caf::PdmField<int> m_legendFontSize;
|
caf::PdmField<int> m_legendFontSize;
|
||||||
|
@ -182,7 +182,7 @@ void RimReloadCaseTools::updateAllPlots()
|
|||||||
RimMultiPlotCollection* multiPlotCollection = project->mainPlotCollection()->multiPlotCollection();
|
RimMultiPlotCollection* multiPlotCollection = project->mainPlotCollection()->multiPlotCollection();
|
||||||
if ( multiPlotCollection )
|
if ( multiPlotCollection )
|
||||||
{
|
{
|
||||||
for ( RimMultiPlot* plotWindow : multiPlotCollection->multiPlots() )
|
for ( RimMultiPlotWindow* plotWindow : multiPlotCollection->multiPlots() )
|
||||||
{
|
{
|
||||||
plotWindow->loadDataAndUpdate();
|
plotWindow->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
@ -326,7 +326,7 @@ void RimViewWindow::initAfterRead()
|
|||||||
void RimViewWindow::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
void RimViewWindow::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||||
{
|
{
|
||||||
caf::PdmUiTreeViewItemAttribute* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute );
|
caf::PdmUiTreeViewItemAttribute* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute );
|
||||||
if ( treeItemAttribute && RiaApplication::instance()->preferences()->showViewIdInProjectTree() )
|
if ( treeItemAttribute && RiaApplication::instance()->preferences()->showViewIdInProjectTree() && id() >= 0 )
|
||||||
{
|
{
|
||||||
treeItemAttribute->tag = QString( "%1" ).arg( id() );
|
treeItemAttribute->tag = QString( "%1" ).arg( id() );
|
||||||
cvf::Color3f viewColor = RiaColorTables::contrastCategoryPaletteColors().cycledColor3f( (size_t)id() );
|
cvf::Color3f viewColor = RiaColorTables::contrastCategoryPaletteColors().cycledColor3f( (size_t)id() );
|
||||||
|
@ -110,7 +110,6 @@ protected:
|
|||||||
virtual void updateMdiWindowTitle(); // Has real default implementation
|
virtual void updateMdiWindowTitle(); // Has real default implementation
|
||||||
virtual void deleteViewWidget() = 0;
|
virtual void deleteViewWidget() = 0;
|
||||||
virtual void onLoadDataAndUpdate() = 0;
|
virtual void onLoadDataAndUpdate() = 0;
|
||||||
virtual void assignIdIfNecessary() = 0;
|
|
||||||
virtual void onViewNavigationChanged();
|
virtual void onViewNavigationChanged();
|
||||||
virtual bool isWindowVisible() const; // Virtual To allow special visibility control
|
virtual bool isWindowVisible() const; // Virtual To allow special visibility control
|
||||||
//////////
|
//////////
|
||||||
@ -129,7 +128,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
friend class RimProject;
|
friend class RimProject;
|
||||||
|
|
||||||
void setAsMdiWindow( int mainWindowID );
|
void setAsMdiWindow( int mainWindowID );
|
||||||
|
virtual void assignIdIfNecessary() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
caf::PdmField<bool> m_showWindow;
|
caf::PdmField<bool> m_showWindow;
|
||||||
|
@ -187,7 +187,7 @@ void RimWellLogCurve::updateLegendsInPlot()
|
|||||||
firstAncestorOrThisOfType( wellLogTrack );
|
firstAncestorOrThisOfType( wellLogTrack );
|
||||||
if ( wellLogTrack )
|
if ( wellLogTrack )
|
||||||
{
|
{
|
||||||
wellLogTrack->updateAllLegendItems();
|
wellLogTrack->updateLegend();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ RimWellLogPlot::RimWellLogPlot()
|
|||||||
m_maxAvailableDepth = -HUGE_VAL;
|
m_maxAvailableDepth = -HUGE_VAL;
|
||||||
|
|
||||||
m_commonDataSourceEnabled = true;
|
m_commonDataSourceEnabled = true;
|
||||||
m_columnCountEnum = RimMultiPlot::COLUMNS_UNLIMITED;
|
m_columnCountEnum = RimMultiPlotWindow::COLUMNS_UNLIMITED;
|
||||||
|
|
||||||
m_plotLegendsHorizontal = false;
|
m_plotLegendsHorizontal = false;
|
||||||
setMultiPlotTitleVisible( false );
|
setMultiPlotTitleVisible( false );
|
||||||
@ -116,7 +116,7 @@ RimWellLogPlot::RimWellLogPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimWellLogPlot& RimWellLogPlot::operator=( RimWellLogPlot&& rhs )
|
RimWellLogPlot& RimWellLogPlot::operator=( RimWellLogPlot&& rhs )
|
||||||
{
|
{
|
||||||
RimMultiPlot::operator=( std::move( rhs ) );
|
RimMultiPlotWindow::operator=( std::move( rhs ) );
|
||||||
|
|
||||||
auto dataSource = rhs.m_commonDataSource();
|
auto dataSource = rhs.m_commonDataSource();
|
||||||
rhs.m_commonDataSource.removeChildObject( dataSource );
|
rhs.m_commonDataSource.removeChildObject( dataSource );
|
||||||
@ -183,7 +183,7 @@ void RimWellLogPlot::updateZoom()
|
|||||||
m_maxAvailableDepth );
|
m_maxAvailableDepth );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimMultiPlot::updateZoom();
|
RimMultiPlotWindow::updateZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -503,7 +503,7 @@ void RimWellLogPlot::onPlotAdditionOrRemoval()
|
|||||||
{
|
{
|
||||||
calculateAvailableDepthRange();
|
calculateAvailableDepthRange();
|
||||||
updateZoom();
|
updateZoom();
|
||||||
RimMultiPlot::onPlotAdditionOrRemoval();
|
RimMultiPlotWindow::onPlotAdditionOrRemoval();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -533,7 +533,7 @@ void RimWellLogPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue )
|
const QVariant& newValue )
|
||||||
{
|
{
|
||||||
RimMultiPlot::fieldChangedByUi( changedField, oldValue, newValue );
|
RimMultiPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
||||||
|
|
||||||
if ( changedField == &m_minVisibleDepth || changedField == &m_maxVisibleDepth )
|
if ( changedField == &m_minVisibleDepth || changedField == &m_maxVisibleDepth )
|
||||||
{
|
{
|
||||||
@ -589,7 +589,7 @@ void RimWellLogPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
|
|
||||||
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||||
uiOrderingForAutoName( uiConfigName, *titleAndLegendsGroup );
|
uiOrderingForAutoName( uiConfigName, *titleAndLegendsGroup );
|
||||||
RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, uiOrdering );
|
RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, *titleAndLegendsGroup );
|
||||||
titleAndLegendsGroup->add( &m_columnCountEnum );
|
titleAndLegendsGroup->add( &m_columnCountEnum );
|
||||||
|
|
||||||
uiOrdering.skipRemainingFields( true );
|
uiOrdering.skipRemainingFields( true );
|
||||||
@ -601,7 +601,8 @@ void RimWellLogPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
QList<caf::PdmOptionItemInfo> RimWellLogPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
QList<caf::PdmOptionItemInfo> RimWellLogPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||||
bool* useOptionsOnly )
|
bool* useOptionsOnly )
|
||||||
{
|
{
|
||||||
QList<caf::PdmOptionItemInfo> options = RimMultiPlot::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
|
QList<caf::PdmOptionItemInfo> options = RimMultiPlotWindow::calculateValueOptions( fieldNeedingOptions,
|
||||||
|
useOptionsOnly );
|
||||||
|
|
||||||
if ( fieldNeedingOptions == &m_depthType )
|
if ( fieldNeedingOptions == &m_depthType )
|
||||||
{
|
{
|
||||||
@ -634,7 +635,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogPlot::calculateValueOptions( const caf::
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogPlot::initAfterRead()
|
void RimWellLogPlot::initAfterRead()
|
||||||
{
|
{
|
||||||
RimMultiPlot::initAfterRead();
|
RimMultiPlotWindow::initAfterRead();
|
||||||
|
|
||||||
if ( m_depthAxisGridVisibility() == AXIS_GRID_MINOR )
|
if ( m_depthAxisGridVisibility() == AXIS_GRID_MINOR )
|
||||||
{
|
{
|
||||||
@ -679,7 +680,7 @@ QImage RimWellLogPlot::snapshotWindowContent()
|
|||||||
CAF_ASSERT( wellLogViewer );
|
CAF_ASSERT( wellLogViewer );
|
||||||
bool isScrollbarVisible = wellLogViewer->isScrollbarVisible();
|
bool isScrollbarVisible = wellLogViewer->isScrollbarVisible();
|
||||||
wellLogViewer->setScrollbarVisible( false );
|
wellLogViewer->setScrollbarVisible( false );
|
||||||
image = RimMultiPlot::snapshotWindowContent();
|
image = RimMultiPlotWindow::snapshotWindowContent();
|
||||||
wellLogViewer->setScrollbarVisible( isScrollbarVisible );
|
wellLogViewer->setScrollbarVisible( isScrollbarVisible );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
|
|
||||||
#include "RiaDefines.h"
|
#include "RiaDefines.h"
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimWellLogPlotNameConfig.h"
|
#include "RimWellLogPlotNameConfig.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
@ -43,7 +43,7 @@ class QKeyEvent;
|
|||||||
///
|
///
|
||||||
///
|
///
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
class RimWellLogPlot : public RimMultiPlot, public RimNameConfigHolderInterface
|
class RimWellLogPlot : public RimMultiPlotWindow, public RimNameConfigHolderInterface
|
||||||
{
|
{
|
||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
@ -487,6 +487,19 @@ void RimWellLogTrack::updateYZoom()
|
|||||||
m_plotWidget->setAxisRange( QwtPlot::yLeft, m_visibleYRangeMin(), m_visibleYRangeMax() );
|
m_plotWidget->setAxisRange( QwtPlot::yLeft, m_visibleYRangeMin(), m_visibleYRangeMax() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogTrack::doRemoveFromCollection()
|
||||||
|
{
|
||||||
|
RimMultiPlotWindow* multiPlot = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType( multiPlot );
|
||||||
|
if ( multiPlot )
|
||||||
|
{
|
||||||
|
multiPlot->removePlot( this );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -494,6 +507,8 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue )
|
const QVariant& newValue )
|
||||||
{
|
{
|
||||||
|
RimPlot::fieldChangedByUi( changedField, oldValue, newValue );
|
||||||
|
|
||||||
if ( changedField == &m_showWindow )
|
if ( changedField == &m_showWindow )
|
||||||
{
|
{
|
||||||
if ( m_plotWidget )
|
if ( m_plotWidget )
|
||||||
@ -716,7 +731,7 @@ void RimWellLogTrack::updateXAxisAndGridTickIntervals()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogTrack::updateAllLegendItems()
|
void RimWellLogTrack::updateLegend()
|
||||||
{
|
{
|
||||||
reattachAllCurves();
|
reattachAllCurves();
|
||||||
if ( m_plotWidget )
|
if ( m_plotWidget )
|
||||||
@ -1087,7 +1102,7 @@ void RimWellLogTrack::onLoadDataAndUpdate()
|
|||||||
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange );
|
m_explicitTickIntervals.uiCapability()->setUiReadOnly( emptyRange );
|
||||||
m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
|
m_xAxisGridVisibility.uiCapability()->setUiReadOnly( emptyRange );
|
||||||
|
|
||||||
updateAllLegendItems();
|
updateLegend();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -186,7 +186,7 @@ public:
|
|||||||
void setFormationsForCaseWithSimWellOnly( bool caseWithSimWellOnly );
|
void setFormationsForCaseWithSimWellOnly( bool caseWithSimWellOnly );
|
||||||
void updateXAxisAndGridTickIntervals();
|
void updateXAxisAndGridTickIntervals();
|
||||||
|
|
||||||
void updateAllLegendItems();
|
void updateLegend() override;
|
||||||
|
|
||||||
QString asciiDataForPlotExport() const override;
|
QString asciiDataForPlotExport() const override;
|
||||||
|
|
||||||
@ -215,6 +215,8 @@ private:
|
|||||||
void updateXZoom();
|
void updateXZoom();
|
||||||
void updateYZoom();
|
void updateYZoom();
|
||||||
|
|
||||||
|
void doRemoveFromCollection() override;
|
||||||
|
|
||||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue ) override;
|
const QVariant& newValue ) override;
|
||||||
|
@ -578,7 +578,7 @@ void RimSummaryCurve::updateLegendsInPlot()
|
|||||||
{
|
{
|
||||||
RimSummaryPlot* plot = nullptr;
|
RimSummaryPlot* plot = nullptr;
|
||||||
firstAncestorOrThisOfTypeAsserted( plot );
|
firstAncestorOrThisOfTypeAsserted( plot );
|
||||||
plot->updateAllLegendItems();
|
plot->updateLegend();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "RimEnsembleCurveSet.h"
|
#include "RimEnsembleCurveSet.h"
|
||||||
#include "RimEnsembleCurveSetCollection.h"
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
#include "RimGridTimeHistoryCurve.h"
|
#include "RimGridTimeHistoryCurve.h"
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPlotAxisProperties.h"
|
#include "RimPlotAxisProperties.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
@ -603,8 +603,10 @@ void RimSummaryPlot::updateAll()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::updateAllLegendItems()
|
void RimSummaryPlot::updateLegend()
|
||||||
{
|
{
|
||||||
|
m_plotWidget->setLegendVisible( m_showPlotLegends && isMdiWindow() );
|
||||||
|
|
||||||
reattachAllCurves();
|
reattachAllCurves();
|
||||||
if ( m_plotWidget )
|
if ( m_plotWidget )
|
||||||
{
|
{
|
||||||
@ -1546,39 +1548,17 @@ void RimSummaryPlot::removeEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::removeFromMdiAreaAndCollection()
|
void RimSummaryPlot::doRemoveFromCollection()
|
||||||
{
|
{
|
||||||
if ( isMdiWindow() )
|
RimSummaryPlotCollection* summaryCollection = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType( summaryCollection );
|
||||||
|
if ( summaryCollection )
|
||||||
{
|
{
|
||||||
RimSummaryPlotCollection* summaryCollection = nullptr;
|
summaryCollection->removeSummaryPlot( this );
|
||||||
this->firstAncestorOrThisOfType( summaryCollection );
|
summaryCollection->updateAllRequiredEditors();
|
||||||
if ( summaryCollection )
|
|
||||||
{
|
|
||||||
summaryCollection->removeSummaryPlot( this );
|
|
||||||
this->revokeMdiWindowStatus();
|
|
||||||
summaryCollection->updateAllRequiredEditors();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimSummaryPlot::updateAfterInsertingIntoMultiPlot()
|
|
||||||
{
|
|
||||||
if ( m_plotWidget )
|
|
||||||
{
|
|
||||||
m_plotWidget->setTitle( "" );
|
|
||||||
m_plotWidget->setLegendVisible( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_timeAxisProperties )
|
|
||||||
{
|
|
||||||
m_timeAxisProperties->showTitle = true;
|
|
||||||
}
|
|
||||||
updateAxes();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1776,15 +1756,22 @@ void RimSummaryPlot::initAfterRead()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::updateMdiWindowTitle()
|
void RimSummaryPlot::updateMdiWindowTitle()
|
||||||
{
|
{
|
||||||
if ( m_plotWidget && isMdiWindow() )
|
if ( m_plotWidget )
|
||||||
{
|
{
|
||||||
QString plotTitle = description();
|
if ( isMdiWindow() )
|
||||||
|
|
||||||
m_plotWidget->setWindowTitle( plotTitle );
|
|
||||||
|
|
||||||
if ( m_showPlotTitle )
|
|
||||||
{
|
{
|
||||||
m_plotWidget->setTitle( plotTitle );
|
QString plotTitle = description();
|
||||||
|
|
||||||
|
m_plotWidget->setWindowTitle( plotTitle );
|
||||||
|
|
||||||
|
if ( m_showPlotTitle )
|
||||||
|
{
|
||||||
|
m_plotWidget->setTitle( plotTitle );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_plotWidget->setTitle( "" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1856,7 +1843,7 @@ void RimSummaryPlot::updateWindowVisibility()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryPlot::performLayoutUpdate()
|
void RimSummaryPlot::doUpdateLayout()
|
||||||
{
|
{
|
||||||
this->loadDataAndUpdate();
|
this->loadDataAndUpdate();
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ public:
|
|||||||
void copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSummaryPlot );
|
void copyAxisPropertiesFromOther( const RimSummaryPlot& sourceSummaryPlot );
|
||||||
|
|
||||||
void updateAll();
|
void updateAll();
|
||||||
void updateAllLegendItems();
|
void updateLegend() override;
|
||||||
|
|
||||||
void setPlotInfoLabel( const QString& label );
|
void setPlotInfoLabel( const QString& label );
|
||||||
void showPlotInfoLabel( bool show );
|
void showPlotInfoLabel( bool show );
|
||||||
@ -173,9 +173,6 @@ public:
|
|||||||
void addOrUpdateEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet );
|
void addOrUpdateEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet );
|
||||||
void removeEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet );
|
void removeEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet );
|
||||||
|
|
||||||
void removeFromMdiAreaAndCollection() override;
|
|
||||||
void updateAfterInsertingIntoMultiPlot() override;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// RimViewWindow overrides
|
// RimViewWindow overrides
|
||||||
QWidget* createViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
QWidget* createViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
||||||
@ -187,10 +184,12 @@ private:
|
|||||||
void updateNameHelperWithCurveData( RimSummaryPlotNameHelper* nameHelper ) const;
|
void updateNameHelperWithCurveData( RimSummaryPlotNameHelper* nameHelper ) const;
|
||||||
|
|
||||||
void updateWindowVisibility();
|
void updateWindowVisibility();
|
||||||
void performLayoutUpdate() override;
|
void doUpdateLayout() override;
|
||||||
|
|
||||||
void detachAllPlotItems();
|
void detachAllPlotItems();
|
||||||
|
|
||||||
|
void doRemoveFromCollection() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overridden PDM methods
|
// Overridden PDM methods
|
||||||
caf::PdmFieldHandle* userDescriptionField() override;
|
caf::PdmFieldHandle* userDescriptionField() override;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "RimEclipseResultCase.h"
|
#include "RimEclipseResultCase.h"
|
||||||
#include "RimIdenticalGridCaseGroup.h"
|
#include "RimIdenticalGridCaseGroup.h"
|
||||||
#include "RimMimeData.h"
|
#include "RimMimeData.h"
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimPlot.h"
|
#include "RimPlot.h"
|
||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
#include "RimSummaryCaseCollection.h"
|
#include "RimSummaryCaseCollection.h"
|
||||||
@ -186,7 +186,7 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
|||||||
itemflags |= Qt::ItemIsDropEnabled;
|
itemflags |= Qt::ItemIsDropEnabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( dynamic_cast<RimMultiPlot*>( uiItem ) )
|
else if ( dynamic_cast<RimMultiPlotWindow*>( uiItem ) )
|
||||||
{
|
{
|
||||||
if ( RiuTypedPdmObjects<RimPlot>::containsTypedObjects( m_dragItems ) )
|
if ( RiuTypedPdmObjects<RimPlot>::containsTypedObjects( m_dragItems ) )
|
||||||
{
|
{
|
||||||
@ -304,7 +304,7 @@ bool RiuDragDrop::dropMimeData( const QMimeData* data, Qt::DropAction action, in
|
|||||||
return handleWellLogPlotTrackDrop( action, draggedObjects, wellLogPlotTrack, row );
|
return handleWellLogPlotTrackDrop( action, draggedObjects, wellLogPlotTrack, row );
|
||||||
}
|
}
|
||||||
|
|
||||||
RimMultiPlot* multiPlot;
|
RimMultiPlotWindow* multiPlot;
|
||||||
dropTarget->firstAncestorOrThisOfType( multiPlot );
|
dropTarget->firstAncestorOrThisOfType( multiPlot );
|
||||||
if ( multiPlot )
|
if ( multiPlot )
|
||||||
{
|
{
|
||||||
@ -456,7 +456,7 @@ bool RiuDragDrop::handleWellLogPlotTrackDrop( Qt::DropAction action,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RiuDragDrop::handleMultiPlotDrop( Qt::DropAction action,
|
bool RiuDragDrop::handleMultiPlotDrop( Qt::DropAction action,
|
||||||
caf::PdmObjectGroup& draggedObjects,
|
caf::PdmObjectGroup& draggedObjects,
|
||||||
RimMultiPlot* multiPlot,
|
RimMultiPlotWindow* multiPlot,
|
||||||
int insertAtPosition )
|
int insertAtPosition )
|
||||||
{
|
{
|
||||||
std::vector<RimPlot*> plots = RiuTypedPdmObjects<RimPlot>::typedObjectsFromGroup( draggedObjects );
|
std::vector<RimPlot*> plots = RiuTypedPdmObjects<RimPlot>::typedObjectsFromGroup( draggedObjects );
|
||||||
|
@ -29,7 +29,7 @@ namespace caf
|
|||||||
class PdmObjectHandle;
|
class PdmObjectHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RimMultiPlot;
|
class RimMultiPlotWindow;
|
||||||
class RimIdenticalGridCaseGroup;
|
class RimIdenticalGridCaseGroup;
|
||||||
class RimSummaryCaseCollection;
|
class RimSummaryCaseCollection;
|
||||||
class RimSummaryCaseMainCollection;
|
class RimSummaryCaseMainCollection;
|
||||||
@ -67,7 +67,7 @@ private:
|
|||||||
int insertAtPosition );
|
int insertAtPosition );
|
||||||
bool handleMultiPlotDrop( Qt::DropAction action,
|
bool handleMultiPlotDrop( Qt::DropAction action,
|
||||||
caf::PdmObjectGroup& objectGroup,
|
caf::PdmObjectGroup& objectGroup,
|
||||||
RimMultiPlot* multiPlot,
|
RimMultiPlotWindow* multiPlot,
|
||||||
int insertAtPosition );
|
int insertAtPosition );
|
||||||
bool handleWellLogPlotCurveDrop( Qt::DropAction action,
|
bool handleWellLogPlotCurveDrop( Qt::DropAction action,
|
||||||
caf::PdmObjectGroup& objectGroup,
|
caf::PdmObjectGroup& objectGroup,
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "WellLogCommands/RicWellLogPlotTrackFeatureImpl.h"
|
#include "WellLogCommands/RicWellLogPlotTrackFeatureImpl.h"
|
||||||
|
|
||||||
#include "RimContextCommandBuilder.h"
|
#include "RimContextCommandBuilder.h"
|
||||||
#include "RimMultiPlot.h"
|
#include "RimMultiPlotWindow.h"
|
||||||
#include "RimWellLogTrack.h"
|
#include "RimWellLogTrack.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
@ -57,7 +57,7 @@
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuMultiPlotWindow::RiuMultiPlotWindow( RimMultiPlot* plotDefinition, QWidget* parent )
|
RiuMultiPlotWindow::RiuMultiPlotWindow( RimMultiPlotWindow* plotDefinition, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
{
|
{
|
||||||
Q_ASSERT( plotDefinition );
|
Q_ASSERT( plotDefinition );
|
||||||
@ -100,7 +100,7 @@ RiuMultiPlotWindow::RiuMultiPlotWindow( RimMultiPlot* plotDefinition, QWidget* p
|
|||||||
|
|
||||||
setFocusPolicy( Qt::StrongFocus );
|
setFocusPolicy( Qt::StrongFocus );
|
||||||
|
|
||||||
setAcceptDrops( true );
|
setAcceptDrops( m_plotDefinition->acceptDrops() );
|
||||||
|
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
int defaultFontSize = RiaFontCache::pointSizeFromFontSizeEnum( app->preferences()->defaultPlotFontSize() );
|
int defaultFontSize = RiaFontCache::pointSizeFromFontSizeEnum( app->preferences()->defaultPlotFontSize() );
|
||||||
@ -117,7 +117,7 @@ RiuMultiPlotWindow::~RiuMultiPlotWindow() {}
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimMultiPlot* RiuMultiPlotWindow::ownerPlotDefinition()
|
RimMultiPlotWindow* RiuMultiPlotWindow::ownerPlotDefinition()
|
||||||
{
|
{
|
||||||
return m_plotDefinition;
|
return m_plotDefinition;
|
||||||
}
|
}
|
||||||
@ -566,7 +566,7 @@ void RiuMultiPlotWindow::reinsertPlotWidgets()
|
|||||||
QList<QPointer<RiuQwtPlotLegend>> legends = this->visibleLegends();
|
QList<QPointer<RiuQwtPlotLegend>> legends = this->visibleLegends();
|
||||||
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
QList<QPointer<RiuQwtPlotWidget>> plotWidgets = this->visiblePlotWidgets();
|
||||||
|
|
||||||
if ( plotWidgets.empty() )
|
if ( plotWidgets.empty() && acceptDrops() )
|
||||||
{
|
{
|
||||||
m_gridLayout->addWidget( m_dropTargetPlaceHolder, 0, 0 );
|
m_gridLayout->addWidget( m_dropTargetPlaceHolder, 0, 0 );
|
||||||
m_gridLayout->setRowStretch( 0, 1 );
|
m_gridLayout->setRowStretch( 0, 1 );
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
class RiaPlotWindowRedrawScheduler;
|
class RiaPlotWindowRedrawScheduler;
|
||||||
class RimMultiPlot;
|
class RimMultiPlotWindow;
|
||||||
class RiuQwtPlotLegend;
|
class RiuQwtPlotLegend;
|
||||||
class RiuQwtPlotWidget;
|
class RiuQwtPlotWidget;
|
||||||
|
|
||||||
@ -53,11 +53,11 @@ class RiuMultiPlotWindow : public QWidget, public RiuInterfaceToViewWindow, publ
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RiuMultiPlotWindow( RimMultiPlot* plotDefinition, QWidget* parent = nullptr );
|
RiuMultiPlotWindow( RimMultiPlotWindow* plotDefinition, QWidget* parent = nullptr );
|
||||||
~RiuMultiPlotWindow() override;
|
~RiuMultiPlotWindow() override;
|
||||||
|
|
||||||
RimMultiPlot* ownerPlotDefinition();
|
RimMultiPlotWindow* ownerPlotDefinition();
|
||||||
RimViewWindow* ownerViewWindow() const override;
|
RimViewWindow* ownerViewWindow() const override;
|
||||||
|
|
||||||
void addPlot( RiuQwtPlotWidget* plotWidget );
|
void addPlot( RiuQwtPlotWidget* plotWidget );
|
||||||
void insertPlot( RiuQwtPlotWidget* plotWidget, size_t index );
|
void insertPlot( RiuQwtPlotWidget* plotWidget, size_t index );
|
||||||
@ -113,17 +113,17 @@ private slots:
|
|||||||
virtual void performUpdate();
|
virtual void performUpdate();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QPointer<QVBoxLayout> m_layout;
|
QPointer<QVBoxLayout> m_layout;
|
||||||
QPointer<QHBoxLayout> m_plotLayout;
|
QPointer<QHBoxLayout> m_plotLayout;
|
||||||
QPointer<QFrame> m_plotWidgetFrame;
|
QPointer<QFrame> m_plotWidgetFrame;
|
||||||
QPointer<QGridLayout> m_gridLayout;
|
QPointer<QGridLayout> m_gridLayout;
|
||||||
QPointer<QLabel> m_plotTitle;
|
QPointer<QLabel> m_plotTitle;
|
||||||
QList<int> m_legendColumns;
|
QList<int> m_legendColumns;
|
||||||
QList<QPointer<QLabel>> m_subTitles;
|
QList<QPointer<QLabel>> m_subTitles;
|
||||||
QList<QPointer<RiuQwtPlotLegend>> m_legends;
|
QList<QPointer<RiuQwtPlotLegend>> m_legends;
|
||||||
QList<QPointer<RiuQwtPlotWidget>> m_plotWidgets;
|
QList<QPointer<RiuQwtPlotWidget>> m_plotWidgets;
|
||||||
caf::PdmPointer<RimMultiPlot> m_plotDefinition;
|
caf::PdmPointer<RimMultiPlotWindow> m_plotDefinition;
|
||||||
QPointer<QLabel> m_dropTargetPlaceHolder;
|
QPointer<QLabel> m_dropTargetPlaceHolder;
|
||||||
|
|
||||||
RiuWidgetStyleSheet m_dropTargetStyleSheet;
|
RiuWidgetStyleSheet m_dropTargetStyleSheet;
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ void RiuPlotMainWindow::updateWellLogPlotToolBar()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuPlotMainWindow::updateMultiPlotToolBar()
|
void RiuPlotMainWindow::updateMultiPlotToolBar()
|
||||||
{
|
{
|
||||||
RimMultiPlot* plotWindow = dynamic_cast<RimMultiPlot*>( m_activePlotViewWindow.p() );
|
RimMultiPlotWindow* plotWindow = dynamic_cast<RimMultiPlotWindow*>( m_activePlotViewWindow.p() );
|
||||||
if ( plotWindow )
|
if ( plotWindow )
|
||||||
{
|
{
|
||||||
std::vector<caf::PdmFieldHandle*> toolBarFields = {plotWindow->columnCountField()};
|
std::vector<caf::PdmFieldHandle*> toolBarFields = {plotWindow->columnCountField()};
|
||||||
@ -592,8 +592,8 @@ void RiuPlotMainWindow::updateMultiPlotToolBar()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuPlotMainWindow::updateSummaryPlotToolBar( bool forceUpdateUi )
|
void RiuPlotMainWindow::updateSummaryPlotToolBar( bool forceUpdateUi )
|
||||||
{
|
{
|
||||||
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>( m_activePlotViewWindow.p() );
|
RimSummaryPlot* summaryPlot = dynamic_cast<RimSummaryPlot*>( m_activePlotViewWindow.p() );
|
||||||
RimMultiPlot* multiPlot = dynamic_cast<RimMultiPlot*>( m_activePlotViewWindow.p() );
|
RimMultiPlotWindow* multiPlot = dynamic_cast<RimMultiPlotWindow*>( m_activePlotViewWindow.p() );
|
||||||
if ( multiPlot )
|
if ( multiPlot )
|
||||||
{
|
{
|
||||||
summaryPlot = caf::SelectionManager::instance()->selectedItemOfType<RimSummaryPlot>();
|
summaryPlot = caf::SelectionManager::instance()->selectedItemOfType<RimSummaryPlot>();
|
||||||
|
@ -55,7 +55,7 @@ void PdmObjectGroup::createCopyByType(std::vector<PdmPointer<T> >* copyOfTypedOb
|
|||||||
{
|
{
|
||||||
QString xml = xmlObj(sourceTypedObjects[i])->writeObjectToXmlString();
|
QString xml = xmlObj(sourceTypedObjects[i])->writeObjectToXmlString();
|
||||||
|
|
||||||
PdmObjectHandle* objectCopy = PdmXmlObjectHandle::readUnknownObjectFromXmlString(xml, PdmDefaultObjectFactory::instance());
|
PdmObjectHandle* objectCopy = PdmXmlObjectHandle::readUnknownObjectFromXmlString(xml, PdmDefaultObjectFactory::instance(), true);
|
||||||
|
|
||||||
T* typedObject = dynamic_cast<T*>(objectCopy);
|
T* typedObject = dynamic_cast<T*>(objectCopy);
|
||||||
CAF_ASSERT(typedObject);
|
CAF_ASSERT(typedObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user