mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3249 Well path target point picking operational.
Still work to do, however.
This commit is contained in:
parent
9cd9173000
commit
dc432e976b
@ -11,6 +11,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h
|
||||
@ -28,6 +29,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp
|
||||
|
@ -818,7 +818,7 @@ void RicWellTarget3dEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
handleSize = 0.7 * view->ownerCase()->characteristicCellSize();
|
||||
}
|
||||
|
||||
m_manipulator->setOrigin(dispXf->transformToDisplayCoord( target->targetPointXYZ() + geomDef->referencePoint()));
|
||||
m_manipulator->setOrigin(dispXf->transformToDisplayCoord( target->targetPointXYZ() + geomDef->referencePointXyz()));
|
||||
m_manipulator->setTangent(target->tangent());
|
||||
m_manipulator->setHandleSize(handleSize);
|
||||
m_cvfModel->removeAllParts();
|
||||
@ -863,7 +863,7 @@ void RicWellTarget3dEditor::slotUpdated(const cvf::Vec3d& origin, const cvf::Vec
|
||||
RimWellPathGeometryDef* geomDef;
|
||||
target->firstAncestorOrThisOfTypeAsserted(geomDef);
|
||||
|
||||
cvf::Vec3d domainOrigin = dispXf->transformToDomainCoord( origin) - geomDef->referencePoint();
|
||||
cvf::Vec3d domainOrigin = dispXf->transformToDomainCoord( origin) - geomDef->referencePointXyz();
|
||||
domainOrigin.z() = -domainOrigin.z();
|
||||
QVariant originVariant = caf::PdmValueFieldSpecialization < cvf::Vec3d >::convert(domainOrigin);
|
||||
|
||||
|
@ -0,0 +1,84 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicCreateWellTargetsPickEventHandler.h"
|
||||
#include "Rim3dView.h"
|
||||
#include "RimWellPathGeometryDef.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
|
||||
#include <vector>
|
||||
#include "RiuViewerCommands.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicCreateWellTargetsPickEventHandler::RicCreateWellTargetsPickEventHandler(RimWellPathGeometryDef* wellGeometryDef)
|
||||
: m_geometryToAddTargetsTo(wellGeometryDef)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicCreateWellTargetsPickEventHandler::~RicCreateWellTargetsPickEventHandler()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicCreateWellTargetsPickEventHandler::handlePickEvent(const Ric3DPickEvent& eventObject)
|
||||
{
|
||||
if (!caf::SelectionManager::instance()->isSelected(m_geometryToAddTargetsTo.p(), 0))
|
||||
{
|
||||
m_geometryToAddTargetsTo->enableTargetPointPicking(false);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( m_geometryToAddTargetsTo )
|
||||
{
|
||||
Rim3dView* rimView = eventObject.m_view;
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transForm = rimView->displayCoordTransform();
|
||||
cvf::Vec3d domainCoord = transForm->transformToDomainCoord(eventObject.m_pickItemInfos.front().globalPickedPoint());
|
||||
if (!m_geometryToAddTargetsTo->firstActiveTarget())
|
||||
{
|
||||
m_geometryToAddTargetsTo->setReferencePoint(domainCoord);
|
||||
}
|
||||
cvf::Vec3d referencePoint = m_geometryToAddTargetsTo->referencePointXyz();
|
||||
cvf::Vec3d relativeTagetPoint = domainCoord - referencePoint;
|
||||
RimWellPathTarget* newTarget = new RimWellPathTarget;
|
||||
newTarget->setAsPointTargetXYD(cvf::Vec3d(relativeTagetPoint.x(), relativeTagetPoint.y(), -relativeTagetPoint.z()));
|
||||
|
||||
m_geometryToAddTargetsTo->insertTarget(nullptr, newTarget);
|
||||
|
||||
m_geometryToAddTargetsTo->updateConnectedEditors();
|
||||
m_geometryToAddTargetsTo->updateWellPathVisualization();
|
||||
|
||||
return true; // Todo: See if we really should eat the event instead
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RicPickEventHandler.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
class RimWellPathGeometryDef;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicCreateWellTargetsPickEventHandler : public RicPickEventHandler
|
||||
{
|
||||
public:
|
||||
RicCreateWellTargetsPickEventHandler(RimWellPathGeometryDef* wellGeometryDef);
|
||||
~RicCreateWellTargetsPickEventHandler();
|
||||
|
||||
protected:
|
||||
caf::PdmPointer<RimWellPathGeometryDef> m_geometryToAddTargetsTo;
|
||||
|
||||
virtual bool handlePickEvent(const Ric3DPickEvent& eventObject) override;
|
||||
};
|
||||
|
@ -18,8 +18,8 @@
|
||||
#include "RicDeleteWellPathAttributeFeature.h"
|
||||
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include <QAction>
|
||||
|
||||
@ -72,5 +72,3 @@ void RicDeleteWellPathAttributeFeature::setupActionLook(QAction* actionToSetup)
|
||||
actionToSetup->setText("Delete Attribute");
|
||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,6 +27,8 @@ CAF_CMD_SOURCE_INIT(RicNewEditableWellPathFeature, "RicNewEditableWellPathFeatur
|
||||
#include "RimModeledWellPath.h"
|
||||
#include <QAction>
|
||||
#include "RimOilField.h"
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "RimWellPathGeometryDef.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -74,7 +76,14 @@ void RicNewEditableWellPathFeature::onActionTriggered(bool isChecked)
|
||||
newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->modelledWellPathCount()+1));
|
||||
wellPathCollection->addWellPaths(newWellPaths);
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
wellPathCollection->scheduleRedrawAffectedViews();
|
||||
|
||||
newModeledWellPath->geometryDefinition()->enableTargetPointPicking(true);
|
||||
|
||||
RimProject* project;
|
||||
wellPathCollection->firstAncestorOrThisOfTypeAsserted(project);
|
||||
project->createDisplayModelAndRedrawAllViews();
|
||||
|
||||
Riu3DMainWindowTools::selectAsCurrentItem(newModeledWellPath->geometryDefinition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,14 @@ void RimModeledWellPath::updateWellPathVisualization()
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathGeometryDef* RimModeledWellPath::geometryDefinition()
|
||||
{
|
||||
return m_geometryDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -19,11 +19,7 @@
|
||||
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
||||
class RimWellPathTarget;
|
||||
class RimWellPath;
|
||||
@ -37,15 +33,14 @@ public:
|
||||
RimModeledWellPath();
|
||||
~RimModeledWellPath();
|
||||
|
||||
void createWellPathGeometry();
|
||||
void updateWellPathVisualization();
|
||||
void createWellPathGeometry();
|
||||
void updateWellPathVisualization();
|
||||
RimWellPathGeometryDef* geometryDefinition();
|
||||
|
||||
private:
|
||||
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
caf::PdmChildField<RimWellPathGeometryDef*> m_geometryDefinition;
|
||||
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
#include "RiaSCurveCalculator.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaJCurveCalculator.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
|
||||
#include "WellPathCommands/RicCreateWellTargetsPickEventHandler.h"
|
||||
#include "RiuViewerCommands.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@ -49,11 +53,12 @@ CAF_PDM_SOURCE_INIT(RimWellPathGeometryDef, "WellPathGeometryDef");
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathGeometryDef::RimWellPathGeometryDef()
|
||||
: m_pickTargetsEventHandler(new RicCreateWellTargetsPickEventHandler(this))
|
||||
{
|
||||
CAF_PDM_InitObject("Trajectory", ":/Well.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellStartType, "WellStartType", "Start Type", "", "", "");
|
||||
CAF_PDM_InitField(&m_referencePoint, "ReferencePos", cvf::Vec3d(0,0,0), "UTM Reference Point", "", "", "");
|
||||
CAF_PDM_InitField(&m_referencePointXyz, "ReferencePos", cvf::Vec3d(0,0,0), "UTM Reference Point", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_parentWell, "ParentWell", "Parent Well", "", "", "");
|
||||
CAF_PDM_InitField(&m_kickoffDepthOrMD, "KickoffDepthOrMD", 100.0, "Kickoff Depth", "", "", "");
|
||||
@ -65,8 +70,8 @@ RimWellPathGeometryDef::RimWellPathGeometryDef()
|
||||
m_wellTargets.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
m_wellTargets.uiCapability()->setCustomContextMenuEnabled(true);
|
||||
|
||||
|
||||
m_wellTargets.push_back(new RimWellPathTarget());
|
||||
CAF_PDM_InitField(&m_pickPointsEnabled, "m_pickPointsEnabled", false, "", "", "", "");
|
||||
caf::PdmUiPushButtonEditor::configureEditorForField(&m_pickPointsEnabled);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -74,7 +79,11 @@ RimWellPathGeometryDef::RimWellPathGeometryDef()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathGeometryDef::~RimWellPathGeometryDef()
|
||||
{
|
||||
RiuViewerCommands::removePickEventHandler(m_pickTargetsEventHandler);
|
||||
|
||||
delete m_pickTargetsEventHandler;
|
||||
|
||||
m_pickTargetsEventHandler = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -109,7 +118,7 @@ void RimWellPathGeometryDef::updateWellPathVisualization()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::insertTarget(RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert)
|
||||
void RimWellPathGeometryDef::insertTarget(const RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert)
|
||||
{
|
||||
size_t index = m_wellTargets.index(targetToInsertBefore);
|
||||
if (index < m_wellTargets.size()) m_wellTargets.insert(index, targetToInsert);
|
||||
@ -180,6 +189,25 @@ const RimWellPathTarget* RimWellPathGeometryDef::lastActiveTarget() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::enableTargetPointPicking(bool isEnabling)
|
||||
{
|
||||
if (isEnabling)
|
||||
{
|
||||
m_pickPointsEnabled = true;
|
||||
RiuViewerCommands::addPickEventHandler(m_pickTargetsEventHandler);
|
||||
updateConnectedEditors();
|
||||
}
|
||||
else
|
||||
{
|
||||
RiuViewerCommands::removePickEventHandler(m_pickTargetsEventHandler);
|
||||
m_pickPointsEnabled = false;
|
||||
updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -203,10 +231,14 @@ void RimWellPathGeometryDef::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
{
|
||||
if (&m_referencePoint == changedField)
|
||||
if (&m_referencePointXyz == changedField)
|
||||
{
|
||||
std::cout << "fieldChanged" << std::endl;
|
||||
}
|
||||
else if (changedField == &m_pickPointsEnabled)
|
||||
{
|
||||
enableTargetPointPicking(m_pickPointsEnabled);
|
||||
}
|
||||
|
||||
updateWellPathVisualization();
|
||||
}
|
||||
@ -230,8 +262,9 @@ void RimWellPathGeometryDef::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
uiOrdering.add(&m_kickoffDepthOrMD);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_referencePoint);
|
||||
uiOrdering.add(&m_referencePointXyz);
|
||||
uiOrdering.add(&m_wellTargets);
|
||||
uiOrdering.add(&m_pickPointsEnabled);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
@ -273,7 +306,7 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
||||
CVF_ASSERT(activeWellPathTargets.size() > 1);
|
||||
|
||||
std::vector<cvf::Vec3d> endPoints;
|
||||
endPoints.push_back( activeWellPathTargets[0]->targetPointXYZ() + m_referencePoint() );
|
||||
endPoints.push_back( activeWellPathTargets[0]->targetPointXYZ() + m_referencePointXyz() );
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < activeWellPathTargets.size() - 1; ++tIdx)
|
||||
{
|
||||
@ -307,9 +340,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
||||
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
|
||||
}
|
||||
|
||||
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePoint() );
|
||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePoint() );
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
|
||||
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePointXyz() );
|
||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePointXyz() );
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
||||
|
||||
}
|
||||
else if ( target1->targetType() == RimWellPathTarget::POINT
|
||||
@ -339,9 +372,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
||||
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
|
||||
}
|
||||
|
||||
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePoint() );
|
||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePoint() );
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
|
||||
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePointXyz() );
|
||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePointXyz() );
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
||||
}
|
||||
else if ( target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
|
||||
&& target2->targetType() == RimWellPathTarget::POINT)
|
||||
@ -353,9 +386,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
||||
target2->targetPointXYZ());
|
||||
if ( jCurve.isOk() )
|
||||
{
|
||||
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePoint());
|
||||
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePointXyz());
|
||||
}
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
||||
prevSegmentEndAzi = jCurve.endAzimuth();
|
||||
prevSegmentEndInc = jCurve.endInclination();
|
||||
|
||||
@ -371,9 +404,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
||||
target2->targetPointXYZ());
|
||||
if ( jCurve.isOk() )
|
||||
{
|
||||
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePoint());
|
||||
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePointXyz());
|
||||
}
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
|
||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
||||
prevSegmentEndAzi = jCurve.endAzimuth();
|
||||
prevSegmentEndInc = jCurve.endInclination();
|
||||
}
|
||||
@ -418,3 +451,34 @@ void RimWellPathGeometryDef::defineCustomContextMenu(const caf::PdmFieldHandle*
|
||||
|
||||
menuBuilder.appendToMenu(menu);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (field == &m_pickPointsEnabled)
|
||||
{
|
||||
caf::PdmUiPushButtonEditorAttribute* pbAttribute = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>(attribute);
|
||||
if ( pbAttribute )
|
||||
{
|
||||
if ( !m_pickPointsEnabled )
|
||||
{
|
||||
pbAttribute->m_buttonText = "Start Picking Targets";
|
||||
}
|
||||
else
|
||||
{
|
||||
pbAttribute->m_buttonText = "Stop Picking Targets";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (field == &m_wellTargets)
|
||||
{
|
||||
auto tvAttribute = dynamic_cast<caf::PdmUiTableViewEditorAttribute*>(attribute);
|
||||
if (tvAttribute && m_pickPointsEnabled)
|
||||
{
|
||||
tvAttribute->baseColor.setRgb(255, 220, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,10 @@
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
|
||||
class RimWellPath;
|
||||
class RimWellPathTarget;
|
||||
class RicCreateWellTargetsPickEventHandler;
|
||||
|
||||
class RigWellPath;
|
||||
|
||||
@ -41,40 +43,56 @@ public:
|
||||
|
||||
enum WellStartType { START_AT_FIRST_TARGET, START_AT_SURFACE, START_FROM_OTHER_WELL, START_AT_AUTO_SURFACE };
|
||||
|
||||
cvf::Vec3d referencePoint() { return m_referencePoint;}
|
||||
cvf::ref<RigWellPath> createWellPathGeometry();
|
||||
cvf::Vec3d referencePointXyz() { return m_referencePointXyz;}
|
||||
void setReferencePoint(const cvf::Vec3d& refPointXyz ) {m_referencePointXyz = refPointXyz;}
|
||||
|
||||
void updateWellPathVisualization();
|
||||
cvf::ref<RigWellPath> createWellPathGeometry();
|
||||
|
||||
void insertTarget(RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert);
|
||||
void deleteTarget(RimWellPathTarget* targetTodelete);
|
||||
void appendTarget();
|
||||
void updateWellPathVisualization();
|
||||
|
||||
const RimWellPathTarget* firstActiveTarget() const;
|
||||
const RimWellPathTarget* lastActiveTarget() const;
|
||||
void insertTarget(const RimWellPathTarget* targetToInsertBefore,
|
||||
RimWellPathTarget* targetToInsert);
|
||||
void deleteTarget(RimWellPathTarget* targetTodelete);
|
||||
void appendTarget();
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
const RimWellPathTarget* firstActiveTarget() const;
|
||||
const RimWellPathTarget* lastActiveTarget() const;
|
||||
|
||||
void enableTargetPointPicking(bool isEnabling);
|
||||
|
||||
std::vector<RimWellPathTarget*> activeWellTargets() const;
|
||||
protected:
|
||||
virtual void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
||||
QMenu* menu,
|
||||
QWidget* fieldEditorWidget) override;
|
||||
void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
||||
QMenu* menu,
|
||||
QWidget* fieldEditorWidget) override;
|
||||
|
||||
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute) override;
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue) override;
|
||||
void defineUiOrdering(QString uiConfigName,
|
||||
caf::PdmUiOrdering& uiOrdering) override;
|
||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering,
|
||||
QString uiConfigName) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
|
||||
std::vector<cvf::Vec3d> lineArcEndpoints() const;
|
||||
cvf::Vec3d startTangent() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<caf::AppEnum<WellStartType> > m_wellStartType;
|
||||
caf::PdmField<cvf::Vec3d> m_referencePoint;
|
||||
caf::PdmField<cvf::Vec3d> m_referencePointXyz;
|
||||
|
||||
caf::PdmField<double> m_kickoffDepthOrMD;
|
||||
caf::PdmPtrField<RimWellPath*> m_parentWell;
|
||||
|
||||
caf::PdmField< bool > m_pickPointsEnabled;
|
||||
|
||||
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
||||
RicCreateWellTargetsPickEventHandler* m_pickTargetsEventHandler;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user