diff --git a/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp b/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp index efa8fc3676..7b06fb0e9a 100644 --- a/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp @@ -89,7 +89,10 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurvesToModel(cvf::ModelBasicList* if (m_wellPath.isNull()) return; if (!m_wellPath->rim3dWellLogCurveCollection()) return; if (m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves().empty()) return; - + + const Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection(); + Rim3dWellLogCurveCollection::PlanePosition planePosition = curveCollection->planePosition(); + for (Rim3dWellLogCurve* rim3dWellLogCurve : m_wellPath->rim3dWellLogCurveCollection()->vectorOf3dWellLogCurves()) { if (!rim3dWellLogCurve->isShowingCurve()) continue; @@ -98,8 +101,14 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurvesToModel(cvf::ModelBasicList* std::vector resultMds; rim3dWellLogCurve->curveValuesAndMds(&resultValues, &resultMds); - cvf::ref curveDrawable = m_3dWellLogCurveGeometryGenerator->createCurveLine( - displayCoordTransform, wellPathClipBoundingBox, resultValues, resultMds, planeAngle(rim3dWellLogCurve->drawPlane()), wellPathCenterToPlotStartOffset(), planeWidth()); + cvf::ref curveDrawable = + m_3dWellLogCurveGeometryGenerator->createCurveLine(displayCoordTransform, + wellPathClipBoundingBox, + resultValues, + resultMds, + planeAngle(rim3dWellLogCurve->drawPlane()), + wellPathCenterToPlotStartOffset(planePosition), + planeWidth()); if (curveDrawable.isNull() || !curveDrawable->boundingBox().isValid()) { @@ -154,19 +163,26 @@ double Riv3dWellLogPlanePartMgr::planeAngle(const Rim3dWellLogCurve::DrawPlane& } //-------------------------------------------------------------------------------------------------- -/// +/// //-------------------------------------------------------------------------------------------------- -double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset() const +double Riv3dWellLogPlanePartMgr::wellPathCenterToPlotStartOffset(Rim3dWellLogCurveCollection::PlanePosition planePosition) const { if (!m_gridView) return 0; double cellSize = m_gridView->ownerCase()->characteristicCellSize(); - return -cellSize * 2; + if (planePosition == Rim3dWellLogCurveCollection::ALONG_WELLPATH) + { + return m_wellPath->wellPathRadius(cellSize) * 2; + } + else + { + return -cellSize * 2; + } } //-------------------------------------------------------------------------------------------------- -/// +/// //-------------------------------------------------------------------------------------------------- double Riv3dWellLogPlanePartMgr::planeWidth() const { @@ -177,7 +193,6 @@ double Riv3dWellLogPlanePartMgr::planeWidth() const return cellSize * 4; } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -187,13 +202,21 @@ void Riv3dWellLogPlanePartMgr::appendGridToModel(cvf::ModelBasicList* const Rim3dWellLogCurve::DrawPlane& drawPlane, double gridIntervalSize) { + const Rim3dWellLogCurveCollection* curveCollection = m_wellPath->rim3dWellLogCurveCollection(); + Rim3dWellLogCurveCollection::PlanePosition planePosition = curveCollection->planePosition(); + caf::MeshEffectGenerator meshEffectGen(cvf::Color3f(0.4f, 0.4f, 0.4f)); - cvf::ref gridHorizontalDrawable = m_3dWellLogCurveGeometryGenerator->createGrid( - displayCoordTransform, wellPathClipBoundingBox, planeAngle(drawPlane), wellPathCenterToPlotStartOffset(), planeWidth(), gridIntervalSize); + cvf::ref gridHorizontalDrawable = + m_3dWellLogCurveGeometryGenerator->createGrid(displayCoordTransform, + wellPathClipBoundingBox, + planeAngle(drawPlane), + wellPathCenterToPlotStartOffset(planePosition), + planeWidth(), + gridIntervalSize); cvf::ref effect = meshEffectGen.generateCachedEffect(); - cvf::ref part = createPart(gridHorizontalDrawable.p(), effect.p()); + cvf::ref part = createPart(gridHorizontalDrawable.p(), effect.p()); if (part.notNull()) { diff --git a/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.h b/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.h index 9a5c51b4f7..fcbe95854a 100644 --- a/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.h +++ b/ApplicationCode/ModelVisualization/Riv3dWellLogPlanePartMgr.h @@ -22,6 +22,7 @@ #include "cvfObject.h" #include "Rim3dWellLogCurve.h" +#include "Rim3dWellLogCurveCollection.h" #include "cafPdmPointer.h" @@ -68,7 +69,7 @@ private: static double planeAngle(const Rim3dWellLogCurve::DrawPlane& drawPlane); - double wellPathCenterToPlotStartOffset() const; + double wellPathCenterToPlotStartOffset(Rim3dWellLogCurveCollection::PlanePosition planePosition) const; double planeWidth() const; private: diff --git a/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.cpp index f85a1e8169..4ad7277a5c 100644 --- a/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.cpp @@ -23,6 +23,17 @@ CAF_PDM_SOURCE_INIT(Rim3dWellLogCurveCollection, "Rim3dWellLogCurveCollection"); +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); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -35,6 +46,8 @@ Rim3dWellLogCurveCollection::Rim3dWellLogCurveCollection() CAF_PDM_InitField(&m_showGrid, "Show3dWellLogGrid", true, "Show Grid", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_planePosition, "PlanePosition", "Plane Position", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_3dWellLogCurves, "ArrayOf3dWellLogCurves", "", "", "", ""); m_3dWellLogCurves.uiCapability()->setUiTreeHidden(true); } @@ -82,6 +95,14 @@ bool Rim3dWellLogCurveCollection::isShowingPlot() const return m_showPlot; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +Rim3dWellLogCurveCollection::PlanePosition Rim3dWellLogCurveCollection::planePosition() const +{ + return m_planePosition(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -113,3 +134,14 @@ caf::PdmFieldHandle* Rim3dWellLogCurveCollection::objectToggleField() { return &m_showPlot; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void Rim3dWellLogCurveCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) +{ + caf::PdmUiGroup* settingsGroup = uiOrdering.addNewGroup("Track Settings"); + + settingsGroup->add(&m_showGrid); + settingsGroup->add(&m_planePosition); +} diff --git a/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.h b/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.h index b8acdb99c8..cc518cbf1f 100644 --- a/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.h +++ b/ApplicationCode/ProjectDataModel/Completions/Rim3dWellLogCurveCollection.h @@ -18,6 +18,7 @@ #pragma once +#include "cafAppEnum.h" #include "cafPdmChildArrayField.h" #include "cafPdmField.h" #include "cafPdmObject.h" @@ -32,6 +33,13 @@ class Rim3dWellLogCurveCollection : public caf::PdmObject { CAF_PDM_HEADER_INIT; +public: + enum PlanePosition + { + ALONG_WELLPATH, + ON_WELLPATH + }; + public: Rim3dWellLogCurveCollection(); virtual ~Rim3dWellLogCurveCollection(); @@ -42,14 +50,20 @@ public: bool isShowingGrid() const; bool isShowingPlot() const; + PlanePosition planePosition() const; + std::vector vectorOf3dWellLogCurves() const; private: - virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; + virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; virtual caf::PdmFieldHandle* objectToggleField() override; + virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; private: caf::PdmField m_showPlot; + caf::PdmField m_showGrid; + caf::PdmField> m_planePosition; + caf::PdmChildArrayField m_3dWellLogCurves; };