2017-05-10 09:52:51 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-05-19 06:47:44 -05:00
|
|
|
#include "RimFishboneWellPath.h"
|
2017-05-10 09:52:51 -05:00
|
|
|
|
|
|
|
#include "RimProject.h"
|
|
|
|
|
|
|
|
#include "cafPdmUiListEditor.h"
|
2017-05-11 04:19:55 -05:00
|
|
|
#include "cafPdmUiTextEditor.h"
|
2017-05-10 09:52:51 -05:00
|
|
|
|
2017-05-19 06:47:44 -05:00
|
|
|
CAF_PDM_SOURCE_INIT(RimFishboneWellPath, "WellPathCompletion");
|
2017-05-10 09:52:51 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-19 06:47:44 -05:00
|
|
|
RimFishboneWellPath::RimFishboneWellPath()
|
2017-05-10 09:52:51 -05:00
|
|
|
{
|
2017-06-05 04:12:13 -05:00
|
|
|
CAF_PDM_InitObject("WellPathCompletion", ":/FishBoneLateralFromFile16x16.png", "", "");
|
2017-05-10 09:52:51 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_coordinates, "Coordinates", "Coordinates", "", "", "");
|
2017-05-10 10:37:50 -05:00
|
|
|
m_coordinates.uiCapability()->setUiHidden(true);
|
2017-12-15 05:34:22 -06:00
|
|
|
|
2017-05-10 09:52:51 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_measuredDepths, "MeasuredDepth", "MeasuredDepth", "", "", "");
|
2017-05-10 10:37:50 -05:00
|
|
|
m_measuredDepths.uiCapability()->setUiHidden(true);
|
2017-12-15 05:34:22 -06:00
|
|
|
|
2017-06-08 03:09:39 -05:00
|
|
|
userDescriptionField()->uiCapability()->setUiHidden(true);
|
2017-05-10 10:37:50 -05:00
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_displayCoordinates, "DisplayCoordinates", "Coordinates", "", "", "");
|
2017-05-19 06:47:44 -05:00
|
|
|
m_displayCoordinates.registerGetMethod(this, &RimFishboneWellPath::displayCoordinates);
|
2017-05-10 10:37:50 -05:00
|
|
|
m_displayCoordinates.uiCapability()->setUiReadOnly(true);
|
2017-05-11 04:19:55 -05:00
|
|
|
m_displayCoordinates.uiCapability()->setUiEditorTypeName(caf::PdmUiTextEditor::uiEditorTypeName());
|
2017-05-12 03:49:48 -05:00
|
|
|
m_displayCoordinates.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::LabelPosType::TOP);
|
2017-05-10 09:52:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-19 06:47:44 -05:00
|
|
|
RimFishboneWellPath::~RimFishboneWellPath()
|
2017-05-10 09:52:51 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-19 06:47:44 -05:00
|
|
|
void RimFishboneWellPath::setCoordinates(std::vector< cvf::Vec3d > coordinates)
|
2017-05-10 09:52:51 -05:00
|
|
|
{
|
|
|
|
m_coordinates = coordinates;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-19 06:47:44 -05:00
|
|
|
void RimFishboneWellPath::setMeasuredDepths(std::vector< double > measuredDepths)
|
2017-05-10 09:52:51 -05:00
|
|
|
{
|
|
|
|
m_measuredDepths = measuredDepths;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-19 06:47:44 -05:00
|
|
|
void RimFishboneWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
2017-05-10 09:52:51 -05:00
|
|
|
{
|
|
|
|
RimProject* proj;
|
|
|
|
this->firstAncestorOrThisOfType(proj);
|
2018-09-11 05:41:45 -05:00
|
|
|
if (proj) proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
2017-05-10 09:52:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-19 06:47:44 -05:00
|
|
|
void RimFishboneWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
2017-05-10 09:52:51 -05:00
|
|
|
{
|
2017-05-12 03:49:48 -05:00
|
|
|
uiOrdering.add(&m_displayCoordinates);
|
2017-05-10 10:37:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-19 06:47:44 -05:00
|
|
|
QString RimFishboneWellPath::displayCoordinates() const
|
2017-05-10 10:37:50 -05:00
|
|
|
{
|
|
|
|
CVF_ASSERT(m_coordinates().size() == m_measuredDepths().size());
|
|
|
|
|
2017-05-11 04:19:55 -05:00
|
|
|
QStringList displayValues;
|
2017-05-10 10:37:50 -05:00
|
|
|
|
|
|
|
displayValues.push_back(QString("X\tY\tZ\tMD"));
|
|
|
|
for (size_t i = 0; i < m_coordinates().size(); i++)
|
|
|
|
{
|
|
|
|
const cvf::Vec3d& coords = m_coordinates()[i];
|
|
|
|
const double& measuredDepth = m_measuredDepths()[i];
|
2017-05-12 02:28:21 -05:00
|
|
|
displayValues.push_back(QString("%1\t%2\t%3\t%4").arg(coords.x(), 0, 'f', 2).arg(coords.y(), 0, 'f', 2).arg(coords.z(), 0, 'f', 2).arg(measuredDepth, 0, 'f', 2));
|
2017-05-10 10:37:50 -05:00
|
|
|
}
|
|
|
|
|
2017-05-11 04:19:55 -05:00
|
|
|
return displayValues.join("\n");
|
2017-05-10 09:52:51 -05:00
|
|
|
}
|