diff --git a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake index 0851d05385..3cbf70fe39 100644 --- a/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationCode/ProjectDataModel/CMakeLists_files.cmake @@ -25,6 +25,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.h ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h ${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.h ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.h @@ -134,6 +135,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp ${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.cpp diff --git a/ApplicationCode/ProjectDataModel/RimWellPathTarget.cpp b/ApplicationCode/ProjectDataModel/RimWellPathTarget.cpp new file mode 100644 index 0000000000..6a85c7830d --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimWellPathTarget.cpp @@ -0,0 +1,107 @@ +#include "RimWellPathTarget.h" + +CAF_PDM_SOURCE_INIT(RimWellPathTarget, "WellPathTarget"); + +namespace caf +{ +template<> +void caf::AppEnum< RimWellPathTarget::TargetTypeEnum >::setUp() +{ + addItem(RimWellPathTarget::POINT_AND_TANGENT, "POINT_AND_TANGENT", "Point and Tangent"); + addItem(RimWellPathTarget::POINT, "POINT", "Point"); + setDefault(RimWellPathTarget::POINT_AND_TANGENT); +} +} +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPathTarget::RimWellPathTarget() + : m_targetType(POINT_AND_TANGENT) + , m_targetPoint(cvf::Vec3d::ZERO) + , m_azimuth(0.0) + , m_inclination(0.0) +{ + + CAF_PDM_InitFieldNoDefault(&m_targetType, "TargetType", "Type", "", "", ""); + CAF_PDM_InitFieldNoDefault(&m_targetPoint, "TargetPoint", "Point", "", "", ""); + CAF_PDM_InitField(&m_azimuth, "Azimuth", 0.0, "Azimuth", "", "", ""); + CAF_PDM_InitField(&m_inclination, "Inclination", 0.0, "Inclination", "", "", ""); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPathTarget::~RimWellPathTarget() +{ + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathTarget::setAsPointTarget(const cvf::Vec3d& point) +{ + m_targetType = POINT; + m_targetPoint = point; + m_azimuth = 0.0; + m_inclination = 0.0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathTarget::setAsPointAndTangentTarget(const cvf::Vec3d& point, + double azimuth, + double inclination) +{ + m_targetType = POINT_AND_TANGENT; + m_targetPoint = point; + m_azimuth = azimuth; + m_inclination = inclination; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPathTarget::TargetTypeEnum RimWellPathTarget::targetType() +{ + return m_targetType(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3d RimWellPathTarget::targetPoint() +{ + return m_targetPoint(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellPathTarget::azimuth() +{ + if ( m_targetType() == POINT_AND_TANGENT ) + { + return m_azimuth; + } + else + { + return std::numeric_limits::infinity(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellPathTarget::inclination() +{ + if ( m_targetType() == POINT_AND_TANGENT ) + { + return m_inclination; + } + else + { + return std::numeric_limits::infinity(); + } +} diff --git a/ApplicationCode/ProjectDataModel/RimWellPathTarget.h b/ApplicationCode/ProjectDataModel/RimWellPathTarget.h new file mode 100644 index 0000000000..51e2f5bcfd --- /dev/null +++ b/ApplicationCode/ProjectDataModel/RimWellPathTarget.h @@ -0,0 +1,50 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2018 - equinor +// +// 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "cafPdmObject.h" + +#include "cvfBase.h" +#include "cvfVector3.h" +#include "cafAppEnum.h" +#include "cafPdmField.h" +#include "cafPdmCoreVec3d.h" + +class RimWellPathTarget : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; +public: + RimWellPathTarget(); + ~RimWellPathTarget(); + + void setAsPointTarget(const cvf::Vec3d& point); + void setAsPointAndTangentTarget(const cvf::Vec3d& point, double azimuth, double inclination); + + enum TargetTypeEnum { POINT_AND_TANGENT, POINT }; + TargetTypeEnum targetType(); + cvf::Vec3d targetPoint(); + double azimuth(); + double inclination(); + +private: + caf::PdmField > m_targetType; + caf::PdmField m_targetPoint; + caf::PdmField m_azimuth; + caf::PdmField m_inclination; +}; +