#3447, #3207, #3448 Polished the target table. Improved insert target commands, Add icons to editable wellpaths and target list.

This commit is contained in:
Jacob Støren
2018-10-02 15:55:28 +02:00
parent 1dfad4f01d
commit d9e8537974
9 changed files with 116 additions and 15 deletions

View File

@@ -40,7 +40,7 @@ CAF_PDM_SOURCE_INIT(RimModeledWellPath, "ModeledWellPath");
//--------------------------------------------------------------------------------------------------
RimModeledWellPath::RimModeledWellPath()
{
CAF_PDM_InitObject("Modeled WellPath", ":/Well.png", "", "");
CAF_PDM_InitObject("Modeled WellPath", ":/EditableWell.png", "", "");
CAF_PDM_InitFieldNoDefault(&m_geometryDefinition, "WellPathGeometryDef", "Trajectory", "", "", "");
m_geometryDefinition = new RimWellPathGeometryDef;

View File

@@ -58,7 +58,7 @@ CAF_PDM_SOURCE_INIT(RimWellPathGeometryDef, "WellPathGeometryDef");
RimWellPathGeometryDef::RimWellPathGeometryDef()
: m_pickTargetsEventHandler(new RicCreateWellTargetsPickEventHandler(this))
{
CAF_PDM_InitObject("Well Targets", ":/Well.png", "", "");
CAF_PDM_InitObject("Well Targets", ":/WellTargets.png", "", "");
CAF_PDM_InitField(&m_referencePointUtmXyd, "ReferencePosUtmXyd", cvf::Vec3d(0,0,0), "UTM Reference Point", "", "", "");
@@ -164,6 +164,31 @@ void RimWellPathGeometryDef::updateWellPathVisualization()
modWellPath->updateWellPathVisualization();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<RimWellPathTarget*, RimWellPathTarget*>
RimWellPathGeometryDef::findActiveTargetsAroundInsertionPoint(const RimWellPathTarget* targetToInsertBefore)
{
RimWellPathTarget* before = nullptr;
RimWellPathTarget* after = nullptr;
bool foundTarget = false;
for (const auto& wt : m_wellTargets)
{
if ( wt == targetToInsertBefore )
{
foundTarget = true;
}
if ( wt->isEnabled() && !after && foundTarget ) after = wt;
if ( wt->isEnabled() && !foundTarget ) before = wt;
}
return { before, after};
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -51,6 +51,7 @@ public:
cvf::ref<RigWellPath> createWellPathGeometry();
void updateWellPathVisualization();
std::pair<RimWellPathTarget*, RimWellPathTarget*> findActiveTargetsAroundInsertionPoint(const RimWellPathTarget* targetToInsertBefore);
void insertTarget(const RimWellPathTarget* targetToInsertBefore,
RimWellPathTarget* targetToInsert);

View File

@@ -3,6 +3,7 @@
#include <cmath>
#include "RimWellPathGeometryDef.h"
#include "cafPdmUiCheckBoxEditor.h"
CAF_PDM_SOURCE_INIT(RimWellPathTarget, "WellPathTarget");
@@ -28,13 +29,16 @@ RimWellPathTarget::RimWellPathTarget()
{
CAF_PDM_InitField(&m_isEnabled, "IsEnabled", true, "", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_targetType, "TargetType", "Type", "", "", "");
//m_targetType.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_dogleg1, "Dogleg1", 3.0, "DLS 1", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_targetPoint, "TargetPoint", "Point", "", "", "");
CAF_PDM_InitField(&m_dogleg1, "Dogleg1", 3.0, "DLh", "", "", "");
CAF_PDM_InitField(&m_dogleg2, "Dogleg2", 3.0, "DLl", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_targetType, "TargetType", "Type", "", "", "");
m_targetType.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&m_hasTangentConstraintUiField, "HasTangentConstraint", false, "Dir", "", "", "");
m_hasTangentConstraintUiField.xmlCapability()->disableIO();
CAF_PDM_InitField(&m_azimuth, "Azimuth", 0.0, "Azi(deg)", "", "", "");
CAF_PDM_InitField(&m_inclination, "Inclination", 0.0, "Inc(deg)", "", "", "");
CAF_PDM_InitField(&m_dogleg2, "Dogleg2", 3.0, "DLS 2", "", "", "");
}
//--------------------------------------------------------------------------------------------------
@@ -252,8 +256,8 @@ QList<caf::PdmOptionItemInfo> RimWellPathTarget::calculateValueOptions(const caf
QList<caf::PdmOptionItemInfo> options;
if (fieldNeedingOptions == & m_targetType)
{
options.push_back(caf::PdmOptionItemInfo("o->",RimWellPathTarget::POINT_AND_TANGENT, false, QIcon(":/WellTargetPointTangent16x16.png") ));
options.push_back(caf::PdmOptionItemInfo("o", RimWellPathTarget::POINT, false, QIcon(":/WellTargetPoint16x16.png")));
options.push_back(caf::PdmOptionItemInfo("o->",RimWellPathTarget::POINT_AND_TANGENT));//, false, QIcon(":/WellTargetPointTangent16x16.png") ));
options.push_back(caf::PdmOptionItemInfo("o", RimWellPathTarget::POINT));//, false, QIcon(":/WellTargetPoint16x16.png")));
}
return options;
}
@@ -263,6 +267,12 @@ QList<caf::PdmOptionItemInfo> RimWellPathTarget::calculateValueOptions(const caf
//--------------------------------------------------------------------------------------------------
void RimWellPathTarget::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &m_hasTangentConstraintUiField)
{
if (m_hasTangentConstraintUiField) m_targetType = POINT_AND_TANGENT;
else m_targetType = POINT;
}
RimModeledWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
wellPath->updateWellPathVisualization();
@@ -270,6 +280,7 @@ void RimWellPathTarget::fieldChangedByUi(const caf::PdmFieldHandle* changedField
{
wellPath->scheduleUpdateOfDependentVisualization();
}
}
//--------------------------------------------------------------------------------------------------
@@ -277,9 +288,11 @@ void RimWellPathTarget::fieldChangedByUi(const caf::PdmFieldHandle* changedField
//--------------------------------------------------------------------------------------------------
void RimWellPathTarget::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
m_hasTangentConstraintUiField = (m_targetType == POINT_AND_TANGENT);
if (m_isEnabled())
{
m_hasTangentConstraintUiField.uiCapability()->setUiReadOnly(false);
m_targetType.uiCapability()->setUiReadOnly(false);
m_targetPoint.uiCapability()->setUiReadOnly(false);
m_dogleg2.uiCapability()->setUiReadOnly(false);
@@ -318,5 +331,6 @@ void RimWellPathTarget::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
m_azimuth.uiCapability()->setUiReadOnly(true);
m_inclination.uiCapability()->setUiReadOnly(true);
m_dogleg2.uiCapability()->setUiReadOnly(true);
m_hasTangentConstraintUiField.uiCapability()->setUiReadOnly(true);
}
}

View File

@@ -68,6 +68,7 @@ private:
caf::PdmField<double> m_inclination;
caf::PdmField<double> m_dogleg1;
caf::PdmField<double> m_dogleg2;
caf::PdmField<bool> m_hasTangentConstraintUiField;
};