Files
ResInsight/ApplicationCode/ProjectDataModel/RimWellPathFracture.cpp

93 lines
3.4 KiB
C++
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- 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 "RimWellPathFracture.h"
2017-01-19 13:35:07 +01:00
#include "RigWellPath.h"
#include "RimProject.h"
#include "RimWellPath.h"
CAF_PDM_SOURCE_INIT(RimWellPathFracture, "WellPathFracture");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathFracture::RimWellPathFracture(void)
{
2017-01-05 14:57:04 +01:00
CAF_PDM_InitObject("Fracture", ":/FractureSymbol16x16.png", "", "");
2017-01-19 13:35:07 +01:00
CAF_PDM_InitField( &measuredDepth, "MeasuredDepth", 0.0f, "Measured Depth Location", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathFracture::~RimWellPathFracture()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
2017-01-19 10:43:23 +01:00
RimFracture::fieldChangedByUi(changedField, oldValue, newValue);
if (changedField == &measuredDepth)
{
2017-01-19 10:43:23 +01:00
cvf::Vec3d positionAtWellpath = cvf::Vec3d::ZERO;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
if (!objHandle) return;
RimWellPath* wellPath = nullptr;
objHandle->firstAncestorOrThisOfType(wellPath);
if (!wellPath) return;
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(measuredDepth);
2017-01-19 10:43:23 +01:00
this->setAnchorPosition(positionAtWellpath);
2017-01-19 10:43:23 +01:00
RimProject* proj;
this->firstAncestorOrThisOfType(proj);
if (proj) proj->createDisplayModelAndRedrawAllViews();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
2017-01-19 13:35:07 +01:00
uiOrdering.add(&name);
2017-01-19 10:43:23 +01:00
uiOrdering.add(&measuredDepth);
2017-01-19 13:35:07 +01:00
caf::PdmUiGroup* geometryGroup = uiOrdering.addNewGroup("Properties");
geometryGroup->add(&azimuth);
geometryGroup->add(&m_fractureTemplate);
caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup("Fracture Center Info");
fractureCenterGroup->add(&m_uiAnchorPosition);
fractureCenterGroup->add(&m_displayIJK);
}