#2089 Cross Plot : Make sure context menu items works as expected

This commit is contained in:
Magne Sjaastad
2017-11-15 07:07:26 +01:00
parent 65e076ab31
commit f14eb44efd
8 changed files with 109 additions and 17 deletions

View File

@@ -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;
}

View File

@@ -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);
};