2018-03-07 08:12:27 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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 "Rim3dWellLogCurveCollection.h"
|
|
|
|
|
2018-04-17 01:30:06 -05:00
|
|
|
#include "RiaColorTables.h"
|
2018-03-07 08:12:27 -06:00
|
|
|
#include "Rim3dWellLogCurve.h"
|
2018-04-10 03:57:04 -05:00
|
|
|
#include "RimWellPath.h"
|
2018-03-20 05:29:46 -05:00
|
|
|
#include "RimProject.h"
|
2018-03-07 08:12:27 -06:00
|
|
|
|
|
|
|
CAF_PDM_SOURCE_INIT(Rim3dWellLogCurveCollection, "Rim3dWellLogCurveCollection");
|
|
|
|
|
2018-03-22 06:54:31 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
template<>
|
|
|
|
void AppEnum< Rim3dWellLogCurveCollection::PlanePosition >::setUp()
|
|
|
|
{
|
|
|
|
addItem(Rim3dWellLogCurveCollection::ALONG_WELLPATH, "ALONG_WELLPATH", "On One Side of Well Path");
|
|
|
|
addItem(Rim3dWellLogCurveCollection::ON_WELLPATH, "ON_WELLPATH", "On Well Path");
|
|
|
|
setDefault(Rim3dWellLogCurveCollection::ALONG_WELLPATH);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-07 08:12:27 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
Rim3dWellLogCurveCollection::Rim3dWellLogCurveCollection()
|
|
|
|
{
|
|
|
|
CAF_PDM_InitObject("3D Track", ":/WellLogCurve16x16.png", "", "");
|
|
|
|
|
2018-03-20 05:29:46 -05:00
|
|
|
CAF_PDM_InitField(&m_showPlot, "Show3dWellLogCurves", true, "Show 3d Well Log Curves", "", "", "");
|
|
|
|
m_showPlot.uiCapability()->setUiHidden(true);
|
|
|
|
|
2018-03-22 06:54:31 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_planePosition, "PlanePosition", "Plane Position", "", "", "");
|
|
|
|
|
2018-04-17 01:30:06 -05:00
|
|
|
CAF_PDM_InitField(&m_showGrid, "Show3dWellLogGrid", true, "Show Grid", "", "", "");
|
|
|
|
CAF_PDM_InitField(&m_showBackground, "Show3dWellLogBackground", false, "Show Background", "", "", "");
|
2018-03-07 08:12:27 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_3dWellLogCurves, "ArrayOf3dWellLogCurves", "", "", "", "");
|
|
|
|
m_3dWellLogCurves.uiCapability()->setUiTreeHidden(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
Rim3dWellLogCurveCollection::~Rim3dWellLogCurveCollection()
|
|
|
|
{
|
|
|
|
m_3dWellLogCurves.deleteAllChildObjects();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool Rim3dWellLogCurveCollection::has3dWellLogCurves() const
|
|
|
|
{
|
|
|
|
return !m_3dWellLogCurves.empty();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim3dWellLogCurveCollection::add3dWellLogCurve(Rim3dWellLogCurve* curve)
|
|
|
|
{
|
|
|
|
if (curve)
|
|
|
|
{
|
2018-04-17 01:38:13 -05:00
|
|
|
size_t index = m_3dWellLogCurves.size();
|
|
|
|
curve->setColor(RiaColorTables::wellLogPlotPaletteColors().cycledColor3f(index));
|
2018-03-07 08:12:27 -06:00
|
|
|
m_3dWellLogCurves.push_back(curve);
|
|
|
|
}
|
|
|
|
}
|
2018-03-08 01:07:13 -06:00
|
|
|
|
2018-04-10 03:57:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim3dWellLogCurveCollection::remove3dWellLogCurve(Rim3dWellLogCurve* curve)
|
|
|
|
{
|
|
|
|
m_3dWellLogCurves.removeChildObject(curve);
|
|
|
|
}
|
|
|
|
|
2018-04-17 01:30:06 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool Rim3dWellLogCurveCollection::isShowingPlot() const
|
|
|
|
{
|
|
|
|
return m_showPlot;
|
|
|
|
}
|
|
|
|
|
2018-03-20 05:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-03-22 05:45:11 -05:00
|
|
|
bool Rim3dWellLogCurveCollection::isShowingGrid() const
|
2018-03-20 05:29:46 -05:00
|
|
|
{
|
|
|
|
return m_showGrid;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-04-17 01:30:06 -05:00
|
|
|
bool Rim3dWellLogCurveCollection::isShowingBackground() const
|
2018-03-20 05:29:46 -05:00
|
|
|
{
|
2018-04-17 01:30:06 -05:00
|
|
|
return m_showBackground;
|
2018-03-20 05:29:46 -05:00
|
|
|
}
|
|
|
|
|
2018-04-17 01:30:06 -05:00
|
|
|
|
2018-03-22 06:54:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-04-17 01:30:06 -05:00
|
|
|
///
|
2018-03-22 06:54:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
Rim3dWellLogCurveCollection::PlanePosition Rim3dWellLogCurveCollection::planePosition() const
|
|
|
|
{
|
|
|
|
return m_planePosition();
|
|
|
|
}
|
|
|
|
|
2018-03-09 06:15:01 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<Rim3dWellLogCurve*> Rim3dWellLogCurveCollection::vectorOf3dWellLogCurves() const
|
|
|
|
{
|
|
|
|
std::vector<Rim3dWellLogCurve*> curves;
|
|
|
|
for (auto& wellLogCurve : m_3dWellLogCurves)
|
|
|
|
{
|
|
|
|
curves.push_back(wellLogCurve);
|
|
|
|
}
|
|
|
|
|
|
|
|
return curves;
|
|
|
|
}
|
|
|
|
|
2018-04-10 03:57:04 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim3dWellLogCurveCollection::redrawAffectedViewsAndEditors()
|
|
|
|
{
|
|
|
|
RimProject* proj = nullptr;
|
|
|
|
this->firstAncestorOrThisOfType(proj);
|
|
|
|
if (proj)
|
|
|
|
{
|
|
|
|
proj->createDisplayModelAndRedrawAllViews();
|
|
|
|
}
|
|
|
|
RimWellPath* path = nullptr;
|
|
|
|
this->firstAncestorOrThisOfType(path);
|
|
|
|
if (path)
|
|
|
|
{
|
|
|
|
path->updateConnectedEditors();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-20 05:29:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim3dWellLogCurveCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
|
|
|
{
|
|
|
|
RimProject* proj;
|
|
|
|
this->firstAncestorOrThisOfTypeAsserted(proj);
|
|
|
|
proj->createDisplayModelAndRedrawAllViews();
|
|
|
|
}
|
|
|
|
|
2018-03-08 01:07:13 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
caf::PdmFieldHandle* Rim3dWellLogCurveCollection::objectToggleField()
|
|
|
|
{
|
2018-03-20 05:29:46 -05:00
|
|
|
return &m_showPlot;
|
2018-03-08 01:07:13 -06:00
|
|
|
}
|
2018-03-22 06:54:31 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void Rim3dWellLogCurveCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
|
|
|
{
|
2018-04-17 01:30:06 -05:00
|
|
|
caf::PdmUiGroup* settingsGroup = uiOrdering.addNewGroup("Draw Plane Settings");
|
2018-03-22 06:54:31 -05:00
|
|
|
|
|
|
|
settingsGroup->add(&m_planePosition);
|
2018-04-17 01:30:06 -05:00
|
|
|
|
|
|
|
caf::PdmUiGroup* appearanceSettingsGroup = uiOrdering.addNewGroup("Draw Plane Appearance");
|
|
|
|
appearanceSettingsGroup->add(&m_showGrid);
|
|
|
|
appearanceSettingsGroup->add(&m_showBackground);
|
|
|
|
|
2018-03-22 06:54:31 -05:00
|
|
|
}
|