mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Move method to CPP file
This commit is contained in:
@@ -50,6 +50,25 @@
|
|||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicNewRftPlotFeature, "RicNewRftPlotFeature");
|
CAF_CMD_SOURCE_INIT(RicNewRftPlotFeature, "RicNewRftPlotFeature");
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
template<typename T>
|
||||||
|
static T selectedPdmObject()
|
||||||
|
{
|
||||||
|
T objToFind = nullptr;
|
||||||
|
|
||||||
|
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||||
|
|
||||||
|
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
|
||||||
|
if (objHandle)
|
||||||
|
{
|
||||||
|
objHandle->firstAncestorOrThisOfType(objToFind);
|
||||||
|
}
|
||||||
|
|
||||||
|
return objToFind;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ class RimWellPath;
|
|||||||
class RimRftPlotCollection;
|
class RimRftPlotCollection;
|
||||||
class RimWellRftPlot;
|
class RimWellRftPlot;
|
||||||
|
|
||||||
namespace caf
|
|
||||||
{
|
|
||||||
class PdmUiItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -52,26 +48,5 @@ private:
|
|||||||
RimWellPath* selectedWellPath() const;
|
RimWellPath* selectedWellPath() const;
|
||||||
RimEclipseWell* selectedSimulationWell(int * branchIndex) const;
|
RimEclipseWell* selectedSimulationWell(int * branchIndex) const;
|
||||||
bool caseAvailable() const;
|
bool caseAvailable() const;
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
T selectedPdmObject() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
template<typename T>
|
|
||||||
T RicNewRftPlotFeature::selectedPdmObject() const
|
|
||||||
{
|
|
||||||
T objToFind = nullptr;
|
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
|
|
||||||
if (objHandle)
|
|
||||||
{
|
|
||||||
objHandle->firstAncestorOrThisOfType(objToFind);
|
|
||||||
}
|
|
||||||
|
|
||||||
return objToFind;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user