#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:
Jacob Støren 2017-04-25 15:49:07 +02:00
parent 1f7c357b67
commit f40cf3a9b7
4 changed files with 123 additions and 2 deletions

View File

@ -38,3 +38,11 @@ RimEclipseWell* RivSimWellPipeSourceInfo::well() const
{
return m_eclipseWell.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RivSimWellPipeSourceInfo::branchIndex() const
{
return m_branchIndex;
}

View File

@ -32,6 +32,8 @@ public:
RimEclipseWell* well() const;
size_t branchIndex() const;
private:
caf::PdmPointer<RimEclipseWell> m_eclipseWell;
size_t m_branchIndex;

View File

@ -21,6 +21,10 @@
#include "RimEclipseView.h"
#include "RimGeoMechView.h"
#include "RimWellPath.h"
#include "RivSimWellPipeSourceInfo.h"
#include "RivWellPathSourceInfo.h"
#include "RiuSelectionChangedHandler.h"
@ -63,6 +67,24 @@ void RiuSelectionManager::selectedItems(std::vector<RiuSelectionItem*>& items, i
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)
{
}

View File

@ -28,11 +28,17 @@
#include <vector>
#include <assert.h>
#include <array>
#include "RimEclipseWell.h"
// #include "RivWellPathSourceInfo.h"
// #include "RivWellPipeSourceInfo.h"
class RimEclipseView;
class RiuSelectionChangedHandler;
class RiuSelectionItem;
class RimGeoMechView;
class RimWellPath;
class RivWellPathSourceInfo;
class RivSimWellPipeSourceInfo;
//==================================================================================================
//
@ -54,7 +60,13 @@ public:
// Returns selected items
// Selection manager owns the selection items
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
// SelectionManager takes ownership of the item
void appendItemToSelection(RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL);
@ -93,7 +105,9 @@ public:
enum RiuSelectionType
{
ECLIPSE_SELECTION_OBJECT,
GEOMECH_SELECTION_OBJECT
GEOMECH_SELECTION_OBJECT,
WELLPATH_SELECTION_OBJECT,
SIMWELL_SELECTION_OBJECT
};
public:
@ -173,3 +187,54 @@ public:
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;
};