mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1427 Apply specific changes from pre-proto regarding selection in 3D
To be used for transporting branch index from 3D context menu operation to feature.
This commit is contained in:
@@ -38,3 +38,11 @@ RimEclipseWell* RivSimWellPipeSourceInfo::well() const
|
|||||||
{
|
{
|
||||||
return m_eclipseWell.p();
|
return m_eclipseWell.p();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RivSimWellPipeSourceInfo::branchIndex() const
|
||||||
|
{
|
||||||
|
return m_branchIndex;
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ public:
|
|||||||
|
|
||||||
RimEclipseWell* well() const;
|
RimEclipseWell* well() const;
|
||||||
|
|
||||||
|
size_t branchIndex() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmPointer<RimEclipseWell> m_eclipseWell;
|
caf::PdmPointer<RimEclipseWell> m_eclipseWell;
|
||||||
size_t m_branchIndex;
|
size_t m_branchIndex;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
|
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
|
#include "RivSimWellPipeSourceInfo.h"
|
||||||
|
#include "RivWellPathSourceInfo.h"
|
||||||
|
|
||||||
#include "RiuSelectionChangedHandler.h"
|
#include "RiuSelectionChangedHandler.h"
|
||||||
|
|
||||||
@@ -63,6 +67,24 @@ void RiuSelectionManager::selectedItems(std::vector<RiuSelectionItem*>& items, i
|
|||||||
items = s;
|
items = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuSelectionItem* RiuSelectionManager::selectedItem(int role /*= RUI_APPLICATION_GLOBAL*/) const
|
||||||
|
{
|
||||||
|
const std::vector<RiuSelectionItem*>& s = m_selection[role];
|
||||||
|
|
||||||
|
if (s.size() == 1)
|
||||||
|
{
|
||||||
|
if (s[0])
|
||||||
|
{
|
||||||
|
return s[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -181,3 +203,27 @@ RiuGeoMechSelectionItem::RiuGeoMechSelectionItem(RimGeoMechView* view,
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuWellPathSelectionItem::RiuWellPathSelectionItem(const RivWellPathSourceInfo* wellPathSourceInfo,
|
||||||
|
const cvf::Vec3d& pipeCenterLineIntersectionInDomainCoords,
|
||||||
|
double measuredDepth)
|
||||||
|
: m_pipeCenterlineIntersectionInDomainCoords(pipeCenterLineIntersectionInDomainCoords),
|
||||||
|
m_measuredDepth(measuredDepth)
|
||||||
|
{
|
||||||
|
m_wellpath = wellPathSourceInfo->wellPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuSimWellSelectionItem::RiuSimWellSelectionItem(RimEclipseWell* simwell,
|
||||||
|
cvf::Vec3d m_domainCoord,
|
||||||
|
size_t m_branchIndex)
|
||||||
|
: m_simWell(simwell),
|
||||||
|
m_domainCoord(m_domainCoord),
|
||||||
|
m_branchIndex(m_branchIndex)
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -28,11 +28,17 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include "RimEclipseWell.h"
|
||||||
|
// #include "RivWellPathSourceInfo.h"
|
||||||
|
// #include "RivWellPipeSourceInfo.h"
|
||||||
|
|
||||||
class RimEclipseView;
|
class RimEclipseView;
|
||||||
class RiuSelectionChangedHandler;
|
class RiuSelectionChangedHandler;
|
||||||
class RiuSelectionItem;
|
class RiuSelectionItem;
|
||||||
class RimGeoMechView;
|
class RimGeoMechView;
|
||||||
|
class RimWellPath;
|
||||||
|
class RivWellPathSourceInfo;
|
||||||
|
class RivSimWellPipeSourceInfo;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@@ -55,6 +61,12 @@ public:
|
|||||||
// Selection manager owns the selection items
|
// Selection manager owns the selection items
|
||||||
void selectedItems(std::vector<RiuSelectionItem*>& items, int role = RUI_APPLICATION_GLOBAL) const;
|
void selectedItems(std::vector<RiuSelectionItem*>& items, int role = RUI_APPLICATION_GLOBAL) const;
|
||||||
|
|
||||||
|
// Returns selected items
|
||||||
|
// Selection manager owns the selection items
|
||||||
|
RiuSelectionItem* selectedItem(int role = RUI_APPLICATION_GLOBAL) const;
|
||||||
|
// PdmUiItem* selectedItem(int role = SelectionManager::APPLICATION_GLOBAL);
|
||||||
|
|
||||||
|
|
||||||
// Append item to selected items
|
// Append item to selected items
|
||||||
// SelectionManager takes ownership of the item
|
// SelectionManager takes ownership of the item
|
||||||
void appendItemToSelection(RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL);
|
void appendItemToSelection(RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL);
|
||||||
@@ -93,7 +105,9 @@ public:
|
|||||||
enum RiuSelectionType
|
enum RiuSelectionType
|
||||||
{
|
{
|
||||||
ECLIPSE_SELECTION_OBJECT,
|
ECLIPSE_SELECTION_OBJECT,
|
||||||
GEOMECH_SELECTION_OBJECT
|
GEOMECH_SELECTION_OBJECT,
|
||||||
|
WELLPATH_SELECTION_OBJECT,
|
||||||
|
SIMWELL_SELECTION_OBJECT
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -173,3 +187,54 @@ public:
|
|||||||
cvf::Vec3d m_localIntersectionPoint;
|
cvf::Vec3d m_localIntersectionPoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class RiuWellPathSelectionItem : public RiuSelectionItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit RiuWellPathSelectionItem(const RivWellPathSourceInfo* wellPathSourceInfo,
|
||||||
|
const cvf::Vec3d& currentPickPositionInDomainCoords,
|
||||||
|
double measuredDepth);
|
||||||
|
|
||||||
|
virtual ~RiuWellPathSelectionItem() {};
|
||||||
|
|
||||||
|
virtual RiuSelectionType type() const
|
||||||
|
{
|
||||||
|
return WELLPATH_SELECTION_OBJECT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimWellPath* m_wellpath;
|
||||||
|
cvf::Vec3d m_pipeCenterlineIntersectionInDomainCoords;
|
||||||
|
double m_measuredDepth;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class RiuSimWellSelectionItem : public RiuSelectionItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit RiuSimWellSelectionItem(RimEclipseWell* simwell, cvf::Vec3d domainCoord, size_t branchIndex);
|
||||||
|
|
||||||
|
|
||||||
|
virtual ~RiuSimWellSelectionItem() {};
|
||||||
|
|
||||||
|
virtual RiuSelectionType type() const
|
||||||
|
{
|
||||||
|
return SIMWELL_SELECTION_OBJECT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimEclipseWell* m_simWell;
|
||||||
|
cvf::Vec3d m_domainCoord;
|
||||||
|
size_t m_branchIndex;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user