mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Create Grid plot collection and allow creation of new combination plots
This commit is contained in:
@@ -137,6 +137,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindowCollection.h
|
||||
)
|
||||
|
||||
|
||||
@@ -278,6 +279,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridPlotWindowCollection.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -130,7 +130,7 @@ RimWellPltPlot::RimWellPltPlot()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_phases, "Phases", "Phases", "", "", "" );
|
||||
m_phases.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
m_phases = std::vector<caf::AppEnum<FlowPhase>>( {FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER} );
|
||||
m_phases = std::vector<caf::AppEnum<FlowPhase>>( { FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER } );
|
||||
m_phases.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
m_nameConfig->setCustomName( "PLT Plot" );
|
||||
@@ -139,7 +139,7 @@ RimWellPltPlot::RimWellPltPlot()
|
||||
m_doInitAfterLoad = false;
|
||||
m_isOnLoad = true;
|
||||
|
||||
setAvailableDepthTypes( {RimWellLogPlot::MEASURED_DEPTH} );
|
||||
setAvailableDepthTypes( { RimWellLogPlot::MEASURED_DEPTH } );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -999,15 +999,13 @@ void RimWellPltPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
if ( track )
|
||||
{
|
||||
track->uiOrderingForRftPltFormations( uiOrdering );
|
||||
caf::PdmUiGroup* axesGroup = uiOrdering.addNewGroup( "Axes" );
|
||||
track->uiOrderingForXAxisSettings( *axesGroup );
|
||||
uiOrderingForDepthAxis( *axesGroup );
|
||||
|
||||
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup( "Legend and Axis" );
|
||||
legendAndAxisGroup->setCollapsedByDefault( true );
|
||||
|
||||
createPlotSettingsUiGroup( *legendAndAxisGroup );
|
||||
|
||||
track->uiOrderingForXAxisSettings( *legendAndAxisGroup );
|
||||
|
||||
uiOrderingForDepthAxis( *legendAndAxisGroup );
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
plotLayoutGroup->setCollapsedByDefault( true );
|
||||
RimWellLogPlot::uiOrderingForPlotLayout( *plotLayoutGroup );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -917,13 +917,13 @@ void RimWellRftPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
if ( track )
|
||||
{
|
||||
track->uiOrderingForRftPltFormations( uiOrdering );
|
||||
caf::PdmUiGroup* axesGroup = uiOrdering.addNewGroup( "Axes" );
|
||||
track->uiOrderingForXAxisSettings( *axesGroup );
|
||||
uiOrderingForDepthAxis( *axesGroup );
|
||||
|
||||
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup( "Legend and Axis" );
|
||||
legendAndAxisGroup->setCollapsedByDefault( true );
|
||||
|
||||
createPlotSettingsUiGroup( *legendAndAxisGroup );
|
||||
track->uiOrderingForXAxisSettings( *legendAndAxisGroup );
|
||||
uiOrderingForDepthAxis( *legendAndAxisGroup );
|
||||
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
plotLayoutGroup->setCollapsedByDefault( true );
|
||||
RimWellLogPlot::uiOrderingForPlotLayout( *plotLayoutGroup );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,10 @@
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuQwtPlotTools.h"
|
||||
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimGridCrossPlotCurve.h"
|
||||
#include "RimGridCrossPlotDataSet.h"
|
||||
#include "RimGridPlotWindow.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
@@ -53,10 +55,7 @@ RimGridCrossPlot::RimGridCrossPlot()
|
||||
CAF_PDM_InitObject( "Grid Cross Plot", ":/SummaryXPlotLight16x16.png", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_showInfoBox, "ShowInfoBox", true, "Show Info Box", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showLegend, "ShowLegend", true, "Show Legend", "", "", "" );
|
||||
CAF_PDM_InitField( &m_legendFontSize, "LegendFontSize", 10, "Legend and Info Font Size", "", "", "" );
|
||||
m_legendFontSize = RiaFontCache::pointSizeFromFontSizeEnum(
|
||||
RiaApplication::instance()->preferences()->defaultPlotFontSize() );
|
||||
CAF_PDM_InitField( &m_showLegend_OBSOLETE, "ShowLegend", false, "Show Legend", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_nameConfig, "NameConfig", "Name Config", "", "", "" );
|
||||
m_nameConfig.uiCapability()->setUiTreeHidden( true );
|
||||
@@ -96,6 +95,22 @@ bool RimGridCrossPlot::isChecked() const
|
||||
return isWindowVisible();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::setChecked( bool checked )
|
||||
{
|
||||
m_showWindow = checked;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridCrossPlot::description() const
|
||||
{
|
||||
return createAutoName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -421,6 +436,17 @@ void RimGridCrossPlot::onLoadDataAndUpdate()
|
||||
updatePlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::initAfterRead()
|
||||
{
|
||||
if ( m_showLegend_OBSOLETE() )
|
||||
{
|
||||
m_showPlotLegends = true;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -429,11 +455,15 @@ void RimGridCrossPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
||||
RimViewWindow::defineUiOrdering( uiConfigName, uiOrdering );
|
||||
|
||||
uiOrdering.add( &m_showInfoBox );
|
||||
uiOrdering.add( &m_showLegend );
|
||||
|
||||
if ( m_showLegend() )
|
||||
if ( isStandalonePlot() )
|
||||
{
|
||||
uiOrdering.add( &m_legendFontSize );
|
||||
uiOrdering.add( &m_showPlotLegends );
|
||||
|
||||
if ( m_showPlotLegends() )
|
||||
{
|
||||
uiOrdering.add( &m_legendFontSize );
|
||||
}
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Name Configuration" );
|
||||
@@ -464,17 +494,10 @@ void RimGridCrossPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_showLegend )
|
||||
{
|
||||
m_plotWidget->setLegendVisible( m_showLegend() );
|
||||
}
|
||||
RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
if ( changedField == &m_legendFontSize )
|
||||
{
|
||||
m_plotWidget->setLegendFontSize( m_legendFontSize() );
|
||||
for ( auto dataSet : m_crossPlotDataSets )
|
||||
{
|
||||
dataSet->updateLegendIcons();
|
||||
}
|
||||
updateLegend();
|
||||
}
|
||||
onLoadDataAndUpdate();
|
||||
}
|
||||
@@ -546,9 +569,7 @@ void RimGridCrossPlot::updatePlot()
|
||||
dataSet->setParentQwtPlotNoReplot( m_plotWidget );
|
||||
}
|
||||
|
||||
m_plotWidget->setLegendVisible( m_showLegend() );
|
||||
m_plotWidget->setLegendFontSize( m_legendFontSize() );
|
||||
m_plotWidget->updateLegendSizesToMatchPlot();
|
||||
updateLegend();
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
}
|
||||
@@ -563,7 +584,7 @@ void RimGridCrossPlot::updateCurveNamesAndPlotTitle()
|
||||
m_crossPlotDataSets[i]->updateCurveNames( i, m_crossPlotDataSets.size() );
|
||||
}
|
||||
|
||||
if ( m_plotWidget )
|
||||
if ( m_plotWidget && isStandalonePlot() )
|
||||
{
|
||||
m_plotWidget->setTitle( this->createAutoName() );
|
||||
}
|
||||
@@ -666,6 +687,12 @@ void RimGridCrossPlot::setYAxisInverted( bool inverted )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimGridCrossPlot::legendFontSize() const
|
||||
{
|
||||
RimGridPlotWindow* plotWindow = nullptr;
|
||||
this->firstAncestorOrThisOfType( plotWindow );
|
||||
if ( plotWindow )
|
||||
{
|
||||
return plotWindow->legendFontSize();
|
||||
}
|
||||
return m_legendFontSize;
|
||||
}
|
||||
|
||||
@@ -735,6 +762,19 @@ void RimGridCrossPlot::updateLayout()
|
||||
updatePlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::updateLegend()
|
||||
{
|
||||
m_plotWidget->setInternalQwtLegendVisible( m_showPlotLegends() && isStandalonePlot() );
|
||||
m_plotWidget->setLegendFontSize( m_legendFontSize() );
|
||||
for ( auto dataSet : m_crossPlotDataSets )
|
||||
{
|
||||
dataSet->updateLegendIcons();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -829,27 +869,18 @@ void RimGridCrossPlot::updateAxisInQwt( RiaDefines::PlotAxis axisType )
|
||||
{
|
||||
m_plotWidget->enableAxis( qwtAxisId, true );
|
||||
|
||||
QwtText axisTitle( axisParameterString );
|
||||
QFont titleFont = m_plotWidget->axisTitle( qwtAxisId ).font();
|
||||
titleFont.setBold( true );
|
||||
titleFont.setPointSize( axisProperties->titleFontSize() );
|
||||
axisTitle.setFont( titleFont );
|
||||
|
||||
QFont valuesFont = m_plotWidget->axisFont( qwtAxisId );
|
||||
valuesFont.setPointSize( axisProperties->valuesFontSize() );
|
||||
m_plotWidget->setAxisFont( qwtAxisId, valuesFont );
|
||||
|
||||
switch ( axisProperties->titlePosition() )
|
||||
Qt::AlignmentFlag alignment = Qt::AlignCenter;
|
||||
if ( axisProperties->titlePosition() == RimPlotAxisPropertiesInterface::AXIS_TITLE_END )
|
||||
{
|
||||
case RimPlotAxisProperties::AXIS_TITLE_CENTER:
|
||||
axisTitle.setRenderFlags( Qt::AlignCenter );
|
||||
break;
|
||||
case RimPlotAxisProperties::AXIS_TITLE_END:
|
||||
axisTitle.setRenderFlags( Qt::AlignRight );
|
||||
break;
|
||||
alignment = Qt::AlignRight;
|
||||
}
|
||||
|
||||
m_plotWidget->setAxisTitle( qwtAxisId, axisTitle );
|
||||
m_plotWidget->setAxisFontsAndAlignment( qwtAxisId,
|
||||
axisProperties->titleFontSize(),
|
||||
axisProperties->valuesFontSize(),
|
||||
true,
|
||||
alignment );
|
||||
m_plotWidget->setAxisTitleText( qwtAxisId, axisParameterString );
|
||||
m_plotWidget->setAxisTitleEnabled( qwtAxisId, true );
|
||||
|
||||
if ( axisProperties->isLogarithmicScaleEnabled )
|
||||
{
|
||||
@@ -1025,6 +1056,35 @@ void RimGridCrossPlot::removeDataSetLegend( RimGridCrossPlotDataSet* dataSet )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::removeFromMdiAreaAndCollection()
|
||||
{
|
||||
RimGridCrossPlotCollection* crossPlotCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( crossPlotCollection );
|
||||
if ( crossPlotCollection )
|
||||
{
|
||||
crossPlotCollection->removeGridCrossPlot( this );
|
||||
this->revokeMdiWindowStatus();
|
||||
crossPlotCollection->updateAllRequiredEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::updateAfterInsertingIntoGridPlotWindow()
|
||||
{
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
m_plotWidget->setTitle( "" );
|
||||
m_plotWidget->setInternalQwtLegendVisible( false );
|
||||
}
|
||||
updateAxes();
|
||||
updateLayout();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Name Configuration
|
||||
///
|
||||
|
||||
@@ -58,6 +58,9 @@ public:
|
||||
~RimGridCrossPlot();
|
||||
|
||||
bool isChecked() const override;
|
||||
void setChecked( bool checked ) override;
|
||||
|
||||
QString description() const override;
|
||||
|
||||
RimGridCrossPlotDataSet* createDataSet();
|
||||
int indexOfDataSet( const RimGridCrossPlotDataSet* dataSet ) const;
|
||||
@@ -95,11 +98,12 @@ public:
|
||||
bool forceChange = false ) override;
|
||||
|
||||
void updateLayout() override;
|
||||
void updateLegend();
|
||||
|
||||
void updateZoomInQwt() override;
|
||||
void updateZoomFromQwt() override;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void loadDataAndUpdate() override;
|
||||
|
||||
void setAutoScaleXEnabled( bool enabled ) override;
|
||||
void setAutoScaleYEnabled( bool enabled ) override;
|
||||
@@ -110,10 +114,14 @@ public:
|
||||
void addOrUpdateDataSetLegend( RimGridCrossPlotDataSet* dataSet );
|
||||
void removeDataSetLegend( RimGridCrossPlotDataSet* dataSet );
|
||||
|
||||
void removeFromMdiAreaAndCollection() override;
|
||||
void updateAfterInsertingIntoGridPlotWindow() override;
|
||||
|
||||
protected:
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||
void deleteViewWidget() override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
void initAfterRead() override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
|
||||
@@ -144,8 +152,7 @@ protected:
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showInfoBox;
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
caf::PdmField<int> m_legendFontSize;
|
||||
caf::PdmField<bool> m_showLegend_OBSOLETE;
|
||||
caf::PdmChildField<RimGridCrossPlotNameConfig*> m_nameConfig;
|
||||
|
||||
caf::PdmChildField<RimPlotAxisProperties*> m_yAxisProperties;
|
||||
|
||||
@@ -75,3 +75,11 @@ void RimGridCrossPlotCollection::addGridCrossPlot( RimGridCrossPlot* plot )
|
||||
{
|
||||
m_gridCrossPlots().push_back( plot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlotCollection::removeGridCrossPlot( RimGridCrossPlot* plot )
|
||||
{
|
||||
m_gridCrossPlots.removeChildObject( plot );
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
std::vector<RimGridCrossPlot*> gridCrossPlots() const;
|
||||
RimGridCrossPlot* createGridCrossPlot();
|
||||
void addGridCrossPlot( RimGridCrossPlot* plot );
|
||||
void removeGridCrossPlot( RimGridCrossPlot* plot );
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimGridCrossPlot*> m_gridCrossPlots;
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimGridCrossPlotDataSet.h"
|
||||
#include "RimGridPlotWindowCollection.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimIntersection.h"
|
||||
#include "RimIntersectionBox.h"
|
||||
@@ -465,6 +466,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicNewWellLogPlotFeature";
|
||||
menuBuilder << "RicNewWellBoreStabilityPlotFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimGridPlotWindowCollection*>( uiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewGridPlotWindowFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimRftPlotCollection*>( uiItem ) )
|
||||
{
|
||||
menuBuilder << "RicNewRftPlotFeature";
|
||||
@@ -506,7 +511,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicNewWellLogRftCurveFeature";
|
||||
menuBuilder << "RicNewWellLogFileCurveFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicDeleteWellLogPlotTrackFeature";
|
||||
menuBuilder << "RicDeleteSubPlotFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimWellLogCurve*>( uiItem ) )
|
||||
{
|
||||
@@ -562,6 +567,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicCopyReferencesToClipboardFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicViewZoomAllFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicDeleteSubPlotFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimSummaryCurve*>( uiItem ) )
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ void RimGridPlotWindow::ColumnCountEnum::setUp()
|
||||
addItem( RimGridPlotWindow::COLUMNS_3, "3", "3 Columns" );
|
||||
addItem( RimGridPlotWindow::COLUMNS_4, "4", "4 Columns" );
|
||||
addItem( RimGridPlotWindow::COLUMNS_UNLIMITED, "UNLIMITED", "Unlimited" );
|
||||
setDefault( RimGridPlotWindow::COLUMNS_UNLIMITED );
|
||||
setDefault( RimGridPlotWindow::COLUMNS_2 );
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
@@ -46,13 +46,15 @@ CAF_PDM_SOURCE_INIT( RimGridPlotWindow, "GridPlotWindow" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridPlotWindow::RimGridPlotWindow()
|
||||
{
|
||||
CAF_PDM_InitObject( "Grid Plot Window", ":/WellLogPlot16x16.png", "", "" );
|
||||
CAF_PDM_InitObject( "Combination Plot", ":/WellLogPlot16x16.png", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_plots, "Tracks", "", "", "", "" );
|
||||
m_plots.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_columnCountEnum, "NumberOfColumns", "Number of Columns", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_showIndividualPlotTitles, "ShowPlotTitles", false, "Show Sub Plot Titles", "", "", "" );
|
||||
|
||||
m_viewer = nullptr;
|
||||
}
|
||||
|
||||
@@ -116,7 +118,9 @@ void RimGridPlotWindow::insertPlot( RimPlotInterface* plot, size_t index )
|
||||
if ( m_viewer )
|
||||
{
|
||||
plot->createPlotWidget();
|
||||
plot->setChecked( true );
|
||||
m_viewer->insertPlot( plot->viewer(), index );
|
||||
plot->updateAfterInsertingIntoGridPlotWindow();
|
||||
}
|
||||
|
||||
onPlotAdditionOrRemoval();
|
||||
@@ -140,6 +144,43 @@ void RimGridPlotWindow::removePlot( RimPlotInterface* plot )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridPlotWindow::movePlotsToThis( const std::vector<RimPlotInterface*>& plotsToMove,
|
||||
RimPlotInterface* plotToInsertAfter )
|
||||
{
|
||||
std::set<caf::PdmObject*> objectsToUpdate;
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
|
||||
{
|
||||
RimPlotInterface* plot = plotsToMove[tIdx];
|
||||
caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( plot );
|
||||
|
||||
RimGridPlotWindow* srcPlot = nullptr;
|
||||
pdmObject->firstAncestorOrThisOfType( srcPlot );
|
||||
if ( srcPlot )
|
||||
{
|
||||
srcPlot->removePlot( plot );
|
||||
}
|
||||
else
|
||||
{
|
||||
plot->removeFromMdiAreaAndCollection();
|
||||
}
|
||||
}
|
||||
|
||||
size_t insertionStartIndex = 0;
|
||||
if ( plotToInsertAfter ) insertionStartIndex = this->plotIndex( plotToInsertAfter ) + 1;
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < plotsToMove.size(); tIdx++ )
|
||||
{
|
||||
this->insertPlot( plotsToMove[tIdx], insertionStartIndex + tIdx );
|
||||
}
|
||||
|
||||
this->updateLayout();
|
||||
this->updateAllRequiredEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -271,21 +312,19 @@ caf::PdmFieldHandle* RimGridPlotWindow::columnCountField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridPlotWindow::zoomAll()
|
||||
bool RimGridPlotWindow::showPlotTitles() const
|
||||
{
|
||||
setAutoScaleXEnabled( true );
|
||||
setAutoScaleYEnabled( true );
|
||||
updateZoom();
|
||||
return m_showIndividualPlotTitles;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmUiGroup* RimGridPlotWindow::createPlotSettingsUiGroup( caf::PdmUiOrdering& uiOrdering )
|
||||
void RimGridPlotWindow::zoomAll()
|
||||
{
|
||||
caf::PdmUiGroup* titleAndLegendsGroup = RimPlotWindow::createPlotSettingsUiGroup( uiOrdering );
|
||||
titleAndLegendsGroup->add( &m_columnCountEnum );
|
||||
return titleAndLegendsGroup;
|
||||
setAutoScaleXEnabled( true );
|
||||
setAutoScaleYEnabled( true );
|
||||
updateZoom();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -326,11 +365,9 @@ QImage RimGridPlotWindow::snapshotWindowContent()
|
||||
|
||||
if ( m_viewer )
|
||||
{
|
||||
m_viewer->setScrollbarVisible( false );
|
||||
m_viewer->setSelectionsVisible( false );
|
||||
QPixmap pix = m_viewer->grab();
|
||||
image = pix.toImage();
|
||||
m_viewer->setScrollbarVisible( true );
|
||||
m_viewer->setSelectionsVisible( true );
|
||||
}
|
||||
|
||||
@@ -370,6 +407,10 @@ void RimGridPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
|
||||
{
|
||||
RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
|
||||
if ( changedField == &m_showIndividualPlotTitles )
|
||||
{
|
||||
updateLayout();
|
||||
}
|
||||
if ( changedField == &m_columnCountEnum )
|
||||
{
|
||||
updateLayout();
|
||||
@@ -383,7 +424,20 @@ void RimGridPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridPlotWindow::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
createPlotSettingsUiGroup( uiOrdering );
|
||||
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
uiOrderingForPlotLayout( *titleAndLegendsGroup );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridPlotWindow::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_showTitleInPlot );
|
||||
uiOrdering.add( &m_description );
|
||||
uiOrdering.add( &m_showIndividualPlotTitles );
|
||||
RimPlotWindow::uiOrderingForPlotLayout( uiOrdering );
|
||||
uiOrdering.add( &m_columnCountEnum );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -426,7 +480,7 @@ QList<caf::PdmOptionItemInfo> RimGridPlotWindow::calculateValueOptions( const ca
|
||||
void RimGridPlotWindow::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
setPlotTitleInWidget( this->fullPlotTitle() );
|
||||
updatePlotTitle();
|
||||
updatePlots();
|
||||
updateLayout();
|
||||
}
|
||||
@@ -443,18 +497,11 @@ void RimGridPlotWindow::initAfterRead()
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridPlotWindow::updatePlotTitle()
|
||||
{
|
||||
m_viewer->setTitleVisible( m_showTitleInPlot() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridPlotWindow::setPlotTitleInWidget( const QString& title )
|
||||
{
|
||||
if ( m_viewer )
|
||||
{
|
||||
m_viewer->setPlotTitle( title );
|
||||
m_viewer->setTitleVisible( m_showTitleInPlot() );
|
||||
m_viewer->setPlotTitle( fullPlotTitle() );
|
||||
}
|
||||
updateMdiWindowTitle();
|
||||
}
|
||||
@@ -512,6 +559,10 @@ bool RimGridPlotWindow::hasCustomFontSizes( RiaDefines::FontSettingType fontSett
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( m_legendFontSize() != defaultFontSize )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
for ( const RimPlotInterface* plot : plots() )
|
||||
{
|
||||
if ( plot->hasCustomFontSizes( fontSettingType, defaultFontSize ) )
|
||||
@@ -540,6 +591,12 @@ bool RimGridPlotWindow::applyFontSize( RiaDefines::FontSettingType fontSettingTy
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
if ( oldFontSize == m_legendFontSize() || forceChange )
|
||||
{
|
||||
m_legendFontSize = fontSize;
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
for ( RimPlotInterface* plot : plots() )
|
||||
{
|
||||
if ( plot->applyFontSize( fontSettingType, oldFontSize, fontSize, forceChange ) )
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <QPointer>
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimPlotInterface;
|
||||
|
||||
class RimGridPlotWindow : public RimPlotWindow
|
||||
@@ -58,6 +60,7 @@ public:
|
||||
void addPlot( RimPlotInterface* plot );
|
||||
void insertPlot( RimPlotInterface* plot, size_t index );
|
||||
void removePlot( RimPlotInterface* plot );
|
||||
void movePlotsToThis( const std::vector<RimPlotInterface*>& plots, RimPlotInterface* plotToInsertAfter );
|
||||
|
||||
size_t plotCount() const;
|
||||
size_t plotIndex( const RimPlotInterface* plot ) const;
|
||||
@@ -75,11 +78,10 @@ public:
|
||||
|
||||
int columnCount() const;
|
||||
caf::PdmFieldHandle* columnCountField();
|
||||
bool showPlotTitles() const;
|
||||
|
||||
void zoomAll() override;
|
||||
|
||||
caf::PdmUiGroup* createPlotSettingsUiGroup( caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
QString asciiDataForPlotExport() const;
|
||||
|
||||
virtual void onPlotAdditionOrRemoval();
|
||||
@@ -90,17 +92,19 @@ protected:
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||
void deleteViewWidget() override;
|
||||
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
void uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
void initAfterRead() override;
|
||||
|
||||
void updatePlotTitle() override;
|
||||
void setPlotTitleInWidget( const QString& plotTitle );
|
||||
void updatePlots();
|
||||
virtual void updateZoom();
|
||||
void recreatePlotWidgets();
|
||||
@@ -121,6 +125,7 @@ private:
|
||||
|
||||
protected:
|
||||
caf::PdmField<ColumnCountEnum> m_columnCountEnum;
|
||||
caf::PdmField<bool> m_showIndividualPlotTitles;
|
||||
|
||||
friend class RiuGridPlotWindow;
|
||||
QPointer<RiuGridPlotWindow> m_viewer;
|
||||
|
||||
@@ -28,7 +28,7 @@ CAF_PDM_SOURCE_INIT( RimGridPlotWindowCollection, "RimGridPlotWindowCollection"
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridPlotWindowCollection::RimGridPlotWindowCollection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Combination Plots", ":/WellFlowPlot16x16.png", "", "" );
|
||||
CAF_PDM_InitObject( "Combination Plots", ":/WellLogPlot16x16.png", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_gridPlotWindows, "GridPlotWindows", "Combination Plots", "", "", "" );
|
||||
m_gridPlotWindows.uiCapability()->setUiHidden( true );
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "RimFlowPlotCollection.h"
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimGridPlotWindowCollection.h"
|
||||
#include "RimPltPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRftPlotCollection.h"
|
||||
@@ -84,6 +85,9 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
"" );
|
||||
m_saturationPressurePlotCollection.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_combinationPlotCollection, "RimGridPlotWindowCollection", "Combination Plots", "", "", "" );
|
||||
m_combinationPlotCollection.uiCapability()->setUiHidden( true );
|
||||
|
||||
m_wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||
m_rftPlotCollection = new RimRftPlotCollection();
|
||||
m_pltPlotCollection = new RimPltPlotCollection();
|
||||
@@ -92,6 +96,7 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
m_flowPlotCollection = new RimFlowPlotCollection();
|
||||
m_gridCrossPlotCollection = new RimGridCrossPlotCollection;
|
||||
m_saturationPressurePlotCollection = new RimSaturationPressurePlotCollection;
|
||||
m_combinationPlotCollection = new RimGridPlotWindowCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -180,6 +185,14 @@ RimSaturationPressurePlotCollection* RimMainPlotCollection::saturationPressurePl
|
||||
return m_saturationPressurePlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGridPlotWindowCollection* RimMainPlotCollection::combinationPlotCollection()
|
||||
{
|
||||
return m_combinationPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -193,6 +206,7 @@ void RimMainPlotCollection::deleteAllContainedObjects()
|
||||
m_gridCrossPlotCollection->deleteAllChildObjects();
|
||||
m_flowPlotCollection()->closeDefaultPlotWindowAndDeletePlots();
|
||||
m_saturationPressurePlotCollection()->deleteAllChildObjects();
|
||||
m_combinationPlotCollection()->deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -244,6 +258,14 @@ void RimMainPlotCollection::updatePlotsWithFormations()
|
||||
crossPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_combinationPlotCollection )
|
||||
{
|
||||
for ( RimGridPlotWindow* plotWindow : m_combinationPlotCollection->gridPlotWindows() )
|
||||
{
|
||||
plotWindow->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -258,6 +280,14 @@ void RimMainPlotCollection::updatePlotsWithCompletions()
|
||||
wellLogPlot->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_combinationPlotCollection )
|
||||
{
|
||||
for ( RimGridPlotWindow* plotWindow : m_combinationPlotCollection->gridPlotWindows() )
|
||||
{
|
||||
plotWindow->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,6 +30,7 @@ class RimWellLogPlotCollection;
|
||||
class RimRftPlotCollection;
|
||||
class RimPltPlotCollection;
|
||||
class RimGridCrossPlotCollection;
|
||||
class RimGridPlotWindowCollection;
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryCrossPlotCollection;
|
||||
class RimSummaryPlot;
|
||||
@@ -58,6 +59,7 @@ public:
|
||||
RimFlowPlotCollection* flowPlotCollection();
|
||||
RimGridCrossPlotCollection* gridCrossPlotCollection();
|
||||
RimSaturationPressurePlotCollection* saturationPressurePlotCollection();
|
||||
RimGridPlotWindowCollection* combinationPlotCollection();
|
||||
|
||||
void deleteAllContainedObjects();
|
||||
void updateCurrentTimeStepInPlots();
|
||||
@@ -81,6 +83,7 @@ private:
|
||||
caf::PdmChildField<RimFlowPlotCollection*> m_flowPlotCollection;
|
||||
caf::PdmChildField<RimGridCrossPlotCollection*> m_gridCrossPlotCollection;
|
||||
caf::PdmChildField<RimSaturationPressurePlotCollection*> m_saturationPressurePlotCollection;
|
||||
caf::PdmChildField<RimGridPlotWindowCollection*> m_combinationPlotCollection;
|
||||
|
||||
caf::PdmField<bool> m_show;
|
||||
};
|
||||
|
||||
@@ -93,7 +93,10 @@ void RimMdiWindowController::handleViewerDeletion()
|
||||
void RimMdiWindowController::removeWindowFromMDI()
|
||||
{
|
||||
RiuMainWindowBase* mainWin = getMainWindow();
|
||||
if ( mainWin && viewWidget() ) mainWin->removeViewer( viewWidget() );
|
||||
if ( mainWin && viewWidget() )
|
||||
{
|
||||
mainWin->removeViewer( viewWidget() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -49,7 +49,6 @@ public:
|
||||
protected:
|
||||
RimViewWindow* viewPdmObject();
|
||||
QWidget* viewWidget();
|
||||
RiuMdiSubWindow* viewSubWindow();
|
||||
RiuMainWindowBase* getMainWindow();
|
||||
|
||||
// Overridden PDM methods
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "RimPlotInterface.h"
|
||||
|
||||
#include "RimGridPlotWindow.h"
|
||||
#include "RimPlotWindow.h"
|
||||
|
||||
#include "RiuQwtPlotWidget.h"
|
||||
|
||||
#define RI_PLOT_MIN_DEFAULT -10.0
|
||||
#define RI_PLOT_MAX_DEFAULT 100.0
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@@ -21,6 +21,23 @@ void RimPlotInterface::WidthScaleFactorEnum::setUp()
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPlotInterface::isStandalonePlot() const
|
||||
{
|
||||
const caf::PdmObject* thisPdm = dynamic_cast<const caf::PdmObject*>( this );
|
||||
CAF_ASSERT( thisPdm );
|
||||
|
||||
if ( thisPdm )
|
||||
{
|
||||
RimGridPlotWindow* gridPlotWindow = nullptr;
|
||||
thisPdm->firstAncestorOrThisOfType( gridPlotWindow );
|
||||
return gridPlotWindow == nullptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -45,12 +45,17 @@ public:
|
||||
typedef caf::AppEnum<WidthScaleFactor> WidthScaleFactorEnum;
|
||||
|
||||
public:
|
||||
virtual RiuQwtPlotWidget* viewer() = 0;
|
||||
virtual bool isChecked() const = 0;
|
||||
|
||||
RimPlotInterface() = default;
|
||||
virtual ~RimPlotInterface() = default;
|
||||
|
||||
bool isStandalonePlot() const;
|
||||
|
||||
virtual RiuQwtPlotWidget* viewer() = 0;
|
||||
virtual bool isChecked() const = 0;
|
||||
virtual void setChecked( bool checked ) = 0;
|
||||
|
||||
virtual QString description() const = 0;
|
||||
|
||||
virtual int widthScaleFactor() const
|
||||
{
|
||||
return NORMAL;
|
||||
@@ -81,6 +86,9 @@ public:
|
||||
|
||||
virtual void onAxisSelected( int axis, bool toggle ) {}
|
||||
|
||||
virtual void removeFromMdiAreaAndCollection() {}
|
||||
virtual void updateAfterInsertingIntoGridPlotWindow() {}
|
||||
|
||||
protected:
|
||||
virtual void updatePlotWindowLayout() {}
|
||||
virtual void onWidthScaleFactorChange() {}
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimPlotWindow.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimPlotWindow, "RimPlotWindow" ); // Do not use. Abstract class
|
||||
@@ -30,10 +33,13 @@ RimPlotWindow::RimPlotWindow()
|
||||
|
||||
CAF_PDM_InitField( &m_description, "PlotDescription", QString( "" ), "Name", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_showTitleInPlot, "ShowTitleInPlot", false, "Show Title", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showTitleInPlot, "ShowTitleInPlot", true, "Show Title", "", "", "" );
|
||||
CAF_PDM_InitField( &m_showPlotLegends, "ShowTrackLegends", true, "Show Legends", "", "", "" );
|
||||
CAF_PDM_InitField( &m_plotLegendsHorizontal, "TrackLegendsHorizontal", false, "Legend Orientation", "", "", "" );
|
||||
CAF_PDM_InitField( &m_plotLegendsHorizontal, "TrackLegendsHorizontal", true, "Legend Orientation", "", "", "" );
|
||||
m_plotLegendsHorizontal.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
|
||||
int fontSize = RiaFontCache::pointSizeFromFontSizeEnum(
|
||||
RiaApplication::instance()->preferences()->defaultPlotFontSize() );
|
||||
CAF_PDM_InitField( &m_legendFontSize, "LegendFontSize", fontSize, "Legend Font Size", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -124,6 +130,22 @@ void RimPlotWindow::setLegendsHorizontal( bool horizontal )
|
||||
m_plotLegendsHorizontal = horizontal;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimPlotWindow::legendFontSize() const
|
||||
{
|
||||
return m_legendFontSize;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotWindow::setLegendFontSize( int fontSize )
|
||||
{
|
||||
m_legendFontSize = fontSize;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -137,10 +159,14 @@ void RimPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
{
|
||||
updateLayout();
|
||||
}
|
||||
else if ( changedField == &m_showTitleInPlot )
|
||||
else if ( changedField == &m_showTitleInPlot || changedField == &m_description )
|
||||
{
|
||||
updatePlotTitle();
|
||||
}
|
||||
else if ( changedField == &m_legendFontSize )
|
||||
{
|
||||
updateLayout();
|
||||
}
|
||||
|
||||
updateConnectedEditors();
|
||||
}
|
||||
@@ -152,7 +178,26 @@ QList<caf::PdmOptionItemInfo> RimPlotWindow::calculateValueOptions( const caf::P
|
||||
bool* useOptionsOnly )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
if ( fieldNeedingOptions == &m_plotLegendsHorizontal )
|
||||
if ( fieldNeedingOptions == &m_legendFontSize )
|
||||
{
|
||||
std::vector<int> fontSizes;
|
||||
fontSizes.push_back( 8 );
|
||||
fontSizes.push_back( 9 );
|
||||
fontSizes.push_back( 10 );
|
||||
fontSizes.push_back( 11 );
|
||||
fontSizes.push_back( 12 );
|
||||
fontSizes.push_back( 14 );
|
||||
fontSizes.push_back( 16 );
|
||||
fontSizes.push_back( 18 );
|
||||
fontSizes.push_back( 24 );
|
||||
|
||||
for ( int value : fontSizes )
|
||||
{
|
||||
QString text = QString( "%1" ).arg( value );
|
||||
options.push_back( caf::PdmOptionItemInfo( text, value ) );
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_plotLegendsHorizontal )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( "Vertical", QVariant::fromValue( false ) ) );
|
||||
options.push_back( caf::PdmOptionItemInfo( "Horizontal", QVariant::fromValue( true ) ) );
|
||||
@@ -163,11 +208,17 @@ QList<caf::PdmOptionItemInfo> RimPlotWindow::calculateValueOptions( const caf::P
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmUiGroup* RimPlotWindow::createPlotSettingsUiGroup( caf::PdmUiOrdering& uiOrdering )
|
||||
caf::PdmFieldHandle* RimPlotWindow::userDescriptionField()
|
||||
{
|
||||
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Title and Legends" );
|
||||
titleAndLegendsGroup->add( &m_showPlotLegends );
|
||||
titleAndLegendsGroup->add( &m_plotLegendsHorizontal );
|
||||
titleAndLegendsGroup->add( &m_showTitleInPlot );
|
||||
return titleAndLegendsGroup;
|
||||
return &m_description;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotWindow::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_showPlotLegends );
|
||||
uiOrdering.add( &m_plotLegendsHorizontal );
|
||||
uiOrdering.add( &m_legendFontSize );
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
RimPlotWindow& operator=( RimPlotWindow&& rhs );
|
||||
|
||||
virtual void setDescription( const QString& description );
|
||||
virtual QString description() const;
|
||||
QString description() const;
|
||||
virtual QString fullPlotTitle() const;
|
||||
|
||||
bool isPlotTitleVisible() const;
|
||||
@@ -46,6 +46,8 @@ public:
|
||||
void setLegendsVisible( bool doShow );
|
||||
bool legendsHorizontal() const;
|
||||
void setLegendsHorizontal( bool horizontal );
|
||||
int legendFontSize() const;
|
||||
void setLegendFontSize( int fontSize );
|
||||
|
||||
virtual void detachAllCurves() = 0;
|
||||
virtual void handleKeyPressEvent( QKeyEvent* keyEvent ) {}
|
||||
@@ -57,13 +59,15 @@ protected:
|
||||
const QVariant& newValue ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
virtual caf::PdmUiGroup* createPlotSettingsUiGroup( caf::PdmUiOrdering& uiOrdering );
|
||||
virtual void updatePlotTitle() = 0;
|
||||
virtual void uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering );
|
||||
virtual void updatePlotTitle() = 0;
|
||||
|
||||
protected:
|
||||
caf::PdmField<QString> m_description;
|
||||
caf::PdmField<bool> m_showTitleInPlot;
|
||||
caf::PdmField<bool> m_showPlotLegends;
|
||||
caf::PdmField<bool> m_plotLegendsHorizontal;
|
||||
caf::PdmField<int> m_legendFontSize;
|
||||
};
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimGeoMechModels.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimGridPlotWindowCollection.h"
|
||||
#include "RimGridSummaryCase.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
@@ -1303,6 +1304,11 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->saturationPressurePlotCollection() );
|
||||
}
|
||||
|
||||
if ( mainPlotCollection->combinationPlotCollection() )
|
||||
{
|
||||
itemCollection->add( mainPlotCollection->combinationPlotCollection() );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "RimFlowPlotCollection.h"
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimGridPlotWindowCollection.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
@@ -176,5 +177,14 @@ void RimReloadCaseTools::updateAllPlots()
|
||||
{
|
||||
flowPlotCollection->loadDataAndUpdate();
|
||||
}
|
||||
|
||||
RimGridPlotWindowCollection* gridPlotWindowCollection = project->mainPlotCollection()->combinationPlotCollection();
|
||||
if ( gridPlotWindowCollection )
|
||||
{
|
||||
for ( RimGridPlotWindow* plotWindow : gridPlotWindowCollection->gridPlotWindows() )
|
||||
{
|
||||
plotWindow->loadDataAndUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QWidget>
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimViewWindow, "ViewWindow" ); // Do not use. Abstract class
|
||||
@@ -148,6 +149,20 @@ void RimViewWindow::updateMdiWindowVisibility()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewWindow::revokeMdiWindowStatus()
|
||||
{
|
||||
if ( m_windowController() )
|
||||
{
|
||||
handleMdiWindowClosed();
|
||||
deleteViewWidget();
|
||||
delete m_windowController();
|
||||
m_windowController = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -76,6 +76,8 @@ public:
|
||||
{
|
||||
setAsMdiWindow( 1 );
|
||||
}
|
||||
void revokeMdiWindowStatus();
|
||||
|
||||
bool isMdiWindow() const;
|
||||
|
||||
void setMdiWindowGeometry( const RimMdiWindowGeometry& windowGeometry );
|
||||
|
||||
@@ -136,8 +136,9 @@ void RimWellBoreStabilityPlot::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
parameterSources->add( &m_ucsSource );
|
||||
parameterSources->add( &m_userDefinedUcs );
|
||||
|
||||
uiOrderingForDepthAxis( uiOrdering );
|
||||
createPlotSettingsUiGroup( uiOrdering );
|
||||
caf::PdmUiGroup* legendAndAxisGroup = uiOrdering.addNewGroup( "Title, Legend and Axis" );
|
||||
RimWellLogPlot::uiOrderingForPlotLayout( *legendAndAxisGroup );
|
||||
uiOrderingForDepthAxis( *legendAndAxisGroup );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
@@ -113,6 +113,8 @@ RimWellLogPlot::RimWellLogPlot()
|
||||
m_maxAvailableDepth = -HUGE_VAL;
|
||||
|
||||
m_commonDataSourceEnabled = true;
|
||||
m_showTitleInPlot = false;
|
||||
m_columnCountEnum = RimGridPlotWindow::COLUMNS_UNLIMITED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -302,31 +304,31 @@ void RimWellLogPlot::enableAllAutoNameTags( bool enable )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::uiOrderingForDepthAxis( caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Depth Axis" );
|
||||
|
||||
if ( m_availableDepthTypes.size() > 1u )
|
||||
{
|
||||
gridGroup->add( &m_depthType );
|
||||
uiOrdering.add( &m_depthType );
|
||||
}
|
||||
|
||||
if ( m_availableDepthUnits.size() > 1u )
|
||||
{
|
||||
gridGroup->add( &m_depthUnit );
|
||||
uiOrdering.add( &m_depthUnit );
|
||||
}
|
||||
|
||||
gridGroup->add( &m_minVisibleDepth );
|
||||
gridGroup->add( &m_maxVisibleDepth );
|
||||
gridGroup->add( &m_depthAxisGridVisibility );
|
||||
uiOrdering.add( &m_minVisibleDepth );
|
||||
uiOrdering.add( &m_maxVisibleDepth );
|
||||
uiOrdering.add( &m_depthAxisGridVisibility );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmUiGroup* RimWellLogPlot::createPlotSettingsUiGroup( caf::PdmUiOrdering& uiOrdering )
|
||||
void RimWellLogPlot::uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* titleAndLegendsGroup = RimGridPlotWindow::createPlotSettingsUiGroup( uiOrdering );
|
||||
m_nameConfig->uiOrdering( "", *titleAndLegendsGroup );
|
||||
return titleAndLegendsGroup;
|
||||
uiOrdering.add( &m_showTitleInPlot );
|
||||
m_nameConfig->uiOrdering( "", uiOrdering );
|
||||
uiOrdering.add( &m_showIndividualPlotTitles );
|
||||
RimPlotWindow::uiOrderingForPlotLayout( uiOrdering );
|
||||
uiOrdering.add( &m_columnCountEnum );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -423,7 +425,7 @@ QWidget* RimWellLogPlot::createViewWidget( QWidget* mainWindowParent )
|
||||
void RimWellLogPlot::performAutoNameUpdate()
|
||||
{
|
||||
updateCommonDataSource();
|
||||
this->setPlotTitleInWidget( this->createAutoName() );
|
||||
updatePlotTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -597,8 +599,13 @@ void RimWellLogPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
{
|
||||
m_commonDataSource->uiOrdering( uiConfigName, uiOrdering );
|
||||
}
|
||||
uiOrderingForDepthAxis( uiOrdering );
|
||||
createPlotSettingsUiGroup( uiOrdering );
|
||||
|
||||
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Depth Axis" );
|
||||
uiOrderingForDepthAxis( *gridGroup );
|
||||
|
||||
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
|
||||
uiOrderingForPlotLayout( *titleAndLegendsGroup );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
@@ -673,6 +680,26 @@ void RimWellLogPlot::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimWellLogPlot::snapshotWindowContent()
|
||||
{
|
||||
QImage image;
|
||||
|
||||
if ( m_viewer )
|
||||
{
|
||||
RiuWellLogPlot* wellLogViewer = dynamic_cast<RiuWellLogPlot*>( m_viewer.data() );
|
||||
CAF_ASSERT( wellLogViewer );
|
||||
bool isScrollbarVisible = wellLogViewer->isScrollbarVisible();
|
||||
wellLogViewer->setScrollbarVisible( false );
|
||||
image = RimGridPlotWindow::snapshotWindowContent();
|
||||
wellLogViewer->setScrollbarVisible( isScrollbarVisible );
|
||||
}
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -96,8 +96,8 @@ public:
|
||||
void setAutoScaleYEnabled( bool enabled ) override;
|
||||
void enableAllAutoNameTags( bool enable );
|
||||
|
||||
void uiOrderingForDepthAxis( caf::PdmUiOrdering& uiOrdering );
|
||||
caf::PdmUiGroup* createPlotSettingsUiGroup( caf::PdmUiOrdering& uiOrdering );
|
||||
void uiOrderingForDepthAxis( caf::PdmUiOrdering& uiOrdering );
|
||||
void uiOrderingForPlotLayout( caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
QString createAutoName() const override;
|
||||
|
||||
@@ -131,6 +131,8 @@ protected:
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
QImage snapshotWindowContent() override;
|
||||
|
||||
protected:
|
||||
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
|
||||
bool m_commonDataSourceEnabled;
|
||||
|
||||
@@ -279,7 +279,7 @@ void RimWellLogTrack::setChecked( bool checked )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString RimWellLogTrack::description() const
|
||||
QString RimWellLogTrack::description() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
@@ -734,13 +734,14 @@ void RimWellLogTrack::updateXAxisAndGridTickIntervals()
|
||||
m_xAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MAJOR,
|
||||
m_xAxisGridVisibility() & RimWellLogPlot::AXIS_GRID_MINOR );
|
||||
|
||||
RimWellLogPlot* plot = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted( plot );
|
||||
|
||||
m_plotWidget->enableGridLines( QwtPlot::yLeft,
|
||||
plot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MAJOR,
|
||||
plot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MINOR );
|
||||
|
||||
RimWellLogPlot* wellLogPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType( wellLogPlot );
|
||||
if ( wellLogPlot )
|
||||
{
|
||||
m_plotWidget->enableGridLines( QwtPlot::yLeft,
|
||||
wellLogPlot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MAJOR,
|
||||
wellLogPlot->depthAxisGridLinesEnabled() & RimWellLogPlot::AXIS_GRID_MINOR );
|
||||
}
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
|
||||
@@ -1229,9 +1230,12 @@ void RimWellLogTrack::setXAxisTitle( const QString& text )
|
||||
QString RimWellLogTrack::yAxisTitle() const
|
||||
{
|
||||
RimWellLogPlot* parent;
|
||||
this->firstAncestorOrThisOfTypeAsserted( parent );
|
||||
|
||||
return parent->depthAxisTitle();
|
||||
this->firstAncestorOrThisOfType( parent );
|
||||
if ( parent )
|
||||
{
|
||||
return parent->depthAxisTitle();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1403,29 +1407,10 @@ void RimWellLogTrack::updateParentPlotZoom()
|
||||
void RimWellLogTrack::updateEditors()
|
||||
{
|
||||
this->updateConnectedEditors();
|
||||
RimPlotWindow* plotWindow = nullptr;
|
||||
|
||||
RimWellLogPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( plot );
|
||||
plot->updateConnectedEditors();
|
||||
|
||||
RimWellRftPlot* rftPlot( nullptr );
|
||||
|
||||
firstAncestorOrThisOfType( rftPlot );
|
||||
|
||||
if ( rftPlot )
|
||||
{
|
||||
rftPlot->updateConnectedEditors();
|
||||
}
|
||||
else
|
||||
{
|
||||
RimWellPltPlot* pltPlot( nullptr );
|
||||
firstAncestorOrThisOfType( pltPlot );
|
||||
|
||||
if ( pltPlot )
|
||||
{
|
||||
pltPlot->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
firstAncestorOrThisOfTypeAsserted( plotWindow );
|
||||
plotWindow->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1734,17 +1719,6 @@ void RimWellLogTrack::updateAxisScaleEngine()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellLogTrack::isFirstVisibleTrackInPlot() const
|
||||
{
|
||||
RimGridPlotWindow* plotWindow = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( plotWindow );
|
||||
std::vector<RimPlotInterface*> visiblePlots = plotWindow->visiblePlots();
|
||||
return visiblePlots.empty() ? false : visiblePlots.front() == this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -89,12 +89,12 @@ public:
|
||||
typedef caf::AppEnum<RiuPlotAnnotationTool::RegionAnnotationType> RegionAnnotationTypeEnum;
|
||||
typedef caf::AppEnum<RiuPlotAnnotationTool::RegionDisplay> RegionAnnotationDisplayEnum;
|
||||
|
||||
bool isChecked() const override;
|
||||
void setChecked( bool checked );
|
||||
const QString description() const;
|
||||
void setDescription( const QString& description );
|
||||
int widthScaleFactor() const override;
|
||||
void setWidthScaleFactor( WidthScaleFactor scaleFactor ) override;
|
||||
bool isChecked() const override;
|
||||
void setChecked( bool checked ) override;
|
||||
QString description() const override;
|
||||
void setDescription( const QString& description );
|
||||
int widthScaleFactor() const override;
|
||||
void setWidthScaleFactor( WidthScaleFactor scaleFactor ) override;
|
||||
|
||||
void addCurve( RimWellLogCurve* curve );
|
||||
void insertCurve( RimWellLogCurve* curve, size_t index );
|
||||
@@ -258,7 +258,6 @@ private:
|
||||
void updateWellPathAttributesOnPlot();
|
||||
void removeRegionAnnotations();
|
||||
void updateAxisScaleEngine();
|
||||
bool isFirstVisibleTrackInPlot() const;
|
||||
|
||||
std::pair<double, double> adjustXRange( double minValue, double maxValue, double tickInterval );
|
||||
|
||||
|
||||
@@ -123,24 +123,23 @@ void RimSummaryPlotYAxisFormatter::applyYAxisPropertiesToPlot( RiuSummaryQwtPlot
|
||||
|
||||
axisTitleY.setText( axisTitle );
|
||||
|
||||
Qt::AlignmentFlag titleAlignment;
|
||||
switch ( m_axisProperties->titlePosition() )
|
||||
{
|
||||
case RimPlotAxisProperties::AXIS_TITLE_CENTER:
|
||||
axisTitleY.setRenderFlags( Qt::AlignCenter );
|
||||
titleAlignment = Qt::AlignCenter;
|
||||
break;
|
||||
case RimPlotAxisProperties::AXIS_TITLE_END:
|
||||
axisTitleY.setRenderFlags( Qt::AlignRight );
|
||||
titleAlignment = Qt::AlignRight;
|
||||
break;
|
||||
}
|
||||
|
||||
qwtPlot->setAxisTitle( m_axisProperties->qwtPlotAxisType(), axisTitleY );
|
||||
}
|
||||
|
||||
{
|
||||
QFont yAxisFont = qwtPlot->axisFont( m_axisProperties->qwtPlotAxisType() );
|
||||
yAxisFont.setBold( false );
|
||||
yAxisFont.setPointSize( m_axisProperties->valuesFontSize() );
|
||||
qwtPlot->setAxisFont( m_axisProperties->qwtPlotAxisType(), yAxisFont );
|
||||
// TODO: We currently call setAxisTitle just to set font size. Fix this.
|
||||
qwtPlot->setAxisFontsAndAlignment( m_axisProperties->qwtPlotAxisType(),
|
||||
m_axisProperties->titleFontSize(),
|
||||
m_axisProperties->valuesFontSize(),
|
||||
true,
|
||||
titleAlignment );
|
||||
qwtPlot->setAxisTitleText( m_axisProperties->qwtPlotAxisType(), axisTitle );
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "RimAsciiDataCurve.h"
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimEnsembleCurveSetCollection.h"
|
||||
#include "RimGridPlotWindow.h"
|
||||
#include "RimGridTimeHistoryCurve.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
#include "RimProject.h"
|
||||
@@ -146,19 +147,14 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
|
||||
m_description = "Summary Plot";
|
||||
|
||||
CAF_PDM_InitField( &m_showPlotTitle, "ShowPlotTitle", true, "Plot Title", "", "", "" );
|
||||
m_showPlotTitle.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
CAF_PDM_InitField( &m_showLegend, "ShowLegend", true, "Legend", "", "", "" );
|
||||
m_showLegend.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
CAF_PDM_InitField( &m_legendFontSize, "LegendFontSize", 11, "Legend Font Size", "", "", "" );
|
||||
m_showLegend.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
CAF_PDM_InitField( &m_showPlotTitle_OBSOLETE, "ShowPlotTitle", true, "Plot Title", "", "", "" );
|
||||
m_showPlotTitle_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitField( &m_showLegend_OBSOLETE, "ShowLegend", true, "Legend", "", "", "" );
|
||||
m_showLegend_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
|
||||
CAF_PDM_InitField( &m_useAutoPlotTitle, "IsUsingAutoName", true, "Auto Title", "", "", "" );
|
||||
m_useAutoPlotTitle.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
CAF_PDM_InitField( &m_normalizeCurveYValues, "normalizeCurveYValues", false, "Normalize all curves", "", "", "" );
|
||||
m_normalizeCurveYValues.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_curveFilters_OBSOLETE, "SummaryCurveFilters", "", "", "", "" );
|
||||
m_curveFilters_OBSOLETE.uiCapability()->setUiTreeHidden( true );
|
||||
@@ -213,6 +209,7 @@ RimSummaryPlot::RimSummaryPlot()
|
||||
m_textCurveSetEditor = new RimSummaryPlotFilterTextCurveSetEditor;
|
||||
|
||||
m_isCrossPlot = false;
|
||||
m_isDraggable = false;
|
||||
|
||||
m_nameHelperAllCurves.reset( new RimSummaryPlotNameHelper );
|
||||
|
||||
@@ -585,7 +582,6 @@ void RimSummaryPlot::updateAll()
|
||||
updatePlotTitle();
|
||||
m_plotWidget->updateLegend();
|
||||
updateAxes();
|
||||
updateZoomInQwt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1319,37 +1315,6 @@ caf::PdmFieldHandle* RimSummaryPlot::userDescriptionField()
|
||||
return &m_description;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimSummaryPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( fieldNeedingOptions == &m_legendFontSize )
|
||||
{
|
||||
std::vector<int> fontSizes;
|
||||
fontSizes.push_back( 8 );
|
||||
fontSizes.push_back( 9 );
|
||||
fontSizes.push_back( 10 );
|
||||
fontSizes.push_back( 11 );
|
||||
fontSizes.push_back( 12 );
|
||||
fontSizes.push_back( 14 );
|
||||
fontSizes.push_back( 16 );
|
||||
fontSizes.push_back( 18 );
|
||||
fontSizes.push_back( 24 );
|
||||
|
||||
for ( int value : fontSizes )
|
||||
{
|
||||
QString text = QString( "%1" ).arg( value );
|
||||
options.push_back( caf::PdmOptionItemInfo( text, value ) );
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1357,31 +1322,26 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
RimViewWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
RimPlotWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
|
||||
if ( changedField == &m_description || changedField == &m_showPlotTitle || changedField == &m_useAutoPlotTitle )
|
||||
if ( changedField == &m_showWindow )
|
||||
{
|
||||
updateWindowVisibility();
|
||||
}
|
||||
|
||||
if ( changedField == &m_useAutoPlotTitle )
|
||||
{
|
||||
updatePlotTitle();
|
||||
updateConnectedEditors();
|
||||
}
|
||||
|
||||
if ( changedField == &m_showLegend )
|
||||
{
|
||||
if ( m_plotWidget ) m_plotWidget->setLegendVisible( m_showLegend );
|
||||
}
|
||||
|
||||
if ( changedField == &m_legendFontSize )
|
||||
{
|
||||
if ( m_plotWidget ) m_plotWidget->setLegendFontSize( m_legendFontSize() );
|
||||
}
|
||||
|
||||
if ( changedField == &m_useAutoPlotTitle && !m_useAutoPlotTitle )
|
||||
{
|
||||
// When auto name of plot is turned off, update the auto name for all curves
|
||||
|
||||
for ( auto c : summaryCurves() )
|
||||
if ( !m_useAutoPlotTitle )
|
||||
{
|
||||
c->updateCurveNameNoLegendUpdate();
|
||||
// When auto name of plot is turned off, update the auto name for all curves
|
||||
|
||||
for ( auto c : summaryCurves() )
|
||||
{
|
||||
c->updateCurveNameNoLegendUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1396,24 +1356,6 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimSummaryPlot::snapshotWindowContent()
|
||||
{
|
||||
#if 0
|
||||
// This does not work with the color legend widgets. Is there a reason for doing this, and not to grab the widget ?
|
||||
QImage image;
|
||||
|
||||
if (m_qwtPlot)
|
||||
{
|
||||
image = QImage(m_qwtPlot->size(), QImage::Format_ARGB32);
|
||||
image.fill(QColor(Qt::white).rgb());
|
||||
|
||||
QPainter painter(&image);
|
||||
QRectF rect(0, 0, m_qwtPlot->size().width(), m_qwtPlot->size().height());
|
||||
|
||||
QwtPlotRenderer plotRenderer;
|
||||
plotRenderer.render(m_qwtPlot, &painter, rect);
|
||||
}
|
||||
|
||||
return image;
|
||||
#endif
|
||||
QImage image;
|
||||
|
||||
if ( m_plotWidget )
|
||||
@@ -1472,7 +1414,7 @@ void RimSummaryPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updatePlotTitle();
|
||||
|
||||
updateMdiWindowVisibility();
|
||||
updateWindowVisibility();
|
||||
|
||||
if ( m_summaryCurveCollection )
|
||||
{
|
||||
@@ -1493,7 +1435,7 @@ void RimSummaryPlot::onLoadDataAndUpdate()
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
m_plotWidget->setLegendVisible( m_showLegend );
|
||||
m_plotWidget->setLegendVisible( m_showPlotLegends && isStandalonePlot() );
|
||||
m_plotWidget->setLegendFontSize( m_legendFontSize() );
|
||||
m_plotWidget->updateLegend();
|
||||
}
|
||||
@@ -1582,6 +1524,39 @@ void RimSummaryPlot::removeEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::removeFromMdiAreaAndCollection()
|
||||
{
|
||||
RimSummaryPlotCollection* summaryCollection = nullptr;
|
||||
this->firstAncestorOrThisOfType( summaryCollection );
|
||||
if ( summaryCollection )
|
||||
{
|
||||
summaryCollection->removeSummaryPlot( this );
|
||||
this->revokeMdiWindowStatus();
|
||||
summaryCollection->updateAllRequiredEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateAfterInsertingIntoGridPlotWindow()
|
||||
{
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
m_plotWidget->setTitle( "" );
|
||||
m_plotWidget->setLegendVisible( false );
|
||||
}
|
||||
|
||||
if ( m_timeAxisProperties )
|
||||
{
|
||||
m_timeAxisProperties->showTitle = true;
|
||||
}
|
||||
updateAxes();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1617,9 +1592,17 @@ bool RimSummaryPlot::isChecked() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::enableShowPlotTitle( bool enable )
|
||||
void RimSummaryPlot::setChecked( bool checked )
|
||||
{
|
||||
m_showPlotTitle = enable;
|
||||
m_showWindow = checked;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::setDraggable( bool draggable )
|
||||
{
|
||||
m_isDraggable = draggable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1660,18 +1643,29 @@ void RimSummaryPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
caf::PdmUiGroup* mainOptions = uiOrdering.addNewGroup( "General Plot Options" );
|
||||
mainOptions->setCollapsedByDefault( true );
|
||||
|
||||
mainOptions->add( &m_showPlotTitle );
|
||||
if ( m_showPlotTitle )
|
||||
if ( isStandalonePlot() )
|
||||
{
|
||||
mainOptions->add( &m_showTitleInPlot );
|
||||
if ( m_showTitleInPlot )
|
||||
{
|
||||
mainOptions->add( &m_useAutoPlotTitle );
|
||||
mainOptions->add( &m_description );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mainOptions->add( &m_useAutoPlotTitle );
|
||||
mainOptions->add( &m_description );
|
||||
}
|
||||
m_description.uiCapability()->setUiReadOnly( m_useAutoPlotTitle );
|
||||
|
||||
mainOptions->add( &m_showLegend );
|
||||
if ( m_showLegend() )
|
||||
if ( isStandalonePlot() )
|
||||
{
|
||||
mainOptions->add( &m_legendFontSize );
|
||||
mainOptions->add( &m_showPlotLegends );
|
||||
if ( m_showPlotLegends() )
|
||||
{
|
||||
mainOptions->add( &m_legendFontSize );
|
||||
}
|
||||
}
|
||||
|
||||
mainOptions->add( &m_normalizeCurveYValues );
|
||||
@@ -1689,6 +1683,7 @@ QWidget* RimSummaryPlot::createViewWidget( QWidget* mainWindowParent )
|
||||
if ( !m_plotWidget )
|
||||
{
|
||||
m_plotWidget = new RiuSummaryQwtPlot( this, mainWindowParent );
|
||||
m_plotWidget->setDraggable( m_isDraggable );
|
||||
|
||||
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
||||
{
|
||||
@@ -1769,6 +1764,16 @@ void RimSummaryPlot::initAfterRead()
|
||||
m_useAutoPlotTitle = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_showPlotTitle_OBSOLETE() )
|
||||
{
|
||||
m_showTitleInPlot = true;
|
||||
}
|
||||
|
||||
if ( m_showLegend_OBSOLETE() )
|
||||
{
|
||||
m_showPlotLegends = true;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1776,13 +1781,13 @@ void RimSummaryPlot::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateMdiWindowTitle()
|
||||
{
|
||||
if ( m_plotWidget )
|
||||
if ( m_plotWidget && isStandalonePlot() )
|
||||
{
|
||||
QString plotTitle = description();
|
||||
QString plotTitle = fullPlotTitle();
|
||||
|
||||
m_plotWidget->setWindowTitle( plotTitle );
|
||||
|
||||
if ( m_showPlotTitle )
|
||||
if ( m_showTitleInPlot )
|
||||
{
|
||||
m_plotWidget->setTitle( plotTitle );
|
||||
}
|
||||
@@ -1790,6 +1795,7 @@ void RimSummaryPlot::updateMdiWindowTitle()
|
||||
{
|
||||
m_plotWidget->setTitle( "" );
|
||||
}
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1836,6 +1842,23 @@ void RimSummaryPlot::updateNameHelperWithCurveData( RimSummaryPlotNameHelper* na
|
||||
nameHelper->setEnsembleCases( ensembleCases );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateWindowVisibility()
|
||||
{
|
||||
RimGridPlotWindow* plotWindow = nullptr;
|
||||
this->firstAncestorOrThisOfType( plotWindow );
|
||||
if ( plotWindow )
|
||||
{
|
||||
plotWindow->updateLayout();
|
||||
}
|
||||
else
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1909,14 +1932,6 @@ void RimSummaryPlot::reattachAllCurves()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::showLegend( bool enable )
|
||||
{
|
||||
m_showLegend = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2062,24 +2077,6 @@ size_t RimSummaryPlot::curveCount() const
|
||||
return m_summaryCurveCollection->curves().size() + m_gridTimeHistoryCurves.size() + m_asciiDataCurves.size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
if ( field == &m_showLegend || field == &m_showPlotTitle || field == &m_useAutoPlotTitle ||
|
||||
field == &m_normalizeCurveYValues )
|
||||
{
|
||||
caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
myAttr->m_useNativeCheckBoxLabel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,11 +72,12 @@ public:
|
||||
RimSummaryPlot();
|
||||
~RimSummaryPlot() override;
|
||||
|
||||
void setDescription( const QString& description );
|
||||
QString description() const;
|
||||
void setDescription( const QString& description ) override;
|
||||
QString description() const override;
|
||||
bool isChecked() const override;
|
||||
void setChecked( bool checked ) override;
|
||||
void setDraggable( bool draggable );
|
||||
|
||||
void enableShowPlotTitle( bool enable );
|
||||
void enableAutoPlotTitle( bool enable );
|
||||
bool autoPlotTitle() const;
|
||||
|
||||
@@ -100,7 +101,7 @@ public:
|
||||
|
||||
size_t curveCount() const;
|
||||
|
||||
void detachAllCurves();
|
||||
void detachAllCurves() override;
|
||||
void reattachAllCurves();
|
||||
void updateCaseNameHasChanged();
|
||||
|
||||
@@ -154,9 +155,8 @@ public:
|
||||
|
||||
void setNormalizationEnabled( bool enable );
|
||||
bool isNormalizationEnabled();
|
||||
void showLegend( bool enable );
|
||||
|
||||
void handleKeyPressEvent( QKeyEvent* keyEvent );
|
||||
void handleKeyPressEvent( QKeyEvent* keyEvent ) override;
|
||||
virtual RimSummaryPlotSourceStepping* sourceSteppingObjectForKeyEventHandling() const;
|
||||
virtual std::vector<caf::PdmFieldHandle*> fieldsToShowInToolbar();
|
||||
|
||||
@@ -171,11 +171,14 @@ public:
|
||||
caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const override;
|
||||
|
||||
void onAxisSelected( int axis, bool toggle ) override;
|
||||
void loadDataAndUpdate();
|
||||
void loadDataAndUpdate() override;
|
||||
|
||||
void addOrUpdateEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet );
|
||||
void removeEnsembleCurveSetLegend( RimEnsembleCurveSet* curveSet );
|
||||
|
||||
void removeFromMdiAreaAndCollection() override;
|
||||
void updateAfterInsertingIntoGridPlotWindow() override;
|
||||
|
||||
public:
|
||||
// RimViewWindow overrides
|
||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||
@@ -186,18 +189,15 @@ private:
|
||||
void updateMdiWindowTitle() override;
|
||||
void updateNameHelperWithCurveData( RimSummaryPlotNameHelper* nameHelper ) const;
|
||||
|
||||
void updateWindowVisibility();
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
@@ -222,12 +222,8 @@ private:
|
||||
std::set<RimPlotAxisPropertiesInterface*> allPlotAxes() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
caf::PdmField<bool> m_normalizeCurveYValues;
|
||||
|
||||
caf::PdmField<int> m_legendFontSize;
|
||||
|
||||
caf::PdmField<bool> m_useAutoPlotTitle;
|
||||
|
||||
caf::PdmChildArrayField<RimGridTimeHistoryCurve*> m_gridTimeHistoryCurves;
|
||||
@@ -248,6 +244,7 @@ private:
|
||||
std::unique_ptr<QwtPlotTextLabel> m_plotInfoLabel;
|
||||
|
||||
bool m_isCrossPlot;
|
||||
bool m_isDraggable;
|
||||
|
||||
std::unique_ptr<RimSummaryPlotNameHelper> m_nameHelperAllCurves;
|
||||
|
||||
@@ -255,4 +252,7 @@ private:
|
||||
caf::PdmChildArrayField<RimSummaryCurve*> m_summaryCurves_OBSOLETE;
|
||||
caf::PdmChildArrayField<RimSummaryCurveFilter_OBSOLETE*> m_curveFilters_OBSOLETE;
|
||||
caf::PdmField<bool> m_isAutoZoom_OBSOLETE;
|
||||
|
||||
caf::PdmField<bool> m_showPlotTitle_OBSOLETE;
|
||||
caf::PdmField<bool> m_showLegend_OBSOLETE;
|
||||
};
|
||||
|
||||
@@ -94,3 +94,11 @@ void RimSummaryPlotCollection::summaryPlotItemInfos( QList<caf::PdmOptionItemInf
|
||||
caf::PdmOptionItemInfo( displayName, plot, false, plot->uiCapability()->uiIconProvider() ) );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlotCollection::removeSummaryPlot( RimSummaryPlot* summaryPlot )
|
||||
{
|
||||
summaryPlots.removeChildObject( summaryPlot );
|
||||
}
|
||||
|
||||
@@ -42,4 +42,6 @@ public:
|
||||
|
||||
void updateSummaryNameHasChanged();
|
||||
void summaryPlotItemInfos( QList<caf::PdmOptionItemInfo>* optionInfos ) const;
|
||||
|
||||
void removeSummaryPlot( RimSummaryPlot* summaryPlot );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user