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:
@@ -11,6 +11,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.h
|
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.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}/RicWellPathsUnitSystemSettingsImpl.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp
|
${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp
|
||||||
|
|||||||
@@ -818,7 +818,7 @@ void RicWellTarget3dEditor::configureAndUpdateUi(const QString& uiConfigName)
|
|||||||
handleSize = 0.7 * view->ownerCase()->characteristicCellSize();
|
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->setTangent(target->tangent());
|
||||||
m_manipulator->setHandleSize(handleSize);
|
m_manipulator->setHandleSize(handleSize);
|
||||||
m_cvfModel->removeAllParts();
|
m_cvfModel->removeAllParts();
|
||||||
@@ -863,7 +863,7 @@ void RicWellTarget3dEditor::slotUpdated(const cvf::Vec3d& origin, const cvf::Vec
|
|||||||
RimWellPathGeometryDef* geomDef;
|
RimWellPathGeometryDef* geomDef;
|
||||||
target->firstAncestorOrThisOfTypeAsserted(geomDef);
|
target->firstAncestorOrThisOfTypeAsserted(geomDef);
|
||||||
|
|
||||||
cvf::Vec3d domainOrigin = dispXf->transformToDomainCoord( origin) - geomDef->referencePoint();
|
cvf::Vec3d domainOrigin = dispXf->transformToDomainCoord( origin) - geomDef->referencePointXyz();
|
||||||
domainOrigin.z() = -domainOrigin.z();
|
domainOrigin.z() = -domainOrigin.z();
|
||||||
QVariant originVariant = caf::PdmValueFieldSpecialization < cvf::Vec3d >::convert(domainOrigin);
|
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 "RicDeleteWellPathAttributeFeature.h"
|
||||||
|
|
||||||
#include "RimWellPathAttributeCollection.h"
|
#include "RimWellPathAttributeCollection.h"
|
||||||
#include "RimWellPathTarget.h"
|
#include "RimWellPath.h"
|
||||||
#include "RimModeledWellPath.h"
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
@@ -72,5 +72,3 @@ void RicDeleteWellPathAttributeFeature::setupActionLook(QAction* actionToSetup)
|
|||||||
actionToSetup->setText("Delete Attribute");
|
actionToSetup->setText("Delete Attribute");
|
||||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ CAF_CMD_SOURCE_INIT(RicNewEditableWellPathFeature, "RicNewEditableWellPathFeatur
|
|||||||
#include "RimModeledWellPath.h"
|
#include "RimModeledWellPath.h"
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include "RimOilField.h"
|
#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));
|
newWellPaths.back()->setName("UWell-" + QString::number(wellPathCollection->modelledWellPathCount()+1));
|
||||||
wellPathCollection->addWellPaths(newWellPaths);
|
wellPathCollection->addWellPaths(newWellPaths);
|
||||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
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();
|
proj->createDisplayModelAndRedrawAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellPathGeometryDef* RimModeledWellPath::geometryDefinition()
|
||||||
|
{
|
||||||
|
return m_geometryDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -19,11 +19,7 @@
|
|||||||
|
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
#include "cafPdmFieldCvfVec3d.h"
|
#include "cafPdmChildField.h"
|
||||||
#include "cafPdmObject.h"
|
|
||||||
#include "cafPdmField.h"
|
|
||||||
#include "cafAppEnum.h"
|
|
||||||
#include "cafPdmPtrField.h"
|
|
||||||
|
|
||||||
class RimWellPathTarget;
|
class RimWellPathTarget;
|
||||||
class RimWellPath;
|
class RimWellPath;
|
||||||
@@ -37,15 +33,14 @@ public:
|
|||||||
RimModeledWellPath();
|
RimModeledWellPath();
|
||||||
~RimModeledWellPath();
|
~RimModeledWellPath();
|
||||||
|
|
||||||
void createWellPathGeometry();
|
void createWellPathGeometry();
|
||||||
void updateWellPathVisualization();
|
void updateWellPathVisualization();
|
||||||
|
RimWellPathGeometryDef* geometryDefinition();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||||
|
|
||||||
caf::PdmChildField<RimWellPathGeometryDef*> m_geometryDefinition;
|
caf::PdmChildField<RimWellPathGeometryDef*> m_geometryDefinition;
|
||||||
|
|
||||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,10 @@
|
|||||||
#include "RiaSCurveCalculator.h"
|
#include "RiaSCurveCalculator.h"
|
||||||
#include "RiaLogging.h"
|
#include "RiaLogging.h"
|
||||||
#include "RiaJCurveCalculator.h"
|
#include "RiaJCurveCalculator.h"
|
||||||
|
#include "cafPdmUiPushButtonEditor.h"
|
||||||
|
|
||||||
|
#include "WellPathCommands/RicCreateWellTargetsPickEventHandler.h"
|
||||||
|
#include "RiuViewerCommands.h"
|
||||||
|
|
||||||
namespace caf
|
namespace caf
|
||||||
{
|
{
|
||||||
@@ -49,11 +53,12 @@ CAF_PDM_SOURCE_INIT(RimWellPathGeometryDef, "WellPathGeometryDef");
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimWellPathGeometryDef::RimWellPathGeometryDef()
|
RimWellPathGeometryDef::RimWellPathGeometryDef()
|
||||||
|
: m_pickTargetsEventHandler(new RicCreateWellTargetsPickEventHandler(this))
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject("Trajectory", ":/Well.png", "", "");
|
CAF_PDM_InitObject("Trajectory", ":/Well.png", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_wellStartType, "WellStartType", "Start Type", "", "", "");
|
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_InitFieldNoDefault(&m_parentWell, "ParentWell", "Parent Well", "", "", "");
|
||||||
CAF_PDM_InitField(&m_kickoffDepthOrMD, "KickoffDepthOrMD", 100.0, "Kickoff Depth", "", "", "");
|
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()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||||
m_wellTargets.uiCapability()->setCustomContextMenuEnabled(true);
|
m_wellTargets.uiCapability()->setCustomContextMenuEnabled(true);
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&m_pickPointsEnabled, "m_pickPointsEnabled", false, "", "", "", "");
|
||||||
m_wellTargets.push_back(new RimWellPathTarget());
|
caf::PdmUiPushButtonEditor::configureEditorForField(&m_pickPointsEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -74,7 +79,11 @@ RimWellPathGeometryDef::RimWellPathGeometryDef()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
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);
|
size_t index = m_wellTargets.index(targetToInsertBefore);
|
||||||
if (index < m_wellTargets.size()) m_wellTargets.insert(index, targetToInsert);
|
if (index < m_wellTargets.size()) m_wellTargets.insert(index, targetToInsert);
|
||||||
@@ -180,6 +189,25 @@ const RimWellPathTarget* RimWellPathGeometryDef::lastActiveTarget() const
|
|||||||
return nullptr;
|
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& oldValue,
|
||||||
const QVariant& newValue)
|
const QVariant& newValue)
|
||||||
{
|
{
|
||||||
if (&m_referencePoint == changedField)
|
if (&m_referencePointXyz == changedField)
|
||||||
{
|
{
|
||||||
std::cout << "fieldChanged" << std::endl;
|
std::cout << "fieldChanged" << std::endl;
|
||||||
}
|
}
|
||||||
|
else if (changedField == &m_pickPointsEnabled)
|
||||||
|
{
|
||||||
|
enableTargetPointPicking(m_pickPointsEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
updateWellPathVisualization();
|
updateWellPathVisualization();
|
||||||
}
|
}
|
||||||
@@ -230,8 +262,9 @@ void RimWellPathGeometryDef::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
|||||||
uiOrdering.add(&m_kickoffDepthOrMD);
|
uiOrdering.add(&m_kickoffDepthOrMD);
|
||||||
}
|
}
|
||||||
|
|
||||||
uiOrdering.add(&m_referencePoint);
|
uiOrdering.add(&m_referencePointXyz);
|
||||||
uiOrdering.add(&m_wellTargets);
|
uiOrdering.add(&m_wellTargets);
|
||||||
|
uiOrdering.add(&m_pickPointsEnabled);
|
||||||
uiOrdering.skipRemainingFields(true);
|
uiOrdering.skipRemainingFields(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,7 +306,7 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
CVF_ASSERT(activeWellPathTargets.size() > 1);
|
CVF_ASSERT(activeWellPathTargets.size() > 1);
|
||||||
|
|
||||||
std::vector<cvf::Vec3d> endPoints;
|
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)
|
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));
|
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.firstArcEndpoint() + m_referencePointXyz() );
|
||||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePoint() );
|
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePointXyz() );
|
||||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
|
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ( target1->targetType() == RimWellPathTarget::POINT
|
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));
|
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.firstArcEndpoint() + m_referencePointXyz() );
|
||||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePoint() );
|
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePointXyz() );
|
||||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePoint() );
|
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
||||||
}
|
}
|
||||||
else if ( target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
|
else if ( target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
|
||||||
&& target2->targetType() == RimWellPathTarget::POINT)
|
&& target2->targetType() == RimWellPathTarget::POINT)
|
||||||
@@ -353,9 +386,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
target2->targetPointXYZ());
|
target2->targetPointXYZ());
|
||||||
if ( jCurve.isOk() )
|
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();
|
prevSegmentEndAzi = jCurve.endAzimuth();
|
||||||
prevSegmentEndInc = jCurve.endInclination();
|
prevSegmentEndInc = jCurve.endInclination();
|
||||||
|
|
||||||
@@ -371,9 +404,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
target2->targetPointXYZ());
|
target2->targetPointXYZ());
|
||||||
if ( jCurve.isOk() )
|
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();
|
prevSegmentEndAzi = jCurve.endAzimuth();
|
||||||
prevSegmentEndInc = jCurve.endInclination();
|
prevSegmentEndInc = jCurve.endInclination();
|
||||||
}
|
}
|
||||||
@@ -418,3 +451,34 @@ void RimWellPathGeometryDef::defineCustomContextMenu(const caf::PdmFieldHandle*
|
|||||||
|
|
||||||
menuBuilder.appendToMenu(menu);
|
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 "cafPdmPtrField.h"
|
||||||
#include "cafPdmChildArrayField.h"
|
#include "cafPdmChildArrayField.h"
|
||||||
|
|
||||||
|
|
||||||
class RimWellPath;
|
class RimWellPath;
|
||||||
class RimWellPathTarget;
|
class RimWellPathTarget;
|
||||||
|
class RicCreateWellTargetsPickEventHandler;
|
||||||
|
|
||||||
class RigWellPath;
|
class RigWellPath;
|
||||||
|
|
||||||
@@ -41,40 +43,56 @@ public:
|
|||||||
|
|
||||||
enum WellStartType { START_AT_FIRST_TARGET, START_AT_SURFACE, START_FROM_OTHER_WELL, START_AT_AUTO_SURFACE };
|
enum WellStartType { START_AT_FIRST_TARGET, START_AT_SURFACE, START_FROM_OTHER_WELL, START_AT_AUTO_SURFACE };
|
||||||
|
|
||||||
cvf::Vec3d referencePoint() { return m_referencePoint;}
|
cvf::Vec3d referencePointXyz() { return m_referencePointXyz;}
|
||||||
cvf::ref<RigWellPath> createWellPathGeometry();
|
void setReferencePoint(const cvf::Vec3d& refPointXyz ) {m_referencePointXyz = refPointXyz;}
|
||||||
|
|
||||||
|
cvf::ref<RigWellPath> createWellPathGeometry();
|
||||||
|
|
||||||
void updateWellPathVisualization();
|
void updateWellPathVisualization();
|
||||||
|
|
||||||
void insertTarget(RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert);
|
void insertTarget(const RimWellPathTarget* targetToInsertBefore,
|
||||||
void deleteTarget(RimWellPathTarget* targetTodelete);
|
RimWellPathTarget* targetToInsert);
|
||||||
void appendTarget();
|
void deleteTarget(RimWellPathTarget* targetTodelete);
|
||||||
|
void appendTarget();
|
||||||
|
|
||||||
const RimWellPathTarget* firstActiveTarget() const;
|
const RimWellPathTarget* firstActiveTarget() const;
|
||||||
const RimWellPathTarget* lastActiveTarget() const;
|
const RimWellPathTarget* lastActiveTarget() const;
|
||||||
|
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
void enableTargetPointPicking(bool isEnabling);
|
||||||
|
|
||||||
std::vector<RimWellPathTarget*> activeWellTargets() const;
|
std::vector<RimWellPathTarget*> activeWellTargets() const;
|
||||||
protected:
|
protected:
|
||||||
virtual void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
||||||
QMenu* menu,
|
QMenu* menu,
|
||||||
QWidget* fieldEditorWidget) override;
|
QWidget* fieldEditorWidget) override;
|
||||||
|
|
||||||
private:
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
void defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
QString uiConfigName,
|
||||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
caf::PdmUiEditorAttribute* attribute) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
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;
|
std::vector<cvf::Vec3d> lineArcEndpoints() const;
|
||||||
cvf::Vec3d startTangent() const;
|
cvf::Vec3d startTangent() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<caf::AppEnum<WellStartType> > m_wellStartType;
|
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::PdmField<double> m_kickoffDepthOrMD;
|
||||||
caf::PdmPtrField<RimWellPath*> m_parentWell;
|
caf::PdmPtrField<RimWellPath*> m_parentWell;
|
||||||
|
|
||||||
|
caf::PdmField< bool > m_pickPointsEnabled;
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
||||||
|
RicCreateWellTargetsPickEventHandler* m_pickTargetsEventHandler;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user