mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2089 Cross Plot : Make sure context menu items works as expected
This commit is contained in:
@@ -24,10 +24,14 @@
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCrossPlot.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -61,3 +65,68 @@ void RiaSummaryTools::notifyCalculatedCurveNameHasChanged(const QString& previou
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlot* RiaSummaryTools::parentSummaryPlot(caf::PdmObject* object)
|
||||
{
|
||||
if (parentCrossPlot(object))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RimSummaryPlot* summaryPlot = nullptr;
|
||||
|
||||
if (object)
|
||||
{
|
||||
object->firstAncestorOrThisOfType(summaryPlot);
|
||||
}
|
||||
|
||||
return summaryPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryPlotCollection* RiaSummaryTools::parentSummaryPlotCollection(caf::PdmObject* object)
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotColl = nullptr;
|
||||
|
||||
if (object)
|
||||
{
|
||||
object->firstAncestorOrThisOfType(summaryPlotColl);
|
||||
}
|
||||
|
||||
return summaryPlotColl;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCrossPlot* RiaSummaryTools::parentCrossPlot(caf::PdmObject* object)
|
||||
{
|
||||
RimSummaryCrossPlot* crossPlot = nullptr;
|
||||
|
||||
if (object)
|
||||
{
|
||||
object->firstAncestorOrThisOfType(crossPlot);
|
||||
}
|
||||
|
||||
return crossPlot;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCrossPlotCollection* RiaSummaryTools::parentCrossPlotCollection(caf::PdmObject* object)
|
||||
{
|
||||
RimSummaryCrossPlotCollection* crossPlotColl = nullptr;
|
||||
|
||||
if (object)
|
||||
{
|
||||
object->firstAncestorOrThisOfType(crossPlotColl);
|
||||
}
|
||||
|
||||
return crossPlotColl;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,16 @@
|
||||
#pragma once
|
||||
|
||||
class RimSummaryPlotCollection;
|
||||
class RimSummaryPlot;
|
||||
class RimSummaryCrossPlot;
|
||||
class RimSummaryCrossPlotCollection;
|
||||
|
||||
class QString;
|
||||
|
||||
namespace caf {
|
||||
class PdmObject;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
@@ -31,4 +38,10 @@ public:
|
||||
static RimSummaryPlotCollection* summaryPlotCollection();
|
||||
static void notifyCalculatedCurveNameHasChanged(const QString& previousCurveName,
|
||||
const QString& currentCurveName);
|
||||
|
||||
static RimSummaryPlot* parentSummaryPlot(caf::PdmObject* object);
|
||||
static RimSummaryPlotCollection* parentSummaryPlotCollection(caf::PdmObject* object);
|
||||
|
||||
static RimSummaryCrossPlot* parentCrossPlot(caf::PdmObject* object);
|
||||
static RimSummaryCrossPlotCollection* parentCrossPlotCollection(caf::PdmObject* object);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user