mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#436) Using static methods in "feature impl" class, for clarity
This commit is contained in:
parent
a79bce6ea4
commit
9a2ec02bcc
@ -19,6 +19,9 @@
|
||||
|
||||
#include "RicAddWellLogToPlotFeature.h"
|
||||
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
|
||||
#include "RimWellLasFileInfo.h"
|
||||
#include "RimWellLog.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
@ -59,7 +62,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
|
||||
std::vector<RimWellLog*> selection = selectedWellLogs();
|
||||
if (selection.size() < 1) return;
|
||||
|
||||
RimWellLogPlot* plot = createWellLogPlot();
|
||||
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot();
|
||||
|
||||
RimWellLogPlotTrace* plotTrace = new RimWellLogPlotTrace();
|
||||
plot->addTrace(plotTrace);
|
||||
@ -79,7 +82,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
|
||||
RimWellLogFileCurve* curve = new RimWellLogFileCurve;
|
||||
plotTrace->addCurve(curve);
|
||||
|
||||
cvf::Color3f curveColor = curveColorFromIndex(curveIdx);
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIdx);
|
||||
curve->setColor(curveColor);
|
||||
curve->setDescription(wellLog->name());
|
||||
|
||||
|
@ -20,8 +20,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -36,7 +34,7 @@ namespace caf
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicAddWellLogToPlotFeature : public CmdFeature, RicWellLogPlotCurveFeatureImpl, RicNewWellLogPlotFeatureImpl
|
||||
class RicAddWellLogToPlotFeature : public CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#include "RicNewWellLogPlotCurveFeature.h"
|
||||
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
#include "RimWellLogPlotTrace.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
|
||||
@ -83,7 +85,7 @@ void RicNewWellLogPlotCurveFeature::addCurve(RimWellLogPlotTrace* plotTrace)
|
||||
RimWellLogPlotCurve* curve = new RimWellLogExtractionCurve();
|
||||
plotTrace->addCurve(curve);
|
||||
|
||||
cvf::Color3f curveColor = curveColorFromIndex(curveIndex);
|
||||
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromIndex(curveIndex);
|
||||
curve->setColor(curveColor);
|
||||
|
||||
curve->setDescription(QString("Curve %1").arg(plotTrace->curveCount()));
|
||||
|
@ -20,14 +20,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
class RimWellLogPlotTrace;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewWellLogPlotCurveFeature : public caf::CmdFeature, RicWellLogPlotCurveFeatureImpl
|
||||
class RicNewWellLogPlotCurveFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#include "RicNewWellLogPlotFeature.h"
|
||||
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotTrace.h"
|
||||
@ -45,7 +47,7 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimWellLogPlot* plot = createWellLogPlot();
|
||||
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot();
|
||||
|
||||
RimWellLogPlotTrace* plotTrace = new RimWellLogPlotTrace();
|
||||
plot->addTrace(plotTrace);
|
||||
|
@ -20,12 +20,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
#include "RicNewWellLogPlotFeatureImpl.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewWellLogPlotFeature : public caf::CmdFeature, RicNewWellLogPlotFeatureImpl
|
||||
class RicNewWellLogPlotFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
|
@ -28,9 +28,9 @@ class RimWellLogPlot;
|
||||
//==================================================================================================
|
||||
class RicNewWellLogPlotFeatureImpl
|
||||
{
|
||||
public:
|
||||
|
||||
protected:
|
||||
RimMainPlotCollection* mainPlotCollection();
|
||||
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
RimWellLogPlot* createWellLogPlot();
|
||||
static RimMainPlotCollection* mainPlotCollection();
|
||||
static RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
static RimWellLogPlot* createWellLogPlot();
|
||||
};
|
||||
|
@ -27,6 +27,6 @@
|
||||
class RicWellLogPlotCurveFeatureImpl
|
||||
{
|
||||
|
||||
protected:
|
||||
public:
|
||||
static cvf::Color3f curveColorFromIndex(size_t curveIndex);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user