From ad5c0cebd7bb3eca27d5647ee48840552786e5c7 Mon Sep 17 00:00:00 2001 From: Philippe Verney Date: Fri, 26 Jan 2024 14:30:55 +0100 Subject: [PATCH] Make LocalCrs an EML2 class to ease RESQML2.2 upgrade Add Well head elevation support to WITSML2.1 Add CRS to WITSML2.1 elevations Upgrade some int32 to int64 (in Activity* classes for instance) --- CMakeLists.txt | 4 +- cmake/swigCsInclude.i | 16 +- cmake/swigJavaInclude.i | 16 +- example/example.cpp | 52 +- src/common/AbstractObject.cpp | 63 +- src/common/AbstractObject.h | 12 +- src/common/DataObjectRepository.cpp | 167 +- src/common/DataObjectRepository.h | 59 +- src/{resqml2 => eml2}/AbstractLocal3dCrs.cpp | 119 +- src/{resqml2 => eml2}/AbstractLocal3dCrs.h | 58 +- src/eml2/Activity.cpp | 10 +- src/eml2/Activity.h | 22 +- src/eml2/ActivityTemplate.cpp | 2 +- src/eml2/ActivityTemplate.h | 20 +- src/eml2/CMakeLists.txt | 2 + src/eml2_3/Activity.cpp | 120 +- src/eml2_3/Activity.h | 52 +- src/eml2_3/ActivityTemplate.cpp | 61 +- src/eml2_3/ActivityTemplate.h | 22 +- src/eml2_3/CMakeLists.txt | 10 +- src/eml2_3/LocalEngineering2dCrs.cpp | 205 ++ src/eml2_3/LocalEngineering2dCrs.h | 201 ++ src/eml2_3/LocalEngineeringCompoundCrs.cpp | 298 +++ src/eml2_3/LocalEngineeringCompoundCrs.h | 403 +++ src/eml2_3/VerticalCrs.cpp | 99 + src/eml2_3/VerticalCrs.h | 132 + src/resqml2/AbstractColorMap.cpp | 16 +- src/resqml2/AbstractColorMap.h | 18 +- src/resqml2/AbstractFeatureInterpretation.cpp | 12 +- src/resqml2/AbstractProperty.cpp | 12 +- src/resqml2/AbstractProperty.h | 5 +- src/resqml2/AbstractRepresentation.cpp | 18 +- src/resqml2/AbstractRepresentation.h | 7 +- src/resqml2/CMakeLists.txt | 4 - src/resqml2/ContinuousColorMap.cpp | 90 +- src/resqml2/ContinuousColorMap.h | 38 +- src/resqml2/DiscreteColorMap.cpp | 21 +- src/resqml2/DiscreteColorMap.h | 8 +- src/resqml2/Grid2dRepresentation.cpp | 8 +- src/resqml2/Grid2dRepresentation.h | 6 +- src/resqml2/IjkGridExplicitRepresentation.h | 4 +- src/resqml2/IjkGridLatticeRepresentation.cpp | 5 +- src/resqml2/IjkGridLatticeRepresentation.h | 2 +- .../IjkGridParametricRepresentation.cpp | 14 +- src/resqml2/IjkGridParametricRepresentation.h | 14 +- src/resqml2/LocalDepth3dCrs.h | 61 - src/resqml2/LocalTime3dCrs.h | 74 - src/resqml2/MdDatum.cpp | 8 +- src/resqml2/MdDatum.h | 9 +- .../NonSealedSurfaceFrameworkRepresentation.h | 2 +- src/resqml2/PlaneSetRepresentation.h | 4 +- src/resqml2/PointSetRepresentation.h | 2 +- src/resqml2/PointsProperty.cpp | 3 +- src/resqml2/PolylineRepresentation.h | 2 +- src/resqml2/PolylineSetRepresentation.h | 4 +- .../SeismicWellboreFrameRepresentation.cpp | 5 +- src/resqml2/StreamlinesRepresentation.h | 2 +- src/resqml2/TriangulatedSetRepresentation.h | 2 +- .../UnstructuredGridRepresentation.cpp | 17 +- src/resqml2/UnstructuredGridRepresentation.h | 16 +- .../WellboreTrajectoryRepresentation.cpp | 11 +- .../WellboreTrajectoryRepresentation.h | 8 +- src/resqml2_0_1/Activity.cpp | 168 +- src/resqml2_0_1/Activity.h | 26 +- src/resqml2_0_1/ActivityTemplate.cpp | 87 +- src/resqml2_0_1/ActivityTemplate.h | 24 +- .../DeviationSurveyRepresentation.cpp | 11 +- src/resqml2_0_1/Grid2dRepresentation.cpp | 19 +- src/resqml2_0_1/Grid2dRepresentation.h | 12 +- .../GridConnectionSetRepresentation.cpp | 2 +- .../IjkGridExplicitRepresentation.cpp | 6 +- .../IjkGridExplicitRepresentation.h | 4 +- .../IjkGridLatticeRepresentation.cpp | 4 +- .../IjkGridLatticeRepresentation.h | 2 +- .../IjkGridParametricRepresentation.cpp | 10 +- .../IjkGridParametricRepresentation.h | 8 +- src/resqml2_0_1/LocalDepth3dCrs.cpp | 28 +- src/resqml2_0_1/LocalDepth3dCrs.h | 108 +- src/resqml2_0_1/LocalTime3dCrs.cpp | 36 +- src/resqml2_0_1/LocalTime3dCrs.h | 101 +- src/resqml2_0_1/MdDatum.cpp | 10 +- src/resqml2_0_1/MdDatum.h | 4 +- ...onSealedSurfaceFrameworkRepresentation.cpp | 4 +- .../NonSealedSurfaceFrameworkRepresentation.h | 2 +- src/resqml2_0_1/PlaneSetRepresentation.cpp | 6 +- src/resqml2_0_1/PlaneSetRepresentation.h | 4 +- src/resqml2_0_1/PointSetRepresentation.cpp | 4 +- src/resqml2_0_1/PointSetRepresentation.h | 2 +- src/resqml2_0_1/PointsProperty.cpp | 4 +- src/resqml2_0_1/PointsProperty.h | 4 +- src/resqml2_0_1/PolylineRepresentation.cpp | 4 +- src/resqml2_0_1/PolylineRepresentation.h | 2 +- src/resqml2_0_1/PolylineSetRepresentation.cpp | 6 +- src/resqml2_0_1/PolylineSetRepresentation.h | 4 +- src/resqml2_0_1/StreamlinesRepresentation.cpp | 2 +- src/resqml2_0_1/StreamlinesRepresentation.h | 2 +- .../TriangulatedSetRepresentation.cpp | 4 +- .../TriangulatedSetRepresentation.h | 2 +- .../UnstructuredGridRepresentation.cpp | 6 +- .../UnstructuredGridRepresentation.h | 4 +- .../WellboreTrajectoryRepresentation.cpp | 8 +- .../WellboreTrajectoryRepresentation.h | 6 +- src/resqml2_2/Grid2dRepresentation.cpp | 14 +- src/resqml2_2/Grid2dRepresentation.h | 12 +- .../IjkGridExplicitRepresentation.cpp | 6 +- src/resqml2_2/IjkGridExplicitRepresentation.h | 4 +- .../IjkGridLatticeRepresentation.cpp | 4 +- src/resqml2_2/IjkGridLatticeRepresentation.h | 2 +- .../IjkGridParametricRepresentation.cpp | 10 +- .../IjkGridParametricRepresentation.h | 8 +- ...onSealedSurfaceFrameworkRepresentation.cpp | 4 +- .../NonSealedSurfaceFrameworkRepresentation.h | 2 +- src/resqml2_2/PlaneSetRepresentation.cpp | 6 +- src/resqml2_2/PlaneSetRepresentation.h | 4 +- src/resqml2_2/PointSetRepresentation.cpp | 4 +- src/resqml2_2/PointSetRepresentation.h | 2 +- src/resqml2_2/PointsProperty.cpp | 2 +- src/resqml2_2/PointsProperty.h | 2 +- src/resqml2_2/PolylineRepresentation.cpp | 4 +- src/resqml2_2/PolylineRepresentation.h | 2 +- src/resqml2_2/PolylineSetRepresentation.cpp | 6 +- src/resqml2_2/PolylineSetRepresentation.h | 4 +- .../SeismicWellboreFrameRepresentation.cpp | 9 +- .../SeismicWellboreFrameRepresentation.h | 6 +- src/resqml2_2/StreamlinesRepresentation.cpp | 4 +- src/resqml2_2/StreamlinesRepresentation.h | 2 +- .../TriangulatedSetRepresentation.cpp | 4 +- src/resqml2_2/TriangulatedSetRepresentation.h | 2 +- .../UnstructuredGridRepresentation.cpp | 6 +- .../UnstructuredGridRepresentation.h | 4 +- .../WellboreTrajectoryRepresentation.cpp | 8 +- .../WellboreTrajectoryRepresentation.h | 6 +- src/witsml2/Well.cpp | 24 + src/witsml2/Well.h | 97 +- src/witsml2_1/Well.cpp | 109 +- src/witsml2_1/Well.h | 66 +- swig/swigEml2Include.i | 807 +++++- swig/swigEml2_3Include.i | 20 + swig/swigModule.i | 2343 ++++++++++++++++- swig/swigResqml2Include.i | 230 +- swig/swigResqml2_0_1Include.i | 4 +- swig/swigWitsml2Include.i | 66 +- 142 files changed, 5879 insertions(+), 1547 deletions(-) rename src/{resqml2 => eml2}/AbstractLocal3dCrs.cpp (57%) rename src/{resqml2 => eml2}/AbstractLocal3dCrs.h (84%) create mode 100644 src/eml2_3/LocalEngineering2dCrs.cpp create mode 100644 src/eml2_3/LocalEngineering2dCrs.h create mode 100644 src/eml2_3/LocalEngineeringCompoundCrs.cpp create mode 100644 src/eml2_3/LocalEngineeringCompoundCrs.h create mode 100644 src/eml2_3/VerticalCrs.cpp create mode 100644 src/eml2_3/VerticalCrs.h delete mode 100644 src/resqml2/LocalDepth3dCrs.h delete mode 100644 src/resqml2/LocalTime3dCrs.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ea0079de8..7911dcc57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,9 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) # version mechanism set (Fesapi_VERSION_MAJOR 2) -set (Fesapi_VERSION_MINOR 9) +set (Fesapi_VERSION_MINOR 10) set (Fesapi_VERSION_PATCH 0) -set (Fesapi_VERSION_TWEAK 1) +set (Fesapi_VERSION_TWEAK 0) set (Fesapi_VERSION ${Fesapi_VERSION_MAJOR}.${Fesapi_VERSION_MINOR}.${Fesapi_VERSION_PATCH}.${Fesapi_VERSION_TWEAK}) diff --git a/cmake/swigCsInclude.i b/cmake/swigCsInclude.i index c5f6b6e76..269d9d786 100644 --- a/cmake/swigCsInclude.i +++ b/cmake/swigCsInclude.i @@ -61,6 +61,8 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig HORIZONINTERPRETATION, IJKGRIDREPRESENTATION, LOCALDEPTH3DCRS, + LOCALENGINEERING2DCRS, + LOCALENGINEERINGCOMPOUNDCRS, LOCALTIME3DCRS, LOG, MDDATUM, @@ -103,6 +105,7 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig TRIANGULATEDSETREPRESENTATION, TRUNCATEDIJKGRIDREPRESENTATION, UNSTRUCTUREDGRIDREPRESENTATION, + VERTICALCRS, WELL, WELLBORE, WELLBORECOMPLETION, @@ -897,14 +900,14 @@ ${COMMENT_END} case DataObjectName.GENERICFEATUREINTERPRETATION : return resqml2_instantiateGenericFeatureInterpretation(cPtr, owner); case DataObjectName.GEOLOGICUNITFEATURE : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.GeologicUnitFeature(cPtr, owner); case DataObjectName.STRATIGRAPHICOCCURRENCEINTERPRETATION : return resqml2_instantiateStratigraphicOccurrenceInterpretation(cPtr, owner); -${COMMENT_START} case DataObjectName.GRAPHICALINFORMATIONSET : return new F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.GraphicalInformationSet(cPtr, owner); -${COMMENT_END} case DataObjectName.GRID2DREPRESENTATION : return resqml2_instantiateGrid2dRepresentation(cPtr, owner); case DataObjectName.GRIDCONNECTIONSETREPRESENTATION : return resqml2_instantiateGridConnectionSetRepresentation(cPtr, owner); case DataObjectName.HORIZONINTERPRETATION : return resqml2_instantiateHorizonInterpretation(cPtr, owner); case DataObjectName.IJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner); case DataObjectName.LOCALDEPTH3DCRS : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.LocalDepth3dCrs(cPtr, owner); + case DataObjectName.LOCALENGINEERING2DCRS : return new F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.LocalEngineering2dCrs(cPtr, owner); + case DataObjectName.LOCALENGINEERINGCOMPOUNDCRS : return F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.LocalEngineeringCompoundCrs(cPtr, owner) case DataObjectName.LOCALTIME3DCRS : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.LocalTime3dCrs(cPtr, owner); case DataObjectName.LOG : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.Log(cPtr, owner); case DataObjectName.MDDATUM : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.MdDatum(cPtr, owner); @@ -952,6 +955,7 @@ ${COMMENT_END} case DataObjectName.TRIANGULATEDSETREPRESENTATION : return resqml2_instantiateTriangulatedSetRepresentation(cPtr, owner); case DataObjectName.TRUNCATEDIJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner); case DataObjectName.UNSTRUCTUREDGRIDREPRESENTATION : return resqml2_instantiateUnstructuredGridRepresentation(cPtr, owner); + case DataObjectName.VERTICALCRS : return new F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.VerticalCrs(cPtr, owner); case DataObjectName.WELL : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.Well(cPtr, owner); case DataObjectName.WELLBORE : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.Wellbore(cPtr, owner); case DataObjectName.WELLBORECOMPLETION : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.WellboreCompletion(cPtr, owner); @@ -979,10 +983,8 @@ namespace COMMON_NS namespace EML2_NS { - %typemap(csout, excode=SWIGEXCODE) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries* -#ifdef WITH_RESQML2_2 + %typemap(csout, excode=SWIGEXCODE) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries*, AbstractLocal3dCrs* ,GraphicalInformationSet* -#endif { global::System.IntPtr cPtr = $imcall; $csclassname ret = ($csclassname) $modulePINVOKE.eml2_instantiateConcreteObject(cPtr, $owner);$excode @@ -1002,7 +1004,7 @@ namespace WITSML2_NS namespace RESQML2_NS { - %typemap(csout, excode=SWIGEXCODE) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*, AbstractLocal3dCrs*, + %typemap(csout, excode=SWIGEXCODE) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*, AbstractProperty*, AbstractValuesProperty*, AbstractIjkGridRepresentation*, AbstractStratigraphicOrganizationInterpretation*, #ifdef WITH_RESQML2_2 @@ -1042,8 +1044,6 @@ namespace RESQML2_NS IjkGridLatticeRepresentation*, IjkGridNoGeometryRepresentation*, IjkGridParametricRepresentation*, - LocalDepth3dCrs*, - LocalTime3dCrs*, MdDatum*, Model*, NonSealedSurfaceFrameworkRepresentation*, diff --git a/cmake/swigJavaInclude.i b/cmake/swigJavaInclude.i index 6478b0134..1e4b5814a 100644 --- a/cmake/swigJavaInclude.i +++ b/cmake/swigJavaInclude.i @@ -61,6 +61,8 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig HORIZONINTERPRETATION, IJKGRIDREPRESENTATION, LOCALDEPTH3DCRS, + LOCALENGINEERING2DCRS, + LOCALENGINEERINGCOMPOUNDCRS, LOCALTIME3DCRS, LOG, MDDATUM, @@ -103,6 +105,7 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig TRIANGULATEDSETREPRESENTATION, TRUNCATEDIJKGRIDREPRESENTATION, UNSTRUCTUREDGRIDREPRESENTATION, + VERTICALCRS, WELL, WELLBORE, WELLBORECOMPLETION, @@ -897,14 +900,14 @@ ${COMMENT_END} case GENERICFEATUREINTERPRETATION : return resqml2_instantiateGenericFeatureInterpretation(cPtr, owner); case GEOLOGICUNITFEATURE : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_GeologicUnitFeature(cPtr, owner); case STRATIGRAPHICOCCURRENCEINTERPRETATION : return resqml2_instantiateStratigraphicOccurrenceInterpretation(cPtr, owner); -${COMMENT_START} case GRAPHICALINFORMATIONSET : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_GraphicalInformationSet(cPtr, owner); -${COMMENT_END} case GRID2DREPRESENTATION : return resqml2_instantiateGrid2dRepresentation(cPtr, owner); case GRIDCONNECTIONSETREPRESENTATION : return resqml2_instantiateGridConnectionSetRepresentation(cPtr, owner); case HORIZONINTERPRETATION : return resqml2_instantiateHorizonInterpretation(cPtr, owner); case IJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner); case LOCALDEPTH3DCRS : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_LocalDepth3dCrs(cPtr, owner); + case LOCALENGINEERING2DCRS : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_LocalEngineering2dCrs(cPtr, owner); + case LOCALENGINEERINGCOMPOUNDCRS : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_LocalEngineeringCompoundCrs(cPtr, owner); case LOCALTIME3DCRS : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_LocalTime3dCrs(cPtr, owner); case LOG : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_Log(cPtr, owner); case MDDATUM : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_MdDatum(cPtr, owner); @@ -952,6 +955,7 @@ ${COMMENT_END} case TRIANGULATEDSETREPRESENTATION : return resqml2_instantiateTriangulatedSetRepresentation(cPtr, owner); case TRUNCATEDIJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner); case UNSTRUCTUREDGRIDREPRESENTATION : return resqml2_instantiateUnstructuredGridRepresentation(cPtr, owner); + case VERTICALCRS : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_VerticalCrs(cPtr, owner); case WELL : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_Well(cPtr, owner); case WELLBORE : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_Wellbore(cPtr, owner); case WELLBORECOMPLETION : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_WellboreCompletion(cPtr, owner); @@ -983,10 +987,8 @@ namespace COMMON_NS namespace EML2_NS { - %typemap(javaout) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries* -#ifdef WITH_RESQML2_2 + %typemap(javaout) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries*, AbstractLocal3dCrs* ,GraphicalInformationSet* -#endif { long cPtr = $jnicall; $javaclassname ret = ($javaclassname) fesapiJNI.eml2_instantiateConcreteObject(cPtr, $owner); @@ -1014,7 +1016,7 @@ namespace WITSML2_NS namespace RESQML2_NS { - %typemap(javaout) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*, AbstractLocal3dCrs*, + %typemap(javaout) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*, AbstractProperty*, AbstractValuesProperty*, AbstractIjkGridRepresentation*, AbstractStratigraphicOrganizationInterpretation*, #ifdef WITH_RESQML2_2 @@ -1054,8 +1056,6 @@ namespace RESQML2_NS IjkGridLatticeRepresentation*, IjkGridNoGeometryRepresentation*, IjkGridParametricRepresentation*, - LocalDepth3dCrs*, - LocalTime3dCrs*, MdDatum*, Model*, NonSealedSurfaceFrameworkRepresentation*, diff --git a/example/example.cpp b/example/example.cpp index 95b3b50ff..5e7a09ceb 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -109,6 +109,7 @@ under the License. #include "eml2/PropertyKind.h" #include "eml2/TimeSeries.h" +#include "eml2_3/LocalEngineeringCompoundCrs.h" #include "eml2_3/PropertyKind.h" #include "witsml2_1/Well.h" @@ -130,6 +131,8 @@ under the License. using namespace std; +EML2_NS::AbstractLocal3dCrs* local3dCrs = nullptr; +EML2_NS::AbstractLocal3dCrs* localTime3dCrs = nullptr; EML2_NS::PropertyKind* propType1 = nullptr; EML2_NS::PropertyKind* pwls3Length = nullptr; @@ -150,8 +153,6 @@ RESQML2_NS::TriangulatedSetRepresentation* xPlusFrontierRep = nullptr; RESQML2_NS::TriangulatedSetRepresentation* yMinusFrontierRep = nullptr; RESQML2_NS::TriangulatedSetRepresentation* yPlusFrontierRep = nullptr; RESQML2_NS::WellboreTrajectoryRepresentation* w1i1TrajRep = nullptr; -RESQML2_NS::LocalDepth3dCrs* local3dCrs = nullptr; -RESQML2_NS::LocalTime3dCrs* localTime3dCrs = nullptr; RESQML2_NS::WellboreFeature* wellbore1 = nullptr; RESQML2_NS::WellboreInterpretation* wellbore1Interp1 = nullptr; RESQML2_NS::StratigraphicColumnRankInterpretation* stratiColumnRank0 = nullptr; @@ -170,10 +171,20 @@ WITSML2_1_NS::WellboreMarker* witsmlWellboreMarker = nullptr; void serializeWitsmlWells(COMMON_NS::DataObjectRepository * repo) { + EML2_3_NS::LocalEngineeringCompoundCrs* eml23Crs = dynamic_cast(local3dCrs); + if (eml23Crs == nullptr) { + repo->setDefaultStandard(COMMON_NS::DataObjectRepository::EnergisticsStandard::EML2_3); + eml23Crs = static_cast + (repo->createLocalDepth3dCrs("", "Local engineering compound CRS", .0, .0, .0, .0, gsoap_resqml2_0_1::eml20__LengthUom::m, 23031, gsoap_resqml2_0_1::eml20__LengthUom::m, "Unknown", false)); + repo->setDefaultStandard(COMMON_NS::DataObjectRepository::EnergisticsStandard::EML2_0); + } + // WELL witsmlWell = repo->createWell("704a287c-5c24-4af3-a97b-bc6670f4e14f", "Well1", false); witsmlWell->setNameLegal("Legal Name"); - witsmlWell->pushBackLocation(275, 75); + witsmlWell->pushBackLocation(275, 75, eml23Crs->getLocalEngineering2dCrs()); + witsmlWell->setWellheadElevation(15, gsoap_eml2_3::eml23__LengthUom::m, eml23Crs->getVerticalCrs()); + witsmlWell->setGroundElevation(.0, gsoap_eml2_3::eml23__LengthUom::m, eml23Crs->getVerticalCrs()); // WELLBORE witsmlWellbore = repo->createWellbore(witsmlWell, "3bd60188-5688-43df-89bb-935fe86a813f", "Wellbore1", false); @@ -263,7 +274,7 @@ void serializeWells(COMMON_NS::DataObjectRepository * repo, EML2_NS::AbstractHdf wellbore1Interp1 = repo->createWellboreInterpretation(wellbore1, "dc7840fe-e5a3-4b53-a1df-18040bc4d0c0", "Wellbore1 Interp1", false); // Representation - RESQML2_NS::MdDatum* mdInfo = repo->createMdDatum("36e91de5-7833-4b6d-90d0-1d643c0adece", "md Info", local3dCrs, gsoap_eml2_3::eml23__ReferencePointKind::mean_x0020sea_x0020level, 275, 75, 0); + RESQML2_NS::MdDatum* mdInfo = repo->createMdDatum("36e91de5-7833-4b6d-90d0-1d643c0adece", "md Info", local3dCrs, gsoap_eml2_3::eml23__ReferencePointKind::mean_x0020sea_x0020level, 275, 75, 15); //Geometry w1i1TrajRep = repo->createWellboreTrajectoryRepresentation(wellbore1Interp1, "acd2cdcf-bb5d-48da-bd0e-9aeff3e52180", "Wellbore1 Interp1 TrajRep", mdInfo); @@ -2396,7 +2407,7 @@ void deserializeActivity(COMMON_NS::AbstractObject const * resqmlObject) } } else if (activity->isAnIntegerQuantityParameter(paramTitle)) { - vector vals = activity->getIntegerQuantityParameterValue(paramTitle); + vector vals = activity->getIntegerQuantityParameterValue(paramTitle); for (size_t k = 0; k < vals.size(); ++k) { cout << "Integer value : " << vals[k] << endl; } @@ -2414,7 +2425,7 @@ void deserializeActivity(COMMON_NS::AbstractObject const * resqmlObject) } } else { - const vector & paramIndex = activity->getParameterIndexOfTitle(paramTitle); + const vector & paramIndex = activity->getParameterIndexOfTitle(paramTitle); for (size_t k = 0; k < paramIndex.size(); ++k) { if (activity->isAFloatingPointQuantityParameter(paramIndex[k])) cout << "Floating Point value : " << activity->getFloatingPointQuantityParameterValue(paramIndex[k]); @@ -5059,21 +5070,22 @@ void deserialize(const string & inputFile) cout << "m (meter) == " << enumStrMapper.getEnergisticsUnitOfMeasureName(enumStrMapper.getEnergisticsUnitOfMeasure("m")) << endl; cout << "CRS" << endl; - vector depthCrsSet = repo.getLocalDepth3dCrsSet(); - for (size_t i = 0; i < depthCrsSet.size(); ++i) { - cout << "Title is : " << depthCrsSet[i]->getTitle() << endl; - if (depthCrsSet[i]->isProjectedCrsDefinedWithEpsg()) - cout << "Projected : EPSG " << depthCrsSet[i]->getProjectedCrsEpsgCode() << endl; - else if (depthCrsSet[i]->isProjectedCrsUnknown()) - cout << "Projected : Unknown." << "Reason is:" << depthCrsSet[i]->getProjectedCrsUnknownReason() << endl; - } - vector timeCrsSet = repo.getLocalTime3dCrsSet(); - for (size_t i = 0; i < timeCrsSet.size(); ++i) { - cout << "Title is : " << timeCrsSet[i]->getTitle() << endl; - if (timeCrsSet[i]->isVerticalCrsDefinedWithEpsg()) + vector crsSet = repo.getLocal3dCrsSet(); + for (auto* crs : crsSet) { + cout << "Title is : " << crs->getTitle() << endl; + if (crs->isProjectedCrsDefinedWithEpsg()) + cout << "Projected : EPSG " << crs->getProjectedCrsEpsgCode() << endl; + else if (crs->isProjectedCrsUnknown()) + cout << "Projected : Unknown." << "Reason is:" << crs->getProjectedCrsUnknownReason() << endl; + + if (crs->isVerticalCrsDefinedWithEpsg()) cout << "Vertical : EPSG one" << endl; - else if (timeCrsSet[i]->isVerticalCrsUnknown()) - cout << "Vertical : Unknown." << "Reason is:" << timeCrsSet[i]->getVerticalCrsUnknownReason() << endl; + else if (crs->isVerticalCrsUnknown()) + cout << "Vertical : Unknown." << "Reason is:" << crs->getVerticalCrsUnknownReason() << endl; + + if (crs->isATimeCrs()) { + cout << "Time Unit of measure is : " << crs->getTimeUomAsString() << endl; + } } cout << endl; diff --git a/src/common/AbstractObject.cpp b/src/common/AbstractObject.cpp index 76df15150..a83fae72a 100644 --- a/src/common/AbstractObject.cpp +++ b/src/common/AbstractObject.cpp @@ -713,12 +713,14 @@ void AbstractObject::addAlias(const std::string & authority, const std::string & } } -unsigned int AbstractObject::getAliasCount() const +uint64_t AbstractObject::getAliasCount() const { - cannotBePartial(); + if (isPartial()) { + throw invalid_argument("The wrapped gsoap proxy must not be null"); + } size_t count = 0; - + if (gsoapProxy2_0_1 != nullptr) { count = gsoapProxy2_0_1->Aliases.size(); } @@ -726,73 +728,54 @@ unsigned int AbstractObject::getAliasCount() const count = gsoapProxy2_3->Aliases.size(); } - if (count > (std::numeric_limits::max)()) { - throw range_error("There is too much aliases for fesapi."); - } - - return static_cast(count); + return count; } -std::string AbstractObject::getAliasAuthorityAtIndex(unsigned int index) const +std::string AbstractObject::getAliasAuthorityAtIndex(uint64_t index) const { - cannotBePartial(); - - if (getAliasCount() <= index) { - throw out_of_range("The index is out of range."); - } + if (isPartial()) + throw invalid_argument("The wrapped gsoap proxy must not be null"); if (gsoapProxy2_0_1 != nullptr) { - return (gsoapProxy2_0_1->Aliases)[index]->authority? *((gsoapProxy2_0_1->Aliases)[index]->authority): std::string(); + return (gsoapProxy2_0_1->Aliases).at(index)->authority + ? *((gsoapProxy2_0_1->Aliases).at(index)->authority) + : ""; } else if (gsoapProxy2_3 != nullptr) { - return gsoapProxy2_3->Aliases[index]->authority; + return gsoapProxy2_3->Aliases.at(index)->authority; } throw invalid_argument("No underlying gsoap proxy."); } -std::string AbstractObject::getAliasTitleAtIndex(unsigned int index) const +std::string AbstractObject::getAliasTitleAtIndex(uint64_t index) const { - cannotBePartial(); - - if (getAliasCount() <= index) - throw out_of_range("The index is out of range."); + if (isPartial()) + throw invalid_argument("The wrapped gsoap proxy must not be null"); if (gsoapProxy2_0_1 != nullptr) { - return (gsoapProxy2_0_1->Aliases)[index]->Identifier; + return (gsoapProxy2_0_1->Aliases).at(index)->Identifier; } else if (gsoapProxy2_3 != nullptr) { - return gsoapProxy2_3->Aliases[index]->Identifier; + return gsoapProxy2_3->Aliases.at(index)->Identifier; } throw invalid_argument("No underlying gsoap proxy."); } -std::vector AbstractObject::getActivitySet() const +std::vector AbstractObject::getActivitySet() const { return getRepository()->getSourceObjects(this); } -unsigned int AbstractObject::getActivityCount() const +uint64_t AbstractObject::getActivityCount() const { - const size_t result = getActivitySet().size(); - - if (result > (std::numeric_limits::max)()) { - throw out_of_range("There are too many associated activities."); - } - - return static_cast(result); + return getActivitySet().size(); } -EML2_NS::Activity * AbstractObject::getActivity(unsigned int index) const +EML2_NS::Activity* AbstractObject::getActivity(uint64_t index) const { - cannotBePartial(); - - const std::vector& activites = getActivitySet(); - if (index >= activites.size()) - throw out_of_range("The index is out of range."); - - return activites[index]; + return getActivitySet().at(index); } void AbstractObject::pushBackExtraMetadata(const std::string & key, const std::string & value) diff --git a/src/common/AbstractObject.h b/src/common/AbstractObject.h index 863ff9ac8..1d640acfd 100644 --- a/src/common/AbstractObject.h +++ b/src/common/AbstractObject.h @@ -505,12 +505,10 @@ namespace COMMON_NS * Gets the count of aliases in this instance * * @exception std::invalid_argument If this instance is actually a partial object. - * @exception std::range_error If the count of aliases is strictly greater than unsigned - * int max. * * @returns The alias count of this instance. */ - DLL_IMPORT_OR_EXPORT unsigned int getAliasCount() const; + DLL_IMPORT_OR_EXPORT uint64_t getAliasCount() const; /** * Gets the alias authority at a particular index in the aliases set @@ -523,7 +521,7 @@ namespace COMMON_NS * * @returns The alias authority at @p index. */ - DLL_IMPORT_OR_EXPORT std::string getAliasAuthorityAtIndex(unsigned int index) const; + DLL_IMPORT_OR_EXPORT std::string getAliasAuthorityAtIndex(uint64_t index) const; /** * Gets the alias title at a particular index in the aliases set @@ -536,7 +534,7 @@ namespace COMMON_NS * * @returns The alias title at @p index. */ - DLL_IMPORT_OR_EXPORT std::string getAliasTitleAtIndex(unsigned int index) const; + DLL_IMPORT_OR_EXPORT std::string getAliasTitleAtIndex(uint64_t index) const; /** * Gets all the activities where this instance is involved @@ -553,7 +551,7 @@ namespace COMMON_NS * * @returns The count of all activities involving this instance. */ - DLL_IMPORT_OR_EXPORT unsigned int getActivityCount() const; + DLL_IMPORT_OR_EXPORT uint64_t getActivityCount() const; /** * Gets an associated activity at a particular index @@ -566,7 +564,7 @@ namespace COMMON_NS * * @returns The associated activity at @p index. */ - DLL_IMPORT_OR_EXPORT EML2_NS::Activity* getActivity(unsigned int index) const; + DLL_IMPORT_OR_EXPORT EML2_NS::Activity* getActivity(uint64_t index) const; /** * Pushes back an extra metadata (not a standard one) onto this instance diff --git a/src/common/DataObjectRepository.cpp b/src/common/DataObjectRepository.cpp index 549ec9cb4..be038fe65 100644 --- a/src/common/DataObjectRepository.cpp +++ b/src/common/DataObjectRepository.cpp @@ -105,8 +105,11 @@ under the License. #include "../eml2_3/Activity.h" #include "../eml2_3/ActivityTemplate.h" #include "../eml2_3/GraphicalInformationSet.h" +#include "../eml2_3/LocalEngineeringCompoundCrs.h" +#include "../eml2_3/LocalEngineering2dCrs.h" #include "../eml2_3/PropertyKind.h" #include "../eml2_3/TimeSeries.h" +#include "../eml2_3/VerticalCrs.h" #include "../resqml2_2/BlockedWellboreRepresentation.h" #include "../resqml2_2/BoundaryFeature.h" @@ -354,11 +357,11 @@ void DataObjectRepository::addRelationship(COMMON_NS::AbstractObject * source, C } backwardRels[target].push_back(source); - RESQML2_NS::AbstractLocal3dCrs const * crs = dynamic_cast(target); + EML2_NS::AbstractLocal3dCrs const* crs = dynamic_cast(target); if (crs != nullptr) { - RESQML2_NS::AbstractRepresentation const * rep = dynamic_cast(source); + RESQML2_NS::AbstractRepresentation const* rep = dynamic_cast(source); if (rep != nullptr && !rep->isPartial()) { - RESQML2_NS::AbstractFeatureInterpretation * interp = rep->getInterpretation(); + RESQML2_NS::AbstractFeatureInterpretation* interp = rep->getInterpretation(); if (interp != nullptr && !interp->isPartial()) { interp->initDomain(gsoap_resqml2_0_1::resqml20__Domain::mixed); } @@ -514,9 +517,9 @@ bool DataObjectRepository::addDataObject(COMMON_NS::AbstractObject* proxy) journal.push_back(std::make_tuple(now, DataObjectReference(proxy), CREATED)); on_CreateDataObject(std::vector, COMMON_NS::AbstractObject*>> { std::make_pair(now, proxy) }); - auto* crs = dynamic_cast(proxy); + auto* crs = dynamic_cast(proxy); if (crs != nullptr) { - if (getDataObjects().size() == 1) { + if (getDataObjects().size() == 1) { setDefaultCrs(crs); } } @@ -866,9 +869,12 @@ COMMON_NS::AbstractObject* DataObjectRepository::createPartial(const std::string else if (ns == "eml23") { if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::Activity) else if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::ActivityTemplate) + else if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::LocalEngineering2dCrs) + else if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::LocalEngineeringCompoundCrs) else if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::GraphicalInformationSet) else if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::PropertyKind) else if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::TimeSeries) + else if CREATE_FESAPI_PARTIAL_WRAPPER_WITH_VERSION(EML2_3_NS::VerticalCrs) } #endif else if (ns == "prodml22") { @@ -1072,118 +1078,200 @@ EML2_NS::AbstractHdfProxy* DataObjectRepository::createHdfProxy(const std::strin //************ CRS ******************* //************************************ -RESQML2_NS::LocalDepth3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { - switch (defaultResqmlVersion) { - case DataObjectRepository::EnergisticsStandard::RESQML2_0_1: + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalDepth3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedEpsgCode, verticalUom, verticalEpsgCode, isUpOriented); #ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedEpsgCode, + verticalUom, verticalEpsgCode, isUpOriented); #endif default: throw std::invalid_argument("Unrecognized Energistics standard."); } } -RESQML2_NS::LocalDepth3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { - switch (defaultResqmlVersion) { - case DataObjectRepository::EnergisticsStandard::RESQML2_0_1: + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalDepth3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedUnknownReason, verticalUom, verticalUnknownReason, isUpOriented); #ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedUnknownReason, + verticalUom, verticalUnknownReason, isUpOriented); #endif default: throw std::invalid_argument("Unrecognized Energistics standard."); } } -RESQML2_NS::LocalDepth3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalDepth3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedEpsgCode, verticalUom, verticalUnknownReason, isUpOriented); +#ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedEpsgCode, + verticalUom, verticalUnknownReason, isUpOriented); +#endif + default: + throw std::invalid_argument("Unrecognized Energistics standard."); + } } -RESQML2_NS::LocalDepth3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalDepth3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedUnknownReason, verticalUom, verticalEpsgCode, isUpOriented); +#ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedUnknownReason, + verticalUom, verticalEpsgCode, isUpOriented); +#endif + default: + throw std::invalid_argument("Unrecognized Energistics standard."); + } } -RESQML2_NS::LocalTime3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalTime3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedEpsgCode, timeUom, verticalUom, verticalEpsgCode, isUpOriented); +#ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedEpsgCode, + timeUom, + verticalUom, verticalEpsgCode, isUpOriented); +#endif + default: + throw std::invalid_argument("Unrecognized Energistics standard."); + } } -RESQML2_NS::LocalTime3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalTime3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedUnknownReason, timeUom, verticalUom, verticalUnknownReason, isUpOriented); +#ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedUnknownReason, + timeUom, + verticalUom, verticalUnknownReason, isUpOriented); +#endif + default: + throw std::invalid_argument("Unrecognized Energistics standard."); + } } -RESQML2_NS::LocalTime3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalTime3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedEpsgCode, timeUom, verticalUom, verticalUnknownReason, isUpOriented); + +#ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedEpsgCode, + timeUom, + verticalUom, verticalUnknownReason, isUpOriented); + +#endif + default: + throw std::invalid_argument("Unrecognized Energistics standard."); + } } -RESQML2_NS::LocalTime3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string & guid, const std::string & title, +EML2_NS::AbstractLocal3dCrs* DataObjectRepository::createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { + switch (defaultEmlVersion) { + case DataObjectRepository::EnergisticsStandard::EML2_0: return new RESQML2_0_1_NS::LocalTime3dCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, projectedUnknownReason, timeUom, verticalUom, verticalEpsgCode, isUpOriented); + +#ifdef WITH_RESQML2_2 + case DataObjectRepository::EnergisticsStandard::EML2_3: + return new EML2_3_NS::LocalEngineeringCompoundCrs(this, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, + projectedUom, projectedUnknownReason, + timeUom, + verticalUom, verticalEpsgCode, isUpOriented); + +#endif + default: + throw std::invalid_argument("Unrecognized Energistics standard."); + } } RESQML2_NS::MdDatum* DataObjectRepository::createMdDatum(const std::string & guid, const std::string & title, - RESQML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, + EML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, double referenceLocationOrdinal1, double referenceLocationOrdinal2, double referenceLocationOrdinal3) { return new RESQML2_0_1_NS::MdDatum(this, guid, title, locCrs, originKind, referenceLocationOrdinal1, referenceLocationOrdinal2, referenceLocationOrdinal3); @@ -1969,7 +2057,7 @@ RESQML2_NS::SeismicWellboreFrameRepresentation* DataObjectRepository::createSeis RESQML2_NS::WellboreTrajectoryRepresentation* traj, double seismicReferenceDatum, double weatheringVelocity, - RESQML2_NS::LocalTime3dCrs* crs) + EML2_NS::AbstractLocal3dCrs* crs) { return new RESQML2_2_NS::SeismicWellboreFrameRepresentation(interp, guid, title, traj, seismicReferenceDatum, weatheringVelocity, crs); #else @@ -1987,19 +2075,18 @@ RESQML2_NS::SeismicWellboreFrameRepresentation* DataObjectRepository::createSeis RESQML2_NS::WellboreMarkerFrameRepresentation* DataObjectRepository::createWellboreMarkerFrameRepresentation(RESQML2_NS::WellboreInterpretation * interp, const std::string & guid, const std::string & title, RESQML2_NS::WellboreTrajectoryRepresentation * traj) { - return new RESQML2_0_1_NS::WellboreMarkerFrameRepresentation(interp, guid, title, traj); + return new RESQML2_0_1_NS::WellboreMarkerFrameRepresentation(interp, guid, title, traj); } RESQML2_NS::WellboreMarker* DataObjectRepository::createWellboreMarker(RESQML2_NS::WellboreMarkerFrameRepresentation* wellboreMarkerFrame, const std::string& guid, const std::string& title) { - return new RESQML2_0_1_NS::WellboreMarker(static_cast(wellboreMarkerFrame), - guid, title); + return new RESQML2_0_1_NS::WellboreMarker(static_cast(wellboreMarkerFrame), guid, title); } RESQML2_NS::WellboreMarker* DataObjectRepository::createWellboreMarker(RESQML2_NS::WellboreMarkerFrameRepresentation* wellboreMarkerFrame, const std::string& guid, const std::string& title, gsoap_resqml2_0_1::resqml20__GeologicBoundaryKind geologicBoundaryKind) { - return new RESQML2_0_1_NS::WellboreMarker(static_cast(wellboreMarkerFrame), - guid, title, geologicBoundaryKind); + return new RESQML2_0_1_NS::WellboreMarker(static_cast(wellboreMarkerFrame), + guid, title, geologicBoundaryKind); } RESQML2_NS::BlockedWellboreRepresentation* DataObjectRepository::createBlockedWellboreRepresentation(RESQML2_NS::WellboreInterpretation * interp, @@ -2507,14 +2594,14 @@ RESQML2_NS::CategoricalProperty* DataObjectRepository::createCategoricalProperty } RESQML2_0_1_NS::PointsProperty* DataObjectRepository::createPointsProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind) { return new RESQML2_0_1_NS::PointsProperty(rep, guid, title, dimension, attachmentKind, localCrs, energisticsPropertyKind); } RESQML2_NS::PointsProperty* DataObjectRepository::createPointsProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind * localPropType) { switch (defaultResqmlVersion) { @@ -2799,8 +2886,13 @@ WITSML2_1_NS::WeightingFunctionDictionary* DataObjectRepository::createWeighting #define GETTER_DATAOBJECTS_IMPL(returnedDataType, dataObjectName)\ std::vector DataObjectRepository::get##dataObjectName##Set() const { return getDataObjects(); } -GETTER_DATAOBJECTS_IMPL(EML2_NS::TimeSeries, TimeSeries) GETTER_DATAOBJECTS_IMPL(EML2_NS::AbstractHdfProxy, HdfProxy) +GETTER_DATAOBJECTS_IMPL(EML2_NS::AbstractLocal3dCrs, Local3dCrs) +GETTER_DATAOBJECTS_IMPL(EML2_NS::Activity, Activity) +GETTER_DATAOBJECTS_IMPL(EML2_NS::ActivityTemplate, ActivityTemplate) +GETTER_DATAOBJECTS_IMPL(EML2_NS::GraphicalInformationSet, GraphicalInformationSet) +GETTER_DATAOBJECTS_IMPL(EML2_NS::PropertyKind, PropertyKind) +GETTER_DATAOBJECTS_IMPL(EML2_NS::TimeSeries, TimeSeries) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::AbstractSeismicLineFeature, SeismicLine) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::AbstractIjkGridRepresentation, IjkGridRepresentation) @@ -2812,8 +2904,6 @@ GETTER_DATAOBJECTS_IMPL(RESQML2_NS::DoubleTableLookup, DoubleTableLookup) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::Grid2dRepresentation, AllGrid2dRepresentation) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::IjkGridParametricRepresentation, IjkGridParametricRepresentation) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::IjkGridExplicitRepresentation, IjkGridExplicitRepresentation) -GETTER_DATAOBJECTS_IMPL(RESQML2_NS::LocalDepth3dCrs, LocalDepth3dCrs) -GETTER_DATAOBJECTS_IMPL(RESQML2_NS::LocalTime3dCrs, LocalTime3dCrs) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::Model, Model) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::PointSetRepresentation, PointSetRepresentation) GETTER_DATAOBJECTS_IMPL(RESQML2_NS::PolylineRepresentation, AllPolylineRepresentation) @@ -3439,8 +3529,11 @@ COMMON_NS::AbstractObject* DataObjectRepository::getEml2_3WrapperFromGsoapContex if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, Activity, gsoap_eml2_3, eml23) else if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, ActivityTemplate, gsoap_eml2_3, eml23) else if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, GraphicalInformationSet, gsoap_eml2_3, eml23) + else if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, LocalEngineering2dCrs, gsoap_eml2_3, eml23) + else if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, LocalEngineeringCompoundCrs, gsoap_eml2_3, eml23) else if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, PropertyKind, gsoap_eml2_3, eml23) else if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, TimeSeries, gsoap_eml2_3, eml23) + else if CHECK_AND_GET_EML_FESAPI_WRAPPER_FROM_GSOAP_CONTEXT(EML2_3_NS, VerticalCrs, gsoap_eml2_3, eml23) else if (datatype.compare("PropertyKindDictionary") == 0) { GET_EML_GSOAP_PROXY_FROM_GSOAP_CONTEXT(PropertyKindDictionary, gsoap_eml2_3, eml23) diff --git a/src/common/DataObjectRepository.h b/src/common/DataObjectRepository.h index 73eb1ac60..3db9c859e 100644 --- a/src/common/DataObjectRepository.h +++ b/src/common/DataObjectRepository.h @@ -28,6 +28,7 @@ under the License. namespace EML2_NS { class AbstractHdfProxy; + class AbstractLocal3dCrs; class Activity; class ActivityTemplate; class GraphicalInformationSet; @@ -40,7 +41,6 @@ namespace RESQML2_NS class AbstractFeature; class AbstractFeatureInterpretation; class AbstractIjkGridRepresentation; - class AbstractLocal3dCrs; class AbstractOrganizationInterpretation; class AbstractRepresentation; class AbstractSeismicLineFeature; @@ -70,8 +70,6 @@ namespace RESQML2_NS class IjkGridLatticeRepresentation; class IjkGridNoGeometryRepresentation; class IjkGridParametricRepresentation; - class LocalDepth3dCrs; - class LocalTime3dCrs; class MdDatum; class Model; class NonSealedSurfaceFrameworkRepresentation; @@ -495,7 +493,7 @@ namespace COMMON_NS * * @returns A pointer to the default CRS if it is defined, else null. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::AbstractLocal3dCrs* getDefaultCrs() const { return defaultCrs; } + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* getDefaultCrs() const { return defaultCrs; } /** * Sets a default CRS for writing. It will be used in all writing methods if no explicit CRS is @@ -503,7 +501,7 @@ namespace COMMON_NS * * @param [in] crs If non-null, the default CRS. */ - DLL_IMPORT_OR_EXPORT void setDefaultCrs(RESQML2_NS::AbstractLocal3dCrs* crs) { defaultCrs = crs; } + DLL_IMPORT_OR_EXPORT void setDefaultCrs(EML2_NS::AbstractLocal3dCrs* crs) { defaultCrs = crs; } /** * Gets the default HDF5 file proxy for writing. It is used in all writing methods if no @@ -537,8 +535,13 @@ namespace COMMON_NS return all[index];\ } - GETTER_DATAOBJECTS(EML2_NS::TimeSeries, TimeSeries) GETTER_DATAOBJECTS(EML2_NS::AbstractHdfProxy, HdfProxy) + GETTER_DATAOBJECTS(EML2_NS::AbstractLocal3dCrs, Local3dCrs) + GETTER_DATAOBJECTS(EML2_NS::Activity, Activity) + GETTER_DATAOBJECTS(EML2_NS::ActivityTemplate, ActivityTemplate) + GETTER_DATAOBJECTS(EML2_NS::GraphicalInformationSet, GraphicalInformationSet) + GETTER_DATAOBJECTS(EML2_NS::PropertyKind, PropertyKind) + GETTER_DATAOBJECTS(EML2_NS::TimeSeries, TimeSeries) GETTER_DATAOBJECTS(RESQML2_NS::AbstractSeismicLineFeature, SeismicLine) GETTER_DATAOBJECTS(RESQML2_NS::AbstractIjkGridRepresentation, IjkGridRepresentation) @@ -556,8 +559,6 @@ namespace COMMON_NS GETTER_DATAOBJECTS(RESQML2_NS::IjkGridParametricRepresentation, IjkGridParametricRepresentation) GETTER_DATAOBJECTS(RESQML2_NS::IjkGridExplicitRepresentation, IjkGridExplicitRepresentation) GETTER_DATAOBJECTS(RESQML2_NS::IjkGridLatticeRepresentation, IjkSeismicCubeGridRepresentation) - GETTER_DATAOBJECTS(RESQML2_NS::LocalDepth3dCrs, LocalDepth3dCrs) - GETTER_DATAOBJECTS(RESQML2_NS::LocalTime3dCrs, LocalTime3dCrs) GETTER_DATAOBJECTS(RESQML2_NS::Model, Model) GETTER_DATAOBJECTS(RESQML2_NS::PointSetRepresentation, PointSetRepresentation) GETTER_DATAOBJECTS(RESQML2_NS::PolylineRepresentation, AllPolylineRepresentation) @@ -793,7 +794,7 @@ namespace COMMON_NS * * @returns A pointer to the new local depth 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, @@ -825,11 +826,11 @@ namespace COMMON_NS * * @returns A pointer to the new local depth 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local depth 3d CRS which is identified by an EPSG code for its projected @@ -858,11 +859,11 @@ namespace COMMON_NS * * @returns A pointer to the new local depth 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local depth 3d CRS which is unknown for its projected part and which is @@ -891,10 +892,10 @@ namespace COMMON_NS * * @returns A pointer to the new local depth 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); /** @@ -924,7 +925,7 @@ namespace COMMON_NS * * @returns A pointer to the new local time 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, @@ -958,12 +959,12 @@ namespace COMMON_NS * * @returns A pointer to the new local time 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local time 3d CRS which is identified by an EPSG code for its projected @@ -993,12 +994,12 @@ namespace COMMON_NS * * @returns A pointer to the new local time 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local time 3d CRS which unknown for its projected part and which is @@ -1028,10 +1029,10 @@ namespace COMMON_NS * * @returns A pointer to the new local time 3d CRS. */ - DLL_IMPORT_OR_EXPORT RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); @@ -1057,7 +1058,7 @@ namespace COMMON_NS * @returns A pointer to the new MD datum. */ DLL_IMPORT_OR_EXPORT RESQML2_NS::MdDatum* createMdDatum(const std::string & guid, const std::string & title, - RESQML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, + EML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, double referenceLocationOrdinal1, double referenceLocationOrdinal2, double referenceLocationOrdinal3); //************ FEATURE *************** @@ -2039,7 +2040,7 @@ namespace COMMON_NS RESQML2_NS::WellboreTrajectoryRepresentation* traj, double seismicReferenceDatum, double weatheringVelocity, - RESQML2_NS::LocalTime3dCrs* crs); + EML2_NS::AbstractLocal3dCrs* crs); /** * Creates a wellbore marker frame representation into this repository @@ -3068,7 +3069,7 @@ namespace COMMON_NS * @returns A pointer to the new points property. */ DLL_IMPORT_OR_EXPORT RESQML2_0_1_NS::PointsProperty* createPointsProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind = gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind::length); /** @@ -3093,7 +3094,7 @@ namespace COMMON_NS * @returns A pointer to the new points property. */ DLL_IMPORT_OR_EXPORT RESQML2_NS::PointsProperty* createPointsProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind * localPropType); //************* ACTIVITIES *********** @@ -3576,7 +3577,7 @@ namespace COMMON_NS std::unique_ptr propertyKindMapper; EML2_NS::AbstractHdfProxy* defaultHdfProxy = nullptr; - RESQML2_NS::AbstractLocal3dCrs* defaultCrs = nullptr; + EML2_NS::AbstractLocal3dCrs* defaultCrs = nullptr; std::vector dataFeeders; diff --git a/src/resqml2/AbstractLocal3dCrs.cpp b/src/eml2/AbstractLocal3dCrs.cpp similarity index 57% rename from src/resqml2/AbstractLocal3dCrs.cpp rename to src/eml2/AbstractLocal3dCrs.cpp index f35e555db..5f5124fd5 100644 --- a/src/resqml2/AbstractLocal3dCrs.cpp +++ b/src/eml2/AbstractLocal3dCrs.cpp @@ -18,16 +18,14 @@ under the License. -----------------------------------------------------------------------*/ #include "AbstractLocal3dCrs.h" -#include #include +#include "../eml2_3/LocalEngineering2dCrs.h" +#include "../eml2_3/VerticalCrs.h" #include "../tools/Trigonometry.h" using namespace std; -using namespace RESQML2_NS; - -void AbstractLocal3dCrs::loadTargetRelationships() { -} +using namespace EML2_NS; void AbstractLocal3dCrs::convertXyzPointsToGlobalCrs(double * xyzPoints, uint64_t xyzPointCount, bool withoutTranslation) const { @@ -66,6 +64,9 @@ double AbstractLocal3dCrs::getOriginOrdinal1() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->XOffset; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getOriginOrdinal1(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -75,6 +76,9 @@ double AbstractLocal3dCrs::getOriginOrdinal2() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->YOffset; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getOriginOrdinal2(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -84,6 +88,9 @@ double AbstractLocal3dCrs::getOriginDepthOrElevation() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->ZOffset; } + else if (gsoapProxy2_3 != nullptr) { + return static_cast(gsoapProxy2_3)->OriginVerticalCoordinate; + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -93,6 +100,9 @@ double AbstractLocal3dCrs::getArealRotation() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->ArealRotation->__item; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getAzimuth(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -102,6 +112,14 @@ gsoap_resqml2_0_1::eml20__PlaneAngleUom AbstractLocal3dCrs::getArealRotationUom( if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->ArealRotation->uom; } + else if (gsoapProxy2_3 != nullptr) { + const std::string uom = getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getAzimuthUomAsString(); + gsoap_resqml2_0_1::eml20__PlaneAngleUom result; + if (gsoap_resqml2_0_1::soap_s2eml20__PlaneAngleUom(gsoapProxy2_3->soap, uom.c_str(), &result) != SOAP_OK) { + throw logic_error("The CRS uom " + uom + " is not supported by FESAPI yet."); + } + return result; + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -111,6 +129,9 @@ bool AbstractLocal3dCrs::isDepthOriented() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->ZIncreasingDownward; } + else if (gsoapProxy2_3 != nullptr) { + return static_cast(gsoapProxy2_3)->VerticalAxis->Direction == gsoap_eml2_3::eml23__VerticalDirection::down; + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found.It is probably a partial one."); } @@ -120,6 +141,9 @@ bool AbstractLocal3dCrs::isProjectedCrsDefinedWithEpsg() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->ProjectedCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__ProjectedCrsEpsgCode; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->isProjectedCrsDefinedWithEpsg(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -129,11 +153,14 @@ bool AbstractLocal3dCrs::isProjectedCrsUnknown() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->ProjectedCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__ProjectedUnknownCrs; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->isProjectedCrsUnknown(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } -const std::string & AbstractLocal3dCrs::getProjectedCrsUnknownReason() const +std::string AbstractLocal3dCrs::getProjectedCrsUnknownReason() const { if (isProjectedCrsUnknown() == false) throw invalid_argument("The associated projected Crs is not unknown."); @@ -141,6 +168,9 @@ const std::string & AbstractLocal3dCrs::getProjectedCrsUnknownReason() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(static_cast(gsoapProxy2_0_1)->ProjectedCrs)->Unknown; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getProjectedCrsUnknownReason(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -153,6 +183,9 @@ uint64_t AbstractLocal3dCrs::getProjectedCrsEpsgCode() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(static_cast(gsoapProxy2_0_1)->ProjectedCrs)->EpsgCode; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getProjectedCrsEpsgCode(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -162,6 +195,9 @@ bool AbstractLocal3dCrs::isVerticalCrsDefinedWithEpsg() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->VerticalCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__VerticalCrsEpsgCode; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->VerticalCrs->Uuid)->isVerticalCrsDefinedWithEpsg(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -171,30 +207,41 @@ bool AbstractLocal3dCrs::isVerticalCrsUnknown() const if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->VerticalCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__VerticalUnknownCrs; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->VerticalCrs->Uuid)->isVerticalCrsUnknown(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } -const std::string & AbstractLocal3dCrs::getVerticalCrsUnknownReason() const +std::string AbstractLocal3dCrs::getVerticalCrsUnknownReason() const { - if (isVerticalCrsUnknown() == false) + if (!isVerticalCrsUnknown()) { throw invalid_argument("The associated vertical Crs is not unknown."); + } if (gsoapProxy2_0_1 != nullptr) { return static_cast(static_cast(gsoapProxy2_0_1)->VerticalCrs)->Unknown; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->VerticalCrs->Uuid)->getVerticalCrsUnknownReason(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } uint64_t AbstractLocal3dCrs::getVerticalCrsEpsgCode() const { - if (isVerticalCrsDefinedWithEpsg() == false) + if (!isVerticalCrsDefinedWithEpsg()) { throw invalid_argument("The associated vertical Crs is not an EPSG one."); + } if (gsoapProxy2_0_1 != nullptr) { return static_cast(static_cast(gsoapProxy2_0_1)->VerticalCrs)->EpsgCode; } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->VerticalCrs->Uuid)->getVerticalCrsEpsgCode(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -204,6 +251,14 @@ gsoap_resqml2_0_1::eml20__LengthUom AbstractLocal3dCrs::getProjectedCrsUnit() co if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->ProjectedUom; } + else if (gsoapProxy2_3 != nullptr) { + const std::string uom = getProjectedCrsUnitAsString(); + gsoap_resqml2_0_1::eml20__LengthUom result; + if (gsoap_resqml2_0_1::soap_s2eml20__LengthUom(gsoapProxy2_3->soap, uom.c_str(), &result) != SOAP_OK) { + throw logic_error("The CRS uom \"" + uom + "\" is not supported by FESAPI yet."); + } + return result; + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -213,6 +268,9 @@ string AbstractLocal3dCrs::getProjectedCrsUnitAsString() const if (gsoapProxy2_0_1 != nullptr) { return gsoap_resqml2_0_1::soap_eml20__LengthUom2s(gsoapProxy2_0_1->soap, static_cast(gsoapProxy2_0_1)->ProjectedUom); } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getProjectedCrsUnitAsString(); + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -222,6 +280,14 @@ gsoap_resqml2_0_1::eml20__LengthUom AbstractLocal3dCrs::getVerticalCrsUnit() con if (gsoapProxy2_0_1 != nullptr) { return static_cast(gsoapProxy2_0_1)->VerticalUom; } + else if (gsoapProxy2_3 != nullptr) { + const std::string uom = static_cast(gsoapProxy2_3)->VerticalAxis->Uom; + gsoap_resqml2_0_1::eml20__LengthUom result; + if (gsoap_resqml2_0_1::soap_s2eml20__LengthUom(gsoapProxy2_3->soap, uom.c_str(), &result) != SOAP_OK) { + throw logic_error("The CRS uom " + uom + " is not supported by FESAPI yet."); + } + return result; + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } @@ -231,23 +297,50 @@ string AbstractLocal3dCrs::getVerticalCrsUnitAsString() const if (gsoapProxy2_0_1 != nullptr) { return gsoap_resqml2_0_1::soap_eml20__LengthUom2s(gsoapProxy2_0_1->soap, static_cast(gsoapProxy2_0_1)->VerticalUom); } + else if (gsoapProxy2_3 != nullptr) { + return static_cast(gsoapProxy2_3)->VerticalAxis->Uom; + } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } -gsoap_resqml2_0_1::eml20__AxisOrder2d AbstractLocal3dCrs::getAxisOrder() const +std::string AbstractLocal3dCrs::getTimeUomAsString() const +{ + return gsoap_resqml2_0_1::soap_eml20__TimeUom2s(getGsoapContext(), getTimeUom()); +} + +gsoap_eml2_3::eml23__AxisOrder2d AbstractLocal3dCrs::getAxisOrder() const { if (gsoapProxy2_0_1 != nullptr) { - return static_cast(gsoapProxy2_0_1)->ProjectedAxisOrder; + auto axisOrder = static_cast(gsoapProxy2_0_1)->ProjectedAxisOrder; + const std::string axisOrderStr = gsoap_resqml2_0_1::soap_eml20__AxisOrder2d2s(gsoapProxy2_0_1->soap, axisOrder); + + gsoap_eml2_3::eml23__AxisOrder2d result; + if (gsoap_eml2_3::soap_s2eml23__AxisOrder2d(gsoapProxy2_0_1->soap, axisOrderStr.c_str(), &result) != SOAP_OK) { + throw logic_error("The axis order \"" + axisOrderStr + "\" is not supported by FESAPI yet."); + } + return result; + } + else if (gsoapProxy2_3 != nullptr) { + return getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getAxisOrder(); } throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); } -void AbstractLocal3dCrs::setAxisOrder(gsoap_resqml2_0_1::eml20__AxisOrder2d axisOrder) const +void AbstractLocal3dCrs::setAxisOrder(gsoap_eml2_3::eml23__AxisOrder2d axisOrder) const { if (gsoapProxy2_0_1 != nullptr) { - static_cast(gsoapProxy2_0_1)->ProjectedAxisOrder = axisOrder; + const std::string axisOrderStr = gsoap_eml2_3::soap_eml23__AxisOrder2d2s(gsoapProxy2_0_1->soap, axisOrder); + gsoap_resqml2_0_1::eml20__AxisOrder2d result; + if (gsoap_resqml2_0_1::soap_s2eml20__AxisOrder2d(gsoapProxy2_3->soap, axisOrderStr.c_str(), &result) != SOAP_OK) { + throw logic_error("The axis order \"" + axisOrderStr + "\" is not supported by FESAPI yet."); + } + + static_cast(gsoapProxy2_0_1)->ProjectedAxisOrder = result; + } + else if (gsoapProxy2_3 != nullptr) { + getRepository()->getDataObjectByUuid(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->setAxisOrder(axisOrder); } else { throw logic_error("The local CRS UUID " + getUuid() + " cannot be found. It is probably a partial one."); diff --git a/src/resqml2/AbstractLocal3dCrs.h b/src/eml2/AbstractLocal3dCrs.h similarity index 84% rename from src/resqml2/AbstractLocal3dCrs.h rename to src/eml2/AbstractLocal3dCrs.h index cabb0634b..0aa7f7fc0 100644 --- a/src/resqml2/AbstractLocal3dCrs.h +++ b/src/eml2/AbstractLocal3dCrs.h @@ -20,7 +20,7 @@ under the License. #include "../common/AbstractObject.h" -namespace RESQML2_NS +namespace EML2_NS { /** @brief Proxy class for an abstract local 3D coordinate reference system (CRS). */ class AbstractLocal3dCrs : public COMMON_NS::AbstractObject @@ -99,7 +99,7 @@ namespace RESQML2_NS * * @returns The projected CRS unknown reason. */ - DLL_IMPORT_OR_EXPORT const std::string & getProjectedCrsUnknownReason() const; + DLL_IMPORT_OR_EXPORT std::string getProjectedCrsUnknownReason() const; /** * Gets the EPSG code of the projected CRS @@ -131,7 +131,7 @@ namespace RESQML2_NS * * @returns The vertical CRS unknown reason. */ - DLL_IMPORT_OR_EXPORT const std::string & getVerticalCrsUnknownReason() const; + DLL_IMPORT_OR_EXPORT std::string getVerticalCrsUnknownReason() const; /** * Gets the EPSG code of the vertical CRS @@ -142,13 +142,6 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT uint64_t getVerticalCrsEpsgCode() const; - /** - * Gets the vertical CRS unit of measure as a string - * - * @returns The vertical CRS unit of measure as string. - */ - DLL_IMPORT_OR_EXPORT std::string getVerticalCrsUnitAsString() const; - /** * Gets the areal rotation unit of measure. * @@ -177,12 +170,42 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::eml20__LengthUom getVerticalCrsUnit() const; + /** + * Gets the vertical CRS unit of measure as a string + * + * @returns The vertical CRS unit of measure as string. + */ + DLL_IMPORT_OR_EXPORT std::string getVerticalCrsUnitAsString() const; + + /** + * Check if the third axis of this local 3d CRS is in timeor not. + * + * @returns True if this local 3d CRS is a time one. False if it is a depth/elevation one. + */ + DLL_IMPORT_OR_EXPORT virtual bool isATimeCrs() const = 0; + + /** + * Gets the unit of measure of the third axis of this local CRS if it is a time CRS. + * Otherwise throw an exception (if isATimeCrs() returns false) + * + * @returns The time unit of measure of the third axis. + */ + DLL_IMPORT_OR_EXPORT virtual gsoap_resqml2_0_1::eml20__TimeUom getTimeUom() const = 0; + + /** + * Gets the unit of measure as a sting of the third axis of this local CRS if it is a time CRS. + * Otherwise throw an exception (if isATimeCrs() returns false) + * + * @returns The time unit of measure of the third axis. + */ + DLL_IMPORT_OR_EXPORT std::string getTimeUomAsString() const; + /** * Gets the axis order of the projected CRS. * * @returns The axis order of the projected CRS. */ - DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::eml20__AxisOrder2d getAxisOrder() const; + DLL_IMPORT_OR_EXPORT gsoap_eml2_3::eml23__AxisOrder2d getAxisOrder() const; /** * Sets the axis order of the projected CRS. It defines the coordinate system axis order of the @@ -191,7 +214,7 @@ namespace RESQML2_NS * * @param axisOrder The axis order to set. */ - DLL_IMPORT_OR_EXPORT void setAxisOrder(gsoap_resqml2_0_1::eml20__AxisOrder2d axisOrder) const; + DLL_IMPORT_OR_EXPORT void setAxisOrder(gsoap_eml2_3::eml23__AxisOrder2d axisOrder) const; /** * Convert some xyz points from local to global CRS. @@ -228,6 +251,14 @@ namespace RESQML2_NS AbstractLocal3dCrs(gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs* fromGsoap) : COMMON_NS::AbstractObject(fromGsoap) {} + /** + * Creates an instance of this class by wrapping a gsoap instance. + * + * @param [in,out] fromGsoap If non-null, from gsoap. + */ + AbstractLocal3dCrs(gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs* fromGsoap) : + COMMON_NS::AbstractObject(fromGsoap) {} + /** * Get the Z offset which is always equal to zero for a time CRS. Don't mix zOffset vs * depthOffset : the schema calls zOffset what is actually a depthOrElevationOffset. @@ -235,8 +266,5 @@ namespace RESQML2_NS * @returns The z coordinate offset. */ virtual double getZOffset() const = 0; - - /** Loads target relationships */ - void loadTargetRelationships() final; }; } diff --git a/src/eml2/Activity.cpp b/src/eml2/Activity.cpp index d06e4923f..42d16b422 100644 --- a/src/eml2/Activity.cpp +++ b/src/eml2/Activity.cpp @@ -50,13 +50,7 @@ ActivityTemplate* Activity::getActivityTemplate() const void Activity::loadTargetRelationships() { COMMON_NS::DataObjectReference dor = getActivityTemplateDor(); - EML2_NS::ActivityTemplate* targetObj = getRepository()->getDataObjectByUuid(dor.getUuid()); - if (targetObj == nullptr) { // partial transfer - getRepository()->createPartial(dor); - targetObj = getRepository()->getDataObjectByUuid(dor.getUuid()); - if (targetObj == nullptr) { - throw invalid_argument("The DOR looks invalid."); - } + if (!dor.isEmpty()) { + convertDorIntoRel(dor); } - repository->addRelationship(this, targetObj); } diff --git a/src/eml2/Activity.h b/src/eml2/Activity.h index 1a9e1831d..4a789fc18 100644 --- a/src/eml2/Activity.h +++ b/src/eml2/Activity.h @@ -135,7 +135,7 @@ namespace EML2_NS * * @returns The parameter title. */ - DLL_IMPORT_OR_EXPORT virtual const std::string & getParameterTitle(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual std::string getParameterTitle(uint64_t index) const = 0; /** * Gets the indices of all the parameters sharing a given title. @@ -144,7 +144,7 @@ namespace EML2_NS * * @returns A vector of parameter indices. */ - DLL_IMPORT_OR_EXPORT virtual std::vector getParameterIndexOfTitle(const std::string & paramTitle) const = 0; + DLL_IMPORT_OR_EXPORT virtual std::vector getParameterIndexOfTitle(const std::string & paramTitle) const = 0; /** * Queries if all of the parameters sharing a given title are floating point quantity parameters. @@ -169,7 +169,7 @@ namespace EML2_NS * @returns True if the parameter at position @p index is a floating point quantity parameter, * false if not. */ - DLL_IMPORT_OR_EXPORT virtual bool isAFloatingPointQuantityParameter(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual bool isAFloatingPointQuantityParameter(uint64_t index) const = 0; /** * Gets the values of all the floating point quantity parameters sharing a given title. @@ -197,7 +197,7 @@ namespace EML2_NS * * @returns The floating point quantity value of the parameter at position @p index. */ - DLL_IMPORT_OR_EXPORT virtual double getFloatingPointQuantityParameterValue(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual double getFloatingPointQuantityParameterValue(uint64_t index) const = 0; /** * Queries if all of the parameters sharing a given title are integer quantity parameters. @@ -222,7 +222,7 @@ namespace EML2_NS * @returns True if the parameter at position @p index is an integer quantity parameter, * false if not. */ - DLL_IMPORT_OR_EXPORT virtual bool isAnIntegerQuantityParameter(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual bool isAnIntegerQuantityParameter(uint64_t index) const = 0; /** * Gets the values of all the integer quantity parameters sharing a given title. @@ -236,7 +236,7 @@ namespace EML2_NS * * @returns A vector of the value of all the @p paramTitle integer quantity parameters. */ - DLL_IMPORT_OR_EXPORT virtual std::vector getIntegerQuantityParameterValue(const std::string & paramTitle) const = 0; + DLL_IMPORT_OR_EXPORT virtual std::vector getIntegerQuantityParameterValue(const std::string & paramTitle) const = 0; /** * Gets the integer quantity value of a given parameter. @@ -250,7 +250,7 @@ namespace EML2_NS * * @returns The integer quantity value of the parameter at position @p index. */ - DLL_IMPORT_OR_EXPORT virtual int64_t getIntegerQuantityParameterValue(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual int64_t getIntegerQuantityParameterValue(uint64_t index) const = 0; /** * @brief Queries if all of the parameters sharing a given title are string parameters. @@ -274,7 +274,7 @@ namespace EML2_NS * @returns True if the parameter at position @p index is a string parameter, * false if not. */ - DLL_IMPORT_OR_EXPORT virtual bool isAStringParameter(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual bool isAStringParameter(uint64_t index) const = 0; /** * Gets the values of all the string parameters sharing a given title. @@ -301,7 +301,7 @@ namespace EML2_NS * * @returns The string value of the parameter at position @p index. */ - DLL_IMPORT_OR_EXPORT virtual const std::string & getStringParameterValue(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual std::string getStringParameterValue(uint64_t index) const = 0; /** * Queries if all of the parameters sharing a given title are RESQML object parameters. @@ -325,7 +325,7 @@ namespace EML2_NS * @returns True if the parameter at position @p index is a RESQML object parameter, * false if not. */ - DLL_IMPORT_OR_EXPORT virtual bool isAResqmlObjectParameter(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual bool isAResqmlObjectParameter(uint64_t index) const = 0; /** * Gets the values of all the RESQML object parameters sharing a given title. @@ -353,7 +353,7 @@ namespace EML2_NS * * @returns The RESQML object value of the parameter at position @p index. */ - DLL_IMPORT_OR_EXPORT virtual AbstractObject* getResqmlObjectParameterValue(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual AbstractObject* getResqmlObjectParameterValue(uint64_t index) const = 0; /** * Sets the activity template of this activity. diff --git a/src/eml2/ActivityTemplate.cpp b/src/eml2/ActivityTemplate.cpp index 4e42b5b4f..8222d3371 100644 --- a/src/eml2/ActivityTemplate.cpp +++ b/src/eml2/ActivityTemplate.cpp @@ -22,7 +22,7 @@ under the License. using namespace EML2_NS; -std::vector ActivityTemplate::getActivityInstanceSet() const +std::vector ActivityTemplate::getActivityInstanceSet() const { return getRepository()->getSourceObjects(this); } diff --git a/src/eml2/ActivityTemplate.h b/src/eml2/ActivityTemplate.h index e5d7e5ed9..4538d1895 100644 --- a/src/eml2/ActivityTemplate.h +++ b/src/eml2/ActivityTemplate.h @@ -71,7 +71,7 @@ namespace EML2_NS */ DLL_IMPORT_OR_EXPORT virtual void pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs) = 0; + uint64_t minOccurs, int64_t maxOccurs) = 0; /** * Pushes back a parameter in the activity template instance. This parameter must be of a RESQML @@ -90,7 +90,7 @@ namespace EML2_NS */ DLL_IMPORT_OR_EXPORT virtual void pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs, + uint64_t minOccurs, int64_t maxOccurs, std::string resqmlObjectContentType) = 0; /** @@ -118,7 +118,7 @@ namespace EML2_NS * * @returns The title of the parameter at position @p index. */ - DLL_IMPORT_OR_EXPORT virtual const std::string & getParameterTitle(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual std::string getParameterTitle(uint64_t index) const = 0; /** * Gets parameter allowed kinds @@ -127,7 +127,7 @@ namespace EML2_NS * * @returns The parameter allowed kinds. */ - DLL_IMPORT_OR_EXPORT virtual std::vector getParameterAllowedKinds(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual std::vector getParameterAllowedKinds(uint64_t index) const = 0; /** * Gets parameter allowed kinds @@ -147,7 +147,7 @@ namespace EML2_NS * * @returns True is the parameter at @p index is an input parameter, false if not. */ - DLL_IMPORT_OR_EXPORT virtual bool getParameterIsInput(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual bool getParameterIsInput(uint64_t index) const = 0; /** * Queries if a particular parameter is an input parameter. @@ -170,7 +170,7 @@ namespace EML2_NS * * @returns True is the parameter at @p index is an output parameter, false if not. */ - DLL_IMPORT_OR_EXPORT virtual bool getParameterIsOutput(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual bool getParameterIsOutput(uint64_t index) const = 0; /** * Queries if a particular parameter is an output parameter. @@ -193,7 +193,7 @@ namespace EML2_NS * * @returns The parameter minimum occurrences. */ - DLL_IMPORT_OR_EXPORT virtual uint64_t getParameterMinOccurences(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual int64_t getParameterMinOccurences(uint64_t index) const = 0; /** * Gets the minimum occurrences of a particular parameter. @@ -205,7 +205,7 @@ namespace EML2_NS * * @returns The parameter minimum occurrences. */ - DLL_IMPORT_OR_EXPORT virtual uint64_t getParameterMinOccurences(const std::string & paramTitle) const = 0; + DLL_IMPORT_OR_EXPORT virtual int64_t getParameterMinOccurences(const std::string & paramTitle) const = 0; /** * Gets the maximum occurrences of a particular parameter. @@ -216,7 +216,7 @@ namespace EML2_NS * * @returns The parameter maximum occurrences. */ - DLL_IMPORT_OR_EXPORT virtual uint64_t getParameterMaxOccurences(unsigned int index) const = 0; + DLL_IMPORT_OR_EXPORT virtual int64_t getParameterMaxOccurences(uint64_t index) const = 0; /** * Gets the maximum occurrences of a particular parameter. @@ -228,7 +228,7 @@ namespace EML2_NS * * @returns The parameter maximum occurrences. */ - DLL_IMPORT_OR_EXPORT virtual uint64_t getParameterMaxOccurences(const std::string & paramTitle) const = 0; + DLL_IMPORT_OR_EXPORT virtual int64_t getParameterMaxOccurences(const std::string & paramTitle) const = 0; /** * Gets the set of activities which are based on this activity template within the repository. diff --git a/src/eml2/CMakeLists.txt b/src/eml2/CMakeLists.txt index 82a13cd4c..f64fd152b 100644 --- a/src/eml2/CMakeLists.txt +++ b/src/eml2/CMakeLists.txt @@ -1,4 +1,5 @@ set(FESAPI_EML_2_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/AbstractHdfProxy.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/AbstractLocal3dCrs.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/Activity.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/ActivityTemplate.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/GraphicalInformationSet.cpp @@ -6,6 +7,7 @@ set(FESAPI_EML_2_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/AbstractHd ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/PropertyKind.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/TimeSeries.cpp ) set(FESAPI_EML_2_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/AbstractHdfProxy.h + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/AbstractLocal3dCrs.h ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/Activity.h ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/ActivityTemplate.h ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2}/EpcExternalPartReference.h diff --git a/src/eml2_3/Activity.cpp b/src/eml2_3/Activity.cpp index e12133b20..ed976b505 100644 --- a/src/eml2_3/Activity.cpp +++ b/src/eml2_3/Activity.cpp @@ -50,7 +50,7 @@ void Activity::pushBackParameter(const std::string& title, double value, gsoap_r throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); } const int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs > -1 && maxOccurs <= getParameterCount(title)) { + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) { throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); } if (dynamic_cast(activityTemplate) != nullptr) { @@ -77,7 +77,7 @@ void Activity::pushBackParameter(const std::string& title, const std::string & v throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); } const int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs > -1 && maxOccurs <= getParameterCount(title)) { + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) { throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); } if (dynamic_cast(activityTemplate) != nullptr) { @@ -103,7 +103,7 @@ void Activity::pushBackParameter(const std::string& title, int64_t value) throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); } const int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs > -1 && maxOccurs <= getParameterCount(title)) { + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) { throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); } if (dynamic_cast(activityTemplate) != nullptr) { @@ -132,10 +132,9 @@ void Activity::pushBackParameter(const std::string& title, AbstractObject* resqm if (activityTemplate->isAnExistingParameter(title) == false) throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs > -1 && maxOccurs <= getParameterCount(title)) + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); - if (dynamic_cast(activityTemplate) != nullptr) - { + if (dynamic_cast(activityTemplate) != nullptr) { vector allowedKinds = static_cast(activityTemplate)->getParameterAllowedKinds(title); if (allowedKinds.size() > 0 && find(allowedKinds.begin(), allowedKinds.end(), gsoap_resqml2_0_1::resqml20__ParameterKind::dataObject) == allowedKinds.end()) throw invalid_argument("The parameter template " + title + " does not allow a data object datatype."); @@ -162,25 +161,20 @@ uint64_t Activity::getParameterCount(const std::string & paramTitle) const return getParameterFromTitle(paramTitle).size(); } -const std::string & Activity::getParameterTitle(unsigned int index) const +std::string Activity::getParameterTitle(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->Title; + return activity->Parameter.at(index)->Title; } -std::vector Activity::getParameterIndexOfTitle(const std::string & paramTitle) const +std::vector Activity::getParameterIndexOfTitle(const std::string & paramTitle) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - vector paramIndex; - for (unsigned int i = 0; i < activity->Parameter.size(); ++i) - { - if (activity->Parameter[i]->Title == paramTitle) - { + vector paramIndex; + for (uint64_t i = 0; i < activity->Parameter.size(); ++i) { + if (activity->Parameter[i]->Title == paramTitle) { paramIndex.push_back(i); } } @@ -193,11 +187,9 @@ std::vector Activity::getParame _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); std::vector params; - for (unsigned int i = 0; i < activity->Parameter.size(); ++i) - { - if (activity->Parameter[i]->Title == paramTitle) - { - params.push_back(activity->Parameter[i]); + for (auto* param : activity->Parameter) { + if (param->Title == paramTitle) { + params.push_back(param); } } @@ -209,40 +201,38 @@ std::vector Activity::getParame *****************************/ bool Activity::isAFloatingPointQuantityParameter(const std::string & paramTitle) const { - std::vector param = getParameterFromTitle(paramTitle); + std::vector params = getParameterFromTitle(paramTitle); - if (param.size() < 1) + if (params.size() < 1) { throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); + } - for (unsigned int i = 0; i < param.size(); ++i) - { - if (param[i]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter) + for (auto const* param : params) { + if (param->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter) { return false; + } } return true; } -bool Activity::isAFloatingPointQuantityParameter(unsigned int index) const +bool Activity::isAFloatingPointQuantityParameter(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter; } vector Activity::getFloatingPointQuantityParameterValue(const std::string & paramTitle) const { std::vector param = getParameterFromTitle(paramTitle); - if (param.size() < 1) + if (param.size() < 1) { throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); + } vector result; - for (unsigned int i = 0; i < param.size(); ++i) - { + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non double values."); else @@ -252,14 +242,11 @@ vector Activity::getFloatingPointQuantityParameterValue(const std::strin return result; } -double Activity::getFloatingPointQuantityParameterValue(unsigned int index) const +double Activity::getFloatingPointQuantityParameterValue(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter) throw invalid_argument("The parameter at index is not a floating point quantity parameter."); return static_cast(activity->Parameter[index])->Value; @@ -286,14 +273,11 @@ vector Activity::getFloatingPointQuantit return result; } -gsoap_resqml2_0_1::resqml20__ResqmlUom Activity::getFloatingPointQuantityParameterUom(unsigned int index) const +gsoap_resqml2_0_1::resqml20__ResqmlUom Activity::getFloatingPointQuantityParameterUom(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw range_error("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DoubleQuantityParameter) throw invalid_argument("The parameter index is not in the parameter range."); gsoap_resqml2_0_1::resqml20__ResqmlUom uom; @@ -311,7 +295,7 @@ bool Activity::isAnIntegerQuantityParameter(const std::string & paramTitle) cons if (param.size() < 1) throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); - for (unsigned int i = 0; i < param.size(); ++i) + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__IntegerQuantityParameter) return false; @@ -320,25 +304,22 @@ bool Activity::isAnIntegerQuantityParameter(const std::string & paramTitle) cons return true; } -bool Activity::isAnIntegerQuantityParameter(unsigned int index) const +bool Activity::isAnIntegerQuantityParameter(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__IntegerQuantityParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__IntegerQuantityParameter; } -vector Activity::getIntegerQuantityParameterValue(const std::string & paramTitle) const +vector Activity::getIntegerQuantityParameterValue(const std::string & paramTitle) const { vector param = getParameterFromTitle(paramTitle); if (param.size() < 1) throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); - vector result; - for (unsigned int i = 0; i < param.size(); ++i) + vector result; + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__IntegerQuantityParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non integer values."); @@ -349,7 +330,7 @@ vector Activity::getIntegerQuantityParameterValue(const std::string & p return result; } -int64_t Activity::getIntegerQuantityParameterValue(unsigned int index) const +int64_t Activity::getIntegerQuantityParameterValue(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); @@ -372,7 +353,7 @@ bool Activity::isAStringParameter(const std::string & paramTitle) const if (param.size() < 1) throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); - for (unsigned int i = 0; i < param.size(); ++i) + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__StringParameter) return false; @@ -381,14 +362,11 @@ bool Activity::isAStringParameter(const std::string & paramTitle) const return true; } -bool Activity::isAStringParameter(unsigned int index) const +bool Activity::isAStringParameter(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__StringParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__StringParameter; } vector Activity::getStringParameterValue(const std::string & paramTitle) const @@ -399,7 +377,7 @@ vector Activity::getStringParameterValue(const std::string & paramTitle) invalid_argument("There exists no " + paramTitle + " parameter in this activity."); vector result; - for (unsigned int i = 0; i < param.size(); ++i) + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__StringParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non string values."); @@ -410,7 +388,7 @@ vector Activity::getStringParameterValue(const std::string & paramTitle) return result; } -const std::string & Activity::getStringParameterValue(unsigned int index) const +std::string Activity::getStringParameterValue(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); @@ -442,14 +420,11 @@ bool Activity::isAResqmlObjectParameter(const std::string & paramTitle) const return true; } -bool Activity::isAResqmlObjectParameter(unsigned int index) const +bool Activity::isAResqmlObjectParameter(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__DataObjectParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__DataObjectParameter; } vector Activity::getResqmlObjectParameterValue(const std::string & paramTitle) const @@ -460,7 +435,7 @@ vector Activity::getResqmlObjectParameterValue(const invalid_argument("There exists no " + paramTitle + " parameter in this activity."); vector result; - for (unsigned int i = 0; i < param.size(); ++i) + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DataObjectParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non RESQML object values."); @@ -471,14 +446,11 @@ vector Activity::getResqmlObjectParameterValue(const return result; } -COMMON_NS::AbstractObject* Activity::getResqmlObjectParameterValue(unsigned int index) const +COMMON_NS::AbstractObject* Activity::getResqmlObjectParameterValue(uint64_t index) const { _eml23__Activity* activity = static_cast<_eml23__Activity*>(gsoapProxy2_3); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DataObjectParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__DataObjectParameter) throw invalid_argument("The parameter at index is not a RESQML object parameter."); return getRepository()->getDataObjectByUuid(static_cast(activity->Parameter[index])->DataObject->Uuid); diff --git a/src/eml2_3/Activity.h b/src/eml2_3/Activity.h index be63b034a..653a16e83 100644 --- a/src/eml2_3/Activity.h +++ b/src/eml2_3/Activity.h @@ -84,7 +84,7 @@ namespace EML2_3_NS * @param value The value. */ DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string& title, - const std::string & value); + const std::string& value) final; /** * Push back an integer parameter in the instance. This parameter must exist in the associated @@ -94,7 +94,7 @@ namespace EML2_3_NS * @param value The value. */ DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string& title, - int64_t value); + int64_t value) final; /** * Push back a resqml object parameter in the instance. This parameter must exist in the @@ -104,14 +104,14 @@ namespace EML2_3_NS * @param [in,out] resqmlObject If non-null, the resqml object. */ DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string& title, - AbstractObject* resqmlObject); + AbstractObject* resqmlObject) final; /** * Get the count of all the parameters * * @returns The parameter count. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterCount() const; + DLL_IMPORT_OR_EXPORT uint64_t getParameterCount() const final; /** * Get the count of all the parameters which have got the same title. @@ -120,7 +120,7 @@ namespace EML2_3_NS * * @returns The parameter count. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterCount(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT uint64_t getParameterCount(const std::string & paramTitle) const final; /** * Gets parameter title @@ -129,7 +129,7 @@ namespace EML2_3_NS * * @returns The parameter title. */ - DLL_IMPORT_OR_EXPORT const std::string & getParameterTitle(unsigned int index) const; + DLL_IMPORT_OR_EXPORT std::string getParameterTitle(uint64_t index) const final; /** * Gets parameter index of title @@ -138,7 +138,7 @@ namespace EML2_3_NS * * @returns The parameter index of title. */ - DLL_IMPORT_OR_EXPORT std::vector getParameterIndexOfTitle(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT std::vector getParameterIndexOfTitle(const std::string & paramTitle) const final; /** * Query if 'paramTitle' is a floating point quantity parameter @@ -147,7 +147,7 @@ namespace EML2_3_NS * * @returns True if a floating point quantity parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAFloatingPointQuantityParameter(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT bool isAFloatingPointQuantityParameter(const std::string & paramTitle) const final; /** * Query if 'index' is a floating point quantity parameter @@ -156,7 +156,7 @@ namespace EML2_3_NS * * @returns True if a floating point quantity parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAFloatingPointQuantityParameter(unsigned int index) const; + DLL_IMPORT_OR_EXPORT bool isAFloatingPointQuantityParameter(uint64_t index) const final; /** * Gets floating point quantity parameter value @@ -165,7 +165,7 @@ namespace EML2_3_NS * * @returns The floating point quantity parameter value. */ - DLL_IMPORT_OR_EXPORT std::vector getFloatingPointQuantityParameterValue(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT std::vector getFloatingPointQuantityParameterValue(const std::string & paramTitle) const final; /** * Gets floating point quantity parameter value @@ -174,7 +174,7 @@ namespace EML2_3_NS * * @returns The floating point quantity parameter value. */ - DLL_IMPORT_OR_EXPORT double getFloatingPointQuantityParameterValue(unsigned int index) const; + DLL_IMPORT_OR_EXPORT double getFloatingPointQuantityParameterValue(uint64_t index) const final; /** * Gets floating point quantity parameter uom @@ -192,7 +192,7 @@ namespace EML2_3_NS * * @returns The floating point quantity parameter uom. */ - DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlUom getFloatingPointQuantityParameterUom(unsigned int index) const; + DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlUom getFloatingPointQuantityParameterUom(uint64_t index) const; /** * Query if 'paramTitle' is an integer quantity parameter @@ -201,7 +201,7 @@ namespace EML2_3_NS * * @returns True if an integer quantity parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAnIntegerQuantityParameter(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT bool isAnIntegerQuantityParameter(const std::string & paramTitle) const final; /** * Query if 'index' is an integer quantity parameter @@ -210,7 +210,7 @@ namespace EML2_3_NS * * @returns True if an integer quantity parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAnIntegerQuantityParameter(unsigned int index) const; + DLL_IMPORT_OR_EXPORT bool isAnIntegerQuantityParameter(uint64_t index) const final; /** * Gets integer quantity parameter value @@ -219,7 +219,7 @@ namespace EML2_3_NS * * @returns The integer quantity parameter value. */ - DLL_IMPORT_OR_EXPORT std::vector getIntegerQuantityParameterValue(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT std::vector getIntegerQuantityParameterValue(const std::string & paramTitle) const final; /** * Gets integer quantity parameter value @@ -228,7 +228,7 @@ namespace EML2_3_NS * * @returns The integer quantity parameter value. */ - DLL_IMPORT_OR_EXPORT int64_t getIntegerQuantityParameterValue(unsigned int index) const; + DLL_IMPORT_OR_EXPORT int64_t getIntegerQuantityParameterValue(uint64_t index) const final; /** * Query if 'paramTitle' is a string parameter @@ -237,7 +237,7 @@ namespace EML2_3_NS * * @returns True if a string parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAStringParameter(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT bool isAStringParameter(const std::string & paramTitle) const final; /** * Query if 'index' is a string parameter @@ -246,7 +246,7 @@ namespace EML2_3_NS * * @returns True if a string parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAStringParameter(unsigned int index) const; + DLL_IMPORT_OR_EXPORT bool isAStringParameter(uint64_t index) const final; /** * Gets string parameter value @@ -255,7 +255,7 @@ namespace EML2_3_NS * * @returns The string parameter value. */ - DLL_IMPORT_OR_EXPORT std::vector getStringParameterValue(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT std::vector getStringParameterValue(const std::string & paramTitle) const final; /** * Gets string parameter value @@ -264,7 +264,7 @@ namespace EML2_3_NS * * @returns The string parameter value. */ - DLL_IMPORT_OR_EXPORT const std::string & getStringParameterValue(unsigned int index) const; + DLL_IMPORT_OR_EXPORT std::string getStringParameterValue(uint64_t index) const final; /** * Query if 'paramTitle' is a resqml object parameter @@ -273,7 +273,7 @@ namespace EML2_3_NS * * @returns True if a resqml object parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAResqmlObjectParameter(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT bool isAResqmlObjectParameter(const std::string & paramTitle) const final; /** * Query if 'index' is a resqml object parameter @@ -282,7 +282,7 @@ namespace EML2_3_NS * * @returns True if a resqml object parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAResqmlObjectParameter(unsigned int index) const; + DLL_IMPORT_OR_EXPORT bool isAResqmlObjectParameter(uint64_t index) const final; /** * Gets resqml object parameter value @@ -291,7 +291,7 @@ namespace EML2_3_NS * * @returns Null if it fails, else the resqml object parameter value. */ - DLL_IMPORT_OR_EXPORT std::vector getResqmlObjectParameterValue(const std::string & paramTitle) const; + DLL_IMPORT_OR_EXPORT std::vector getResqmlObjectParameterValue(const std::string & paramTitle) const final; /** * Gets resqml object parameter value @@ -300,21 +300,21 @@ namespace EML2_3_NS * * @returns Null if it fails, else the resqml object parameter value. */ - DLL_IMPORT_OR_EXPORT AbstractObject* getResqmlObjectParameterValue(unsigned int index) const; + DLL_IMPORT_OR_EXPORT AbstractObject* getResqmlObjectParameterValue(uint64_t index) const final; /** * Set the activity template of the activity * * @param [in,out] activityTemplate If non-null, the activity template. */ - DLL_IMPORT_OR_EXPORT void setActivityTemplate(EML2_NS::ActivityTemplate* activityTemplate); + DLL_IMPORT_OR_EXPORT void setActivityTemplate(EML2_NS::ActivityTemplate* activityTemplate) final; /** * Gets activity template dor * * @returns Empty data object reference if it fails, else the activity template data object reference. */ - COMMON_NS::DataObjectReference getActivityTemplateDor() const; + COMMON_NS::DataObjectReference getActivityTemplateDor() const final; /** * The standard XML namespace for serializing this data object. diff --git a/src/eml2_3/ActivityTemplate.cpp b/src/eml2_3/ActivityTemplate.cpp index 799b01b73..a4394645b 100644 --- a/src/eml2_3/ActivityTemplate.cpp +++ b/src/eml2_3/ActivityTemplate.cpp @@ -34,7 +34,7 @@ ActivityTemplate::ActivityTemplate(COMMON_NS::DataObjectRepository * repo, const void ActivityTemplate::pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs) + uint64_t minOccurs, int64_t maxOccurs) { // Preconditions if (maxOccurs >= 0 && minOccurs > static_cast(maxOccurs)) { @@ -56,7 +56,7 @@ void ActivityTemplate::pushBackParameter(const std::string & title, void ActivityTemplate::pushBackParameter(const std::string & title, gsoap_resqml2_0_1::resqml20__ParameterKind kind, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs) + uint64_t minOccurs, int64_t maxOccurs) { pushBackParameter(title, isInput, isOutput, minOccurs, maxOccurs); @@ -66,7 +66,7 @@ void ActivityTemplate::pushBackParameter(const std::string & title, void ActivityTemplate::pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs, + uint64_t minOccurs, int64_t maxOccurs, std::string resqmlObjectContentType) { pushBackParameter(title, gsoap_resqml2_0_1::resqml20__ParameterKind::dataObject, isInput, isOutput, minOccurs, maxOccurs); @@ -83,9 +83,10 @@ bool ActivityTemplate::isAnExistingParameter(const std::string & paramTitle) con { eml23__ActivityTemplate* activityTemplate = static_cast(gsoapProxy2_3); - for (size_t i = 0; i < activityTemplate->Parameter.size(); ++i) { - if (activityTemplate->Parameter[i]->Title == paramTitle) + for (auto const* param : activityTemplate->Parameter) { + if (param->Title == paramTitle) { return true; + } } return false; @@ -96,25 +97,18 @@ uint64_t ActivityTemplate::getParameterCount() const return static_cast(gsoapProxy2_3)->Parameter.size(); } -const std::string & ActivityTemplate::getParameterTitle(unsigned int index) const +std::string ActivityTemplate::getParameterTitle(uint64_t index) const { eml23__ActivityTemplate* activityTemplate = static_cast(gsoapProxy2_3); - - if (activityTemplate->Parameter.size() <= index) - throw out_of_range("The parameter template index is not in the parameter range."); - - return activityTemplate->Parameter[index]->Title; + return activityTemplate->Parameter.at(index)->Title; } -vector ActivityTemplate::getParameterAllowedKinds(unsigned int index) const +vector ActivityTemplate::getParameterAllowedKinds(uint64_t index) const { eml23__ActivityTemplate* activityTemplate = static_cast(gsoapProxy2_3); - if (activityTemplate->Parameter.size() <= index) - throw range_error("The parameter template index is not in the parameter range."); - vector result; - for (auto& pk : activityTemplate->Parameter[index]->AllowedKind) { + for (auto& pk : activityTemplate->Parameter.at(index)->AllowedKind) { result.push_back(static_cast(pk)); } @@ -136,14 +130,10 @@ vector ActivityTemplate::getParamete return result; } -bool ActivityTemplate::getParameterIsInput(unsigned int index) const +bool ActivityTemplate::getParameterIsInput(uint64_t index) const { eml23__ActivityTemplate* activityTemplate = static_cast(gsoapProxy2_3); - - if (activityTemplate->Parameter.size() <= index) - throw out_of_range("The parameter template index is not in the parameter range."); - - return activityTemplate->Parameter[index]->IsInput; + return activityTemplate->Parameter.at(index)->IsInput; } bool ActivityTemplate::getParameterIsInput(const std::string & paramTitle) const @@ -156,14 +146,10 @@ bool ActivityTemplate::getParameterIsInput(const std::string & paramTitle) const return param->IsInput; } -bool ActivityTemplate::getParameterIsOutput(unsigned int index) const +bool ActivityTemplate::getParameterIsOutput(uint64_t index) const { eml23__ActivityTemplate* activityTemplate = static_cast(gsoapProxy2_3); - - if (activityTemplate->Parameter.size() <= index) - throw range_error("The parameter template index is not in the parameter range."); - - return activityTemplate->Parameter[index]->IsOutput; + return activityTemplate->Parameter.at(index)->IsOutput; } bool ActivityTemplate::getParameterIsOutput(const std::string & paramTitle) const @@ -176,17 +162,14 @@ bool ActivityTemplate::getParameterIsOutput(const std::string & paramTitle) cons return param->IsOutput; } -uint64_t ActivityTemplate::getParameterMinOccurences(unsigned int index) const +int64_t ActivityTemplate::getParameterMinOccurences(uint64_t index) const { eml23__ActivityTemplate* activityTemplate = static_cast(gsoapProxy2_3); - if (activityTemplate->Parameter.size() <= index) - throw range_error("The parameter template index is not in the parameter range."); - - return activityTemplate->Parameter[index]->MinOccurs; + return activityTemplate->Parameter.at(index)->MinOccurs; } -uint64_t ActivityTemplate::getParameterMinOccurences(const std::string & paramTitle) const +int64_t ActivityTemplate::getParameterMinOccurences(const std::string & paramTitle) const { eml23__ParameterTemplate* param = getParameterFromTitle(paramTitle); @@ -196,17 +179,13 @@ uint64_t ActivityTemplate::getParameterMinOccurences(const std::string & paramTi return param->MinOccurs; } -uint64_t ActivityTemplate::getParameterMaxOccurences(unsigned int index) const +int64_t ActivityTemplate::getParameterMaxOccurences(uint64_t index) const { eml23__ActivityTemplate* activityTemplate = static_cast(gsoapProxy2_3); - - if (activityTemplate->Parameter.size() <= index) - throw range_error("The parameter template index is not in the parameter range."); - - return activityTemplate->Parameter[index]->MaxOccurs; + return activityTemplate->Parameter.at(index)->MaxOccurs; } -uint64_t ActivityTemplate::getParameterMaxOccurences(const std::string & paramTitle) const +int64_t ActivityTemplate::getParameterMaxOccurences(const std::string & paramTitle) const { eml23__ParameterTemplate* param = getParameterFromTitle(paramTitle); diff --git a/src/eml2_3/ActivityTemplate.h b/src/eml2_3/ActivityTemplate.h index e69102178..0be5f898c 100644 --- a/src/eml2_3/ActivityTemplate.h +++ b/src/eml2_3/ActivityTemplate.h @@ -69,7 +69,7 @@ namespace EML2_3_NS */ DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs) final; + uint64_t minOccurs, int64_t maxOccurs) final; /** * Push back a parameter in the activity template instance. This parameter must not be of a data @@ -85,7 +85,7 @@ namespace EML2_3_NS DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string & title, gsoap_resqml2_0_1::resqml20__ParameterKind kind, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs); + uint64_t minOccurs, int64_t maxOccurs); /** * Push back a parameter in the activity template instance. This parameter must be of a data @@ -101,7 +101,7 @@ namespace EML2_3_NS */ DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs, + uint64_t minOccurs, int64_t maxOccurs, std::string resqmlObjectContentType) final; /** @@ -127,7 +127,7 @@ namespace EML2_3_NS * * @returns The parameter title. */ - DLL_IMPORT_OR_EXPORT const std::string & getParameterTitle(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT std::string getParameterTitle(uint64_t index) const final; /** * Gets parameter allowed kinds @@ -136,7 +136,7 @@ namespace EML2_3_NS * * @returns The parameter allowed kinds. */ - DLL_IMPORT_OR_EXPORT std::vector getParameterAllowedKinds(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT std::vector getParameterAllowedKinds(uint64_t index) const final; /** * Gets parameter allowed kinds @@ -154,7 +154,7 @@ namespace EML2_3_NS * * @returns The parameter is input. */ - DLL_IMPORT_OR_EXPORT bool getParameterIsInput(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool getParameterIsInput(uint64_t index) const final; /** * Gets parameter is input @@ -172,7 +172,7 @@ namespace EML2_3_NS * * @returns The parameter is output. */ - DLL_IMPORT_OR_EXPORT bool getParameterIsOutput(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool getParameterIsOutput(uint64_t index) const final; /** * Gets parameter is output @@ -190,7 +190,7 @@ namespace EML2_3_NS * * @returns The parameter minimum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMinOccurences(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMinOccurences(uint64_t index) const; /** * Gets parameter minimum occurences @@ -199,7 +199,7 @@ namespace EML2_3_NS * * @returns The parameter minimum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMinOccurences(const std::string & paramTitle) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMinOccurences(const std::string & paramTitle) const final; /** * Gets parameter maximum occurences @@ -208,7 +208,7 @@ namespace EML2_3_NS * * @returns The parameter maximum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMaxOccurences(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMaxOccurences(uint64_t index) const final; /** * Gets parameter maximum occurences @@ -217,7 +217,7 @@ namespace EML2_3_NS * * @returns The parameter maximum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMaxOccurences(const std::string & paramTitle) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMaxOccurences(const std::string & paramTitle) const final; /** * The standard XML namespace for serializing this data object. diff --git a/src/eml2_3/CMakeLists.txt b/src/eml2_3/CMakeLists.txt index e7e555dd0..173d16bd7 100644 --- a/src/eml2_3/CMakeLists.txt +++ b/src/eml2_3/CMakeLists.txt @@ -2,11 +2,17 @@ set(FESAPI_EML_2_3_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/Activi ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/ActivityTemplate.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/GraphicalInformationSet.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/HdfProxy.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/LocalEngineering2dCrs.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/LocalEngineeringCompoundCrs.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/PropertyKind.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/TimeSeries.cpp ) + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/TimeSeries.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/VerticalCrs.cpp ) set(FESAPI_EML_2_3_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/Activity.h ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/ActivityTemplate.h ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/GraphicalInformationSet.h ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/HdfProxy.h + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/LocalEngineering2dCrs.h + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/LocalEngineeringCompoundCrs.h ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/PropertyKind.h - ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/TimeSeries.h ) + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/TimeSeries.h + ${CMAKE_CURRENT_SOURCE_DIR}/${EML_PREFIX_2_3}/VerticalCrs.h ) \ No newline at end of file diff --git a/src/eml2_3/LocalEngineering2dCrs.cpp b/src/eml2_3/LocalEngineering2dCrs.cpp new file mode 100644 index 000000000..cd9b344c7 --- /dev/null +++ b/src/eml2_3/LocalEngineering2dCrs.cpp @@ -0,0 +1,205 @@ +/*----------------------------------------------------------------------- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"; you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +-----------------------------------------------------------------------*/ +#include "LocalEngineering2dCrs.h" + +#include + +#include +#include + +using namespace std; +using namespace EML2_3_NS; +using namespace gsoap_eml2_3; + +void LocalEngineering2dCrs::init(eml23__LocalEngineering2dCrs* local2dCrs, const std::string& guid, const std::string& title, + double originOrdinal1, double originOrdinal2, gsoap_eml2_3::eml23__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, eml23__NorthReferenceKind azimuthReference, + eml23__AxisOrder2d axisOrder) +{ + local2dCrs->Azimuth = soap_new_eml23__PlaneAngleMeasureExt(gsoapProxy2_3->soap); + local2dCrs->Azimuth->__item = azimuth; + local2dCrs->Azimuth->uom = soap_eml23__PlaneAngleUom2s(gsoapProxy2_3->soap, azimuthUom); + local2dCrs->AzimuthReference = azimuthReference; + local2dCrs->OriginProjectedCoordinate1 = originOrdinal1; + local2dCrs->OriginProjectedCoordinate2 = originOrdinal2; + + //Local Axes + local2dCrs->HorizontalAxes = soap_new_eml23__HorizontalAxes(gsoapProxy2_3->soap); + local2dCrs->HorizontalAxes->IsTime = false; + local2dCrs->HorizontalAxes->Uom = soap_eml23__LengthUom2s(gsoapProxy2_3->soap, projectedUom); + switch (axisOrder) { + case eml23__AxisOrder2d::easting_x0020northing: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::east; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::north; + break; + case eml23__AxisOrder2d::easting_x0020southing: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::east; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::south; + break; + case eml23__AxisOrder2d::northing_x0020easting: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::north; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::east; + break; + case eml23__AxisOrder2d::northing_x0020westing: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::north; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::west; + break; + case eml23__AxisOrder2d::southing_x0020easting: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::south; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::east; + break; + case eml23__AxisOrder2d::southing_x0020westing: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::south; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::west; + break; + case eml23__AxisOrder2d::westing_x0020northing: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::west; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::north; + break; + case eml23__AxisOrder2d::westing_x0020southing: + local2dCrs->HorizontalAxes->Direction1 = eml23__AxisDirectionKind::west; + local2dCrs->HorizontalAxes->Direction2 = eml23__AxisDirectionKind::south; + break; + default: throw range_error("This axis order is not supported yet."); + } + + // ProjectedCrs + eml23__ProjectedCrs* projectedCrs = soap_new_eml23__ProjectedCrs(gsoapProxy2_3->soap); + local2dCrs->OriginProjectedCrs = projectedCrs; + projectedCrs->AxisOrder = axisOrder; + projectedCrs->uom = soap_new_std__string(gsoapProxy2_3->soap); + projectedCrs->uom->assign(soap_eml23__LengthUom2s(gsoapProxy2_3->soap, projectedUom)); + + initMandatoryMetadata(); + setMetadata(guid, title, "", -1, "", "", -1, ""); + + projectedCrs->schemaVersion = getXmlNamespaceVersion(); + projectedCrs->uuid = boost::uuids::to_string(boost::uuids::nil_uuid()); + projectedCrs->Citation = gsoap_eml2_3::soap_new_eml23__Citation(gsoapProxy2_3->soap); + projectedCrs->Citation->Title = getTitle() + " ProjectedCrs"; + projectedCrs->Citation->Originator = getOriginator(); + projectedCrs->Citation->Format = getFormat(); + projectedCrs->Citation->Creation = getCreationAsTimeStructure(); +} + +LocalEngineering2dCrs::LocalEngineering2dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + uint64_t projectedEpsgCode, + double originOrdinal1, double originOrdinal2, gsoap_eml2_3::eml23__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, eml23__NorthReferenceKind azimuthReference, + eml23__AxisOrder2d axisOrder) +{ + if (repo == nullptr) { + throw invalid_argument("The soap context where the local 2d CRS will be instantiated must exist."); + } + if (projectedEpsgCode == 0) { + throw invalid_argument("The EPSG code must be positive"); + } + + gsoapProxy2_3 = soap_new_eml23__LocalEngineering2dCrs(repo->getGsoapContext()); + eml23__LocalEngineering2dCrs* local2dCrs = static_cast(gsoapProxy2_3); + init(local2dCrs, guid, title, + originOrdinal1, originOrdinal2, projectedUom, + azimuth, azimuthUom, azimuthReference, + axisOrder); + + auto* epsgCrs = soap_new_eml23__ProjectedEpsgCrs(gsoapProxy2_3->soap); + epsgCrs->EpsgCode = projectedEpsgCode; + local2dCrs->OriginProjectedCrs->AbstractProjectedCrs = epsgCrs; + + repo->addDataObject(this); +} + +LocalEngineering2dCrs::LocalEngineering2dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + std::string unknownReason, + double originOrdinal1, double originOrdinal2, gsoap_eml2_3::eml23__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, eml23__NorthReferenceKind azimuthReference, + eml23__AxisOrder2d axisOrder) +{ + if (repo == nullptr) { + throw invalid_argument("The soap context where the local 2d CRS will be instantiated must exist."); + } + + gsoapProxy2_3 = soap_new_eml23__LocalEngineering2dCrs(repo->getGsoapContext()); + eml23__LocalEngineering2dCrs* local2dCrs = static_cast(gsoapProxy2_3); + init(local2dCrs, guid, title, + originOrdinal1, originOrdinal2, projectedUom, + azimuth, azimuthUom, azimuthReference, + axisOrder); + + auto* unknownCrs = soap_new_eml23__ProjectedUnknownCrs(gsoapProxy2_3->soap); + unknownCrs->Unknown = unknownReason; + local2dCrs->OriginProjectedCrs->AbstractProjectedCrs = unknownCrs; + + repo->addDataObject(this); +} + +double LocalEngineering2dCrs::getOriginOrdinal1() const +{ + return static_cast(gsoapProxy2_3)->OriginProjectedCoordinate1; +} + +double LocalEngineering2dCrs::getOriginOrdinal2() const +{ + return static_cast(gsoapProxy2_3)->OriginProjectedCoordinate2; +} + +double LocalEngineering2dCrs::getAzimuth() const +{ + return static_cast(gsoapProxy2_3)->Azimuth->__item; +} + +std::string LocalEngineering2dCrs::getAzimuthUomAsString() const +{ + return static_cast(gsoapProxy2_3)->Azimuth->uom; +} + +bool LocalEngineering2dCrs::isProjectedCrsDefinedWithEpsg() const +{ + return static_cast(gsoapProxy2_3)->OriginProjectedCrs->AbstractProjectedCrs->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__ProjectedEpsgCrs; +} + +bool LocalEngineering2dCrs::isProjectedCrsUnknown() const +{ + return static_cast(gsoapProxy2_3)->OriginProjectedCrs->AbstractProjectedCrs->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__ProjectedUnknownCrs; +} + +std::string LocalEngineering2dCrs::getProjectedCrsUnknownReason() const +{ + return static_cast(static_cast(gsoapProxy2_3)->OriginProjectedCrs->AbstractProjectedCrs)->Unknown; +} + +int64_t LocalEngineering2dCrs::getProjectedCrsEpsgCode() const +{ + return static_cast(static_cast(gsoapProxy2_3)->OriginProjectedCrs->AbstractProjectedCrs)->EpsgCode; +} + +std::string LocalEngineering2dCrs::getProjectedCrsUnitAsString() const +{ + return static_cast(gsoapProxy2_3)->HorizontalAxes->Uom; +} + +gsoap_eml2_3::eml23__AxisOrder2d LocalEngineering2dCrs::getAxisOrder() const +{ + return static_cast(gsoapProxy2_3)->OriginProjectedCrs->AxisOrder; +} + +void LocalEngineering2dCrs::setAxisOrder(gsoap_eml2_3::eml23__AxisOrder2d axisOrder) const +{ + static_cast(gsoapProxy2_3)->OriginProjectedCrs->AxisOrder = axisOrder; +} diff --git a/src/eml2_3/LocalEngineering2dCrs.h b/src/eml2_3/LocalEngineering2dCrs.h new file mode 100644 index 000000000..9b0c02f54 --- /dev/null +++ b/src/eml2_3/LocalEngineering2dCrs.h @@ -0,0 +1,201 @@ +/*----------------------------------------------------------------------- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"; you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +-----------------------------------------------------------------------*/ +#pragma once + +#include "../common/AbstractObject.h" + +namespace EML2_3_NS +{ + /** A local depth 3D crs. */ + class LocalEngineering2dCrs final : public COMMON_NS::AbstractObject + { + public: + + /** + * Only to be used in partial transfer context + * + * @param [in,out] partialObject If non-null, the partial object. + * + * + */ + DLL_IMPORT_OR_EXPORT LocalEngineering2dCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : COMMON_NS::AbstractObject(partialObject) {} + + /** + * Construct a LocalEngineering2dCrs deriving from an EPSG projected CRS + * + * @param [in,out] repo If non-null, the repo. + * @param guid Unique identifier. + * @param title The title. + * @param projectedEpsgCode The EPSG code of the projected CRS + * @param originOrdinal1 The first origin ordinal. + * @param originOrdinal2 The second origin ordinal. + * @param projectedUom The projected uom. + * @param azimuth The areal rotation regarding the north. + * @param azimuthUom The unit of measure of the @p azimuth. + * @param azimuthReference The kind of north reference of the @p azimuth. + * @param axisOrder The axis order of the projected CRS. + */ + LocalEngineering2dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + uint64_t projectedEpsgCode, + double originOrdinal1, double originOrdinal2, gsoap_eml2_3::eml23__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, gsoap_eml2_3::eml23__NorthReferenceKind azimuthReference, + gsoap_eml2_3::eml23__AxisOrder2d axisOrder); + + /** + * Construct a LocalEngineering2dCrs deriving from an unknown projected CRS + * + * @param [in,out] repo If non-null, the repo. + * @param guid Unique identifier. + * @param title The title. + * @param unknownReason The reason why this CRS is unknown. + * @param originOrdinal1 The first origin ordinal. + * @param originOrdinal2 The second origin ordinal. + * @param projectedUom The projected uom. + * @param azimuth The areal rotation regarding the north. + * @param azimuthUom The unit of measure of the @p azimuth. + * @param azimuthReference The kind of north reference of the @p azimuth. + * @param axisOrder The axis order of the projected CRS. + */ + LocalEngineering2dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + std::string unknownReason, + double originOrdinal1, double originOrdinal2, gsoap_eml2_3::eml23__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, gsoap_eml2_3::eml23__NorthReferenceKind azimuthReference, + gsoap_eml2_3::eml23__AxisOrder2d axisOrder); + + /** + * Creates an instance of this class by wrapping a gsoap instance. + * + * @param [in,out] fromGsoap If non-null, from gsoap. + */ + LocalEngineering2dCrs(gsoap_eml2_3::_eml23__LocalEngineering2dCrs* fromGsoap): COMMON_NS::AbstractObject(fromGsoap) {} + + /** Destructor does nothing since the memory is manged by the gsoap context. */ + ~LocalEngineering2dCrs() = default; + + /** + * Gets the first origin ordinal of this local CRS. This is the X location of the origin of the + * local areal axes relative to the projected CRS origin. The unit of measure is defined by the + * unit of measure for the projected 2d CRS. + * + * @returns The first origin ordinal of this local CRS. + */ + DLL_IMPORT_OR_EXPORT double getOriginOrdinal1() const; + + /** + * Gets the second origin ordinal of this local CRS. This is the Y location of the origin of the + * local areal axes relative to the projected CRS origin. The unit of measure is defined by the + * unit of measure for the projected 2d CRS. + * + * @returns The second origin ordinal of this local CRS. + */ + DLL_IMPORT_OR_EXPORT double getOriginOrdinal2() const; + + /** + * Get the azimuth of this CRS. + * + * @returns The azimuth. + */ + DLL_IMPORT_OR_EXPORT double getAzimuth() const; + + /** + * Get the azimuth uom of this CRS as a string. + * + * @returns The azimuth uom. + */ + DLL_IMPORT_OR_EXPORT std::string getAzimuthUomAsString() const; + + /** + * Indicates either the associated projected CRS is identified by means of an EPSG code or not. + * + * @returns True if the projected CRS is defined with an EPSG code, false if not. + */ + DLL_IMPORT_OR_EXPORT bool isProjectedCrsDefinedWithEpsg() const; + + /** + * Indicates either the associated projected CRS is unknown or not. + * + * @returns True if projected CRS is unknown, false if not. + */ + DLL_IMPORT_OR_EXPORT bool isProjectedCrsUnknown() const; + + /** + * Gets the reason why the projected CRS is unknown. + * + * @exception std::invalid_argument If the associated projected CRS is not unknown. + * + * @returns The projected CRS unknown reason. + */ + DLL_IMPORT_OR_EXPORT std::string getProjectedCrsUnknownReason() const; + + /** + * Gets the EPSG code of the projected CRS + * + * @exception std::invalid_argument If the associated projected CRS is not an EPSG one. + * + * @returns The projected CRS EPSG code. + */ + DLL_IMPORT_OR_EXPORT int64_t getProjectedCrsEpsgCode() const; + + /** + * Gets the projected CRS unit of measure as a string + * + * @returns The projected CRS unit of measure as string. + */ + DLL_IMPORT_OR_EXPORT std::string getProjectedCrsUnitAsString() const; + + /** + * Gets the axis order of the projected CRS. + * + * @returns The axis order of the projected CRS. + */ + DLL_IMPORT_OR_EXPORT gsoap_eml2_3::eml23__AxisOrder2d getAxisOrder() const; + + /** + * Sets the axis order of the projected CRS. It defines the coordinate system axis order of the + * global projected CRS when the projected CRS is an unknown CRS, else it must correspond to the + * axis order of the projected CRS. + * + * @param axisOrder The axis order to set. + */ + DLL_IMPORT_OR_EXPORT void setAxisOrder(gsoap_eml2_3::eml23__AxisOrder2d axisOrder) const; + + /** + * The standard XML namespace for serializing this data object. + */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "eml23"; + + /** + * Get the standard XML namespace for serializing this data object. + */ + DLL_IMPORT_OR_EXPORT std::string getXmlNamespace() const final { return XML_NS; } + + /** The standard XML tag without XML namespace for serializing this data object. */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "LocalEngineering2dCrs"; + + DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } + + void loadTargetRelationships() final {} + + private: + void init(gsoap_eml2_3::eml23__LocalEngineering2dCrs* local2dCrs, const std::string& guid, const std::string& title, + double originOrdinal1, double originOrdinal2, gsoap_eml2_3::eml23__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, gsoap_eml2_3::eml23__NorthReferenceKind azimuthReference, + gsoap_eml2_3::eml23__AxisOrder2d axisOrder); + }; +} diff --git a/src/eml2_3/LocalEngineeringCompoundCrs.cpp b/src/eml2_3/LocalEngineeringCompoundCrs.cpp new file mode 100644 index 000000000..48bc5c54c --- /dev/null +++ b/src/eml2_3/LocalEngineeringCompoundCrs.cpp @@ -0,0 +1,298 @@ +/*----------------------------------------------------------------------- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"; you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +-----------------------------------------------------------------------*/ +#include "LocalEngineeringCompoundCrs.h" + +#include + +#include +#include + +#include "LocalEngineering2dCrs.h" +#include "VerticalCrs.h" + +using namespace std; +using namespace EML2_3_NS; +using namespace gsoap_eml2_3; + +void LocalEngineeringCompoundCrs::init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + uint64_t projectedEpsgCode, std::string unknownProjectedReason, + double originOrdinal1, double originOrdinal2, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, gsoap_eml2_3::eml23__NorthReferenceKind azimuthReference, + gsoap_eml2_3::eml23__AxisOrder2d axisOrder, + uint64_t verticalEpsgCode, std::string unknwownVerticalReason, + double originOrdinal3, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, + bool isUpOriented) +{ + if (repo == nullptr) { + throw invalid_argument("The soap context where the local CRS will be instantiated must exist."); + } + if (unknownProjectedReason.empty() && projectedEpsgCode == 0) { + throw invalid_argument("The projected CRS must either have a non null EPSG code or a reason why it is unkown."); + } + if (unknwownVerticalReason.empty() && verticalEpsgCode == 0) { + throw invalid_argument("The vertical CRS must either have a non null EPSG code or a reason why it is unkown."); + } + + gsoapProxy2_3 = soap_new_eml23__LocalEngineeringCompoundCrs(repo->getGsoapContext()); + eml23__LocalEngineeringCompoundCrs* local3dCrs = static_cast(gsoapProxy2_3); + + // Uuid creation + boost::uuids::name_generator_sha1 gen(boost::uuids::ns::dns()); + boost::uuids::name_generator_sha1 finalGen(gen("fesapi.com")); + + // uom conversion + std::string str = gsoap_resqml2_0_1::soap_eml20__LengthUom2s(gsoapProxy2_3->soap, projectedUom); + gsoap_eml2_3::eml23__LengthUom projectedLengthUom; + if (gsoap_eml2_3::soap_s2eml23__LengthUom(gsoapProxy2_3->soap, str.c_str(), &projectedLengthUom) != SOAP_OK) { + throw invalid_argument("Cannot recognize the uom \"" + str + "\""); + } + std::string verticalUomStr = gsoap_resqml2_0_1::soap_eml20__LengthUom2s(gsoapProxy2_3->soap, verticalUom); + gsoap_eml2_3::eml23__LengthUom verticalLengthUom; + if (gsoap_eml2_3::soap_s2eml23__LengthUom(gsoapProxy2_3->soap, verticalUomStr.c_str(), &verticalLengthUom) != SOAP_OK) { + throw invalid_argument("Cannot recognize the uom \"" + verticalUomStr + "\""); + } + + // 2d crs + LocalEngineering2dCrs* local2dCrs = !unknownProjectedReason.empty() + ? new LocalEngineering2dCrs(repo, boost::uuids::to_string(finalGen(guid + "_ProjectedEpsgCrs")), title + " LocalEngineering2dCrs", + unknownProjectedReason, + originOrdinal1, originOrdinal2, projectedLengthUom, + azimuth, azimuthUom, azimuthReference, + axisOrder) + : new LocalEngineering2dCrs(repo, boost::uuids::to_string(finalGen(guid + "_ProjectedUnknownCrs")), title + " LocalEngineering2dCrs", + projectedEpsgCode, + originOrdinal1, originOrdinal2, projectedLengthUom, + azimuth, azimuthUom, azimuthReference, + axisOrder); + local3dCrs->LocalEngineering2dCrs = local2dCrs->newEml23Reference(); + repo->addRelationship(this, local2dCrs); + + // Vertical CRS + VerticalCrs* verticalCrs = !unknwownVerticalReason.empty() + ? new VerticalCrs(repo, boost::uuids::to_string(finalGen(guid + "_VerticalEpsgCrs")), title + " VerticalCrs", + unknwownVerticalReason, + verticalLengthUom, + isUpOriented) + : new VerticalCrs(repo, boost::uuids::to_string(finalGen(guid + "_VerticalUnknownCrs")), title + " VerticalCrs", + verticalEpsgCode, + verticalLengthUom, + isUpOriented); + local3dCrs->VerticalCrs = verticalCrs->newEml23Reference(); + repo->addRelationship(this, verticalCrs); + local3dCrs->OriginVerticalCoordinate = originOrdinal3; + local3dCrs->VerticalAxis = soap_new_eml23__VerticalAxis(repo->getGsoapContext()); + local3dCrs->VerticalAxis->IsTime = false; + local3dCrs->VerticalAxis->Uom = verticalUomStr; + local3dCrs->VerticalAxis->Direction = isUpOriented ? eml23__VerticalDirection::up : eml23__VerticalDirection::down; + + initMandatoryMetadata(); + setMetadata(guid, title, "", -1, "", "", -1, ""); + + repo->addDataObject(this); +} + +void LocalEngineeringCompoundCrs::init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + uint64_t projectedEpsgCode, std::string unknownProjectedReason, + double originOrdinal1, double originOrdinal2, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, gsoap_eml2_3::eml23__NorthReferenceKind azimuthReference, + gsoap_eml2_3::eml23__AxisOrder2d axisOrder, + uint64_t verticalEpsgCode, std::string unknwownVerticalReason, + double originOrdinal3, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + bool isUpOriented) +{ + init(repo, guid, title, + projectedEpsgCode, unknownProjectedReason, + originOrdinal1, originOrdinal2, projectedUom, + azimuth, azimuthUom, azimuthReference, + axisOrder, + verticalEpsgCode, unknwownVerticalReason, + originOrdinal3, verticalUom, + isUpOriented); + static_cast(gsoapProxy2_3)->VerticalAxis->IsTime = true; + static_cast(gsoapProxy2_3)->VerticalAxis->Uom = gsoap_resqml2_0_1::soap_eml20__TimeUom2s(gsoapProxy2_3->soap, timeUom); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) +{ + init(repo, guid, title, + projectedEpsgCode, "", + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + verticalEpsgCode, "", + originOrdinal3, verticalUom, + isUpOriented); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) +{ + init(repo, guid, title, + 0, projectedUnknownReason, + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + 0, verticalUnknownReason, + originOrdinal3, verticalUom, + isUpOriented); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) +{ + init(repo, guid, title, + projectedEpsgCode, "", + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + 0, verticalUnknownReason, + originOrdinal3, verticalUom, + isUpOriented); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) +{ + init(repo, guid, title, + 0, projectedUnknownReason, + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + verticalEpsgCode, "", + originOrdinal3, verticalUom, + isUpOriented); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) +{ + init(repo, guid, title, + projectedEpsgCode, "", + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + verticalEpsgCode, "", + originOrdinal3, verticalUom, timeUom, + isUpOriented); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) +{ + init(repo, guid, title, + 0, projectedUnknownReason, + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + 0, verticalUnknownReason, + originOrdinal3, verticalUom, timeUom, + isUpOriented); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) +{ + init(repo, guid, title, + projectedEpsgCode, "", + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + 0, verticalUnknownReason, + originOrdinal3, verticalUom, timeUom, + isUpOriented); +} + +LocalEngineeringCompoundCrs::LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) +{ + init(repo, guid, title, + 0, projectedUnknownReason, + originOrdinal1, originOrdinal2, projectedUom, + arealRotation, gsoap_eml2_3::eml23__PlaneAngleUom::rad, gsoap_eml2_3::eml23__NorthReferenceKind::grid_x0020north, + gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing, + verticalEpsgCode, "", + originOrdinal3, verticalUom, timeUom, + isUpOriented); +} + +gsoap_resqml2_0_1::eml20__TimeUom LocalEngineeringCompoundCrs::getTimeUom() const +{ + if (!isATimeCrs()) { + throw std::logic_error("You cannot get time uom from a depth/elevation CRS."); + } + + gsoap_resqml2_0_1::eml20__TimeUom result; + + if (gsoap_resqml2_0_1::soap_s2eml20__TimeUom(getGsoapContext(), static_cast(gsoapProxy2_3)->VerticalAxis->Uom.c_str(), &result) != SOAP_OK) { + throw invalid_argument("The time uom \"" + static_cast(gsoapProxy2_3)->VerticalAxis->Uom + "\" is not recognized by FESAPI."); + } + + return result; +} + +LocalEngineering2dCrs* LocalEngineeringCompoundCrs::getLocalEngineering2dCrs() const +{ + return getRepository()->getDataObjectByUuid + (static_cast(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid); +} + +VerticalCrs* LocalEngineeringCompoundCrs::getVerticalCrs() const +{ + return getRepository()->getDataObjectByUuid + (static_cast(gsoapProxy2_3)->VerticalCrs->Uuid); +} + +void LocalEngineeringCompoundCrs::loadTargetRelationships() +{ + COMMON_NS::DataObjectReference dorVerticalCrs(static_cast(gsoapProxy2_3)->VerticalCrs); + convertDorIntoRel(dorVerticalCrs); + + COMMON_NS::DataObjectReference dor2dCrs(static_cast(gsoapProxy2_3)->LocalEngineering2dCrs); + convertDorIntoRel(dor2dCrs); +} diff --git a/src/eml2_3/LocalEngineeringCompoundCrs.h b/src/eml2_3/LocalEngineeringCompoundCrs.h new file mode 100644 index 000000000..e2a7c0bbf --- /dev/null +++ b/src/eml2_3/LocalEngineeringCompoundCrs.h @@ -0,0 +1,403 @@ +/*----------------------------------------------------------------------- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"; you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +-----------------------------------------------------------------------*/ +#pragma once + +#include "../eml2/AbstractLocal3dCrs.h" + +namespace EML2_3_NS +{ + class LocalEngineering2dCrs; + class VerticalCrs; + + /** A local depth 3D crs. */ + class LocalEngineeringCompoundCrs final : public EML2_NS::AbstractLocal3dCrs + { + public: + + /** + * Only to be used in partial transfer context + * + * @param [in,out] partialObject If non-null, the partial object. + * + * + */ + DLL_IMPORT_OR_EXPORT LocalEngineeringCompoundCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : EML2_NS::AbstractLocal3dCrs(partialObject) {} + + /** + * @brief Creates a local depth 3d CRS which is fully identified by means of EPSG code. + * + * @exception std::invalid_argument If projectedEpsgCode == 0 || verticalEpsgCode == + * 0. + * + * @param [in,out] repo The repo where the underlying gsoap proxy is going to be + * created. + * @param guid The guid to set to the local 3d crs. If empty then a new + * guid will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected crs. + * @param projectedUom The unit of measure of the projected axis of this + * instance. + * @param projectedEpsgCode The epsg code of the associated projected CRS. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The epsg code of the associated vertical CRS. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); + + /** + * Creates a local depth 3d CRS which is fully unknown. + * + * @param [in,out] repo The repo where the underlying gsoap proxy is going to + * be created. + * @param guid The guid to set to the local 3d crs. If empty then a + * new guid will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected + * crs. + * @param projectedUom The unit of measure of the projected axis of this + * instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided + * using EPSG or GML. + * @param verticalUom The unit of measure of the vertical axis of this + * instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided + * using EPSG or GML. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + + /** + * @brief Creates a local depth 3d CRS which is identified by an EPSG code for its projected + * part and which is unkown for its vertical part. + * + * @exception std::invalid_argument If projectedEpsgCode == 0. + * + * @param [in,out] repo The repo where the underlying gsoap proxy is going to + * be created. + * @param guid The guid to set to the local 3d crs. If empty then a + * new guid will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected + * crs. + * @param projectedUom The unit of measure of the projected axis of this + * instance. + * @param projectedEpsgCode The epsg code of the associated projected CRS. + * @param verticalUom The unit of measure of the vertical axis of this + * instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided + * using EPSG or GML. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + + /** + * @brief Creates a local depth 3d CRS which unkown for its projected part and which is + * identified by an EPSG code for its vertical part. + * + * @exception std::invalid_argument If verticalEpsgCode == 0. + * + * @param [in] repo The repo where the underlying gsoap proxy is going to + * be created. + * @param guid The guid to set to the local 3d crs. If empty then a new + * guid will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected crs. + * @param projectedUom The unit of measure of the projected axis of this + * instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided using + * EPSG or GML. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The epsg code of the associated vertical CRS. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); + + /** + * @brief Creates a local time 3d CRS which is fully identified by means of EPSG code. + * + * @exception std::invalid_argument If projectedEpsgCode == 0 || verticalEpsgCode == + * 0. + * + * @param [in] repo The repo where the underlying gsoap proxy is going to be + * created. + * @param guid The guid to set to the local 3d crs. If empty then a new guid + * will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. + * @param arealRotation The areal rotation in radians regarding the projected crs. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); + + /** + * Creates a local time 3d CRS which is fully unknown. + * + * @param [in,out] repo The repo where the underlying gsoap proxy is going to + * be created. + * @param guid The guid to set to the local 3d crs. If empty then a + * new guid will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. + * @param arealRotation The areal rotation in radians regarding the projected + * crs. + * @param projectedUom The unit of measure of the projected axis of this + * instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided + * using EPSG or GML. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this + * instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided + * using EPSG or GML. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + + /** + * @brief Creates a local depth 3d CRS which is identified by an EPSG code for its projected + * part and which is unkown for its vertial part. + * + * @exception std::invalid_argument If projectedEpsgCode == 0. + * + * @param [in] repo The repo where the underlying gsoap proxy is going to + * be created. + * @param guid The guid to set to the local 3d crs. If empty then a new + * guid will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. + * @param arealRotation The areal rotation in radians regarding the projected crs. + * @param projectedUom The unit of measure of the projected axis of this + * instance. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided using + * EPSG or GML. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + + /** + * @brief Creates a local time 3d CRS which unkown for its projected part and which is + * identified by an EPSG code for its vertical part. + * + * @exception std::invalid_argument If verticalEpsgCode == 0. + * + * @param [in] repo The repo where the underlying gsoap proxy is going to + * be created. + * @param guid The guid to set to the local 3d crs. If empty then a new + * guid will be generated. + * @param title A title for the instance to create. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. + * @param arealRotation The areal rotation in radians regarding the projected crs. + * @param projectedUom The unit of measure of the projected axis of this + * instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided using + * EPSG or GML. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. + */ + LocalEngineeringCompoundCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); + + /** + * Creates an instance of this class by wrapping a gsoap instance. + * + * @param [in,out] fromGsoap If non-null, from gsoap. + */ + LocalEngineeringCompoundCrs(gsoap_eml2_3::_eml23__LocalEngineeringCompoundCrs* fromGsoap): EML2_NS::AbstractLocal3dCrs(fromGsoap) {} + + /** Destructor does nothing since the memory is manged by the gsoap context. */ + ~LocalEngineeringCompoundCrs() = default; + + DLL_IMPORT_OR_EXPORT bool isATimeCrs() const final { return static_cast(gsoapProxy2_3)->VerticalAxis->IsTime; } + + DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::eml20__TimeUom getTimeUom() const final; + + DLL_IMPORT_OR_EXPORT LocalEngineering2dCrs* getLocalEngineering2dCrs() const; + + DLL_IMPORT_OR_EXPORT VerticalCrs* getVerticalCrs() const; + + /** + * The standard XML namespace for serializing this data object. + */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "eml23"; + + /** + * Get the standard XML namespace for serializing this data object. + */ + DLL_IMPORT_OR_EXPORT std::string getXmlNamespace() const final { return XML_NS; } + + /** The standard XML tag without XML namespace for serializing this data object. */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "LocalEngineeringCompoundCrs"; + + DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } + + /** Loads target relationships */ + void loadTargetRelationships() final; + + private: + + /** + * Initializes this object + * + * @param [in,out] repo If non-null, the repo. + * @param guid Unique identifier. + * @param title The title. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. Ignored if @p unknownProjectedReason is not empty. + * @param unknownProjectedReason The reason why the projected CRS is unkown. + * @param originOrdinal1 The first origin ordinal. + * @param originOrdinal2 The second origin ordinal. + * @param projectedUom The projected uom. + * @param azimuth The areal rotation regarding the north. + * @param azimuthUom The unit of measure of the @p azimuth. + * @param azimuthReference The kind of north reference of the @p azimuth. + * @param axisOrder The axis order of the projected CRS. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. Ignored if @p unknwownVerticalReason is not empty. + * @param unknwownVerticalReason The reason why the vertical CRS is unkown. + * @param originOrdinal3 The third origin ordinal. + * @param verticalUom The vertical uom. + * @param isUpOriented True if is up oriented, false if not. + */ + void init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + uint64_t projectedEpsgCode, std::string unknownProjectedReason, + double originOrdinal1, double originOrdinal2, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, gsoap_eml2_3::eml23__NorthReferenceKind azimuthReference, + gsoap_eml2_3::eml23__AxisOrder2d axisOrder, + uint64_t verticalEpsgCode, std::string unknwownVerticalReason, + double originOrdinal3, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, bool isUpOriented); + + /** + * Initializes this object + * + * @param [in,out] repo If non-null, the repo. + * @param guid Unique identifier. + * @param title The title. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. Ignored if @p unknownProjectedReason is not empty. + * @param unknownProjectedReason The reason why the projected CRS is unkown. + * @param originOrdinal1 The first origin ordinal. + * @param originOrdinal2 The second origin ordinal. + * @param projectedUom The projected uom. + * @param azimuth The areal rotation regarding the north. + * @param azimuthUom The unit of measure of the @p azimuth. + * @param azimuthReference The kind of north reference of the @p azimuth. + * @param axisOrder The axis order of the projected CRS. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. Ignored if @p unknwownVerticalReason is not empty. + * @param unknwownVerticalReason The reason why the vertical CRS is unkown. + * @param originOrdinal3 The third origin ordinal. + * @param verticalUom The vertical uom. + * @param isUpOriented True if is up oriented, false if not. + */ + void init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + uint64_t projectedEpsgCode, std::string unknownProjectedReason, + double originOrdinal1, double originOrdinal2, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, + double azimuth, gsoap_eml2_3::eml23__PlaneAngleUom azimuthUom, gsoap_eml2_3::eml23__NorthReferenceKind azimuthReference, + gsoap_eml2_3::eml23__AxisOrder2d axisOrder, + uint64_t verticalEpsgCode, std::string unknwownVerticalReason, + double originOrdinal3, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, + gsoap_resqml2_0_1::eml20__TimeUom timeUom, bool isUpOriented); + + /** + * Get z coordinate offset + * + * @returns The z coordinate offset. + */ + double getZOffset() const { return isATimeCrs() ? .0 : getOriginDepthOrElevation(); } + }; +} diff --git a/src/eml2_3/VerticalCrs.cpp b/src/eml2_3/VerticalCrs.cpp new file mode 100644 index 000000000..493f496d3 --- /dev/null +++ b/src/eml2_3/VerticalCrs.cpp @@ -0,0 +1,99 @@ +/*----------------------------------------------------------------------- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"; you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +-----------------------------------------------------------------------*/ +#include "VerticalCrs.h" + +#include + +using namespace std; +using namespace EML2_3_NS; +using namespace gsoap_eml2_3; + +void VerticalCrs::init(eml23__VerticalCrs* verticalCrs, const std::string& guid, const std::string& title, + gsoap_eml2_3::eml23__LengthUom verticalUom, + bool isUpOriented) +{ + verticalCrs->uom = soap_eml23__LengthUom2s(gsoapProxy2_3->soap, verticalUom); + verticalCrs->Direction = isUpOriented ? eml23__VerticalDirection::up : eml23__VerticalDirection::down; + + initMandatoryMetadata(); + setMetadata(guid, title, "", -1, "", "", -1, ""); +} + +VerticalCrs::VerticalCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + uint64_t verticalEpsgCode, + gsoap_eml2_3::eml23__LengthUom verticalUom, + bool isUpOriented) +{ + if (repo == nullptr) { + throw invalid_argument("The soap context where the local 2d CRS will be instantiated must exist."); + } + if (verticalEpsgCode == 0) { + throw invalid_argument("The EPSG code must be positive"); + } + + gsoapProxy2_3 = soap_new_eml23__VerticalCrs(repo->getGsoapContext()); + eml23__VerticalCrs* verticalCrs = static_cast(gsoapProxy2_3); + init(verticalCrs, guid, title, verticalUom, isUpOriented); + + auto* epsgCrs = soap_new_eml23__VerticalEpsgCrs(gsoapProxy2_3->soap); + epsgCrs->EpsgCode = verticalEpsgCode; + verticalCrs->AbstractVerticalCrs = epsgCrs; + + repo->addDataObject(this); +} + +VerticalCrs::VerticalCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + std::string unknownReason, + gsoap_eml2_3::eml23__LengthUom verticalUom, + bool isUpOriented) +{ + if (repo == nullptr) { + throw invalid_argument("The soap context where the local 2d CRS will be instantiated must exist."); + } + + gsoapProxy2_3 = soap_new_eml23__VerticalCrs(repo->getGsoapContext()); + eml23__VerticalCrs* verticalCrs = static_cast(gsoapProxy2_3); + init(verticalCrs, guid, title, verticalUom, isUpOriented); + + auto* unknownCrs = soap_new_eml23__VerticalUnknownCrs(gsoapProxy2_3->soap); + unknownCrs->Unknown = unknownReason; + verticalCrs->AbstractVerticalCrs = unknownCrs; + + repo->addDataObject(this); +} + +bool VerticalCrs::isVerticalCrsDefinedWithEpsg() const +{ + return static_cast(gsoapProxy2_3)->AbstractVerticalCrs->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__VerticalEpsgCrs; +} + +bool VerticalCrs::isVerticalCrsUnknown() const +{ + return static_cast(gsoapProxy2_3)->AbstractVerticalCrs->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__VerticalUnknownCrs; +} + +std::string VerticalCrs::getVerticalCrsUnknownReason() const +{ + return static_cast(static_cast(gsoapProxy2_3)->AbstractVerticalCrs)->Unknown; +} + +int64_t VerticalCrs::getVerticalCrsEpsgCode() const +{ + return static_cast(static_cast(gsoapProxy2_3)->AbstractVerticalCrs)->EpsgCode; +} diff --git a/src/eml2_3/VerticalCrs.h b/src/eml2_3/VerticalCrs.h new file mode 100644 index 000000000..c229476c8 --- /dev/null +++ b/src/eml2_3/VerticalCrs.h @@ -0,0 +1,132 @@ +/*----------------------------------------------------------------------- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"; you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +-----------------------------------------------------------------------*/ +#pragma once + +#include "../common/AbstractObject.h" + +namespace EML2_3_NS +{ + /** A vertical crs. */ + class VerticalCrs final : public COMMON_NS::AbstractObject + { + public: + + /** + * Only to be used in partial transfer context + * + * @param [in,out] partialObject If non-null, the partial object. + */ + DLL_IMPORT_OR_EXPORT VerticalCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : COMMON_NS::AbstractObject(partialObject) {} + + /** + * Construct a VerticalCrs deriving from an EPSG vertical CRS + * + * @param [in,out] repo If non-null, the repo. + * @param guid Unique identifier. + * @param title The title. + * @param verticalEpsgCode The EPSG code of the vertical CRS + * @param verticalUom The vertical axis uom. + * @param isUpOriented Defines if the vertical CRS axis is up oreinted or not. + */ + VerticalCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + uint64_t verticalEpsgCode, + gsoap_eml2_3::eml23__LengthUom verticalUom, + bool isUpOriented); + + /** + * Construct a VerticalCrs deriving from an unknown vertical CRS + * + * @param [in,out] repo If non-null, the repo. + * @param guid Unique identifier. + * @param title The title. + * @param unknownReason The reason why this CRS is unknown. + * @param verticalUom The projected uom. + * @param isUpOriented Defines if the vertical CRS axis is up oreinted or not. + */ + VerticalCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, + std::string unknownReason, + gsoap_eml2_3::eml23__LengthUom verticalUom, + bool isUpOriented); + + /** + * Creates an instance of this class by wrapping a gsoap instance. + * + * @param [in,out] fromGsoap If non-null, from gsoap. + */ + VerticalCrs(gsoap_eml2_3::_eml23__VerticalCrs* fromGsoap): COMMON_NS::AbstractObject(fromGsoap) {} + + /** Destructor does nothing since the memory is managed by the gsoap context. */ + ~VerticalCrs() = default; + + /** + * Indicates either the associated vertical CRS is identified by means of EPSG or not. + * + * @returns True if the vertical CRS is defined with an EPSG code, false if not. + */ + DLL_IMPORT_OR_EXPORT bool isVerticalCrsDefinedWithEpsg() const; + + /** + * Indicates either the associated vertical CRS is unknown or not. + * + * @returns True if vertical CRS is unknown, false if not. + */ + DLL_IMPORT_OR_EXPORT bool isVerticalCrsUnknown() const; + + /** + * Gets the reason why the vertical CRS is unknown. + * + * @exception std::invalid_argument If the associated vertical CRS is not unknown. + * + * @returns The vertical CRS unknown reason. + */ + DLL_IMPORT_OR_EXPORT std::string getVerticalCrsUnknownReason() const; + + /** + * Gets the EPSG code of the vertical CRS + * + * @exception std::invalid_argument If the associated projected CRS is not an EPSG one. + * + * @returns The vertical CRS EPSG code. + */ + DLL_IMPORT_OR_EXPORT int64_t getVerticalCrsEpsgCode() const; + + /** + * The standard XML namespace for serializing this data object. + */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "eml23"; + + /** + * Get the standard XML namespace for serializing this data object. + */ + DLL_IMPORT_OR_EXPORT std::string getXmlNamespace() const final { return XML_NS; } + + /** The standard XML tag without XML namespace for serializing this data object. */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "VerticalCrs"; + + DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } + + void loadTargetRelationships() final {} + + private: + + void init(gsoap_eml2_3::eml23__VerticalCrs* verticalCrs, const std::string& guid, const std::string& title, + gsoap_eml2_3::eml23__LengthUom verticalUom, + bool isUpOriented); + }; +} diff --git a/src/resqml2/AbstractColorMap.cpp b/src/resqml2/AbstractColorMap.cpp index e7efa9c1f..2756f2dac 100644 --- a/src/resqml2/AbstractColorMap.cpp +++ b/src/resqml2/AbstractColorMap.cpp @@ -24,7 +24,7 @@ using namespace std; using namespace gsoap_eml2_3; using namespace RESQML2_NS; -void AbstractColorMap::setRgbColors(unsigned int colorCount, +void AbstractColorMap::setRgbColors(uint64_t colorCount, double const* rgbColors, double const* alphas, vector const& colorTitles, double const* indices) { @@ -49,7 +49,7 @@ void AbstractColorMap::setRgbColors(unsigned int colorCount, setHsvColors(colorCount, hsvColors.get(), alphas, colorTitles, indices); } -void AbstractColorMap::setRgbColors(unsigned int colorCount, +void AbstractColorMap::setRgbColors(uint64_t colorCount, unsigned int const* rgbColors, double const* alphas, vector const& colorTitles, double const* indices) { @@ -78,7 +78,7 @@ double AbstractColorMap::getHue(double colorIndex) const { resqml22__HsvColor const* const color = getColor(colorIndex); if (color == nullptr) { - throw out_of_range("There is no such color index"); + throw out_of_range("There is no color index \"" + std::to_string(colorIndex) + "\" in this color map"); } return color->Hue; @@ -88,7 +88,7 @@ double AbstractColorMap::getSaturation(double colorIndex) const { resqml22__HsvColor const* const color = getColor(colorIndex); if (color == nullptr) { - throw invalid_argument("There is no such color index"); + throw invalid_argument("There is no color index \"" + std::to_string(colorIndex) + "\" in this color map"); } return color->Saturation; } @@ -97,7 +97,7 @@ double AbstractColorMap::getValue(double colorIndex) const { resqml22__HsvColor const* const color = getColor(colorIndex); if (color == nullptr) { - throw invalid_argument("There is no such color index"); + throw invalid_argument("There is no color index \"" + std::to_string(colorIndex) + "\" in this color map"); } return color->Value; @@ -107,7 +107,7 @@ double AbstractColorMap::getAlpha(double colorIndex) const { resqml22__HsvColor const* const color = getColor(colorIndex); if (color == nullptr) { - throw invalid_argument("There is no such color index"); + throw invalid_argument("There is no color index \"" + std::to_string(colorIndex) + "\" in this color map"); } return color->Alpha; @@ -127,7 +127,7 @@ bool AbstractColorMap::hasColorTitle(double colorIndex) const { resqml22__HsvColor const* const color = getColor(colorIndex); if (color == nullptr) { - throw invalid_argument("There is no such color index"); + throw invalid_argument("There is no color index \"" + std::to_string(colorIndex) + "\" in this color map"); } return color->Title != nullptr; @@ -136,7 +136,7 @@ std::string AbstractColorMap::getColorTitle(double colorIndex) const { resqml22__HsvColor const* const color = getColor(colorIndex); if (color == nullptr) { - throw invalid_argument("There is no such color index"); + throw invalid_argument("There is no color index \"" + std::to_string(colorIndex) + "\" in this color map"); } if (!hasColorTitle(colorIndex)) { diff --git a/src/resqml2/AbstractColorMap.h b/src/resqml2/AbstractColorMap.h index 572def841..2a93f0e40 100644 --- a/src/resqml2/AbstractColorMap.h +++ b/src/resqml2/AbstractColorMap.h @@ -36,7 +36,7 @@ namespace RESQML2_NS * @param colorTitles vector (of size colorCount) of color titles. Titles are not set if colorTitles == nullptr (default value) * @param indices array (of size solorCount) of color indices. These indices are cast to unsigned int in the case of a discrete color map. If indices == nullptr (default value), indices are set from 0 to colorCount - 1 */ - virtual DLL_IMPORT_OR_EXPORT void setHsvColors(unsigned int colorCount, + virtual DLL_IMPORT_OR_EXPORT void setHsvColors(uint64_t colorCount, double const* hsvColors, double const* alphas = nullptr, std::vector const& colorTitles = std::vector(), double const* indices = nullptr) = 0; @@ -48,7 +48,7 @@ namespace RESQML2_NS * @param colorTitles vector (of size colorCount) of color titles. Titles are not set if colorTitles == nullptr (default value) * @param indices array (of size solorCount) of color indices. These indices are cast to unsigned int in the case of a discrete color map. If indices == nullptr (default value), indices are set from 0 to colorCount - 1 */ - DLL_IMPORT_OR_EXPORT void setRgbColors(unsigned int colorCount, + DLL_IMPORT_OR_EXPORT void setRgbColors(uint64_t colorCount, double const* rgbColors, double const* alphas = nullptr, std::vector const& colorTitles = std::vector(), double const* indices = nullptr); @@ -60,7 +60,7 @@ namespace RESQML2_NS * @param colorTitles vector (of size colorCount) of color titles. Titles are not set if colorTitles == nullptr (default value) * @param indices array (of size solorCount) of color indices. These indices are cast to unsigned int in the case of a discrete color map. If indices == nullptr (default value), indices are set from 0 to colorCount - 1 */ - DLL_IMPORT_OR_EXPORT void setRgbColors(unsigned int colorCount, + DLL_IMPORT_OR_EXPORT void setRgbColors(uint64_t colorCount, unsigned int const* rgbColors, double const* alphas = nullptr, std::vector const& colorTitles = std::vector(), double const* indices = nullptr); @@ -131,12 +131,6 @@ namespace RESQML2_NS void loadTargetRelationships() {}; - private: - /** - * @param colorIndex index of a color in the color map. It is cast to unsigned int in the case of a discrete color map - */ - virtual gsoap_eml2_3::resqml22__HsvColor* getColor(double colorIndex) const = 0; - protected: /** * Only to be used in partial transfer context @@ -153,5 +147,11 @@ namespace RESQML2_NS * Set the gsoap proxy to nullptr from superclass constructor */ AbstractColorMap() {} + + private: + /** + * @param colorIndex index of a color in the color map. It is cast to unsigned int in the case of a discrete color map + */ + virtual gsoap_eml2_3::resqml22__HsvColor* getColor(double colorIndex) const = 0; }; } \ No newline at end of file diff --git a/src/resqml2/AbstractFeatureInterpretation.cpp b/src/resqml2/AbstractFeatureInterpretation.cpp index 44428840b..c90d8a133 100644 --- a/src/resqml2/AbstractFeatureInterpretation.cpp +++ b/src/resqml2/AbstractFeatureInterpretation.cpp @@ -23,10 +23,10 @@ under the License. #include #include +#include "../eml2/AbstractLocal3dCrs.h" + #include "AbstractFeature.h" #include "GridConnectionSetRepresentation.h" -#include "LocalDepth3dCrs.h" -#include "LocalTime3dCrs.h" using namespace RESQML2_NS; using namespace std; @@ -104,12 +104,12 @@ gsoap_resqml2_0_1::resqml20__Domain AbstractFeatureInterpretation::initDomain(gs } const uint64_t patchCount = rep->getPatchCount(); for (uint64_t patchIndex = 0; patchIndex < patchCount && (!isTimeDomain || !isDepthDomain); ++patchIndex) { - AbstractLocal3dCrs* local3dCrs = rep->getLocalCrs(patchIndex); - if (local3dCrs != nullptr) { - if (dynamic_cast(local3dCrs) != nullptr) { + EML2_NS::AbstractLocal3dCrs* local3dCrs = rep->getLocalCrs(patchIndex); + if (local3dCrs != nullptr && (!local3dCrs->isPartial() || local3dCrs->getXmlNamespaceVersion() == "2.0")) { + if (local3dCrs->isATimeCrs()) { isTimeDomain = true; } - else if (dynamic_cast(local3dCrs) != nullptr) { + else { isDepthDomain = true; } } diff --git a/src/resqml2/AbstractProperty.cpp b/src/resqml2/AbstractProperty.cpp index b55d9a4f5..f4e7019da 100644 --- a/src/resqml2/AbstractProperty.cpp +++ b/src/resqml2/AbstractProperty.cpp @@ -19,19 +19,17 @@ under the License. #include "AbstractProperty.h" #include -#include -#include #include "../tools/TimeTools.h" #include "../common/EnumStringMapper.h" #include "../eml2/AbstractHdfProxy.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/PropertyKind.h" #include "../eml2/TimeSeries.h" #include "AbstractRepresentation.h" -#include "AbstractLocal3dCrs.h" #include "../resqml2_0_1/PropertyKindMapper.h" #include "../resqml2_0_1/PropertySet.h" @@ -51,7 +49,7 @@ void AbstractProperty::loadTargetRelationships() dor = getLocalCrsDor(); if (!dor.isEmpty()) { - convertDorIntoRel(dor); + convertDorIntoRel(dor); } dor = getPropertyKindDor(); @@ -294,7 +292,7 @@ RESQML2_0_1_NS::PropertySet * AbstractProperty::getPropertySet(uint64_t index) c return getPropertySets().at(index); } -void AbstractProperty::setLocalCrs(AbstractLocal3dCrs * crs) +void AbstractProperty::setLocalCrs(EML2_NS::AbstractLocal3dCrs* crs) { if (crs == nullptr) { throw invalid_argument("The crs of this property values cannot be null."); @@ -314,9 +312,9 @@ void AbstractProperty::setLocalCrs(AbstractLocal3dCrs * crs) getRepository()->addRelationship(this, crs); } -AbstractLocal3dCrs* AbstractProperty::getLocalCrs() const +EML2_NS::AbstractLocal3dCrs* AbstractProperty::getLocalCrs() const { - return getRepository()->getDataObjectByUuid(getLocalCrsDor().getUuid()); + return getRepository()->getDataObjectByUuid(getLocalCrsDor().getUuid()); } COMMON_NS::DataObjectReference AbstractProperty::getLocalCrsDor() const diff --git a/src/resqml2/AbstractProperty.h b/src/resqml2/AbstractProperty.h index ee480c50f..d3001ab06 100644 --- a/src/resqml2/AbstractProperty.h +++ b/src/resqml2/AbstractProperty.h @@ -23,6 +23,7 @@ under the License. namespace EML2_NS { class AbstractHdfProxy; + class AbstractLocal3dCrs; class PropertyKind; class TimeSeries; } @@ -181,7 +182,7 @@ namespace RESQML2_NS * * @param [in] crs The local CRS to associate with the current property. */ - DLL_IMPORT_OR_EXPORT void setLocalCrs(class AbstractLocal3dCrs * crs); + DLL_IMPORT_OR_EXPORT void setLocalCrs(EML2_NS::AbstractLocal3dCrs* crs); /** * Gets the local CRS which is associated to this property. @@ -189,7 +190,7 @@ namespace RESQML2_NS * @returns The local CRS which is associated to the current property if exists, null if not * (usually for a property which is not CRS related). */ - DLL_IMPORT_OR_EXPORT class AbstractLocal3dCrs* getLocalCrs() const; + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* getLocalCrs() const; /** * Gets the data object reference of the local CRS which is associated to this property diff --git a/src/resqml2/AbstractRepresentation.cpp b/src/resqml2/AbstractRepresentation.cpp index e46df4f3e..0241b053a 100644 --- a/src/resqml2/AbstractRepresentation.cpp +++ b/src/resqml2/AbstractRepresentation.cpp @@ -26,14 +26,14 @@ under the License. #include "H5public.h" #include "../eml2/AbstractHdfProxy.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/TimeSeries.h" #include "AbstractFeatureInterpretation.h" -#include "RepresentationSetRepresentation.h" #include "AbstractValuesProperty.h" #include "PointsProperty.h" +#include "RepresentationSetRepresentation.h" #include "SubRepresentation.h" -#include "AbstractLocal3dCrs.h" using namespace RESQML2_NS; using namespace std; @@ -105,7 +105,7 @@ gsoap_eml2_3::resqml22__Seismic3dCoordinates* AbstractRepresentation::getSeismic } gsoap_resqml2_0_1::resqml20__PointGeometry* AbstractRepresentation::createPointGeometryPatch2_0_1(uint64_t patchIndex, - double const * points, AbstractLocal3dCrs const* localCrs, uint64_t const* numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy* proxy) + double const * points, EML2_NS::AbstractLocal3dCrs const* localCrs, uint64_t const* numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy* proxy) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -151,7 +151,7 @@ gsoap_resqml2_0_1::resqml20__PointGeometry* AbstractRepresentation::createPointG } gsoap_eml2_3::resqml22__PointGeometry* AbstractRepresentation::createPointGeometryPatch2_2(uint64_t patchIndex, - double const * points, AbstractLocal3dCrs const* localCrs, uint64_t const* numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy* proxy) + double const * points, EML2_NS::AbstractLocal3dCrs const* localCrs, uint64_t const* numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy* proxy) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -197,10 +197,10 @@ gsoap_eml2_3::resqml22__PointGeometry* AbstractRepresentation::createPointGeomet } } -AbstractLocal3dCrs* AbstractRepresentation::getLocalCrs(unsigned int patchIndex) const +EML2_NS::AbstractLocal3dCrs* AbstractRepresentation::getLocalCrs(unsigned int patchIndex) const { const auto dor = getLocalCrsDor(patchIndex); - return dor.isEmpty() ? nullptr : getRepository()->getDataObjectByUuid(dor.getUuid()); + return dor.isEmpty() ? nullptr : getRepository()->getDataObjectByUuid(dor.getUuid()); } COMMON_NS::DataObjectReference AbstractRepresentation::getLocalCrsDor(unsigned int patchIndex) const @@ -424,7 +424,7 @@ bool AbstractRepresentation::isInSingleLocalCrs() const if (patchCount < 2) { return true; } - AbstractLocal3dCrs const* localCrsRef = getLocalCrs(0); + EML2_NS::AbstractLocal3dCrs const* localCrsRef = getLocalCrs(0); for (uint64_t patchIndex = 1; patchIndex < patchCount; ++patchIndex) { if (getLocalCrs(patchIndex) != localCrsRef) { @@ -441,7 +441,7 @@ bool AbstractRepresentation::isInSingleGlobalCrs() const if (patchCount < 2) { return true; } - AbstractLocal3dCrs const* localCrs = getLocalCrs(0); + EML2_NS::AbstractLocal3dCrs const* localCrs = getLocalCrs(0); const uint64_t epsgCode = (localCrs != nullptr && localCrs->isProjectedCrsDefinedWithEpsg()) ? localCrs->getProjectedCrsEpsgCode() : (std::numeric_limits::max)(); for (uint64_t patchIndex = 1; patchIndex < patchCount; ++patchIndex) { @@ -537,7 +537,7 @@ void AbstractRepresentation::loadTargetRelationships() for (unsigned int patchIndex = 0; patchIndex < getPatchCount(); ++patchIndex) { dor = getLocalCrsDor(patchIndex); if (!dor.isEmpty()) { - convertDorIntoRel(dor); + convertDorIntoRel(dor); } } diff --git a/src/resqml2/AbstractRepresentation.h b/src/resqml2/AbstractRepresentation.h index a09c565c0..244a5a24e 100644 --- a/src/resqml2/AbstractRepresentation.h +++ b/src/resqml2/AbstractRepresentation.h @@ -24,6 +24,7 @@ under the License. namespace EML2_NS { + class AbstractLocal3dCrs; class TimeSeries; } @@ -50,7 +51,7 @@ namespace RESQML2_NS * * @returns Null if it fails, else the local CRS associated to the @p patchIndex patch. */ - DLL_IMPORT_OR_EXPORT class AbstractLocal3dCrs* getLocalCrs(unsigned int patchIndex) const; + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* getLocalCrs(unsigned int patchIndex) const; /** * Gets the data object reference of the local 3d CRS associated to a given patch of this @@ -457,7 +458,7 @@ namespace RESQML2_NS * * @returns Null if it fails, else the new point geometry patch 2 0 1. */ - gsoap_resqml2_0_1::resqml20__PointGeometry* createPointGeometryPatch2_0_1(uint64_t patchIndex, double const * points, class AbstractLocal3dCrs const* localCrs, uint64_t const * numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy * proxy); + gsoap_resqml2_0_1::resqml20__PointGeometry* createPointGeometryPatch2_0_1(uint64_t patchIndex, double const * points, EML2_NS::AbstractLocal3dCrs const* localCrs, uint64_t const * numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy * proxy); /** * Creates a v2.2 point geometry patch. @@ -477,7 +478,7 @@ namespace RESQML2_NS * * @returns Null if it fails, else the new point geometry patch 2 0 1. */ - gsoap_eml2_3::resqml22__PointGeometry* createPointGeometryPatch2_2(uint64_t patchIndex, double const * points, class AbstractLocal3dCrs const* localCrs, uint64_t const * numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy * proxy); + gsoap_eml2_3::resqml22__PointGeometry* createPointGeometryPatch2_2(uint64_t patchIndex, double const * points, EML2_NS::AbstractLocal3dCrs const* localCrs, uint64_t const * numPoints, uint32_t numDimensionsInArray, EML2_NS::AbstractHdfProxy * proxy); /** * Gets hdf proxy dor from point geometry patch diff --git a/src/resqml2/CMakeLists.txt b/src/resqml2/CMakeLists.txt index 6312a6e1c..fef5d2a8d 100644 --- a/src/resqml2/CMakeLists.txt +++ b/src/resqml2/CMakeLists.txt @@ -4,7 +4,6 @@ set(FESAPI_RESQML_2_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/Abstr ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractFeatureInterpretation.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractGridRepresentation.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractIjkGridRepresentation.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractLocal3dCrs.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractOrganizationInterpretation.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractProperty.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractRepresentation.cpp @@ -58,7 +57,6 @@ set(FESAPI_RESQML_2_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/Abstr ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractFeatureInterpretation.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractGridRepresentation.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractIjkGridRepresentation.h - ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractLocal3dCrs.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractOrganizationInterpretation.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractProperty.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/AbstractRepresentation.h @@ -94,8 +92,6 @@ set(FESAPI_RESQML_2_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/Abstr ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/IjkGridLatticeRepresentation.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/IjkGridNoGeometryRepresentation.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/IjkGridParametricRepresentation.h - ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/LocalDepth3dCrs.h - ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/LocalTime3dCrs.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/MdDatum.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/Model.h ${CMAKE_CURRENT_SOURCE_DIR}/${RESQML_PREFIX_2}/NonSealedSurfaceFrameworkRepresentation.h diff --git a/src/resqml2/ContinuousColorMap.cpp b/src/resqml2/ContinuousColorMap.cpp index 0a596c86a..2ac720f5b 100644 --- a/src/resqml2/ContinuousColorMap.cpp +++ b/src/resqml2/ContinuousColorMap.cpp @@ -24,7 +24,7 @@ using namespace std; using namespace gsoap_eml2_3; using namespace RESQML2_NS; -void ContinuousColorMap::setHsvColors(unsigned int colorCount, +void ContinuousColorMap::setHsvColors(uint64_t colorCount, double const* hsvColors, double const* alphas, vector const& colorTitles, double const* indices) { @@ -51,16 +51,16 @@ void ContinuousColorMap::setHsvColors(unsigned int colorCount, throw invalid_argument("alpha must be in range [0, 1]"); } - resqml22__ContinuousColorMapEntry* continuousColorMapEntry = soap_new_resqml22__ContinuousColorMapEntry(gsoapProxy2_3->soap, 1); + resqml22__ContinuousColorMapEntry* continuousColorMapEntry = soap_new_resqml22__ContinuousColorMapEntry(gsoapProxy2_3->soap); continuousColorMapEntry->Index = indices != nullptr ? indices[colorIndex] : colorIndex; - resqml22__HsvColor* color = soap_new_resqml22__HsvColor(gsoapProxy2_3->soap, 1); + resqml22__HsvColor* color = soap_new_resqml22__HsvColor(gsoapProxy2_3->soap); color->Hue = hsvColors[3 * colorIndex]; color->Saturation = hsvColors[3 * colorIndex + 1]; color->Value = hsvColors[3 * colorIndex + 2]; color->Alpha = alphas != nullptr ? alphas[colorIndex] : 1.0; if (!colorTitles.empty()) { - color->Title = soap_new_std__string(gsoapProxy2_3->soap, 1); + color->Title = soap_new_std__string(gsoapProxy2_3->soap); *color->Title = colorTitles[colorIndex]; } @@ -97,6 +97,88 @@ std::string ContinuousColorMap::getInterpolationMethodAsString() return soap_resqml22__InterpolationMethod2s(gsoapProxy2_3->soap, getInterpolationMethod()); } +void ContinuousColorMap::setNanHsvColor(double hue, double saturation, double value, double alpha, std::string const& colorTitle) +{ + if (hue < 0 || hue > 360) { + throw invalid_argument("hue must be in range [0, 360]"); + } + + if (saturation < 0 || saturation > 1) { + throw invalid_argument("saturation must be in range [0, 1]"); + } + + if (value < 0 || value > 1) { + throw invalid_argument("value must be in range [0, 1]"); + } + + if (alpha < 0 || alpha > 1) { + throw invalid_argument("alpha must be in range [0, 1]"); + } + + resqml22__ContinuousColorMap* const continuousColorMap = static_cast(gsoapProxy2_3); + + if (continuousColorMap->NullColor == nullptr) { + continuousColorMap->NullColor = soap_new_resqml22__HsvColor(gsoapProxy2_3->soap); + } + + continuousColorMap->NullColor->Hue = hue; + continuousColorMap->NullColor->Saturation = saturation; + continuousColorMap->NullColor->Value = value; + continuousColorMap->NullColor->Alpha = alpha; + if (!colorTitle.empty()) { + continuousColorMap->NullColor->Title = soap_new_std__string(gsoapProxy2_3->soap); + *continuousColorMap->NullColor->Title = colorTitle; + } +} + +void ContinuousColorMap::setNanRgbColor(double red, double green, double blue, double alpha, std::string const& colorTitle) +{ + if (red < 0 || red > 1) { + throw invalid_argument("red must be in range [0, 1]"); + } + + if (green < 0 || green > 1) { + throw invalid_argument("green must be in range [0, 1]"); + } + + if (blue < 0 || blue > 1) { + throw invalid_argument("blue must be in range [0, 1]"); + } + + if (alpha < 0 || alpha > 1) { + throw invalid_argument("alpha must be in range [0, 1]"); + } + + double hue, saturation, value; + EML2_NS::GraphicalInformationSet::rgbToHsv(red, green, blue, hue, saturation, value); + + setNanHsvColor(hue, saturation, value, alpha, colorTitle); +} + +void ContinuousColorMap::setNanRgbColor(unsigned int red, unsigned int green, unsigned int blue, double alpha, std::string const& colorTitle) +{ + if (red > 255) { + throw invalid_argument("red must be in range [0, 255]"); + } + + if (green > 255) { + throw invalid_argument("green must be in range [0, 255]"); + } + + if (blue > 255) { + throw invalid_argument("blue must be in range [0, 255]"); + } + + if (alpha < 0 || alpha > 255) { + throw invalid_argument("alpha must be in range [0, 255]"); + } + + double hue, saturation, value; + EML2_NS::GraphicalInformationSet::rgbToHsv(red, green, blue, hue, saturation, value); + + setNanHsvColor(hue, saturation, value, alpha, colorTitle); +} + resqml22__HsvColor* ContinuousColorMap::getColor(double colorIndex) const { resqml22__ContinuousColorMap const* const continuousColorMap = static_cast(gsoapProxy2_3); diff --git a/src/resqml2/ContinuousColorMap.h b/src/resqml2/ContinuousColorMap.h index 08c759783..2ee2eb09e 100644 --- a/src/resqml2/ContinuousColorMap.h +++ b/src/resqml2/ContinuousColorMap.h @@ -39,7 +39,7 @@ namespace RESQML2_NS * @param colorTitles vector (of size colorCount) of color titles. Titles are not set if colorTitles == nullptr (default value) * @param indices array (of size solorCount) of color indices. If indices == nullptr (default value), indices are set from 0 to colorCount - 1 */ - DLL_IMPORT_OR_EXPORT void setHsvColors(unsigned int colorCount, + DLL_IMPORT_OR_EXPORT void setHsvColors(uint64_t colorCount, double const* hsvColors, double const* alphas = nullptr, std::vector const& colorTitles = std::vector(), double const* indices = nullptr) final; @@ -73,6 +73,42 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT std::string getInterpolationMethodAsString(); + /** + * @brief Sets the NanColor value of a continuous color map + * + * @param hue hue in the range [0, 360]. + * @param saturation saturation in the range [0, 1]. + * @param value value in the range [0, 1]. + * @param alpha (Optional) alpha in the range [0, 1] (0 means transparent and 1 means + * opaque). Default alpha value is 1. + * @param colorTitle (Optional) color title. It is not set if empty string (default value) + */ + DLL_IMPORT_OR_EXPORT void setNanHsvColor(double hue, double saturation, double value, double alpha = 1, std::string const& colorTitle = ""); + + /** + * @brief Sets the NanColor value of a continuous color map + * + * @param red red value in the range [0, 1]. + * @param green green value in the range [0, 1]. + * @param blue blue value in the range [0, 1]. + * @param alpha (Optional) alpha in the range [0, 1] (0 means transparent and 1 means + * opaque). Default alpha value is 1. + * @param colorTitle (Optional) color title. It is not set if empty string (default value) + */ + DLL_IMPORT_OR_EXPORT void setNanRgbColor(double red, double green, double blue, double alpha = 1, std::string const& colorTitle = ""); + + /** + * @brief Sets the NanColor value of a continuous color map + * + * @param red red value in the range [0, 255]. + * @param green green value in the range [0, 255]. + * @param blue blue value in the range [0, 255]. + * @param alpha (Optional) alpha in the range [0, 1] (0 means transparent and 1 means + * opaque). Default alpha value is 1. + * @param colorTitle (Optional) color title. It is not set if empty string (default value) + */ + DLL_IMPORT_OR_EXPORT void setNanRgbColor(unsigned int red, unsigned int green, unsigned int blue, double alpha = 1, std::string const& colorTitle = ""); + /** @brief The XML tag */ DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "ContinuousColorMap"; diff --git a/src/resqml2/DiscreteColorMap.cpp b/src/resqml2/DiscreteColorMap.cpp index bf16eaff2..8f5a87867 100644 --- a/src/resqml2/DiscreteColorMap.cpp +++ b/src/resqml2/DiscreteColorMap.cpp @@ -23,14 +23,13 @@ using namespace gsoap_eml2_3; using namespace COMMON_NS; using namespace RESQML2_NS; -const char* DiscreteColorMap::XML_TAG = "DiscreteColorMap"; - -void DiscreteColorMap::setHsvColors(unsigned int colorCount, +void DiscreteColorMap::setHsvColors(uint64_t colorCount, double const* hsvColors, double const* alphas, vector const& colorTitles, double const* indices) { - if (colorCount == 0) + if (colorCount == 0) { throw invalid_argument("The color count cannot be 0."); + } resqml22__DiscreteColorMap* const discreteColorMap = static_cast(gsoapProxy2_3); @@ -51,16 +50,16 @@ void DiscreteColorMap::setHsvColors(unsigned int colorCount, throw invalid_argument("alpha must be in range [0, 1]"); } - resqml22__DiscreteColorMapEntry* discreteColorMapEntry = soap_new_resqml22__DiscreteColorMapEntry(gsoapProxy2_3->soap, 1); - indices != nullptr ? discreteColorMapEntry->index = indices[colorIndex] : discreteColorMapEntry->index = colorIndex; - resqml22__HsvColor* color = soap_new_resqml22__HsvColor(gsoapProxy2_3->soap, 1); + resqml22__DiscreteColorMapEntry* discreteColorMapEntry = soap_new_resqml22__DiscreteColorMapEntry(gsoapProxy2_3->soap); + discreteColorMapEntry->index = indices != nullptr ? indices[colorIndex] : colorIndex; + resqml22__HsvColor* color = soap_new_resqml22__HsvColor(gsoapProxy2_3->soap); color->Hue = hsvColors[3 * colorIndex]; color->Saturation = hsvColors[3 * colorIndex + 1]; color->Value = hsvColors[3 * colorIndex + 2]; color->Alpha = alphas != nullptr ? alphas[colorIndex] : 1.0; if (!colorTitles.empty()) { - color->Title = soap_new_std__string(gsoapProxy2_3->soap, 1); + color->Title = soap_new_std__string(gsoapProxy2_3->soap); *color->Title = colorTitles[colorIndex]; } @@ -79,9 +78,9 @@ resqml22__HsvColor* DiscreteColorMap::getColor(double colorIndex) const { resqml22__DiscreteColorMap const* const discreteColorMap = static_cast(gsoapProxy2_3); - for (size_t i = 0; i < discreteColorMap->Entry.size(); ++i) { - if (discreteColorMap->Entry[i]->index == colorIndex) { - return discreteColorMap->Entry[i]->Hsv; + for (auto* entry : discreteColorMap->Entry) { + if (entry->index == colorIndex) { + return entry->Hsv; } } diff --git a/src/resqml2/DiscreteColorMap.h b/src/resqml2/DiscreteColorMap.h index 9d78b9741..b2e522eae 100644 --- a/src/resqml2/DiscreteColorMap.h +++ b/src/resqml2/DiscreteColorMap.h @@ -48,16 +48,16 @@ namespace RESQML2_NS * are cast to unsigned int in the case of a discrete color map. If indices * == nullptr (default value), indices are set from 0 to colorCount - 1. */ - DLL_IMPORT_OR_EXPORT void setHsvColors(unsigned int colorCount, - double const * hsvColors, double const * alphas = nullptr, std::vector const& colorTitles = std::vector(), - double const * indices = nullptr) final; + DLL_IMPORT_OR_EXPORT void setHsvColors(uint64_t colorCount, + double const* hsvColors, double const* alphas = nullptr, std::vector const& colorTitles = std::vector(), + double const* indices = nullptr) final; DLL_IMPORT_OR_EXPORT uint64_t getColorCount() const final; /** * The standard XML tag without XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static const char* XML_TAG; + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "DiscreteColorMap"; /** * Get the standard XML tag without XML namespace for serializing this data object. diff --git a/src/resqml2/Grid2dRepresentation.cpp b/src/resqml2/Grid2dRepresentation.cpp index c208ebb00..80d72d533 100644 --- a/src/resqml2/Grid2dRepresentation.cpp +++ b/src/resqml2/Grid2dRepresentation.cpp @@ -18,9 +18,7 @@ under the License. -----------------------------------------------------------------------*/ #include "Grid2dRepresentation.h" -#include - -#include "AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace RESQML2_NS; @@ -49,7 +47,7 @@ void Grid2dRepresentation::getZValuesInGlobalCrs(double * values) const { getZValues(values); - RESQML2_NS::AbstractLocal3dCrs* localCrs = !getSupportingRepresentationDor().isEmpty() + EML2_NS::AbstractLocal3dCrs* localCrs = !getSupportingRepresentationDor().isEmpty() ? getSupportingRepresentation()->getLocalCrs(0) : getLocalCrs(0); @@ -71,7 +69,7 @@ double Grid2dRepresentation::getComponentInGlobalCrs(double x, double y, double } // there can be only one patch in a 2d grid repesentation - RESQML2_NS::AbstractLocal3dCrs* localCrs = componentIndex != 2 && !getSupportingRepresentationDor().isEmpty() + EML2_NS::AbstractLocal3dCrs* localCrs = componentIndex != 2 && !getSupportingRepresentationDor().isEmpty() ? getSupportingRepresentation()->getLocalCrs(0) : getLocalCrs(0); diff --git a/src/resqml2/Grid2dRepresentation.h b/src/resqml2/Grid2dRepresentation.h index f30426084..a3cd522af 100644 --- a/src/resqml2/Grid2dRepresentation.h +++ b/src/resqml2/Grid2dRepresentation.h @@ -341,7 +341,7 @@ namespace RESQML2_NS double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** * Sets the geometry of this 2d grid representation. The set geometry is a 2d array of explicit @@ -377,7 +377,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT virtual void setGeometryAsArray2dOfExplicitZ( double * zValues, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, - Grid2dRepresentation * supportingGrid2dRepresentation, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr, + Grid2dRepresentation * supportingGrid2dRepresentation, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr, unsigned int startIndexI = 0, unsigned int startIndexJ = 0, int indexIncrementI = 1, int indexIncrementJ = 1) = 0; @@ -417,7 +417,7 @@ namespace RESQML2_NS unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, - double offsetJX, double offsetJY, double offsetJZ, double spacingJ, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + double offsetJX, double offsetJY, double offsetJZ, double spacingJ, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** * Gets the supporting representation data object reference. diff --git a/src/resqml2/IjkGridExplicitRepresentation.h b/src/resqml2/IjkGridExplicitRepresentation.h index 10eb82d0a..b6353dd70 100644 --- a/src/resqml2/IjkGridExplicitRepresentation.h +++ b/src/resqml2/IjkGridExplicitRepresentation.h @@ -144,7 +144,7 @@ namespace RESQML2_NS double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, unsigned int const* pillarOfCoordinateLine = nullptr, unsigned int const* splitCoordinateLineColumnCumulativeCount = nullptr, unsigned int const* splitCoordinateLineColumns = nullptr, - int8_t const* definedPillars = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + int8_t const* definedPillars = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** * @copybrief setGeometryAsCoordinateLineNodes @@ -157,7 +157,7 @@ namespace RESQML2_NS const std::string & points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, const std::string & pillarOfCoordinateLine = "", const std::string & splitCoordinateLineColumnCumulativeCount = "", const std::string & splitCoordinateLineColumns = "", - const std::string & definedPillars = "", RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + const std::string & definedPillars = "", EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; DLL_IMPORT_OR_EXPORT bool isNodeGeometryCompressed() const final; diff --git a/src/resqml2/IjkGridLatticeRepresentation.cpp b/src/resqml2/IjkGridLatticeRepresentation.cpp index 06d898cdb..b9ee0fc7a 100644 --- a/src/resqml2/IjkGridLatticeRepresentation.cpp +++ b/src/resqml2/IjkGridLatticeRepresentation.cpp @@ -19,11 +19,10 @@ under the License. #include "IjkGridLatticeRepresentation.h" -#include +#include "../eml2/AbstractLocal3dCrs.h" #include "AbstractFeature.h" #include "AbstractFeatureInterpretation.h" -#include "AbstractLocal3dCrs.h" #include "AbstractValuesProperty.h" using namespace std; @@ -111,7 +110,7 @@ double IjkGridLatticeRepresentation::getZOriginInGlobalCrs() const return result; } // Only one patch is allowed for an IJK Grid lattice - RESQML2_NS::AbstractLocal3dCrs const * localCrs = getLocalCrs(0); + EML2_NS::AbstractLocal3dCrs const * localCrs = getLocalCrs(0); if (localCrs->getGsoapType() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__obj_USCORELocalTime3dCrs) { return result; } diff --git a/src/resqml2/IjkGridLatticeRepresentation.h b/src/resqml2/IjkGridLatticeRepresentation.h index 282e89d28..23efbef2c 100644 --- a/src/resqml2/IjkGridLatticeRepresentation.h +++ b/src/resqml2/IjkGridLatticeRepresentation.h @@ -356,7 +356,7 @@ namespace RESQML2_NS double originX, double originY, double originZ, double directionIX, double directionIY, double directionIZ, double spacingI, double directionJX, double directionJY, double directionJZ, double spacingJ, - double directionKX, double directionKY, double directionKZ, double spacingK, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + double directionKX, double directionKY, double directionKZ, double spacingK, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** * Pushes back a patch of seismic 3D coordinates. diff --git a/src/resqml2/IjkGridParametricRepresentation.cpp b/src/resqml2/IjkGridParametricRepresentation.cpp index e1194ab34..4506984b8 100644 --- a/src/resqml2/IjkGridParametricRepresentation.cpp +++ b/src/resqml2/IjkGridParametricRepresentation.cpp @@ -18,12 +18,10 @@ under the License. -----------------------------------------------------------------------*/ #include "IjkGridParametricRepresentation.h" -#include -#include +#include #include "../eml2/AbstractHdfProxy.h" - -#include "AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace gsoap_resqml2_0_1; @@ -964,7 +962,7 @@ void IjkGridParametricRepresentation::getXyzPointsOfBlock(double * xyzPoints) void IjkGridParametricRepresentation::setGeometryAsParametricNonSplittedPillarNodes( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, - EML2_NS::AbstractHdfProxy* proxy, RESQML2_NS::AbstractLocal3dCrs * localCrs) + EML2_NS::AbstractHdfProxy* proxy, EML2_NS::AbstractLocal3dCrs * localCrs) { setGeometryAsParametricSplittedPillarNodes(mostComplexPillarGeometry, isRightHanded, parameters, controlPoints, controlPointParameters, controlPointMaxCountPerPillar, pillarKind, proxy, 0, nullptr, nullptr, nullptr, localCrs); @@ -972,7 +970,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricNonSplittedPillarNo void IjkGridParametricRepresentation::setGeometryAsParametricNonSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, - const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, EML2_NS::AbstractLocal3dCrs * localCrs) { setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets(mostComplexPillarGeometry, kDirectionKind, isRightHanded, parameters, controlPoints, controlPointParameters, controlPointMaxCountPerPillar, pillarKind, definedPillars, proxy, 0, "", "", "", localCrs); @@ -1020,7 +1018,7 @@ void IjkGridParametricRepresentation::writeGeometryOnHdf(double const * paramete void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes(bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy * proxy, uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine, - unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (parameters == nullptr) { @@ -1363,7 +1361,7 @@ namespace { } } -gsoap_resqml2_0_1::resqml20__KDirection IjkGridParametricRepresentation::computeKDirection(double const * controlPoints, unsigned int controlPointCountPerPillar, short const * pillarKind, RESQML2_NS::AbstractLocal3dCrs const * localCrs) { +gsoap_resqml2_0_1::resqml20__KDirection IjkGridParametricRepresentation::computeKDirection(double const * controlPoints, unsigned int controlPointCountPerPillar, short const * pillarKind, EML2_NS::AbstractLocal3dCrs const * localCrs) { if (controlPoints == nullptr) { throw invalid_argument("The control points cannot be null."); } diff --git a/src/resqml2/IjkGridParametricRepresentation.h b/src/resqml2/IjkGridParametricRepresentation.h index bd35a5d5a..e2b2178ac 100644 --- a/src/resqml2/IjkGridParametricRepresentation.h +++ b/src/resqml2/IjkGridParametricRepresentation.h @@ -261,7 +261,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT void setGeometryAsParametricNonSplittedPillarNodes( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); /** * Sets the geometry of this IJK grid as parametric pillar nodes where no pillar is splitted. @@ -310,7 +310,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT void setGeometryAsParametricNonSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); /** * Sets the geometry of this IJK grid as parametric pillar nodes where at least one pillar is @@ -381,7 +381,7 @@ namespace RESQML2_NS gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine, - unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** * Sets the geometry of this IJK grid as parametric pillar nodes where at least one pillar is @@ -455,7 +455,7 @@ namespace RESQML2_NS gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** * Set the geometry of the IJK grid as parametric pillar nodes where at least one pillar is @@ -523,7 +523,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT void setGeometryAsParametricSplittedPillarNodes(bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine, - unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); /** * Set the geometry of the IJK grid as parametric pillar nodes where at least one pillar is @@ -591,7 +591,7 @@ namespace RESQML2_NS gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; DLL_IMPORT_OR_EXPORT bool isNodeGeometryCompressed() const final; @@ -619,7 +619,7 @@ namespace RESQML2_NS /** * Compute the K Direction of the gid according to its control points. */ - gsoap_resqml2_0_1::resqml20__KDirection computeKDirection(double const * controlPoints, unsigned int controlPointCountPerPillar, short const * pillarKind, RESQML2_NS::AbstractLocal3dCrs const * localCrs); + gsoap_resqml2_0_1::resqml20__KDirection computeKDirection(double const * controlPoints, unsigned int controlPointCountPerPillar, short const * pillarKind, EML2_NS::AbstractLocal3dCrs const * localCrs); void writeGeometryOnHdf(double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointCountPerPillar, diff --git a/src/resqml2/LocalDepth3dCrs.h b/src/resqml2/LocalDepth3dCrs.h deleted file mode 100644 index f3a809be9..000000000 --- a/src/resqml2/LocalDepth3dCrs.h +++ /dev/null @@ -1,61 +0,0 @@ -/*----------------------------------------------------------------------- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"; you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ------------------------------------------------------------------------*/ -#pragma once - -#include "AbstractLocal3dCrs.h" - -namespace RESQML2_NS -{ - /** - * @brief Defines a local depth coordinate system. The geometrical origin and location are - * defined by the elements of the base class AbstractLocal3dCrs. This CRS uses the units - * of measure of its projected and vertical CRS. - */ - class LocalDepth3dCrs : public RESQML2_NS::AbstractLocal3dCrs - { - public: - - /** - * Only to be used in partial transfer context. - * - * @param [in] partialObject If non-nullptr, the partial object. - */ - DLL_IMPORT_OR_EXPORT LocalDepth3dCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : AbstractLocal3dCrs(partialObject) {} - - /** Destructor does nothing since the memory is manged by the gSOAP context. */ - virtual ~LocalDepth3dCrs() = default; - - /** The standard XML tag without XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "LocalDepth3dCrs"; - - DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } - - protected : - - LocalDepth3dCrs() {} - - /** - * Creates an instance of this class by wrapping a gsoap instance. - * - * @param [in,out] fromGsoap If non-null, from gsoap. - */ - LocalDepth3dCrs(gsoap_resqml2_0_1::_resqml20__LocalDepth3dCrs* fromGsoap) : AbstractLocal3dCrs(fromGsoap) {} - - }; -} diff --git a/src/resqml2/LocalTime3dCrs.h b/src/resqml2/LocalTime3dCrs.h deleted file mode 100644 index d00b36660..000000000 --- a/src/resqml2/LocalTime3dCrs.h +++ /dev/null @@ -1,74 +0,0 @@ -/*----------------------------------------------------------------------- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"; you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ------------------------------------------------------------------------*/ -#pragma once - -#include "AbstractLocal3dCrs.h" - -namespace RESQML2_NS -{ - /** - * @brief Defines a local time coordinate system. The geometrical origin and location are - * defined by the elements of the base class AbstractLocal3dCrs. This CRS defines the - * time unit that the time-based geometries that refer to it will use. - */ - class LocalTime3dCrs : public AbstractLocal3dCrs - { - public: - - /** - * Only to be used in partial transfer context. - * - * @param [in] partialObject If non-nullptr, the partial object. - */ - DLL_IMPORT_OR_EXPORT LocalTime3dCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : AbstractLocal3dCrs(partialObject) {} - - /** Destructor does nothing since the memory is manged by the gSOAP context. */ - virtual ~LocalTime3dCrs() = default; - - /** - * Gets the unit of measure of this local time 3d CRS. - * - * @returns The unit of measure. - */ - DLL_IMPORT_OR_EXPORT virtual gsoap_resqml2_0_1::eml20__TimeUom getUnit() const = 0; - - /** - * Gets unit of measure of this local time 3d CRS as a string. - * - * @returns The unit of measure as a string. - */ - DLL_IMPORT_OR_EXPORT virtual std::string getUnitAsString() const = 0; - - /** The standard XML tag without XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "LocalTime3dCrs"; - - DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } - - protected : - - LocalTime3dCrs() {} - - /** - * Creates an instance of this class by wrapping a gsoap instance. - * - * @param [in,out] fromGsoap If non-null, from gsoap. - */ - LocalTime3dCrs(gsoap_resqml2_0_1::_resqml20__LocalTime3dCrs* fromGsoap) : AbstractLocal3dCrs(fromGsoap) {} - }; -} diff --git a/src/resqml2/MdDatum.cpp b/src/resqml2/MdDatum.cpp index 5cb95dd39..6ad71e8e3 100644 --- a/src/resqml2/MdDatum.cpp +++ b/src/resqml2/MdDatum.cpp @@ -18,7 +18,7 @@ under the License. -----------------------------------------------------------------------*/ #include "MdDatum.h" -#include "AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace RESQML2_NS; @@ -51,14 +51,14 @@ double MdDatum::getYInGlobalCrs() const double MdDatum::getZInGlobalCrs() const { double originOrdinal3 = .0; - RESQML2_NS::AbstractLocal3dCrs* localCrs = getLocalCrs(); + EML2_NS::AbstractLocal3dCrs* localCrs = getLocalCrs(); if (localCrs->getGsoapType() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__obj_USCORELocalTime3dCrs) originOrdinal3 = localCrs->getOriginDepthOrElevation(); return getZ() + originOrdinal3; } -AbstractLocal3dCrs * MdDatum::getLocalCrs() const +EML2_NS::AbstractLocal3dCrs * MdDatum::getLocalCrs() const { const string uuidLocalCrs = getLocalCrsDor().getUuid(); - return static_cast(repository->getDataObjectByUuid(uuidLocalCrs)); + return static_cast(repository->getDataObjectByUuid(uuidLocalCrs)); } diff --git a/src/resqml2/MdDatum.h b/src/resqml2/MdDatum.h index a04a6aebf..9e854e412 100644 --- a/src/resqml2/MdDatum.h +++ b/src/resqml2/MdDatum.h @@ -20,6 +20,11 @@ under the License. #include "../common/AbstractObject.h" +namespace RESQML2_NS +{ + class AbstractLocal3dCrs; +} + namespace RESQML2_NS { /** @@ -49,7 +54,7 @@ namespace RESQML2_NS * * @returns A pointer to the local CRS. */ - DLL_IMPORT_OR_EXPORT class AbstractLocal3dCrs * getLocalCrs() const; + DLL_IMPORT_OR_EXPORT EML2_NS::AbstractLocal3dCrs* getLocalCrs() const; /** * Gets the data object reference of the local 3d CRS where the reference point ordinals are @@ -153,6 +158,6 @@ namespace RESQML2_NS * @param [in] localCrs If non-nullptr, the local CRS. If nullptr, the data object repository * default CRS is set. */ - DLL_IMPORT_OR_EXPORT virtual void setLocalCrs(RESQML2_NS::AbstractLocal3dCrs * localCrs) = 0; + DLL_IMPORT_OR_EXPORT virtual void setLocalCrs(EML2_NS::AbstractLocal3dCrs * localCrs) = 0; }; } diff --git a/src/resqml2/NonSealedSurfaceFrameworkRepresentation.h b/src/resqml2/NonSealedSurfaceFrameworkRepresentation.h index c75ba9f6f..36ec878c8 100644 --- a/src/resqml2/NonSealedSurfaceFrameworkRepresentation.h +++ b/src/resqml2/NonSealedSurfaceFrameworkRepresentation.h @@ -56,7 +56,7 @@ namespace RESQML2_NS * representation is based on. If @c nullptr (default), then the * default local 3d CRS of the repository will be used. */ - DLL_IMPORT_OR_EXPORT virtual void pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + DLL_IMPORT_OR_EXPORT virtual void pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /* * Pushes back a contact patch in a particular contact representation of the structural framework. diff --git a/src/resqml2/PlaneSetRepresentation.h b/src/resqml2/PlaneSetRepresentation.h index 9803abd28..34a74a9eb 100644 --- a/src/resqml2/PlaneSetRepresentation.h +++ b/src/resqml2/PlaneSetRepresentation.h @@ -55,7 +55,7 @@ namespace RESQML2_NS * @param [in] localCrs (Optional) If non-null, the local CRS. If @c nullptr (default), the * repository default local CRS will be used. */ - DLL_IMPORT_OR_EXPORT virtual void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + DLL_IMPORT_OR_EXPORT virtual void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Pushs back a new patch which is not a horizontal plane. Its geometry is given by means of 3 @@ -80,7 +80,7 @@ namespace RESQML2_NS double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, - RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** The standard XML tag without XML namespace for serializing this data object. */ DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "PlaneSetRepresentation"; diff --git a/src/resqml2/PointSetRepresentation.h b/src/resqml2/PointSetRepresentation.h index 7099dbc34..e648cc051 100644 --- a/src/resqml2/PointSetRepresentation.h +++ b/src/resqml2/PointSetRepresentation.h @@ -54,7 +54,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT virtual void pushBackGeometryPatch( unsigned int xyzPointCount, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** The standard XML tag without XML namespace for serializing this data object. */ DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "PointSetRepresentation"; diff --git a/src/resqml2/PointsProperty.cpp b/src/resqml2/PointsProperty.cpp index dbf1208fd..fd4ab2b55 100644 --- a/src/resqml2/PointsProperty.cpp +++ b/src/resqml2/PointsProperty.cpp @@ -19,8 +19,7 @@ under the License. #include "PointsProperty.h" #include "../eml2/AbstractHdfProxy.h" - -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace RESQML2_NS; using namespace std; diff --git a/src/resqml2/PolylineRepresentation.h b/src/resqml2/PolylineRepresentation.h index e10e77666..f70c3b015 100644 --- a/src/resqml2/PolylineRepresentation.h +++ b/src/resqml2/PolylineRepresentation.h @@ -59,7 +59,7 @@ namespace RESQML2_NS * nullptr (default), then the repository default local CRS will be * used. */ - DLL_IMPORT_OR_EXPORT virtual void setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + DLL_IMPORT_OR_EXPORT virtual void setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Indicates if this representation is a closed polyline or a non closed polyline. A closed diff --git a/src/resqml2/PolylineSetRepresentation.h b/src/resqml2/PolylineSetRepresentation.h index feb0fc223..4f4bf3f85 100644 --- a/src/resqml2/PolylineSetRepresentation.h +++ b/src/resqml2/PolylineSetRepresentation.h @@ -108,7 +108,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT virtual void pushBackGeometryPatch( unsigned int const * nodeCountPerPolyline, double const * nodes, uint64_t polylineCount, bool allPolylinesClosedFlag, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Pushes back a new patch of polylines. @@ -137,7 +137,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT virtual void pushBackGeometryPatch( unsigned int const * nodeCountPerPolyline, double const * nodes, uint64_t polylineCount, bool * polylineClosedFlags, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Checks if all polylines contained in a given patch are closed. Notice that a returned "false" diff --git a/src/resqml2/SeismicWellboreFrameRepresentation.cpp b/src/resqml2/SeismicWellboreFrameRepresentation.cpp index e99feb856..12d5ceda5 100644 --- a/src/resqml2/SeismicWellboreFrameRepresentation.cpp +++ b/src/resqml2/SeismicWellboreFrameRepresentation.cpp @@ -19,9 +19,8 @@ under the License. #include "SeismicWellboreFrameRepresentation.h" #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/LocalTime3dCrs.h" -#include "../resqml2/WellboreInterpretation.h" -#include "../resqml2/WellboreTrajectoryRepresentation.h" + +#include "AbstractValuesProperty.h" using namespace std; using namespace RESQML2_NS; diff --git a/src/resqml2/StreamlinesRepresentation.h b/src/resqml2/StreamlinesRepresentation.h index 601f2596e..70063daa6 100644 --- a/src/resqml2/StreamlinesRepresentation.h +++ b/src/resqml2/StreamlinesRepresentation.h @@ -239,7 +239,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT virtual void setGeometry( uint32_t const * nodeCountPerPolyline, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; //******************************** //******* GRID INFO ************* diff --git a/src/resqml2/TriangulatedSetRepresentation.h b/src/resqml2/TriangulatedSetRepresentation.h index 9e9faff0a..e00ff24e9 100644 --- a/src/resqml2/TriangulatedSetRepresentation.h +++ b/src/resqml2/TriangulatedSetRepresentation.h @@ -62,7 +62,7 @@ namespace RESQML2_NS * @c nullptr (default value), then the repository default * local CRS will be used. */ - DLL_IMPORT_OR_EXPORT virtual void pushBackTrianglePatch(unsigned int nodeCount, double const * nodes, unsigned int triangleCount, unsigned int const * triangleNodeIndices, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; + DLL_IMPORT_OR_EXPORT virtual void pushBackTrianglePatch(unsigned int nodeCount, double const * nodes, unsigned int triangleCount, unsigned int const * triangleNodeIndices, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Gets the triangle count in a given patch of this representation. diff --git a/src/resqml2/UnstructuredGridRepresentation.cpp b/src/resqml2/UnstructuredGridRepresentation.cpp index 0dc29186b..a254ceada 100644 --- a/src/resqml2/UnstructuredGridRepresentation.cpp +++ b/src/resqml2/UnstructuredGridRepresentation.cpp @@ -18,11 +18,10 @@ under the License. -----------------------------------------------------------------------*/ #include "UnstructuredGridRepresentation.h" -#include +#include #include "../eml2/AbstractHdfProxy.h" - -#include "AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace gsoap_resqml2_0_1; @@ -83,7 +82,7 @@ void UnstructuredGridRepresentation::getNodeCountPerFace(uint64_t * nodeCountPer void UnstructuredGridRepresentation::setGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, EML2_NS::AbstractHdfProxy * proxy, uint64_t * faceIndicesPerCell, uint64_t * faceIndicesCumulativeCountPerCell, uint64_t faceCount, uint64_t * nodeIndicesPerFace, uint64_t * nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs) + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs) { if (cellFaceIsRightHanded == nullptr) throw invalid_argument("The cellFaceIsRightHanded information cannot be null."); @@ -128,7 +127,7 @@ void UnstructuredGridRepresentation::setGeometry(uint8_t * cellFaceIsRightHanded } void UnstructuredGridRepresentation::setConstantCellShapeGeometry(uint8_t * cellFaceIsRightHanded, double * points, - uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, + uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, uint64_t * faceIndicesPerCell, uint64_t faceCountPerCell, uint64_t * nodeIndicesPerFace, uint64_t nodeCountPerFace) { @@ -179,7 +178,7 @@ void UnstructuredGridRepresentation::setConstantCellShapeGeometry(uint8_t * cell void UnstructuredGridRepresentation::setTetrahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs) { setConstantCellShapeGeometryUsingExistingDatasets(cellFaceIsRightHanded, points, pointCount, faceCount, localCrs, proxy, @@ -188,7 +187,7 @@ void UnstructuredGridRepresentation::setTetrahedraOnlyGeometryUsingExistingDatas } void UnstructuredGridRepresentation::setTetrahedraOnlyGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy * proxy, - uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs) + uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs) { setConstantCellShapeGeometry(cellFaceIsRightHanded, points, pointCount, faceCount, localCrs, proxy, @@ -198,7 +197,7 @@ void UnstructuredGridRepresentation::setTetrahedraOnlyGeometry(uint8_t * cellFac void UnstructuredGridRepresentation::setHexahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs) { setConstantCellShapeGeometryUsingExistingDatasets(cellFaceIsRightHanded, points, pointCount, faceCount, localCrs, proxy, @@ -207,7 +206,7 @@ void UnstructuredGridRepresentation::setHexahedraOnlyGeometryUsingExistingDatase } void UnstructuredGridRepresentation::setHexahedraOnlyGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy * proxy, - uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs) + uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs) { setConstantCellShapeGeometry(cellFaceIsRightHanded, points, pointCount, faceCount, localCrs, proxy, diff --git a/src/resqml2/UnstructuredGridRepresentation.h b/src/resqml2/UnstructuredGridRepresentation.h index 8ab161882..6fb69c6cd 100644 --- a/src/resqml2/UnstructuredGridRepresentation.h +++ b/src/resqml2/UnstructuredGridRepresentation.h @@ -450,7 +450,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT virtual void setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, const std::string& faceIndicesCumulativeCountPerCell, uint64_t faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) = 0; /** * Sets the geometry and creates corresponding HDF5 datasets. @@ -515,7 +515,7 @@ namespace RESQML2_NS DLL_IMPORT_OR_EXPORT void setGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, uint64_t * faceIndicesPerCell, uint64_t * faceIndicesCumulativeCountPerCell, uint64_t faceCount, uint64_t * nodeIndicesPerFace, uint64_t * nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); /** * @brief Sets a geometry which is only defined by means of tetrahedra using some existing HDF5 dataset. @@ -558,7 +558,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT void setTetrahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); /** * @brief Sets a geometry which is only defined by means of tetrahedra and creates corresponding HDF5 @@ -598,7 +598,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT void setTetrahedraOnlyGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); /** * Sets a geometry which is only defined by means of hexahedra using some existing HDF5 dataset. @@ -607,7 +607,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT void setHexahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); /** * Sets a geometry which is only defined by means of hexahedra and creates corresponding HDF5 datasets. @@ -616,7 +616,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT void setHexahedraOnlyGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr); + uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); DLL_IMPORT_OR_EXPORT uint64_t getPatchCount() const final {return 1;} @@ -639,7 +639,7 @@ namespace RESQML2_NS * @param nodeCountPerFace The constant node count per face. */ void virtual setConstantCellShapeGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, - uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, + uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, uint64_t faceCountPerCell, const std::string& nodeIndicesPerFace, uint64_t nodeCountPerFace) = 0; @@ -657,7 +657,7 @@ namespace RESQML2_NS * @param nodeCountPerFace The constant node count per face. */ void setConstantCellShapeGeometry(uint8_t * cellFaceIsRightHanded, double * points, - uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, + uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, uint64_t * faceIndicesPerCell, uint64_t faceCountPerCell, uint64_t * nodeIndicesPerFace, uint64_t nodeCountPerFace); diff --git a/src/resqml2/WellboreTrajectoryRepresentation.cpp b/src/resqml2/WellboreTrajectoryRepresentation.cpp index 7f242ac39..5d5975459 100644 --- a/src/resqml2/WellboreTrajectoryRepresentation.cpp +++ b/src/resqml2/WellboreTrajectoryRepresentation.cpp @@ -19,11 +19,10 @@ under the License. #include "WellboreTrajectoryRepresentation.h" #include -#include -#include #include -#include "AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" + #include "DeviationSurveyRepresentation.h" #include "MdDatum.h" #include "WellboreFrameRepresentation.h" @@ -35,7 +34,7 @@ using namespace COMMON_NS; void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double const* inclinations, double const* azimuths, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy, AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy* proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -43,7 +42,7 @@ void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, throw std::invalid_argument("A (default) CRS must be provided."); } } - if (localCrs->getAxisOrder() != gsoap_resqml2_0_1::eml20__AxisOrder2d::easting_x0020northing) { + if (localCrs->getAxisOrder() != gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing) { throw std::invalid_argument("Cannot compute inclinations and azimuths if the local CRS is not an easting northing one."); } @@ -84,7 +83,7 @@ void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, void WellboreTrajectoryRepresentation::getInclinationsAndAzimuths(double * inclinations, double * azimuths) { auto* localCrs = getLocalCrs(0); - if (localCrs->getAxisOrder() != gsoap_resqml2_0_1::eml20__AxisOrder2d::easting_x0020northing) { + if (localCrs->getAxisOrder() != gsoap_eml2_3::eml23__AxisOrder2d::easting_x0020northing) { throw std::invalid_argument("Cannot compute inclinations and azimuths if the local CRS is not an easting northing one."); } diff --git a/src/resqml2/WellboreTrajectoryRepresentation.h b/src/resqml2/WellboreTrajectoryRepresentation.h index e241e6b1d..9eea0027b 100644 --- a/src/resqml2/WellboreTrajectoryRepresentation.h +++ b/src/resqml2/WellboreTrajectoryRepresentation.h @@ -77,7 +77,7 @@ namespace RESQML2_NS * CRS of the data object repository will be arbitrarily * selected. */ - DLL_IMPORT_OR_EXPORT virtual void setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr) = 0; + DLL_IMPORT_OR_EXPORT virtual void setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Sets the geometry of the representation by means of a parametric line with MD information. @@ -118,7 +118,7 @@ namespace RESQML2_NS * arbitrarily selected. */ DLL_IMPORT_OR_EXPORT virtual void setGeometry(double const* controlPoints, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr) = 0; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Sets the geometry of the representation by means of a parametric line with MD and tangent @@ -168,7 +168,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT virtual void setGeometry(double const* controlPoints, double const* tangentVectors, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr) = 0; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) = 0; /** * Sets the geometry of the representation by means of a parametric line with MD and tangent @@ -218,7 +218,7 @@ namespace RESQML2_NS */ DLL_IMPORT_OR_EXPORT void setGeometry(double const* controlPoints, double const* inclinations, double const* azimuths, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); /** * Gets the geometry kind. diff --git a/src/resqml2_0_1/Activity.cpp b/src/resqml2_0_1/Activity.cpp index a5b8faca9..4704a8669 100644 --- a/src/resqml2_0_1/Activity.cpp +++ b/src/resqml2_0_1/Activity.cpp @@ -21,14 +21,11 @@ under the License. #include "../eml2/ActivityTemplate.h" #include -#include using namespace std; using namespace RESQML2_0_1_NS; using namespace gsoap_resqml2_0_1; -const char* Activity::XML_NS = "resqml20"; - Activity::Activity(EML2_NS::ActivityTemplate* activityTemplate, const string & guid, const string & title) { if (activityTemplate == nullptr) { @@ -51,8 +48,8 @@ void Activity::pushBackParameter(const std::string& title, double value, resqml2 if (!activityTemplate->isAnExistingParameter(title)) { throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); } - uint64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs <= getParameterCount(title)) { + int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) { throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); } vector allowedKinds = activityTemplate->getParameterAllowedKinds(title); @@ -74,10 +71,10 @@ void Activity::pushBackParameter(const std::string& title, const std::string & v { EML2_NS::ActivityTemplate* activityTemplate = getActivityTemplate(); if (!activityTemplate->isPartial()) { - if (!activityTemplate->isAnExistingParameter(title)) + if (activityTemplate->isAnExistingParameter(title) == false) throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); - uint64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs <= getParameterCount(title)) + int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); vector allowedKinds = activityTemplate->getParameterAllowedKinds(title); if (allowedKinds.size() > 0 && find(allowedKinds.begin(), allowedKinds.end(), resqml20__ParameterKind::string) == allowedKinds.end()) @@ -96,10 +93,10 @@ void Activity::pushBackParameter(const std::string& title, int64_t value) { EML2_NS::ActivityTemplate* activityTemplate = getActivityTemplate(); if (!activityTemplate->isPartial()) { - if (!activityTemplate->isAnExistingParameter(title)) + if (activityTemplate->isAnExistingParameter(title) == false) throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); - uint64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs <= getParameterCount(title)) + int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); vector allowedKinds = activityTemplate->getParameterAllowedKinds(title); if (allowedKinds.size() > 0 && find(allowedKinds.begin(), allowedKinds.end(), resqml20__ParameterKind::integer) == allowedKinds.end()) @@ -121,12 +118,12 @@ void Activity::pushBackParameter(const std::string& title, AbstractObject* resqm } EML2_NS::ActivityTemplate* activityTemplate = getActivityTemplate(); if (!activityTemplate->isPartial()) { - if (!activityTemplate->isAnExistingParameter(title)) { + if (activityTemplate->isAnExistingParameter(title) == false) { throw invalid_argument("The parameter " + title + " does not exist in the associated activity template."); } - uint64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); - if (maxOccurs <= getParameterCount(title)) { + int64_t maxOccurs = activityTemplate->getParameterMaxOccurences(title); + if (maxOccurs > -1 && static_cast(maxOccurs) <= getParameterCount(title)) { throw invalid_argument("The max number of occurrences has already been reached for parameter " + title); } @@ -156,25 +153,20 @@ uint64_t Activity::getParameterCount(const std::string & paramTitle) const return getParameterFromTitle(paramTitle).size(); } -const std::string & Activity::getParameterTitle(unsigned int index) const +std::string Activity::getParameterTitle(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->Title; + return activity->Parameter.at(index)->Title; } -std::vector Activity::getParameterIndexOfTitle(const std::string & paramTitle) const +std::vector Activity::getParameterIndexOfTitle(const std::string & paramTitle) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - vector paramIndex; - for (unsigned int i = 0; i < activity->Parameter.size(); ++i) - { - if (activity->Parameter[i]->Title == paramTitle) - { + vector paramIndex; + for (uint64_t i = 0; i < activity->Parameter.size(); ++i) { + if (activity->Parameter[i]->Title == paramTitle) { paramIndex.push_back(i); } } @@ -201,57 +193,51 @@ std::vector Activity::getParameterFromTitl *****************************/ bool Activity::isAFloatingPointQuantityParameter(const std::string & paramTitle) const { - vector param = getParameterFromTitle(paramTitle); + vector params = getParameterFromTitle(paramTitle); - if (param.size() < 1) + if (params.empty()) { throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); + } - for (unsigned int i = 0; i < param.size(); ++i) - { - if (param[i]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) + for (const auto* param : params) { + if (param->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) { return false; + } } return true; } -bool Activity::isAFloatingPointQuantityParameter(unsigned int index) const +bool Activity::isAFloatingPointQuantityParameter(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter; } vector Activity::getFloatingPointQuantityParameterValue(const std::string & paramTitle) const { - vector param = getParameterFromTitle(paramTitle); + vector params = getParameterFromTitle(paramTitle); - if (param.size() < 1) + if (params.size() < 1) throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); vector result; - for (unsigned int i = 0; i < param.size(); ++i) - { - if (param[i]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) + for (auto const* param : params) { + if (param->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non double values."); else - result.push_back(static_cast(param[i])->Value); + result.push_back(static_cast(param)->Value); } return result; } -double Activity::getFloatingPointQuantityParameterValue(unsigned int index) const +double Activity::getFloatingPointQuantityParameterValue(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) throw invalid_argument("The parameter at index is not a floating point quantity parameter."); return static_cast(activity->Parameter[index])->Value; @@ -259,31 +245,27 @@ double Activity::getFloatingPointQuantityParameterValue(unsigned int index) cons vector Activity::getFloatingPointQuantityParameterUom(const std::string & paramTitle) const { - vector param = getParameterFromTitle(paramTitle); + vector params = getParameterFromTitle(paramTitle); - if (param.size() < 1) + if (params.size() < 1) throw range_error("The parameter " + paramTitle + " is not in the parameter range."); vector result; - for (unsigned int i = 0; i < param.size(); ++i) - { - if (param[i]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) + for (auto const* param : params) { + if (param->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non double values."); else - result.push_back(static_cast(param[i])->Uom); + result.push_back(static_cast(param)->Uom); } return result; } -gsoap_resqml2_0_1::resqml20__ResqmlUom Activity::getFloatingPointQuantityParameterUom(unsigned int index) const +gsoap_resqml2_0_1::resqml20__ResqmlUom Activity::getFloatingPointQuantityParameterUom(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw range_error("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__FloatingPointQuantityParameter) throw invalid_argument("The parameter index is not in the parameter range."); return static_cast(activity->Parameter[index])->Uom; @@ -294,57 +276,49 @@ gsoap_resqml2_0_1::resqml20__ResqmlUom Activity::getFloatingPointQuantityParamet *****************************/ bool Activity::isAnIntegerQuantityParameter(const std::string & paramTitle) const { - vector param = getParameterFromTitle(paramTitle); + vector params = getParameterFromTitle(paramTitle); - if (param.size() < 1) + if (params.size() < 1) throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); - for (unsigned int i = 0; i < param.size(); ++i) - { - if (param[i]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter) + for (auto const* param : params) { + if (param->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter) return false; } return true; } -bool Activity::isAnIntegerQuantityParameter(unsigned int index) const +bool Activity::isAnIntegerQuantityParameter(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter; } -vector Activity::getIntegerQuantityParameterValue(const std::string & paramTitle) const +vector Activity::getIntegerQuantityParameterValue(const std::string & paramTitle) const { - vector param = getParameterFromTitle(paramTitle); + vector params = getParameterFromTitle(paramTitle); - if (param.size() < 1) + if (params.size() < 1) throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); - vector result; - for (size_t i = 0; i < param.size(); ++i) - { - if (param[i]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter) + vector result; + for (auto const* param : params) { + if (param->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non integer values."); else - result.push_back(static_cast(param[i])->Value); + result.push_back(static_cast(param)->Value); } return result; } -int64_t Activity::getIntegerQuantityParameterValue(unsigned int index) const +int64_t Activity::getIntegerQuantityParameterValue(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerQuantityParameter) throw invalid_argument("The parameter at index is not an integer quantity parameter."); return static_cast(activity->Parameter[index])->Value; @@ -369,14 +343,11 @@ bool Activity::isAStringParameter(const std::string & paramTitle) const return true; } -bool Activity::isAStringParameter(unsigned int index) const +bool Activity::isAStringParameter(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__StringParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__StringParameter; } vector Activity::getStringParameterValue(const std::string & paramTitle) const @@ -387,8 +358,7 @@ vector Activity::getStringParameterValue(const std::string & paramTitle) invalid_argument("There exists no " + paramTitle + " parameter in this activity."); vector result; - for (unsigned int i = 0; i < param.size(); ++i) - { + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__StringParameter) throw invalid_argument("The parameter " + paramTitle + " contains some non string values."); else @@ -398,14 +368,11 @@ vector Activity::getStringParameterValue(const std::string & paramTitle) return result; } -const std::string & Activity::getStringParameterValue(unsigned int index) const +std::string Activity::getStringParameterValue(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__StringParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__StringParameter) throw invalid_argument("The parameter at index is not a string parameter."); return static_cast(activity->Parameter[index])->Value; @@ -421,8 +388,7 @@ bool Activity::isAResqmlObjectParameter(const std::string & paramTitle) const if (param.size() < 1) throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); - for (unsigned int i = 0; i < param.size(); ++i) - { + for (size_t i = 0; i < param.size(); ++i) { if (param[i]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DataObjectParameter) return false; } @@ -430,14 +396,11 @@ bool Activity::isAResqmlObjectParameter(const std::string & paramTitle) const return true; } -bool Activity::isAResqmlObjectParameter(unsigned int index) const +bool Activity::isAResqmlObjectParameter(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - return activity->Parameter[index]->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DataObjectParameter; + return activity->Parameter.at(index)->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DataObjectParameter; } vector Activity::getResqmlObjectParameterValue(const std::string & paramTitle) const @@ -459,14 +422,11 @@ vector Activity::getResqmlObjectParameterValue(const return result; } -COMMON_NS::AbstractObject* Activity::getResqmlObjectParameterValue(unsigned int index) const +COMMON_NS::AbstractObject* Activity::getResqmlObjectParameterValue(uint64_t index) const { _resqml20__Activity* activity = static_cast<_resqml20__Activity*>(gsoapProxy2_0_1); - if (activity->Parameter.size() <= index) - throw out_of_range("The parameter index is not in the parameter range."); - - if (activity->Parameter[index]->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DataObjectParameter) + if (activity->Parameter.at(index)->soap_type() != SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DataObjectParameter) throw invalid_argument("The parameter at index is not a RESQML object parameter."); return getRepository()->getDataObjectByUuid(static_cast(activity->Parameter[index])->DataObject->UUID); diff --git a/src/resqml2_0_1/Activity.h b/src/resqml2_0_1/Activity.h index a24a94df5..5325476c1 100644 --- a/src/resqml2_0_1/Activity.h +++ b/src/resqml2_0_1/Activity.h @@ -101,7 +101,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter title. */ - DLL_IMPORT_OR_EXPORT const std::string & getParameterTitle(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT std::string getParameterTitle(uint64_t index) const final; /** * Gets parameter index of title @@ -110,7 +110,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter index of title. */ - DLL_IMPORT_OR_EXPORT std::vector getParameterIndexOfTitle(const std::string & paramTitle) const final; + DLL_IMPORT_OR_EXPORT std::vector getParameterIndexOfTitle(const std::string & paramTitle) const final; /** * Query if 'paramTitle' is a floating point quantity parameter @@ -128,7 +128,7 @@ namespace RESQML2_0_1_NS * * @returns True if a floating point quantity parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAFloatingPointQuantityParameter(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool isAFloatingPointQuantityParameter(uint64_t index) const final; /** * Gets floating point quantity parameter value @@ -146,7 +146,7 @@ namespace RESQML2_0_1_NS * * @returns The floating point quantity parameter value. */ - DLL_IMPORT_OR_EXPORT double getFloatingPointQuantityParameterValue(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT double getFloatingPointQuantityParameterValue(uint64_t index) const final; /** * Gets floating point quantity parameter uom @@ -164,7 +164,7 @@ namespace RESQML2_0_1_NS * * @returns The floating point quantity parameter uom. */ - DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlUom getFloatingPointQuantityParameterUom(unsigned int index) const; + DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlUom getFloatingPointQuantityParameterUom(uint64_t index) const; /** * Query if 'paramTitle' is an integer quantity parameter @@ -182,7 +182,7 @@ namespace RESQML2_0_1_NS * * @returns True if an integer quantity parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAnIntegerQuantityParameter(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool isAnIntegerQuantityParameter(uint64_t index) const final; /** * Gets integer quantity parameter value @@ -191,7 +191,7 @@ namespace RESQML2_0_1_NS * * @returns The integer quantity parameter value. */ - DLL_IMPORT_OR_EXPORT std::vector getIntegerQuantityParameterValue(const std::string & paramTitle) const final; + DLL_IMPORT_OR_EXPORT std::vector getIntegerQuantityParameterValue(const std::string & paramTitle) const final; /** * Gets integer quantity parameter value @@ -200,7 +200,7 @@ namespace RESQML2_0_1_NS * * @returns The integer quantity parameter value. */ - DLL_IMPORT_OR_EXPORT int64_t getIntegerQuantityParameterValue(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT int64_t getIntegerQuantityParameterValue(uint64_t index) const final; /** * Query if 'paramTitle' is a string parameter @@ -218,7 +218,7 @@ namespace RESQML2_0_1_NS * * @returns True if a string parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAStringParameter(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool isAStringParameter(uint64_t index) const final; /** * Gets string parameter value @@ -236,7 +236,7 @@ namespace RESQML2_0_1_NS * * @returns The string parameter value. */ - DLL_IMPORT_OR_EXPORT const std::string & getStringParameterValue(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT std::string getStringParameterValue(uint64_t index) const final; /** * Query if 'paramTitle' is a resqml object parameter @@ -254,7 +254,7 @@ namespace RESQML2_0_1_NS * * @returns True if a resqml object parameter, false if not. */ - DLL_IMPORT_OR_EXPORT bool isAResqmlObjectParameter(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool isAResqmlObjectParameter(uint64_t index) const final; /** * Gets resqml object parameter value @@ -272,7 +272,7 @@ namespace RESQML2_0_1_NS * * @returns Null if it fails, else the resqml object parameter value. */ - DLL_IMPORT_OR_EXPORT AbstractObject* getResqmlObjectParameterValue(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT AbstractObject* getResqmlObjectParameterValue(uint64_t index) const final; /** * Set the activity template of the activity @@ -298,7 +298,7 @@ namespace RESQML2_0_1_NS /** * The standard XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static const char* XML_NS; + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "resqml20"; /** * Get the standard XML namespace for serializing this data object. diff --git a/src/resqml2_0_1/ActivityTemplate.cpp b/src/resqml2_0_1/ActivityTemplate.cpp index 18a519b4e..8e7a4e3e0 100644 --- a/src/resqml2_0_1/ActivityTemplate.cpp +++ b/src/resqml2_0_1/ActivityTemplate.cpp @@ -18,14 +18,10 @@ under the License. -----------------------------------------------------------------------*/ #include "ActivityTemplate.h" -#include - using namespace std; using namespace RESQML2_0_1_NS; using namespace gsoap_resqml2_0_1; -const char* ActivityTemplate::XML_NS = "resqml20"; - ActivityTemplate::ActivityTemplate(COMMON_NS::DataObjectRepository * repo, const string & guid, const string & title) { gsoapProxy2_0_1 = soap_new_resqml20__obj_USCOREActivityTemplate(repo->getGsoapContext()); @@ -38,7 +34,7 @@ ActivityTemplate::ActivityTemplate(COMMON_NS::DataObjectRepository * repo, const void ActivityTemplate::pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs) + uint64_t minOccurs, int64_t maxOccurs) { // Preconditions if (maxOccurs >= 0 && minOccurs > static_cast(maxOccurs)) { @@ -58,9 +54,9 @@ void ActivityTemplate::pushBackParameter(const std::string & title, } void ActivityTemplate::pushBackParameter(const std::string & title, - resqml20__ParameterKind kind, - bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs) + resqml20__ParameterKind kind, + bool isInput, bool isOutput, + uint64_t minOccurs, int64_t maxOccurs) { pushBackParameter(title, isInput, isOutput, minOccurs, maxOccurs); @@ -70,7 +66,7 @@ void ActivityTemplate::pushBackParameter(const std::string & title, void ActivityTemplate::pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs, + uint64_t minOccurs, int64_t maxOccurs, std::string resqmlObjectContentType) { pushBackParameter(title, resqml20__ParameterKind::dataObject, isInput, isOutput, minOccurs, maxOccurs); @@ -87,9 +83,8 @@ bool ActivityTemplate::isAnExistingParameter(const std::string & paramTitle) con { _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); - for (size_t i = 0; i < activityTemplate->Parameter.size(); ++i) - { - if (activityTemplate->Parameter[i]->Title == paramTitle) { + for (const auto* param : activityTemplate->Parameter) { + if (param->Title == paramTitle) { return true; } } @@ -102,25 +97,18 @@ uint64_t ActivityTemplate::getParameterCount() const return static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1)->Parameter.size(); } -const std::string & ActivityTemplate::getParameterTitle(unsigned int index) const +std::string ActivityTemplate::getParameterTitle(uint64_t index) const { _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); - if (activityTemplate->Parameter.size() <= index) - throw out_of_range("The parameter template index is not in the parameter range."); - - return activityTemplate->Parameter[index]->Title; + return activityTemplate->Parameter.at(index)->Title; } -vector ActivityTemplate::getParameterAllowedKinds(unsigned int index) const +vector ActivityTemplate::getParameterAllowedKinds(uint64_t index) const { _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); - if (activityTemplate->Parameter.size() <= index) { - throw range_error("The parameter template index is not in the parameter range."); - } - - return activityTemplate->Parameter[index]->AllowedKind; + return activityTemplate->Parameter.at(index)->AllowedKind; } vector ActivityTemplate::getParameterAllowedKinds(const std::string & paramTitle) const @@ -134,85 +122,74 @@ vector ActivityTemplate::getParameterAllowedKinds(const return param->AllowedKind; } -bool ActivityTemplate::getParameterIsInput(unsigned int index) const +bool ActivityTemplate::getParameterIsInput(uint64_t index) const { _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); - if (activityTemplate->Parameter.size() <= index) - throw out_of_range("The parameter template index is not in the parameter range."); - - return activityTemplate->Parameter[index]->IsInput; + return activityTemplate->Parameter.at(index)->IsInput; } bool ActivityTemplate::getParameterIsInput(const std::string & paramTitle) const { resqml20__ParameterTemplate* param = getParameterFromTitle(paramTitle); - if (param == nullptr) + if (param == nullptr) { throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); + } return param->IsInput; } -bool ActivityTemplate::getParameterIsOutput(unsigned int index) const +bool ActivityTemplate::getParameterIsOutput(uint64_t index) const { _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); - if (activityTemplate->Parameter.size() <= index) { - throw range_error("The parameter template index is not in the parameter range."); - } - - return activityTemplate->Parameter[index]->IsOutput; + return activityTemplate->Parameter.at(index)->IsOutput; } bool ActivityTemplate::getParameterIsOutput(const std::string & paramTitle) const { resqml20__ParameterTemplate* param = getParameterFromTitle(paramTitle); - if (param == nullptr) + if (param == nullptr) { throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); + } return param->IsOutput; } -uint64_t ActivityTemplate::getParameterMinOccurences(unsigned int index) const +int64_t ActivityTemplate::getParameterMinOccurences(uint64_t index) const { _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); - if (activityTemplate->Parameter.size() <= index) { - throw range_error("The parameter template index is not in the parameter range."); - } - - return activityTemplate->Parameter[index]->MinOccurs; + return activityTemplate->Parameter.at(index)->MinOccurs; } -uint64_t ActivityTemplate::getParameterMinOccurences(const std::string & paramTitle) const +int64_t ActivityTemplate::getParameterMinOccurences(const std::string & paramTitle) const { resqml20__ParameterTemplate* param = getParameterFromTitle(paramTitle); - if (param == nullptr) + if (param == nullptr) { throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); + } return param->MinOccurs; } -uint64_t ActivityTemplate::getParameterMaxOccurences(unsigned int index) const +int64_t ActivityTemplate::getParameterMaxOccurences(uint64_t index) const { _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); - if (activityTemplate->Parameter.size() <= index) { - throw range_error("The parameter template index is not in the parameter range."); - } - - return activityTemplate->Parameter[index]->MaxOccurs; + return activityTemplate->Parameter.at(index)->MaxOccurs; } -uint64_t ActivityTemplate::getParameterMaxOccurences(const std::string & paramTitle) const +int64_t ActivityTemplate::getParameterMaxOccurences(const std::string & paramTitle) const { resqml20__ParameterTemplate* param = getParameterFromTitle(paramTitle); - if (param == nullptr) + if (param == nullptr) { throw invalid_argument("There exists no " + paramTitle + " parameter in this activity."); + } return param->MaxOccurs; } @@ -227,9 +204,9 @@ resqml20__ParameterTemplate* ActivityTemplate::getParameterFromTitle(const std:: _resqml20__ActivityTemplate* activityTemplate = static_cast<_resqml20__ActivityTemplate*>(gsoapProxy2_0_1); resqml20__ParameterTemplate* param = nullptr; - for (size_t i = 0; i < activityTemplate->Parameter.size(); ++i) { - if (activityTemplate->Parameter[i]->Title == paramTitle) { - param = activityTemplate->Parameter[i]; + for (auto* paramTmp : activityTemplate->Parameter) { + if (paramTmp->Title == paramTitle) { + param = paramTmp; break; } } diff --git a/src/resqml2_0_1/ActivityTemplate.h b/src/resqml2_0_1/ActivityTemplate.h index ed44360b9..8791e9261 100644 --- a/src/resqml2_0_1/ActivityTemplate.h +++ b/src/resqml2_0_1/ActivityTemplate.h @@ -69,7 +69,7 @@ namespace RESQML2_0_1_NS */ DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs) final; + uint64_t minOccurs, int64_t maxOccurs) final; /** * Push back a parameter in the activity template instance. This parameter must not be of a data @@ -85,7 +85,7 @@ namespace RESQML2_0_1_NS DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string & title, gsoap_resqml2_0_1::resqml20__ParameterKind kind, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs); + uint64_t minOccurs, int64_t maxOccurs); /** * Push back a parameter in the activity template instance. This parameter must be of a data @@ -101,7 +101,7 @@ namespace RESQML2_0_1_NS */ DLL_IMPORT_OR_EXPORT void pushBackParameter(const std::string & title, bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs, + uint64_t minOccurs, int64_t maxOccurs, std::string resqmlObjectContentType) final; /** @@ -127,7 +127,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter title. */ - DLL_IMPORT_OR_EXPORT const std::string & getParameterTitle(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT std::string getParameterTitle(uint64_t index) const final; /** * Gets parameter allowed kinds @@ -136,7 +136,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter allowed kinds. */ - DLL_IMPORT_OR_EXPORT std::vector getParameterAllowedKinds(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT std::vector getParameterAllowedKinds(uint64_t index) const final; /** * Gets parameter allowed kinds @@ -154,7 +154,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter is input. */ - DLL_IMPORT_OR_EXPORT bool getParameterIsInput(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool getParameterIsInput(uint64_t index) const final; /** * Gets parameter is input @@ -172,7 +172,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter is output. */ - DLL_IMPORT_OR_EXPORT bool getParameterIsOutput(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT bool getParameterIsOutput(uint64_t index) const final; /** * Gets parameter is output @@ -190,7 +190,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter minimum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMinOccurences(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMinOccurences(uint64_t index) const final; /** * Gets parameter minimum occurences @@ -199,7 +199,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter minimum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMinOccurences(const std::string & paramTitle) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMinOccurences(const std::string & paramTitle) const final; /** * Gets parameter maximum occurences @@ -208,7 +208,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter maximum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMaxOccurences(unsigned int index) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMaxOccurences(uint64_t index) const final; /** * Gets parameter maximum occurences @@ -217,7 +217,7 @@ namespace RESQML2_0_1_NS * * @returns The parameter maximum occurences. */ - DLL_IMPORT_OR_EXPORT uint64_t getParameterMaxOccurences(const std::string & paramTitle) const final; + DLL_IMPORT_OR_EXPORT int64_t getParameterMaxOccurences(const std::string & paramTitle) const final; /** * ****************************************************************** @@ -231,7 +231,7 @@ namespace RESQML2_0_1_NS /** * The standard XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static const char* XML_NS; + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "resqml20"; /** * Get the standard XML namespace for serializing this data object. diff --git a/src/resqml2_0_1/DeviationSurveyRepresentation.cpp b/src/resqml2_0_1/DeviationSurveyRepresentation.cpp index 948d75600..6c415027e 100644 --- a/src/resqml2_0_1/DeviationSurveyRepresentation.cpp +++ b/src/resqml2_0_1/DeviationSurveyRepresentation.cpp @@ -22,10 +22,11 @@ under the License. #include "H5public.h" -#include "../resqml2/WellboreInterpretation.h" -#include "../resqml2/MdDatum.h" -#include "../resqml2/AbstractLocal3dCrs.h" #include "../eml2/AbstractHdfProxy.h" +#include "../eml2/AbstractLocal3dCrs.h" + +#include "../resqml2/MdDatum.h" +#include "../resqml2/WellboreInterpretation.h" using namespace std; using namespace RESQML2_0_1_NS; @@ -51,8 +52,8 @@ DeviationSurveyRepresentation::DeviationSurveyRepresentation(RESQML2_NS::Wellbor initMandatoryMetadata(); setMetadata(guid, title, "", -1, "", "", -1, ""); - if (dynamic_cast(mdInfo->getLocalCrs()) != nullptr) { - rep->MdUom = static_cast(mdInfo->getLocalCrs())->getVerticalCrsUnit(); + if (dynamic_cast(mdInfo->getLocalCrs()) != nullptr) { + rep->MdUom = static_cast(mdInfo->getLocalCrs())->getVerticalCrsUnit(); } interp->getRepository()->addDataObject(this); diff --git a/src/resqml2_0_1/Grid2dRepresentation.cpp b/src/resqml2_0_1/Grid2dRepresentation.cpp index 45337e2d3..4eb47c2dd 100644 --- a/src/resqml2_0_1/Grid2dRepresentation.cpp +++ b/src/resqml2_0_1/Grid2dRepresentation.cpp @@ -19,15 +19,14 @@ under the License. #include "Grid2dRepresentation.h" #include -#include -#include #include "H5public.h" +#include "../eml2/AbstractHdfProxy.h" +#include "../eml2/AbstractLocal3dCrs.h" + #include "../resqml2/AbstractFeature.h" #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" using namespace std; using namespace RESQML2_0_1_NS; @@ -516,7 +515,7 @@ void Grid2dRepresentation::setGeometryAsArray2dOfLatticePoints3d( double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -545,7 +544,7 @@ void Grid2dRepresentation::setGeometryAsArray2dOfLatticePoints3d( void Grid2dRepresentation::setGeometryAsArray2dOfExplicitZ( double * zValues, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, - RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, RESQML2_NS::AbstractLocal3dCrs * localCrs, + RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int startIndexI, unsigned int startIndexJ, int indexIncrementI, int indexIncrementJ) { @@ -579,7 +578,7 @@ void Grid2dRepresentation::setGeometryAsArray2dOfExplicitZ( unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, - double offsetJX, double offsetJY, double offsetJZ, double spacingJ, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double offsetJX, double offsetJY, double offsetJZ, double spacingJ, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -707,7 +706,7 @@ gsoap_resqml2_0_1::resqml20__PointGeometry* Grid2dRepresentation::createArray2dO double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { throw invalid_argument("The CRS cannot be the null pointer"); @@ -753,7 +752,7 @@ gsoap_resqml2_0_1::resqml20__PointGeometry* Grid2dRepresentation::createArray2dO } gsoap_resqml2_0_1::resqml20__PointGeometry* Grid2dRepresentation::createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::Grid2dRepresentation * supportingRepresentation, uint64_t startGlobalIndex, @@ -820,7 +819,7 @@ gsoap_resqml2_0_1::resqml20__PointGeometry* Grid2dRepresentation::createArray2dO } gsoap_resqml2_0_1::resqml20__PointGeometry* Grid2dRepresentation::createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, diff --git a/src/resqml2_0_1/Grid2dRepresentation.h b/src/resqml2_0_1/Grid2dRepresentation.h index 236f127cf..c332d084a 100644 --- a/src/resqml2_0_1/Grid2dRepresentation.h +++ b/src/resqml2_0_1/Grid2dRepresentation.h @@ -100,12 +100,12 @@ namespace RESQML2_0_1_NS double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsArray2dOfExplicitZ( double * zValues, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, - RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr, + RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr, unsigned int startIndexI = 0, unsigned int startIndexJ = 0, int indexIncrementI = 1, int indexIncrementJ = 1) final; @@ -114,7 +114,7 @@ namespace RESQML2_0_1_NS unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, - double offsetJX, double offsetJY, double offsetJZ, double spacingJ, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + double offsetJX, double offsetJY, double offsetJZ, double spacingJ, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; COMMON_NS::DataObjectReference getSupportingRepresentationDor() const final; @@ -182,7 +182,7 @@ namespace RESQML2_0_1_NS double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs); + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs); /** * Creates a geometry for a grid 2d representation which derives from another existing grid 2d @@ -215,7 +215,7 @@ namespace RESQML2_0_1_NS * @returns Null if it fails, else the new array 2D of explicit z coordinate. */ gsoap_resqml2_0_1::resqml20__PointGeometry* createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, RESQML2_NS::Grid2dRepresentation * supportingRepresentation, uint64_t startGlobalIndex = 0, @@ -247,7 +247,7 @@ namespace RESQML2_0_1_NS * @returns Null if it fails, else the new array 2D of explicit z coordinate. */ gsoap_resqml2_0_1::resqml20__PointGeometry* createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, diff --git a/src/resqml2_0_1/GridConnectionSetRepresentation.cpp b/src/resqml2_0_1/GridConnectionSetRepresentation.cpp index 69cc65893..0ca3eff80 100644 --- a/src/resqml2_0_1/GridConnectionSetRepresentation.cpp +++ b/src/resqml2_0_1/GridConnectionSetRepresentation.cpp @@ -25,7 +25,7 @@ under the License. #include "../resqml2/AbstractFeatureInterpretation.h" #include "../resqml2/AbstractGridRepresentation.h" #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace RESQML2_0_1_NS; diff --git a/src/resqml2_0_1/IjkGridExplicitRepresentation.cpp b/src/resqml2_0_1/IjkGridExplicitRepresentation.cpp index cf123395e..21215bbcd 100644 --- a/src/resqml2_0_1/IjkGridExplicitRepresentation.cpp +++ b/src/resqml2_0_1/IjkGridExplicitRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -92,7 +92,7 @@ void IjkGridExplicitRepresentation::setGeometryAsCoordinateLineNodesUsingExistin const std::string & points, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, - const std::string & definedPillars, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & definedPillars, EML2_NS::AbstractLocal3dCrs * localCrs) { if (points.empty()) { throw invalid_argument("The points HDF dataset of the ijk grid cannot be empty."); @@ -191,7 +191,7 @@ void IjkGridExplicitRepresentation::setGeometryAsCoordinateLineNodes( double const* points, EML2_NS::AbstractHdfProxy * proxy, uint64_t splitCoordinateLineCount, unsigned int const* pillarOfCoordinateLine, unsigned int const* splitCoordinateLineColumnCumulativeCount, unsigned int const* splitCoordinateLineColumns, - int8_t const* definedPillars, RESQML2_NS::AbstractLocal3dCrs * localCrs) + int8_t const* definedPillars, EML2_NS::AbstractLocal3dCrs * localCrs) { if (points == nullptr) { throw invalid_argument("The points of the ijk grid cannot be null."); diff --git a/src/resqml2_0_1/IjkGridExplicitRepresentation.h b/src/resqml2_0_1/IjkGridExplicitRepresentation.h index f66098ea6..188e7dfd3 100644 --- a/src/resqml2_0_1/IjkGridExplicitRepresentation.h +++ b/src/resqml2_0_1/IjkGridExplicitRepresentation.h @@ -108,14 +108,14 @@ namespace RESQML2_0_1_NS double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, unsigned int const* pillarOfCoordinateLine = nullptr, unsigned int const* splitCoordinateLineColumnCumulativeCount = nullptr, unsigned int const* splitCoordinateLineColumns = nullptr, - int8_t const* definedPillars = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + int8_t const* definedPillars = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsCoordinateLineNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, const std::string & pillarOfCoordinateLine = "", const std::string & splitCoordinateLineColumnCumulativeCount = "", const std::string & splitCoordinateLineColumns = "", - const std::string & definedPillars = "", RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + const std::string & definedPillars = "", EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. diff --git a/src/resqml2_0_1/IjkGridLatticeRepresentation.cpp b/src/resqml2_0_1/IjkGridLatticeRepresentation.cpp index 18c120066..4dfb692b8 100644 --- a/src/resqml2_0_1/IjkGridLatticeRepresentation.cpp +++ b/src/resqml2_0_1/IjkGridLatticeRepresentation.cpp @@ -23,7 +23,7 @@ under the License. #include "../resqml2/AbstractFeature.h" #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -312,7 +312,7 @@ void IjkGridLatticeRepresentation::setGeometryAsCoordinateLineNodes( double originX, double originY, double originZ, double directionIX, double directionIY, double directionIZ, double spacingI, double directionJX, double directionJY, double directionJZ, double spacingJ, - double directionKX, double directionKY, double directionKZ, double spacingK, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double directionKX, double directionKY, double directionKZ, double spacingK, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_0_1/IjkGridLatticeRepresentation.h b/src/resqml2_0_1/IjkGridLatticeRepresentation.h index f8fcb7f64..393285d91 100644 --- a/src/resqml2_0_1/IjkGridLatticeRepresentation.h +++ b/src/resqml2_0_1/IjkGridLatticeRepresentation.h @@ -134,7 +134,7 @@ namespace RESQML2_0_1_NS double originX, double originY, double originZ, double directionIX, double directionIY, double directionIZ, double spacingI, double directionJX, double directionJY, double directionJZ, double spacingJ, - double directionKX, double directionKY, double directionKZ, double spacingK, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + double directionKX, double directionKY, double directionKZ, double spacingK, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void addSeismic3dCoordinatesToPatch( unsigned int patchIndex, diff --git a/src/resqml2_0_1/IjkGridParametricRepresentation.cpp b/src/resqml2_0_1/IjkGridParametricRepresentation.cpp index e8149bf59..b9f5e7c9d 100644 --- a/src/resqml2_0_1/IjkGridParametricRepresentation.cpp +++ b/src/resqml2_0_1/IjkGridParametricRepresentation.cpp @@ -22,7 +22,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -238,7 +238,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, EML2_NS::AbstractHdfProxy * proxy, uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine, - unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (pillarKind == nullptr) { throw invalid_argument("The kind of the coordinate lines cannot be null."); @@ -316,7 +316,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (pillarKind.empty()) throw invalid_argument("The kind of the coordinate lines cannot be null."); @@ -361,7 +361,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (controlPointCountPerPillar < 1) { throw invalid_argument("The max count of control points per coordinate line of the ijk grid cannot be less than one."); @@ -465,7 +465,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (pillarKind < 0 || pillarKind > 5) { throw range_error("The kind of the coordinate lines is out of range."); diff --git a/src/resqml2_0_1/IjkGridParametricRepresentation.h b/src/resqml2_0_1/IjkGridParametricRepresentation.h index 6d4942b45..035193132 100644 --- a/src/resqml2_0_1/IjkGridParametricRepresentation.h +++ b/src/resqml2_0_1/IjkGridParametricRepresentation.h @@ -114,19 +114,19 @@ namespace RESQML2_0_1_NS gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine, - unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. @@ -150,6 +150,6 @@ namespace RESQML2_0_1_NS gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs); + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs); }; } diff --git a/src/resqml2_0_1/LocalDepth3dCrs.cpp b/src/resqml2_0_1/LocalDepth3dCrs.cpp index e40d55b71..7f6f4ff6a 100644 --- a/src/resqml2_0_1/LocalDepth3dCrs.cpp +++ b/src/resqml2_0_1/LocalDepth3dCrs.cpp @@ -18,15 +18,11 @@ under the License. -----------------------------------------------------------------------*/ #include "LocalDepth3dCrs.h" -#include - using namespace std; using namespace RESQML2_0_1_NS; using namespace gsoap_resqml2_0_1; -const char* LocalDepth3dCrs::XML_NS = "resqml20"; - -void LocalDepth3dCrs::init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +void LocalDepth3dCrs::init(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, @@ -55,14 +51,14 @@ void LocalDepth3dCrs::init(COMMON_NS::DataObjectRepository * repo, const std::st repo->addDataObject(this); } -LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { if (projectedEpsgCode == 0 || verticalEpsgCode == 0) { - throw invalid_argument("An EPSG code cannot be set to 0."); + throw invalid_argument("The EPSG code must be positive."); } init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, verticalUom, isUpOriented); _resqml20__LocalDepth3dCrs* local3dCrs = static_cast<_resqml20__LocalDepth3dCrs*>(gsoapProxy2_0_1); @@ -78,11 +74,11 @@ LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const s vertCrs->EpsgCode = verticalEpsgCode; } -LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, verticalUom, isUpOriented); _resqml20__LocalDepth3dCrs* local3dCrs = static_cast<_resqml20__LocalDepth3dCrs*>(gsoapProxy2_0_1); @@ -98,14 +94,14 @@ LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const s vertCrs->Unknown = verticalUnknownReason; } -LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { if (projectedEpsgCode == 0) { - throw invalid_argument("An EPSG code cannot be set to 0."); + throw invalid_argument("The EPSG code must be positive."); } init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, verticalUom, isUpOriented); _resqml20__LocalDepth3dCrs* local3dCrs = static_cast<_resqml20__LocalDepth3dCrs*>(gsoapProxy2_0_1); @@ -121,14 +117,14 @@ LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const s vertCrs->Unknown = verticalUnknownReason; } -LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalDepth3dCrs::LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { if (verticalEpsgCode == 0) { - throw invalid_argument("An EPSG code cannot be set to 0."); + throw invalid_argument("The EPSG code must be positive."); } init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, verticalUom, isUpOriented); _resqml20__LocalDepth3dCrs* local3dCrs = static_cast<_resqml20__LocalDepth3dCrs*>(gsoapProxy2_0_1); diff --git a/src/resqml2_0_1/LocalDepth3dCrs.h b/src/resqml2_0_1/LocalDepth3dCrs.h index 39ab64db9..87677c607 100644 --- a/src/resqml2_0_1/LocalDepth3dCrs.h +++ b/src/resqml2_0_1/LocalDepth3dCrs.h @@ -18,12 +18,16 @@ under the License. -----------------------------------------------------------------------*/ #pragma once -#include "../resqml2/LocalDepth3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" namespace RESQML2_0_1_NS { - /** A local depth 3D crs. */ - class LocalDepth3dCrs final : public RESQML2_NS::LocalDepth3dCrs + /** + * @brief Defines a local depth coordinate system. The geometrical origin and location are + * defined by the elements of the base class AbstractLocal3dCrs. This CRS uses the units + * of measure of its projected and vertical CRS. + */ + class LocalDepth3dCrs final : public EML2_NS::AbstractLocal3dCrs { private: @@ -41,7 +45,7 @@ namespace RESQML2_0_1_NS * @param verticalUom The vertical uom. * @param isUpOriented True if is up oriented, false if not. */ - void init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + void init(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, @@ -52,7 +56,7 @@ namespace RESQML2_0_1_NS * * @returns The z coordinate offset. */ - double getZOffset() const {return getOriginDepthOrElevation();} + double getZOffset() const { return getOriginDepthOrElevation(); } public: @@ -61,32 +65,33 @@ namespace RESQML2_0_1_NS * * @param [in,out] partialObject If non-null, the partial object. * - * + * */ - DLL_IMPORT_OR_EXPORT LocalDepth3dCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : RESQML2_NS::LocalDepth3dCrs(partialObject) {} + DLL_IMPORT_OR_EXPORT LocalDepth3dCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : EML2_NS::AbstractLocal3dCrs(partialObject) {} /** * Creates a local depth 3d CRS which is fully identified by means of EPSG code. + * Projected CRS (and consequently local CRS) is supposed to be an easting northing one for now. * * @param [in,out] repo The repo where the underlying gsoap proxy is going to be * created. * @param guid The guid to set to the local 3d crs. If empty then a new * guid will be generated. * @param title A title for the instance to create. - * @param originOrdinal1 The offset of the global 2d crs on its first axis. - * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the depth - * origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. * @param arealRotation The areal rotation in radians regarding the projected crs. * @param projectedUom The unit of measure of the projected axis of this * instance. - * @param projectedEpsgCode The epsg code of the associated projected CRS. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. * @param verticalUom The unit of measure of the vertical axis of this instance. - * @param verticalEpsgCode The epsg code of the associated vertical CRS. - * @param isUpOriented If true, indicates that this depth CRS is actually an - * elevation CRS. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. */ - LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, @@ -94,6 +99,7 @@ namespace RESQML2_0_1_NS /** * Creates a local depth 3d CRS which is fully unknown. + * Projected CRS (and consequently local CRS) is supposed to be an easting northing one for now. * * @param [in,out] repo The repo where the underlying gsoap proxy is going to * be created. @@ -102,8 +108,9 @@ namespace RESQML2_0_1_NS * @param title A title for the instance to create. * @param originOrdinal1 The offset of the global 2d crs on its first axis. * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the - * depth origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. * @param arealRotation The areal rotation in radians regarding the projected * crs. * @param projectedUom The unit of measure of the projected axis of this @@ -114,18 +121,20 @@ namespace RESQML2_0_1_NS * instance. * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided * using EPSG or GML. - * @param isUpOriented If true, indicates that this depth CRS is actually an - * elevation CRS. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. */ - LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local depth 3d CRS which is identified by an EPSG code for its projected * part and which is unkown for its vertical part. + * Projected CRS (and consequently local CRS) is supposed to be an easting northing one for now. * * @exception std::invalid_argument If projectedEpsgCode == 0. * @@ -134,31 +143,32 @@ namespace RESQML2_0_1_NS * @param guid The guid to set to the local 3d crs. If empty then a * new guid will be generated. * @param title A title for the instance to create. - * @param originOrdinal1 The offset of the global 2d crs on its first axis. - * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the - * depth origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. * @param arealRotation The areal rotation in radians regarding the projected * crs. * @param projectedUom The unit of measure of the projected axis of this * instance. - * @param projectedEpsgCode The epsg code of the associated projected CRS. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. * @param verticalUom The unit of measure of the vertical axis of this * instance. * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided * using EPSG or GML. - * @param isUpOriented If true, indicates that this depth CRS is actually an - * elevation CRS. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. */ - LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local depth 3d CRS which unkown for its projected part and which is * identified by an EPSG code for its vertical part. + * Projected CRS (and consequently local CRS) is supposed to be an easting northing one for now. * * @exception std::invalid_argument If verticalEpsgCode == 0. * @@ -167,24 +177,24 @@ namespace RESQML2_0_1_NS * @param guid The guid to set to the local 3d crs. If empty then a new * guid will be generated. * @param title A title for the instance to create. - * @param originOrdinal1 The offset of the global 2d crs on its first axis. - * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the depth - * origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. * @param arealRotation The areal rotation in radians regarding the projected crs. * @param projectedUom The unit of measure of the projected axis of this * instance. * @param projectedUnknownReason Indicates why the projected CRS cannot be provided using * EPSG or GML. * @param verticalUom The unit of measure of the vertical axis of this instance. - * @param verticalEpsgCode The epsg code of the associated vertical CRS. - * @param isUpOriented If true, indicates that this depth CRS is actually an - * elevation CRS. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented If true, indicates that this local depth CRS is actually a + * local elevation CRS and that the associated vertical CRS is + * an elevation one as well. */ - LocalDepth3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalDepth3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); /** @@ -192,19 +202,31 @@ namespace RESQML2_0_1_NS * * @param [in,out] fromGsoap If non-null, from gsoap. */ - LocalDepth3dCrs(gsoap_resqml2_0_1::_resqml20__LocalDepth3dCrs* fromGsoap): RESQML2_NS::LocalDepth3dCrs(fromGsoap) {} + LocalDepth3dCrs(gsoap_resqml2_0_1::_resqml20__LocalDepth3dCrs* fromGsoap) : EML2_NS::AbstractLocal3dCrs(fromGsoap) {} /** Destructor does nothing since the memory is manged by the gsoap context. */ ~LocalDepth3dCrs() = default; + DLL_IMPORT_OR_EXPORT bool isATimeCrs() const final { return false; } + + DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::eml20__TimeUom getTimeUom() const final { throw std::logic_error("You cannot get time uom from a depth CRS."); } + /** * The standard XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static const char* XML_NS; + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "resqml20"; /** * Get the standard XML namespace for serializing this data object. */ DLL_IMPORT_OR_EXPORT std::string getXmlNamespace() const final { return XML_NS; } + + /** The standard XML tag without XML namespace for serializing this data object. */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "LocalDepth3dCrs"; + + DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } + + /** Loads target relationships */ + void loadTargetRelationships() final {} }; } diff --git a/src/resqml2_0_1/LocalTime3dCrs.cpp b/src/resqml2_0_1/LocalTime3dCrs.cpp index 9aa7e7ccb..d284f43ed 100644 --- a/src/resqml2_0_1/LocalTime3dCrs.cpp +++ b/src/resqml2_0_1/LocalTime3dCrs.cpp @@ -18,15 +18,11 @@ under the License. -----------------------------------------------------------------------*/ #include "LocalTime3dCrs.h" -#include - using namespace std; using namespace RESQML2_0_1_NS; using namespace gsoap_resqml2_0_1; -const char* LocalTime3dCrs::XML_NS = "resqml20"; - -void LocalTime3dCrs::init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +void LocalTime3dCrs::init(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, @@ -57,7 +53,7 @@ void LocalTime3dCrs::init(COMMON_NS::DataObjectRepository * repo, const std::str repo->addDataObject(this); } -LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, @@ -65,7 +61,7 @@ LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { if (projectedEpsgCode == 0 || verticalEpsgCode == 0) { - throw invalid_argument("An EPSG code cannot be set to 0."); + throw invalid_argument("The EPSG code must be positive."); } init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, timeUom, verticalUom, isUpOriented); _resqml20__LocalTime3dCrs* local3dCrs = static_cast<_resqml20__LocalTime3dCrs*>(gsoapProxy2_0_1); @@ -81,12 +77,12 @@ LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std vertCrs->EpsgCode = verticalEpsgCode; } -LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, timeUom, verticalUom, isUpOriented); _resqml20__LocalTime3dCrs* local3dCrs = static_cast<_resqml20__LocalTime3dCrs*>(gsoapProxy2_0_1); @@ -102,15 +98,15 @@ LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std vertCrs->Unknown = verticalUnknownReason; } -LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented) + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented) { if (projectedEpsgCode == 0) { - throw invalid_argument("An EPSG code cannot be set to 0."); + throw invalid_argument("The EPSG code must be positive."); } init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, timeUom, verticalUom, isUpOriented); _resqml20__LocalTime3dCrs* local3dCrs = static_cast<_resqml20__LocalTime3dCrs*>(gsoapProxy2_0_1); @@ -126,15 +122,15 @@ LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std vertCrs->Unknown = verticalUnknownReason; } -LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, +LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented) { if (verticalEpsgCode == 0) { - throw invalid_argument("An EPSG code cannot be set to 0."); + throw invalid_argument("The EPSG code must be positive."); } init(repo, guid, title, originOrdinal1, originOrdinal2, originOrdinal3, arealRotation, projectedUom, timeUom, verticalUom, isUpOriented); _resqml20__LocalTime3dCrs* local3dCrs = static_cast<_resqml20__LocalTime3dCrs*>(gsoapProxy2_0_1); @@ -150,13 +146,7 @@ LocalTime3dCrs::LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std vertCrs->EpsgCode = verticalEpsgCode; } -gsoap_resqml2_0_1::eml20__TimeUom LocalTime3dCrs::getUnit() const +gsoap_resqml2_0_1::eml20__TimeUom LocalTime3dCrs::getTimeUom() const { return static_cast<_resqml20__LocalTime3dCrs*>(gsoapProxy2_0_1)->TimeUom; } - -std::string LocalTime3dCrs::getUnitAsString() const -{ - return gsoap_resqml2_0_1::soap_eml20__TimeUom2s(gsoapProxy2_0_1->soap, static_cast<_resqml20__LocalTime3dCrs*>(gsoapProxy2_0_1)->TimeUom); -} - diff --git a/src/resqml2_0_1/LocalTime3dCrs.h b/src/resqml2_0_1/LocalTime3dCrs.h index 67767a648..121dda879 100644 --- a/src/resqml2_0_1/LocalTime3dCrs.h +++ b/src/resqml2_0_1/LocalTime3dCrs.h @@ -18,12 +18,12 @@ under the License. -----------------------------------------------------------------------*/ #pragma once -#include "../resqml2/LocalTime3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" namespace RESQML2_0_1_NS { /** A local time 3D crs. */ - class LocalTime3dCrs final : public RESQML2_NS::LocalTime3dCrs + class LocalTime3dCrs final : public EML2_NS::AbstractLocal3dCrs { private: @@ -42,7 +42,7 @@ namespace RESQML2_0_1_NS * @param verticalUom The vertical uom. * @param isUpOriented True if is up oriented, false if not. */ - void init(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + void init(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, @@ -63,9 +63,9 @@ namespace RESQML2_0_1_NS * * @param [in,out] partialObject If non-null, the partial object. * - * + * */ - DLL_IMPORT_OR_EXPORT LocalTime3dCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : RESQML2_NS::LocalTime3dCrs(partialObject) {} + DLL_IMPORT_OR_EXPORT LocalTime3dCrs(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : EML2_NS::AbstractLocal3dCrs(partialObject) {} /** * @brief Creates a local depth 3d CRS which is fully identified by means of EPSG code. @@ -78,25 +78,25 @@ namespace RESQML2_0_1_NS * @param guid The guid to set to the local 3d crs. If empty then a new guid * will be generated. * @param title A title for the instance to create. - * @param originOrdinal1 The offset of the global 2d crs on its first axis. - * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the depth - * origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. * @param arealRotation The areal rotation in radians regarding the projected crs. * @param projectedUom The unit of measure of the projected axis of this instance. - * @param projectedEpsgCode The epsg code of the associated projected CRS. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. * @param timeUom The unit of measure of the Z offset of this instance. * @param verticalUom The unit of measure of the vertical axis of this instance. - * @param verticalEpsgCode The epsg code of the associated vertical CRS. - * @param isUpOriented If true, indicates that the Z offset if an elevation when - * positive. If false, the Z offset is a depth when positive. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. */ - LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); /** * Creates a local depth 3d CRS which is fully unknown. @@ -106,10 +106,10 @@ namespace RESQML2_0_1_NS * @param guid The guid to set to the local 3d crs. If empty then a * new guid will be generated. * @param title A title for the instance to create. - * @param originOrdinal1 The offset of the global 2d crs on its first axis. - * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the - * depth origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. * @param arealRotation The areal rotation in radians regarding the projected * crs. * @param projectedUom The unit of measure of the projected axis of this @@ -121,16 +121,15 @@ namespace RESQML2_0_1_NS * instance. * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided * using EPSG or GML. - * @param isUpOriented If true, indicates that the Z offset if an elevation - * when positive. If false, the Z offset is a depth when - * positive. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. */ - LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local depth 3d CRS which is identified by an EPSG code for its projected @@ -143,27 +142,27 @@ namespace RESQML2_0_1_NS * @param guid The guid to set to the local 3d crs. If empty then a new * guid will be generated. * @param title A title for the instance to create. - * @param originOrdinal1 The offset of the global 2d crs on its first axis. - * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the depth - * origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. * @param arealRotation The areal rotation in radians regarding the projected crs. * @param projectedUom The unit of measure of the projected axis of this * instance. - * @param projectedEpsgCode The epsg code of the associated projected CRS. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. * @param timeUom The unit of measure of the Z offset of this instance. * @param verticalUom The unit of measure of the vertical axis of this instance. * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided using * EPSG or GML. - * @param isUpOriented If true, indicates that the Z offset if an elevation when - * positive. If false, the Z offset is a depth when positive. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. */ - LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string& verticalUnknownReason, bool isUpOriented); /** * @brief Creates a local depth 3d CRS which unkown for its projected part and which is @@ -176,10 +175,10 @@ namespace RESQML2_0_1_NS * @param guid The guid to set to the local 3d crs. If empty then a new * guid will be generated. * @param title A title for the instance to create. - * @param originOrdinal1 The offset of the global 2d crs on its first axis. - * @param originOrdinal2 The offset of the global 2d crs on its second axis. - * @param originOrdinal3 The offset in depth of the local CRS regarding the depth - * origin of the vertical CRS. + * @param originOrdinal1 The local CRS origin coordinate on the first axis of the projected CRS. + * @param originOrdinal2 The local CRS origin coordinate on the second axis of the projected CRS. + * @param originOrdinal3 The local CRS origin coordinate on the axis of the vertical CRS. + * It generally represents the Seismic Reference Datum. * @param arealRotation The areal rotation in radians regarding the projected crs. * @param projectedUom The unit of measure of the projected axis of this * instance. @@ -187,14 +186,14 @@ namespace RESQML2_0_1_NS * EPSG or GML. * @param timeUom The unit of measure of the Z offset of this instance. * @param verticalUom The unit of measure of the vertical axis of this instance. - * @param verticalEpsgCode The epsg code of the associated vertical CRS. - * @param isUpOriented If true, indicates that the Z offset if an elevation when - * positive. If false, the Z offset is a depth when positive. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented Indicates if the axis of the associated vertical CRS is up oriented or not. + * It is important to rightly place @p originOrdinal3 in the space. */ - LocalTime3dCrs(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, + LocalTime3dCrs(COMMON_NS::DataObjectRepository* repo, const std::string& guid, const std::string& title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string& projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); @@ -203,23 +202,31 @@ namespace RESQML2_0_1_NS * * @param [in,out] fromGsoap If non-null, from gsoap. */ - LocalTime3dCrs(gsoap_resqml2_0_1::_resqml20__LocalTime3dCrs* fromGsoap): RESQML2_NS::LocalTime3dCrs(fromGsoap) {} + LocalTime3dCrs(gsoap_resqml2_0_1::_resqml20__LocalTime3dCrs* fromGsoap) : EML2_NS::AbstractLocal3dCrs(fromGsoap) {} /** Destructor does nothing since the memory is manged by the gsoap context. */ ~LocalTime3dCrs() = default; - DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::eml20__TimeUom getUnit() const final; + DLL_IMPORT_OR_EXPORT bool isATimeCrs() const final { return true; } - DLL_IMPORT_OR_EXPORT std::string getUnitAsString() const final; + DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::eml20__TimeUom getTimeUom() const final; /** * The standard XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static const char* XML_NS; + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "resqml20"; /** * Get the standard XML namespace for serializing this data object. */ DLL_IMPORT_OR_EXPORT std::string getXmlNamespace() const final { return XML_NS; } + + /** The standard XML tag without XML namespace for serializing this data object. */ + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "LocalTime3dCrs"; + + DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } + + /** Loads target relationships */ + void loadTargetRelationships() final {} }; } diff --git a/src/resqml2_0_1/MdDatum.cpp b/src/resqml2_0_1/MdDatum.cpp index d99c05606..91d80eaad 100644 --- a/src/resqml2_0_1/MdDatum.cpp +++ b/src/resqml2_0_1/MdDatum.cpp @@ -20,7 +20,7 @@ under the License. #include -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace RESQML2_0_1_NS; @@ -29,7 +29,7 @@ using namespace gsoap_resqml2_0_1; const char* MdDatum::XML_NS = "resqml20"; MdDatum::MdDatum(COMMON_NS::DataObjectRepository * repo, const string & guid, const string & title, - RESQML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, + EML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, double referenceLocationOrdinal1, double referenceLocationOrdinal2, double referenceLocationOrdinal3) { if (repo == nullptr) @@ -45,13 +45,13 @@ MdDatum::MdDatum(COMMON_NS::DataObjectRepository * repo, const string & guid, co mdInfo->Location->Coordinate3 = referenceLocationOrdinal3; initMandatoryMetadata(); - setMetadata(guid, title, std::string(), -1, std::string(), std::string(), -1, std::string()); + setMetadata(guid, title, "", -1, "", "", -1, ""); repo->addDataObject(this); setLocalCrs(locCrs); } -void MdDatum::setLocalCrs(RESQML2_NS::AbstractLocal3dCrs * localCrs) +void MdDatum::setLocalCrs(EML2_NS::AbstractLocal3dCrs * localCrs) { // The constructor must force getRepository() not to return nullptr @@ -113,6 +113,6 @@ void MdDatum::loadTargetRelationships() { COMMON_NS::DataObjectReference dor = getLocalCrsDor(); if (!dor.isEmpty()) { - convertDorIntoRel(dor); + convertDorIntoRel(dor); } } diff --git a/src/resqml2_0_1/MdDatum.h b/src/resqml2_0_1/MdDatum.h index ff793b04f..b7c22fe69 100644 --- a/src/resqml2_0_1/MdDatum.h +++ b/src/resqml2_0_1/MdDatum.h @@ -54,7 +54,7 @@ namespace RESQML2_0_1_NS * third axis of the local 3d CRS. */ MdDatum(COMMON_NS::DataObjectRepository * repo, const std::string & guid, const std::string & title, - RESQML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, + EML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, double referenceLocationOrdinal1, double referenceLocationOrdinal2, double referenceLocationOrdinal3); /** @@ -108,6 +108,6 @@ namespace RESQML2_0_1_NS * @param [in] localCrs If non-nullptr, the local CRS. If nullptr, the data object repository * default CRS is set. */ - DLL_IMPORT_OR_EXPORT void setLocalCrs(RESQML2_NS::AbstractLocal3dCrs * localCrs) final; + DLL_IMPORT_OR_EXPORT void setLocalCrs(EML2_NS::AbstractLocal3dCrs * localCrs) final; }; } diff --git a/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.cpp b/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.cpp index b7ec0b59b..bca3a1c5d 100644 --- a/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.cpp +++ b/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.cpp @@ -27,7 +27,7 @@ under the License. #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/StructuralOrganizationInterpretation.h" using namespace std; @@ -58,7 +58,7 @@ NonSealedSurfaceFrameworkRepresentation::NonSealedSurfaceFrameworkRepresentation setInterpretation(interp); } -void NonSealedSurfaceFrameworkRepresentation::pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void NonSealedSurfaceFrameworkRepresentation::pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (pointCount == 0) throw invalid_argument("Contact point count cannot be zero."); diff --git a/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.h b/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.h index 0aa20ad2e..47a90eb53 100644 --- a/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.h +++ b/src/resqml2_0_1/NonSealedSurfaceFrameworkRepresentation.h @@ -58,7 +58,7 @@ namespace RESQML2_0_1_NS /** Destructor does nothing since the memory is managed by the gsoap context. */ ~NonSealedSurfaceFrameworkRepresentation() = default; - DLL_IMPORT_OR_EXPORT void pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + DLL_IMPORT_OR_EXPORT void pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; /** * Pushes back a contact patch in a particular contact representation of the structural framework. diff --git a/src/resqml2_0_1/PlaneSetRepresentation.cpp b/src/resqml2_0_1/PlaneSetRepresentation.cpp index 2f295bf42..3a8db0a0c 100644 --- a/src/resqml2_0_1/PlaneSetRepresentation.cpp +++ b/src/resqml2_0_1/PlaneSetRepresentation.cpp @@ -24,7 +24,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace RESQML2_0_1_NS; @@ -60,7 +60,7 @@ COMMON_NS::DataObjectReference PlaneSetRepresentation::getLocalCrsDor(unsigned i return COMMON_NS::DataObjectReference(result); } -void PlaneSetRepresentation::pushBackHorizontalPlaneGeometryPatch(double zCoordinate, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void PlaneSetRepresentation::pushBackHorizontalPlaneGeometryPatch(double zCoordinate, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -82,7 +82,7 @@ void PlaneSetRepresentation::pushBackTiltedPlaneGeometryPatch( double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, - RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_0_1/PlaneSetRepresentation.h b/src/resqml2_0_1/PlaneSetRepresentation.h index a20cc68cb..5b99451db 100644 --- a/src/resqml2_0_1/PlaneSetRepresentation.h +++ b/src/resqml2_0_1/PlaneSetRepresentation.h @@ -76,13 +76,13 @@ namespace RESQML2_0_1_NS DLL_IMPORT_OR_EXPORT uint64_t getPatchCount() const final; - DLL_IMPORT_OR_EXPORT void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + DLL_IMPORT_OR_EXPORT void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void pushBackTiltedPlaneGeometryPatch( double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, - RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. diff --git a/src/resqml2_0_1/PointSetRepresentation.cpp b/src/resqml2_0_1/PointSetRepresentation.cpp index 69f10329e..3152c6810 100644 --- a/src/resqml2_0_1/PointSetRepresentation.cpp +++ b/src/resqml2_0_1/PointSetRepresentation.cpp @@ -24,7 +24,7 @@ under the License. #include "H5public.h" #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/AbstractHdfProxy.h" using namespace std; @@ -66,7 +66,7 @@ PointSetRepresentation::PointSetRepresentation(RESQML2_NS::AbstractFeatureInterp void PointSetRepresentation::pushBackGeometryPatch( unsigned int xyzPointCount, double const * xyzPoints, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs * localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_0_1/PointSetRepresentation.h b/src/resqml2_0_1/PointSetRepresentation.h index e8e694cf1..512609eb8 100644 --- a/src/resqml2_0_1/PointSetRepresentation.h +++ b/src/resqml2_0_1/PointSetRepresentation.h @@ -89,7 +89,7 @@ namespace RESQML2_0_1_NS DLL_IMPORT_OR_EXPORT void pushBackGeometryPatch( unsigned int xyzPointCount, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. diff --git a/src/resqml2_0_1/PointsProperty.cpp b/src/resqml2_0_1/PointsProperty.cpp index a46b40e7a..4b46fb3bc 100644 --- a/src/resqml2_0_1/PointsProperty.cpp +++ b/src/resqml2_0_1/PointsProperty.cpp @@ -30,7 +30,7 @@ using namespace gsoap_resqml2_0_1; const char* PointsProperty::XML_NS = "resqml20"; PointsProperty::PointsProperty(RESQML2_NS::AbstractRepresentation * rep, const string & guid, const string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, resqml20__ResqmlPropertyKind energisticsPropertyKind) + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, resqml20__ResqmlPropertyKind energisticsPropertyKind) { if (dimension == 0) { throw invalid_argument("The dimension cannot be zero."); @@ -54,7 +54,7 @@ PointsProperty::PointsProperty(RESQML2_NS::AbstractRepresentation * rep, const s } PointsProperty::PointsProperty(RESQML2_NS::AbstractRepresentation * rep, const string & guid, const string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind * localPropKind) + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind * localPropKind) { if (dimension == 0) { throw invalid_argument("The dimension cannot be zero."); diff --git a/src/resqml2_0_1/PointsProperty.h b/src/resqml2_0_1/PointsProperty.h index 5a3bbf063..6fc3b2bc2 100644 --- a/src/resqml2_0_1/PointsProperty.h +++ b/src/resqml2_0_1/PointsProperty.h @@ -55,7 +55,7 @@ namespace RESQML2_0_1_NS * dictionary. Defatul is a length kind */ PointsProperty(RESQML2_NS::AbstractRepresentation* rep, const std::string& guid, const std::string& title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind = gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind::length); /** @@ -78,7 +78,7 @@ namespace RESQML2_0_1_NS * in the EPC document as a local property kind. It cannot be null. */ PointsProperty(RESQML2_NS::AbstractRepresentation* rep, const std::string& guid, const std::string& title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind* localPropKind); /** diff --git a/src/resqml2_0_1/PolylineRepresentation.cpp b/src/resqml2_0_1/PolylineRepresentation.cpp index c071cb869..8ed71bfda 100644 --- a/src/resqml2_0_1/PolylineRepresentation.cpp +++ b/src/resqml2_0_1/PolylineRepresentation.cpp @@ -24,7 +24,7 @@ under the License. #include "../resqml2/AbstractFeature.h" #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -113,7 +113,7 @@ void PolylineRepresentation::getXyzPointsOfPatch(unsigned int patchIndex, double throw invalid_argument("The geometry of the representation either does not exist or it is not an explicit one."); } -void PolylineRepresentation::setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void PolylineRepresentation::setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_0_1/PolylineRepresentation.h b/src/resqml2_0_1/PolylineRepresentation.h index 6a3f69723..b8c36e72d 100644 --- a/src/resqml2_0_1/PolylineRepresentation.h +++ b/src/resqml2_0_1/PolylineRepresentation.h @@ -95,7 +95,7 @@ namespace RESQML2_0_1_NS DLL_IMPORT_OR_EXPORT void getXyzPointsOfPatch(unsigned int patchIndex, double * xyzPoints) const final; - DLL_IMPORT_OR_EXPORT void setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + DLL_IMPORT_OR_EXPORT void setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT bool isClosed() const final; diff --git a/src/resqml2_0_1/PolylineSetRepresentation.cpp b/src/resqml2_0_1/PolylineSetRepresentation.cpp index 4b10bb12b..a033c0839 100644 --- a/src/resqml2_0_1/PolylineSetRepresentation.cpp +++ b/src/resqml2_0_1/PolylineSetRepresentation.cpp @@ -24,7 +24,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/AbstractHdfProxy.h" using namespace std; @@ -81,7 +81,7 @@ PolylineSetRepresentation::PolylineSetRepresentation(RESQML2_NS::AbstractFeature void PolylineSetRepresentation::pushBackGeometryPatch( unsigned int const* nodeCountPerPolyline, double const* nodes, uint64_t polylineCount, bool allPolylinesClosedFlag, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -136,7 +136,7 @@ void PolylineSetRepresentation::pushBackGeometryPatch( void PolylineSetRepresentation::pushBackGeometryPatch( unsigned int const* nodeCountPerPolyline, double const* nodes, uint64_t polylineCount, bool * polylineClosedFlags, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_0_1/PolylineSetRepresentation.h b/src/resqml2_0_1/PolylineSetRepresentation.h index 047cb1656..e6a488e3d 100644 --- a/src/resqml2_0_1/PolylineSetRepresentation.h +++ b/src/resqml2_0_1/PolylineSetRepresentation.h @@ -101,12 +101,12 @@ namespace RESQML2_0_1_NS DLL_IMPORT_OR_EXPORT void pushBackGeometryPatch( unsigned int const * nodeCountPerPolyline, double const * nodes, uint64_t polylineCount, bool allPolylinesClosedFlag, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void pushBackGeometryPatch( unsigned int const * nodeCountPerPolyline, double const * nodes, uint64_t polylineCount, bool * polylineClosedFlags, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT bool areAllPolylinesClosedOfPatch(unsigned int patchIndex) const final; diff --git a/src/resqml2_0_1/StreamlinesRepresentation.cpp b/src/resqml2_0_1/StreamlinesRepresentation.cpp index b9ab94dcf..943018f96 100644 --- a/src/resqml2_0_1/StreamlinesRepresentation.cpp +++ b/src/resqml2_0_1/StreamlinesRepresentation.cpp @@ -176,7 +176,7 @@ void StreamlinesRepresentation::getNodeCountPerLine(uint32_t * nodeCountPerPolyl void StreamlinesRepresentation::setGeometry( uint32_t const * nodeCountPerPolyline, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* hdfProxy, RESQML2_NS::AbstractLocal3dCrs*) + EML2_NS::AbstractHdfProxy* hdfProxy, EML2_NS::AbstractLocal3dCrs*) { if (nodeCountPerPolyline == nullptr) { throw invalid_argument("The nodeCountPerPolyline cannot be null."); diff --git a/src/resqml2_0_1/StreamlinesRepresentation.h b/src/resqml2_0_1/StreamlinesRepresentation.h index 18ae7afe6..d62cc36e8 100644 --- a/src/resqml2_0_1/StreamlinesRepresentation.h +++ b/src/resqml2_0_1/StreamlinesRepresentation.h @@ -186,7 +186,7 @@ namespace RESQML2_0_1_NS */ DLL_IMPORT_OR_EXPORT void setGeometry( uint32_t const * nodeCountPerPolyline, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; //******************************** //******* GRID INFO ************* diff --git a/src/resqml2_0_1/TriangulatedSetRepresentation.cpp b/src/resqml2_0_1/TriangulatedSetRepresentation.cpp index b37ad1f2c..2d1715e36 100644 --- a/src/resqml2_0_1/TriangulatedSetRepresentation.cpp +++ b/src/resqml2_0_1/TriangulatedSetRepresentation.cpp @@ -23,7 +23,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/AbstractHdfProxy.h" using namespace std; @@ -88,7 +88,7 @@ resqml20__PointGeometry* TriangulatedSetRepresentation::getPointGeometry2_0_1(ui void TriangulatedSetRepresentation::pushBackTrianglePatch( unsigned int nodeCount, double const * nodes, unsigned int triangleCount, unsigned int const * triangleNodeIndices, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_0_1/TriangulatedSetRepresentation.h b/src/resqml2_0_1/TriangulatedSetRepresentation.h index 0396ebd91..17abff469 100644 --- a/src/resqml2_0_1/TriangulatedSetRepresentation.h +++ b/src/resqml2_0_1/TriangulatedSetRepresentation.h @@ -76,7 +76,7 @@ namespace RESQML2_0_1_NS COMMON_NS::DataObjectReference getHdfProxyDor() const; DLL_IMPORT_OR_EXPORT void pushBackTrianglePatch(unsigned int nodeCount, double const * nodes, unsigned int triangleCount, unsigned int const * triangleNodeIndices, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT uint64_t getXyzPointCountOfPatch(unsigned int patchIndex) const final; diff --git a/src/resqml2_0_1/UnstructuredGridRepresentation.cpp b/src/resqml2_0_1/UnstructuredGridRepresentation.cpp index 6a383075b..cdb3faace 100644 --- a/src/resqml2_0_1/UnstructuredGridRepresentation.cpp +++ b/src/resqml2_0_1/UnstructuredGridRepresentation.cpp @@ -22,7 +22,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/AbstractHdfProxy.h" using namespace std; @@ -342,7 +342,7 @@ void UnstructuredGridRepresentation::getCellFaceIsRightHanded(uint8_t* cellFaceI void UnstructuredGridRepresentation::setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, const std::string&faceIndicesCumulativeCountPerCell, uint64_t faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs) + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs) { if (cellFaceIsRightHanded.empty()) throw invalid_argument("The cellFaceIsRightHanded dataset path information cannot be empty."); @@ -433,7 +433,7 @@ void UnstructuredGridRepresentation::setGeometryUsingExistingDatasets(const std: } void UnstructuredGridRepresentation::setConstantCellShapeGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, - uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, + uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, uint64_t faceCountPerCell, const std::string& nodeIndicesPerFace, uint64_t nodeCountPerFace) { diff --git a/src/resqml2_0_1/UnstructuredGridRepresentation.h b/src/resqml2_0_1/UnstructuredGridRepresentation.h index 575d2b0ec..8e96ad4e4 100644 --- a/src/resqml2_0_1/UnstructuredGridRepresentation.h +++ b/src/resqml2_0_1/UnstructuredGridRepresentation.h @@ -109,7 +109,7 @@ namespace RESQML2_0_1_NS DLL_IMPORT_OR_EXPORT void setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, const std::string& faceIndicesCumulativeCountPerCell, uint64_t faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. @@ -147,7 +147,7 @@ namespace RESQML2_0_1_NS * @param nodeCountPerFace The constant node count per face. */ void setConstantCellShapeGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, - uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, + uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, uint64_t faceCountPerCell, const std::string& nodeIndicesPerFace, uint64_t nodeCountPerFace) final; }; diff --git a/src/resqml2_0_1/WellboreTrajectoryRepresentation.cpp b/src/resqml2_0_1/WellboreTrajectoryRepresentation.cpp index 94cc86d2d..1987977c0 100644 --- a/src/resqml2_0_1/WellboreTrajectoryRepresentation.cpp +++ b/src/resqml2_0_1/WellboreTrajectoryRepresentation.cpp @@ -23,7 +23,7 @@ under the License. #include "H5public.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/DeviationSurveyRepresentation.h" #include "../resqml2/MdDatum.h" #include "../resqml2/WellboreFrameRepresentation.h" @@ -102,7 +102,7 @@ void WellboreTrajectoryRepresentation::setMinimalGeometry(double startMd, double rep->FinishMd = endMd; } -void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (controlPoints == nullptr) { throw invalid_argument("The control points are missing."); @@ -152,7 +152,7 @@ void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, } void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (controlPointParameters == nullptr) { throw invalid_argument("The control points parameters are missing."); @@ -184,7 +184,7 @@ void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double const* tangentVectors, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (tangentVectors == nullptr) { throw invalid_argument("The tangent vectors parameter is missing."); diff --git a/src/resqml2_0_1/WellboreTrajectoryRepresentation.h b/src/resqml2_0_1/WellboreTrajectoryRepresentation.h index c1ebe4be1..14998b03c 100644 --- a/src/resqml2_0_1/WellboreTrajectoryRepresentation.h +++ b/src/resqml2_0_1/WellboreTrajectoryRepresentation.h @@ -89,14 +89,14 @@ namespace RESQML2_0_1_NS DLL_IMPORT_OR_EXPORT void setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy* proxy = nullptr, - RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometry(double const* controlPoints, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometry(double const* controlPoints, double const* tangentVectors, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT int getGeometryKind() const final; diff --git a/src/resqml2_2/Grid2dRepresentation.cpp b/src/resqml2_2/Grid2dRepresentation.cpp index 9d1b12ec0..02a77a7b6 100644 --- a/src/resqml2_2/Grid2dRepresentation.cpp +++ b/src/resqml2_2/Grid2dRepresentation.cpp @@ -25,7 +25,7 @@ under the License. #include "../resqml2/AbstractFeature.h" #include "../resqml2/AbstractFeatureInterpretation.h" #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" using namespace std; using namespace RESQML2_2_NS; @@ -483,7 +483,7 @@ void Grid2dRepresentation::setGeometryAsArray2dOfLatticePoints3d( double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs) { // The below check exists because Count of spacing must be > 0 in the standard which occurs inly if we have at least two nodes per direction. if (numPointsInFastestDirection < 2 || numPointsInSlowestDirection < 2) { @@ -510,7 +510,7 @@ void Grid2dRepresentation::setGeometryAsArray2dOfLatticePoints3d( void Grid2dRepresentation::setGeometryAsArray2dOfExplicitZ( double * zValues, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, - RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, RESQML2_NS::AbstractLocal3dCrs * localCrs, + RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int startIndexI, unsigned int startIndexJ, int indexIncrementI, int indexIncrementJ) { @@ -538,7 +538,7 @@ void Grid2dRepresentation::setGeometryAsArray2dOfExplicitZ( unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, - double offsetJX, double offsetJY, double offsetJZ, double spacingJ, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double offsetJX, double offsetJY, double offsetJZ, double spacingJ, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -661,7 +661,7 @@ resqml22__PointGeometry* Grid2dRepresentation::createArray2dOfLatticePoints3d( double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { throw invalid_argument("The CRS cannot be the null pointer"); @@ -707,7 +707,7 @@ resqml22__PointGeometry* Grid2dRepresentation::createArray2dOfLatticePoints3d( } resqml22__PointGeometry* Grid2dRepresentation::createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::Grid2dRepresentation * supportingRepresentation, uint64_t startGlobalIndex, @@ -771,7 +771,7 @@ resqml22__PointGeometry* Grid2dRepresentation::createArray2dOfExplicitZ( } resqml22__PointGeometry* Grid2dRepresentation::createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy * proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, diff --git a/src/resqml2_2/Grid2dRepresentation.h b/src/resqml2_2/Grid2dRepresentation.h index 5b08d0035..1ec2b3f31 100644 --- a/src/resqml2_2/Grid2dRepresentation.h +++ b/src/resqml2_2/Grid2dRepresentation.h @@ -101,12 +101,12 @@ namespace RESQML2_2_NS double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsArray2dOfExplicitZ( double * zValues, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, - RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr, + RESQML2_NS::Grid2dRepresentation * supportingGrid2dRepresentation, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr, unsigned int startIndexI = 0, unsigned int startIndexJ = 0, int indexIncrementI = 1, int indexIncrementJ = 1) final; @@ -115,7 +115,7 @@ namespace RESQML2_2_NS unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, - double offsetJX, double offsetJY, double offsetJZ, double spacingJ, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + double offsetJX, double offsetJY, double offsetJZ, double spacingJ, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; COMMON_NS::DataObjectReference getSupportingRepresentationDor() const final; @@ -183,7 +183,7 @@ namespace RESQML2_2_NS double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, RESQML2_NS::AbstractLocal3dCrs * localCrs); + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs); /** * Creates a geometry for a grid 2d representation which derives from another existing grid 2d @@ -216,7 +216,7 @@ namespace RESQML2_2_NS * @returns Null if it fails, else the new array 2D of explicit z coordinate. */ gsoap_eml2_3::resqml22__PointGeometry* createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, RESQML2_NS::Grid2dRepresentation * supportingRepresentation, uint64_t startGlobalIndex = 0, @@ -248,7 +248,7 @@ namespace RESQML2_2_NS * @returns Null if it fails, else the new array 2D of explicit z coordinate. */ gsoap_eml2_3::resqml22__PointGeometry* createArray2dOfExplicitZ( - unsigned int patchIndex, double * zValues, RESQML2_NS::AbstractLocal3dCrs * localCrs, + unsigned int patchIndex, double * zValues, EML2_NS::AbstractLocal3dCrs * localCrs, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, diff --git a/src/resqml2_2/IjkGridExplicitRepresentation.cpp b/src/resqml2_2/IjkGridExplicitRepresentation.cpp index 6dcfb3bff..15276a636 100644 --- a/src/resqml2_2/IjkGridExplicitRepresentation.cpp +++ b/src/resqml2_2/IjkGridExplicitRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -94,7 +94,7 @@ void IjkGridExplicitRepresentation::setGeometryAsCoordinateLineNodesUsingExistin const std::string & points, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, - const std::string & definedPillars, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & definedPillars, EML2_NS::AbstractLocal3dCrs * localCrs) { if (points.empty()) { throw invalid_argument("The points HDF dataset of the ijk grid cannot be empty."); @@ -188,7 +188,7 @@ void IjkGridExplicitRepresentation::setGeometryAsCoordinateLineNodes( double const* points, EML2_NS::AbstractHdfProxy * proxy, uint64_t splitCoordinateLineCount, unsigned int const* pillarOfCoordinateLine, unsigned int const* splitCoordinateLineColumnCumulativeCount, unsigned int const* splitCoordinateLineColumns, - int8_t const* definedPillars, RESQML2_NS::AbstractLocal3dCrs * localCrs) + int8_t const* definedPillars, EML2_NS::AbstractLocal3dCrs * localCrs) { if (points == nullptr) { throw invalid_argument("The points of the ijk grid cannot be null."); diff --git a/src/resqml2_2/IjkGridExplicitRepresentation.h b/src/resqml2_2/IjkGridExplicitRepresentation.h index 64c000ecf..f2e023cf6 100644 --- a/src/resqml2_2/IjkGridExplicitRepresentation.h +++ b/src/resqml2_2/IjkGridExplicitRepresentation.h @@ -111,14 +111,14 @@ namespace RESQML2_2_NS double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, unsigned int const* pillarOfCoordinateLine = nullptr, unsigned int const* splitCoordinateLineColumnCumulativeCount = nullptr, unsigned int const* splitCoordinateLineColumns = nullptr, - int8_t const* definedPillars = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + int8_t const* definedPillars = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsCoordinateLineNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, const std::string & pillarOfCoordinateLine = "", const std::string & splitCoordinateLineColumnCumulativeCount = "", const std::string & splitCoordinateLineColumns = "", - const std::string & definedPillars = "", RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + const std::string & definedPillars = "", EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. diff --git a/src/resqml2_2/IjkGridLatticeRepresentation.cpp b/src/resqml2_2/IjkGridLatticeRepresentation.cpp index cef1c624e..33615d829 100644 --- a/src/resqml2_2/IjkGridLatticeRepresentation.cpp +++ b/src/resqml2_2/IjkGridLatticeRepresentation.cpp @@ -20,7 +20,7 @@ under the License. #include "../resqml2/AbstractFeature.h" #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -304,7 +304,7 @@ void IjkGridLatticeRepresentation::setGeometryAsCoordinateLineNodes( double originX, double originY, double originZ, double directionIX, double directionIY, double directionIZ, double spacingI, double directionJX, double directionJY, double directionJZ, double spacingJ, - double directionKX, double directionKY, double directionKZ, double spacingK, RESQML2_NS::AbstractLocal3dCrs * localCrs) + double directionKX, double directionKY, double directionKZ, double spacingK, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_2/IjkGridLatticeRepresentation.h b/src/resqml2_2/IjkGridLatticeRepresentation.h index 33e4097ae..39a820a4e 100644 --- a/src/resqml2_2/IjkGridLatticeRepresentation.h +++ b/src/resqml2_2/IjkGridLatticeRepresentation.h @@ -130,7 +130,7 @@ namespace RESQML2_2_NS double originX, double originY, double originZ, double directionIX, double directionIY, double directionIZ, double spacingI, double directionJX, double directionJY, double directionJZ, double spacingJ, - double directionKX, double directionKY, double directionKZ, double spacingK, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + double directionKX, double directionKY, double directionKZ, double spacingK, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void addSeismic3dCoordinatesToPatch( unsigned int patchIndex, diff --git a/src/resqml2_2/IjkGridParametricRepresentation.cpp b/src/resqml2_2/IjkGridParametricRepresentation.cpp index 7a087ef4f..0f4d90f4e 100644 --- a/src/resqml2_2/IjkGridParametricRepresentation.cpp +++ b/src/resqml2_2/IjkGridParametricRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -237,7 +237,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, EML2_NS::AbstractHdfProxy * proxy, uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine, - unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (pillarKind == nullptr) { throw invalid_argument("The kind of the coordinate lines cannot be null."); @@ -313,7 +313,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (pillarKind.empty()) throw invalid_argument("The kind of the coordinate lines cannot be null."); @@ -356,7 +356,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (controlPointCountPerPillar < 1) { throw invalid_argument("The max count of control points per coordinate line of the ijk grid cannot be less than one."); @@ -454,7 +454,7 @@ void IjkGridParametricRepresentation::setGeometryAsParametricSplittedPillarNodes gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs) + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs) { if (pillarKind < 0 || pillarKind > 5) { throw range_error("The kind of the coordinate lines is out of range."); diff --git a/src/resqml2_2/IjkGridParametricRepresentation.h b/src/resqml2_2/IjkGridParametricRepresentation.h index e53ba4781..6dafa0f73 100644 --- a/src/resqml2_2/IjkGridParametricRepresentation.h +++ b/src/resqml2_2/IjkGridParametricRepresentation.h @@ -119,19 +119,19 @@ namespace RESQML2_2_NS gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double const * parameters, double const * controlPoints, double const * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short const * pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, unsigned int const * pillarOfCoordinateLine, - unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + unsigned int const * splitCoordinateLineColumnCumulativeCount, unsigned int const * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. @@ -155,6 +155,6 @@ namespace RESQML2_2_NS gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, RESQML2_NS::AbstractLocal3dCrs * localCrs); + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs); }; } diff --git a/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.cpp b/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.cpp index c53e8037a..fa104f54a 100644 --- a/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.cpp +++ b/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.cpp @@ -24,7 +24,7 @@ under the License. #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/StructuralOrganizationInterpretation.h" using namespace std; @@ -55,7 +55,7 @@ NonSealedSurfaceFrameworkRepresentation::NonSealedSurfaceFrameworkRepresentation setInterpretation(interp); } -void NonSealedSurfaceFrameworkRepresentation::pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void NonSealedSurfaceFrameworkRepresentation::pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (pointCount == 0) throw invalid_argument("Contact point count cannot be zero."); diff --git a/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.h b/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.h index 395f556b6..808a1d871 100644 --- a/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.h +++ b/src/resqml2_2/NonSealedSurfaceFrameworkRepresentation.h @@ -58,7 +58,7 @@ namespace RESQML2_2_NS /** Destructor does nothing since the memory is managed by the gsoap context. */ ~NonSealedSurfaceFrameworkRepresentation() = default; - DLL_IMPORT_OR_EXPORT void pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + DLL_IMPORT_OR_EXPORT void pushBackNonSealedContactRepresentation(unsigned int pointCount, double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; /** * Pushes back a contact patch in a particular contact representation of the structural framework. diff --git a/src/resqml2_2/PlaneSetRepresentation.cpp b/src/resqml2_2/PlaneSetRepresentation.cpp index 53c11a1da..481322d13 100644 --- a/src/resqml2_2/PlaneSetRepresentation.cpp +++ b/src/resqml2_2/PlaneSetRepresentation.cpp @@ -20,7 +20,7 @@ under the License. #include -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractFeatureInterpretation.h" @@ -58,7 +58,7 @@ COMMON_NS::DataObjectReference PlaneSetRepresentation::getLocalCrsDor(unsigned i return COMMON_NS::DataObjectReference(result); } -void PlaneSetRepresentation::pushBackHorizontalPlaneGeometryPatch(double zCoordinate, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void PlaneSetRepresentation::pushBackHorizontalPlaneGeometryPatch(double zCoordinate, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -80,7 +80,7 @@ void PlaneSetRepresentation::pushBackTiltedPlaneGeometryPatch( double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, - RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_2/PlaneSetRepresentation.h b/src/resqml2_2/PlaneSetRepresentation.h index ed9608321..5e696ab4e 100644 --- a/src/resqml2_2/PlaneSetRepresentation.h +++ b/src/resqml2_2/PlaneSetRepresentation.h @@ -81,13 +81,13 @@ namespace RESQML2_2_NS */ DLL_IMPORT_OR_EXPORT uint64_t getPatchCount() const final; - DLL_IMPORT_OR_EXPORT void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + DLL_IMPORT_OR_EXPORT void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void pushBackTiltedPlaneGeometryPatch( double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, - RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. diff --git a/src/resqml2_2/PointSetRepresentation.cpp b/src/resqml2_2/PointSetRepresentation.cpp index 26fd741a6..77fc5c26c 100644 --- a/src/resqml2_2/PointSetRepresentation.cpp +++ b/src/resqml2_2/PointSetRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/AbstractHdfProxy.h" using namespace std; @@ -63,7 +63,7 @@ PointSetRepresentation::PointSetRepresentation(RESQML2_NS::AbstractFeatureInterp void PointSetRepresentation::pushBackGeometryPatch( unsigned int xyzPointCount, double const * xyzPoints, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs * localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs * localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_2/PointSetRepresentation.h b/src/resqml2_2/PointSetRepresentation.h index baf0d7310..bd7d4ece5 100644 --- a/src/resqml2_2/PointSetRepresentation.h +++ b/src/resqml2_2/PointSetRepresentation.h @@ -89,7 +89,7 @@ namespace RESQML2_2_NS DLL_IMPORT_OR_EXPORT void pushBackGeometryPatch( unsigned int xyzPointCount, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. diff --git a/src/resqml2_2/PointsProperty.cpp b/src/resqml2_2/PointsProperty.cpp index 9c406394f..a19542a6e 100644 --- a/src/resqml2_2/PointsProperty.cpp +++ b/src/resqml2_2/PointsProperty.cpp @@ -30,7 +30,7 @@ using namespace gsoap_eml2_3; const char* PointsProperty::XML_NS = "resqml22"; PointsProperty::PointsProperty(RESQML2_NS::AbstractRepresentation * rep, const string & guid, const string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind * localPropKind) + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind * localPropKind) { gsoapProxy2_3 = soap_new_resqml22__PointsProperty(rep->getGsoapContext()); _resqml22__PointsProperty* prop = static_cast<_resqml22__PointsProperty*>(gsoapProxy2_3); diff --git a/src/resqml2_2/PointsProperty.h b/src/resqml2_2/PointsProperty.h index 0b69036db..7ae6c67a9 100644 --- a/src/resqml2_2/PointsProperty.h +++ b/src/resqml2_2/PointsProperty.h @@ -54,7 +54,7 @@ namespace RESQML2_2_NS * in the EPC document as a local property kind. It cannot be null. */ PointsProperty(RESQML2_NS::AbstractRepresentation* rep, const std::string& guid, const std::string& title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind* localPropKind); /** diff --git a/src/resqml2_2/PolylineRepresentation.cpp b/src/resqml2_2/PolylineRepresentation.cpp index 8407f711f..bc9608184 100644 --- a/src/resqml2_2/PolylineRepresentation.cpp +++ b/src/resqml2_2/PolylineRepresentation.cpp @@ -22,7 +22,7 @@ under the License. #include "../resqml2/AbstractFeature.h" #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractValuesProperty.h" #include "../eml2/AbstractHdfProxy.h" @@ -119,7 +119,7 @@ void PolylineRepresentation::getXyzPointsOfPatch(unsigned int patchIndex, double throw invalid_argument("The geometry of the representation either does not exist or it is not an explicit one."); } -void PolylineRepresentation::setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void PolylineRepresentation::setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_2/PolylineRepresentation.h b/src/resqml2_2/PolylineRepresentation.h index 42e693a86..58338ad95 100644 --- a/src/resqml2_2/PolylineRepresentation.h +++ b/src/resqml2_2/PolylineRepresentation.h @@ -95,7 +95,7 @@ namespace RESQML2_2_NS DLL_IMPORT_OR_EXPORT void getXyzPointsOfPatch(unsigned int patchIndex, double * xyzPoints) const final; - DLL_IMPORT_OR_EXPORT void setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + DLL_IMPORT_OR_EXPORT void setGeometry(double const* points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT bool isClosed() const final; diff --git a/src/resqml2_2/PolylineSetRepresentation.cpp b/src/resqml2_2/PolylineSetRepresentation.cpp index f609f1389..a939cda1d 100644 --- a/src/resqml2_2/PolylineSetRepresentation.cpp +++ b/src/resqml2_2/PolylineSetRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include #include "../resqml2/AbstractFeatureInterpretation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../eml2/AbstractHdfProxy.h" using namespace std; @@ -73,7 +73,7 @@ PolylineSetRepresentation::PolylineSetRepresentation(RESQML2_NS::AbstractFeature void PolylineSetRepresentation::pushBackGeometryPatch( unsigned int const* nodeCountPerPolyline, double const* nodes, uint64_t polylineCount, bool allPolylinesClosedFlag, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); @@ -125,7 +125,7 @@ void PolylineSetRepresentation::pushBackGeometryPatch( void PolylineSetRepresentation::pushBackGeometryPatch( unsigned int const* nodeCountPerPolyline, double const* nodes, uint64_t polylineCount, bool * polylineClosedFlags, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_2/PolylineSetRepresentation.h b/src/resqml2_2/PolylineSetRepresentation.h index fc7246288..fe8041b1e 100644 --- a/src/resqml2_2/PolylineSetRepresentation.h +++ b/src/resqml2_2/PolylineSetRepresentation.h @@ -100,12 +100,12 @@ namespace RESQML2_2_NS DLL_IMPORT_OR_EXPORT void pushBackGeometryPatch( unsigned int const * nodeCountPerPolyline, double const * nodes, uint64_t polylineCount, bool allPolylinesClosedFlag, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void pushBackGeometryPatch( unsigned int const * nodeCountPerPolyline, double const * nodes, uint64_t polylineCount, bool * polylineClosedFlags, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT bool areAllPolylinesClosedOfPatch(unsigned int patchIndex) const final; diff --git a/src/resqml2_2/SeismicWellboreFrameRepresentation.cpp b/src/resqml2_2/SeismicWellboreFrameRepresentation.cpp index 2ae64f8bd..b539c4fcf 100644 --- a/src/resqml2_2/SeismicWellboreFrameRepresentation.cpp +++ b/src/resqml2_2/SeismicWellboreFrameRepresentation.cpp @@ -18,7 +18,8 @@ under the License. -----------------------------------------------------------------------*/ #include "SeismicWellboreFrameRepresentation.h" -#include "../resqml2/LocalTime3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" + #include "../resqml2/WellboreInterpretation.h" #include "../resqml2/WellboreTrajectoryRepresentation.h" @@ -26,15 +27,13 @@ using namespace std; using namespace RESQML2_2_NS; using namespace gsoap_eml2_3; -const char* SeismicWellboreFrameRepresentation::XML_NS = "resqml22"; - SeismicWellboreFrameRepresentation::SeismicWellboreFrameRepresentation( RESQML2_NS::WellboreInterpretation* interp, const std::string& guid, const std::string& title, RESQML2_NS::WellboreTrajectoryRepresentation* traj, double seismicReferenceDatum, double weatheringVelocity, - RESQML2_NS::LocalTime3dCrs* crs) + EML2_NS::AbstractLocal3dCrs* crs) { if (interp == nullptr) { throw invalid_argument("The wellbore interpretation cannot be null."); @@ -42,7 +41,7 @@ SeismicWellboreFrameRepresentation::SeismicWellboreFrameRepresentation( if (traj == nullptr) { throw invalid_argument("The trajectory cannot be null."); } - if (crs == nullptr) { + if (crs == nullptr || !crs->isATimeCrs()) { throw invalid_argument("The local 3d crs cannot be null and must be a time one."); } diff --git a/src/resqml2_2/SeismicWellboreFrameRepresentation.h b/src/resqml2_2/SeismicWellboreFrameRepresentation.h index 48f84684d..00df35363 100644 --- a/src/resqml2_2/SeismicWellboreFrameRepresentation.h +++ b/src/resqml2_2/SeismicWellboreFrameRepresentation.h @@ -36,7 +36,7 @@ namespace RESQML2_2_NS /** * Creates an instance of this class by wrapping a gsoap instance. */ - SeismicWellboreFrameRepresentation(gsoap_eml2_3::resqml22__SeismicWellboreFrameRepresentation * fromGsoap) : + SeismicWellboreFrameRepresentation(gsoap_eml2_3::resqml22__SeismicWellboreFrameRepresentation* fromGsoap) : RESQML2_NS::SeismicWellboreFrameRepresentation(fromGsoap) {} ~SeismicWellboreFrameRepresentation() = default; @@ -56,12 +56,12 @@ namespace RESQML2_2_NS RESQML2_NS::WellboreTrajectoryRepresentation* traj, double seismicReferenceDatum, double weatheringVelocity, - RESQML2_NS::LocalTime3dCrs* crs); + EML2_NS::AbstractLocal3dCrs* crs); /** * The standard XML namespace for serializing this data object. */ - DLL_IMPORT_OR_EXPORT static const char* XML_NS; + DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "resqml22"; /** * Get the standard XML namespace for serializing this data object. diff --git a/src/resqml2_2/StreamlinesRepresentation.cpp b/src/resqml2_2/StreamlinesRepresentation.cpp index c294f9ce8..24908f78d 100644 --- a/src/resqml2_2/StreamlinesRepresentation.cpp +++ b/src/resqml2_2/StreamlinesRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include "../eml2/AbstractHdfProxy.h" #include "../resqml2/AbstractGridRepresentation.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/GenericFeatureInterpretation.h" #include "../resqml2/WellboreTrajectoryRepresentation.h" @@ -172,7 +172,7 @@ void StreamlinesRepresentation::getNodeCountPerLine(uint32_t * nodeCountPerPolyl void StreamlinesRepresentation::setGeometry( uint32_t const * nodeCountPerPolyline, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* hdfProxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy* hdfProxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (nodeCountPerPolyline == nullptr) { throw invalid_argument("The nodeCountPerPolyline cannot be null."); diff --git a/src/resqml2_2/StreamlinesRepresentation.h b/src/resqml2_2/StreamlinesRepresentation.h index 1299e1b38..7cadcef2b 100644 --- a/src/resqml2_2/StreamlinesRepresentation.h +++ b/src/resqml2_2/StreamlinesRepresentation.h @@ -184,7 +184,7 @@ namespace RESQML2_2_NS */ DLL_IMPORT_OR_EXPORT void setGeometry( uint32_t const * nodeCountPerPolyline, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; //******************************** //******* GRID INFO ************* diff --git a/src/resqml2_2/TriangulatedSetRepresentation.cpp b/src/resqml2_2/TriangulatedSetRepresentation.cpp index b20f5758e..fc8d035a0 100644 --- a/src/resqml2_2/TriangulatedSetRepresentation.cpp +++ b/src/resqml2_2/TriangulatedSetRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractFeatureInterpretation.h" @@ -91,7 +91,7 @@ resqml22__PointGeometry* TriangulatedSetRepresentation::getPointGeometry2_2(uint void TriangulatedSetRepresentation::pushBackTrianglePatch( unsigned int nodeCount, double const * nodes, unsigned int triangleCount, unsigned int const * triangleNodeIndices, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (localCrs == nullptr) { localCrs = getRepository()->getDefaultCrs(); diff --git a/src/resqml2_2/TriangulatedSetRepresentation.h b/src/resqml2_2/TriangulatedSetRepresentation.h index fa08b3da2..098531f50 100644 --- a/src/resqml2_2/TriangulatedSetRepresentation.h +++ b/src/resqml2_2/TriangulatedSetRepresentation.h @@ -76,7 +76,7 @@ namespace RESQML2_2_NS COMMON_NS::DataObjectReference getHdfProxyDor() const; DLL_IMPORT_OR_EXPORT void pushBackTrianglePatch(unsigned int nodeCount, double const * nodes, unsigned int triangleCount, unsigned int const * triangleNodeIndices, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT uint64_t getXyzPointCountOfPatch(unsigned int patchIndex) const final; diff --git a/src/resqml2_2/UnstructuredGridRepresentation.cpp b/src/resqml2_2/UnstructuredGridRepresentation.cpp index c612df0bf..797d2a360 100644 --- a/src/resqml2_2/UnstructuredGridRepresentation.cpp +++ b/src/resqml2_2/UnstructuredGridRepresentation.cpp @@ -19,7 +19,7 @@ under the License. #include "UnstructuredGridRepresentation.h" #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/AbstractFeatureInterpretation.h" @@ -340,7 +340,7 @@ void UnstructuredGridRepresentation::getCellFaceIsRightHanded(uint8_t* cellFaceI void UnstructuredGridRepresentation::setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, const std::string&faceIndicesCumulativeCountPerCell, uint64_t faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs) + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs) { if (cellFaceIsRightHanded.empty()) throw invalid_argument("The cellFaceIsRightHanded dataset path information cannot be empty."); @@ -425,7 +425,7 @@ void UnstructuredGridRepresentation::setGeometryUsingExistingDatasets(const std: } void UnstructuredGridRepresentation::setConstantCellShapeGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, - uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, + uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, uint64_t faceCountPerCell, const std::string& nodeIndicesPerFace, uint64_t nodeCountPerFace) { diff --git a/src/resqml2_2/UnstructuredGridRepresentation.h b/src/resqml2_2/UnstructuredGridRepresentation.h index 0aa8fd8eb..1bf5f1b86 100644 --- a/src/resqml2_2/UnstructuredGridRepresentation.h +++ b/src/resqml2_2/UnstructuredGridRepresentation.h @@ -105,7 +105,7 @@ namespace RESQML2_2_NS DLL_IMPORT_OR_EXPORT void setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, const std::string& faceIndicesCumulativeCountPerCell, uint64_t faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, RESQML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr) final; /** * The standard XML namespace for serializing this data object. @@ -143,7 +143,7 @@ namespace RESQML2_2_NS * @param nodeCountPerFace The constant node count per face. */ void setConstantCellShapeGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, - uint64_t pointCount, uint64_t faceCount, RESQML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, + uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractLocal3dCrs * localCrs, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, uint64_t faceCountPerCell, const std::string& nodeIndicesPerFace, uint64_t nodeCountPerFace) final; }; diff --git a/src/resqml2_2/WellboreTrajectoryRepresentation.cpp b/src/resqml2_2/WellboreTrajectoryRepresentation.cpp index 904762e1f..dd17e2738 100644 --- a/src/resqml2_2/WellboreTrajectoryRepresentation.cpp +++ b/src/resqml2_2/WellboreTrajectoryRepresentation.cpp @@ -21,7 +21,7 @@ under the License. #include "H5public.h" #include "../eml2/AbstractHdfProxy.h" -#include "../resqml2/AbstractLocal3dCrs.h" +#include "../eml2/AbstractLocal3dCrs.h" #include "../resqml2/MdDatum.h" #include "../resqml2/WellboreFrameRepresentation.h" @@ -65,7 +65,7 @@ void WellboreTrajectoryRepresentation::setMinimalGeometry(double startMd, double rep->MdInterval->MdMax = endMd; } -void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) +void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (controlPoints == nullptr) { throw invalid_argument("The control points are missing."); @@ -114,7 +114,7 @@ void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, } void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (controlPointParameters == nullptr) { throw invalid_argument("The control points parameters are missing."); @@ -145,7 +145,7 @@ void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, void WellboreTrajectoryRepresentation::setGeometry(double const* controlPoints, double const* tangentVectors, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy * proxy, RESQML2_NS::AbstractLocal3dCrs* localCrs) + EML2_NS::AbstractHdfProxy * proxy, EML2_NS::AbstractLocal3dCrs* localCrs) { if (tangentVectors == nullptr) { throw invalid_argument("The tangent vectors parameter is missing."); diff --git a/src/resqml2_2/WellboreTrajectoryRepresentation.h b/src/resqml2_2/WellboreTrajectoryRepresentation.h index dfce28693..0a4a23848 100644 --- a/src/resqml2_2/WellboreTrajectoryRepresentation.h +++ b/src/resqml2_2/WellboreTrajectoryRepresentation.h @@ -63,14 +63,14 @@ namespace RESQML2_2_NS DLL_IMPORT_OR_EXPORT void setMinimalGeometry(double startMd, double endMd) final; DLL_IMPORT_OR_EXPORT void setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, - int lineKind, EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + int lineKind, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometry(double const* controlPoints, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT void setGeometry(double const* controlPoints, double const* tangentVectors, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr) final; DLL_IMPORT_OR_EXPORT int getGeometryKind() const final; diff --git a/src/witsml2/Well.cpp b/src/witsml2/Well.cpp index 1eaef2060..ccff325bd 100644 --- a/src/witsml2/Well.cpp +++ b/src/witsml2/Well.cpp @@ -18,6 +18,8 @@ under the License. -----------------------------------------------------------------------*/ #include "Well.h" +#include "../eml2_3/VerticalCrs.h" + #include "../resqml2/WellboreFeature.h" #include "../witsml2_1/WellCompletion.h" @@ -40,3 +42,25 @@ std::vector Well::getWellcompletionSet() const { return getRepository()->getSourceObjects(this); } + +EML2_3_NS::VerticalCrs* Well::getGroundElevationDatum() const +{ + return dynamic_cast(getRepository()->getDataObjectByUuid(getGroundElevationDatumDor().getUuid())); +} + +EML2_3_NS::VerticalCrs* Well::getWellheadElevationDatum() const +{ + return dynamic_cast(getRepository()->getDataObjectByUuid(getWellheadElevationDatumDor().getUuid())); +} + +void Well::loadTargetRelationships() +{ + COMMON_NS::DataObjectReference dor = getGroundElevationDatumDor(); + if (!dor.isEmpty()) { + convertDorIntoRel(dor); + } + dor = getWellheadElevationDatumDor(); + if (!dor.isEmpty()) { + convertDorIntoRel(dor); + } +} diff --git a/src/witsml2/Well.h b/src/witsml2/Well.h index fe43f71db..4f3ab6787 100644 --- a/src/witsml2/Well.h +++ b/src/witsml2/Well.h @@ -32,6 +32,12 @@ namespace WITSML2_1_NS class WellCompletion; } +namespace EML2_3_NS +{ + class LocalEngineering2dCrs; + class VerticalCrs; +} + namespace WITSML2_NS { class Wellbore; @@ -74,6 +80,7 @@ namespace WITSML2_NS ABSTRACT_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(WaterDepth, gsoap_eml2_3::eml23__LengthUom) ABSTRACT_GETTER_PRESENCE_ATTRIBUTE(GroundElevation) + ABSTRACT_GETTER_PRESENCE_ATTRIBUTE(WellheadElevation) ABSTRACT_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(PcInterest, gsoap_eml2_3::eml23__DimensionlessUom) @@ -86,10 +93,11 @@ namespace WITSML2_NS * * @exception std::invalid_argument If @p value is undefined. * - * @param value The elevation value. - * @param uom The elevation unit of measure. + * @param value The elevation value. + * @param uom The elevation unit of measure. + * @param verticalCrs The vertical CRS which is used as the datum for the ground elevation */ - DLL_IMPORT_OR_EXPORT virtual void setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom) = 0; + DLL_IMPORT_OR_EXPORT virtual void setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) = 0; /** * @brief Gets the ground level elevation value @@ -109,6 +117,63 @@ namespace WITSML2_NS */ DLL_IMPORT_OR_EXPORT virtual gsoap_eml2_3::eml23__LengthUom getGroundElevationUom() const = 0; + /** + * Gets the data object reference of the datum of this ground elevation. + * + * @returns The data object reference of the datum of this ground elevation. + */ + DLL_IMPORT_OR_EXPORT virtual COMMON_NS::DataObjectReference getGroundElevationDatumDor() const = 0; + + /** + * Gets the vertical CRS which acts as the datum of this ground elevation. + * + * @returns The vertical CRS which acts as the datum of this ground elevation.. + */ + DLL_IMPORT_OR_EXPORT EML2_3_NS::VerticalCrs* getGroundElevationDatum() const; + + /** + * @brief Sets the well head elevation + * + * @exception std::invalid_argument If @p value is undefined. + * + * @param value The elevation value. + * @param uom The elevation unit of measure. + * @param verticalCrs The vertical CRS which is used as the datum for the well head elevation + */ + DLL_IMPORT_OR_EXPORT virtual void setWellheadElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) = 0; + + /** + * @brief Gets the well head elevation value + * + * @exception std::invalid_argument If the well head elevation does not exist. + * + * @returns The well head elevation value. + */ + DLL_IMPORT_OR_EXPORT virtual double getWellheadElevationValue() const = 0; + + /** + * @brief Gets the well head elevation unit of measure + * + * @exception std::invalid_argument If the well head elevation does not exist. + * + * @returns The well head elevation unit of measure. + */ + DLL_IMPORT_OR_EXPORT virtual gsoap_eml2_3::eml23__LengthUom getWellheadElevationUom() const = 0; + + /** + * Gets the data object reference of the datum of this well head elevation. + * + * @returns The data object reference of the datum of this well head elevation. + */ + DLL_IMPORT_OR_EXPORT virtual COMMON_NS::DataObjectReference getWellheadElevationDatumDor() const = 0; + + /** + * Gets the vertical CRS which acts as the datum of this well head elevation. + * + * @returns The vertical CRS which acts as the datum of this well head elevation.. + */ + DLL_IMPORT_OR_EXPORT EML2_3_NS::VerticalCrs* getWellheadElevationDatum() const; + /** * Set the time zone in which the well is located.It is the deviation in hours and minutes from * UTC.This should be the normal time zone at the well and not a seasonally-adjusted value, @@ -153,7 +218,7 @@ namespace WITSML2_NS * * @returns The location projected x coordinate. */ - DLL_IMPORT_OR_EXPORT virtual double getLocationProjectedX(unsigned int locationIndex) = 0; + DLL_IMPORT_OR_EXPORT virtual double getLocationProjectedX(uint64_t locationIndex) = 0; /** * Gets location projected y coordinate @@ -162,24 +227,23 @@ namespace WITSML2_NS * * @returns The location projected y coordinate. */ - DLL_IMPORT_OR_EXPORT virtual double getLocationProjectedY(unsigned int locationIndex) = 0; + DLL_IMPORT_OR_EXPORT virtual double getLocationProjectedY(uint64_t locationIndex) = 0; /** * Pushes a back location * - * @param projectedX The projected x coordinate. - * @param projectedY The projected y coordinate. + * @param projectedX The projected x coordinate. + * @param projectedY The projected y coordinate. + * @param crs The CRS of the X and Y coordinates. */ - DLL_IMPORT_OR_EXPORT virtual void pushBackLocation( - double projectedX, - double projectedY) = 0; + DLL_IMPORT_OR_EXPORT virtual void pushBackLocation(double projectedX, double projectedY, EML2_3_NS::LocalEngineering2dCrs* crs) = 0; /** * Get location count * * @returns An int. */ - DLL_IMPORT_OR_EXPORT virtual unsigned int geLocationCount() const = 0; + DLL_IMPORT_OR_EXPORT virtual uint64_t geLocationCount() const = 0; GETTER_DATAOBJECTS(RESQML2_NS::WellboreFeature, ResqmlWellboreFeature) GETTER_DATAOBJECTS(WITSML2_NS::Wellbore, Wellbore) @@ -199,9 +263,6 @@ namespace WITSML2_NS */ DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; } - /** A WITSML well points towards no other dataobject */ - void loadTargetRelationships() {} - protected: /** Default constructor does nothing */ @@ -214,11 +275,7 @@ namespace WITSML2_NS */ Well(gsoap_eml2_3::witsml21__Well* fromGsoap) : COMMON_NS::AbstractObject(fromGsoap) {} - /** - * Creates an instance of this class by wrapping a gsoap instance. - * - * @param [in,out] fromGsoap If non-null, from gsoap. - */ - //Well(gsoap_eml2_3::_resqml22__Well* fromGsoap) : COMMON_NS::AbstractObject(fromGsoap) {} + /** Loads target relationships */ + void loadTargetRelationships(); }; } diff --git a/src/witsml2_1/Well.cpp b/src/witsml2_1/Well.cpp index 949f4ce18..b3f97020f 100644 --- a/src/witsml2_1/Well.cpp +++ b/src/witsml2_1/Well.cpp @@ -25,6 +25,9 @@ under the License. #include "Wellbore.h" #include "WellCompletion.h" +#include "../eml2_3/LocalEngineering2dCrs.h" +#include "../eml2_3/VerticalCrs.h" + #include "../resqml2_0_1/WellboreFeature.h" #include "../tools/TimeTools.h" @@ -103,6 +106,7 @@ GETTER_AND_SETTER_GENERIC_OPTIONAL_ATTRIBUTE_IMPL(gsoap_eml2_3::witsml21__WellDi GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IMPL(Well, WaterDepth, gsoap_eml2_3::eml23__LengthUom, gsoap_eml2_3::soap_eml23__LengthUom2s, gsoap_eml2_3::soap_new_eml23__LengthMeasure) GETTER_PRESENCE_ATTRIBUTE_IMPL(Well, GroundElevation) +GETTER_PRESENCE_ATTRIBUTE_IMPL(Well, WellheadElevation) GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IMPL(Well, PcInterest, gsoap_eml2_3::eml23__DimensionlessUom, gsoap_eml2_3::soap_eml23__DimensionlessUom2s, gsoap_eml2_3::soap_new_eml23__DimensionlessMeasure) @@ -122,7 +126,18 @@ gsoap_eml2_3::eml23__LengthUom Well::getGroundElevationUom() const { return result; } -void Well::setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom) +COMMON_NS::DataObjectReference Well::getGroundElevationDatumDor() const { + if (!hasGroundElevation()) { return COMMON_NS::DataObjectReference(); } + witsml21__Well* well = static_cast(gsoapProxy2_3); + if (well->GroundElevation->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__DatumElevation) { + return COMMON_NS::DataObjectReference(static_cast(well->GroundElevation)->Datum); + } + else { + return COMMON_NS::DataObjectReference(static_cast(well->GroundElevation)->ReferencePoint); + } +} + +void Well::setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) { if (value != value) { throw invalid_argument("You cannot set an undefined measure"); } witsml21__Well* well = static_cast(gsoapProxy2_3); @@ -135,13 +150,50 @@ void Well::setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom) lengthMeasure->__item = value; lengthMeasure->uom = gsoap_eml2_3::soap_eml23__LengthUom2s(gsoapProxy2_3->soap, uom); datumElevation->Elevation = lengthMeasure; - datumElevation->Datum = soap_new_eml23__DataObjectReference(gsoapProxy2_3->soap); // TODO : allow to reference an existing vertical CRS - datumElevation->Datum->Uuid.assign("00000000-0000-0000-0000-000000000000"); - datumElevation->Datum->QualifiedType.assign("eml23.VerticalCrs"); - datumElevation->Datum->Title.assign("Fake Vertical CRS"); + datumElevation->Datum = verticalCrs->newEml23Reference(); well->GroundElevation = datumElevation; } +double Well::getWellheadElevationValue() const { + if (!hasWellheadElevation()) { throw invalid_argument("The Wellhead elevation does not exist."); } + return static_cast(gsoapProxy2_3)->WellheadElevation->Elevation->__item; +} + +gsoap_eml2_3::eml23__LengthUom Well::getWellheadElevationUom() const { + if (!hasWellheadElevation()) { throw invalid_argument("The Wellhead elevation does not exist."); } + gsoap_eml2_3::eml23__LengthUom result; + gsoap_eml2_3::soap_s2eml23__LengthUom(gsoapProxy2_3->soap, static_cast(gsoapProxy2_3)->WellheadElevation->Elevation->uom.c_str(), &result); + return result; +} + +COMMON_NS::DataObjectReference Well::getWellheadElevationDatumDor() const { + if (!hasWellheadElevation()) { return COMMON_NS::DataObjectReference(); } + witsml21__Well* well = static_cast(gsoapProxy2_3); + if (well->WellheadElevation->soap_type() == SOAP_TYPE_gsoap_eml2_3_eml23__DatumElevation) { + return COMMON_NS::DataObjectReference(static_cast(well->WellheadElevation)->Datum); + } + else { + return COMMON_NS::DataObjectReference(static_cast(well->WellheadElevation)->ReferencePoint); + } +} + +void Well::setWellheadElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) +{ + if (value != value) { throw invalid_argument("You cannot set an undefined measure"); } + witsml21__Well* well = static_cast(gsoapProxy2_3); + eml23__DatumElevation* datumElevation = well->WellheadElevation == nullptr + ? soap_new_eml23__DatumElevation(gsoapProxy2_3->soap) + : dynamic_cast(well->WellheadElevation); + eml23__LengthMeasureExt* lengthMeasure = datumElevation->Elevation == nullptr + ? soap_new_eml23__LengthMeasureExt(gsoapProxy2_3->soap) + : datumElevation->Elevation; + lengthMeasure->__item = value; + lengthMeasure->uom = gsoap_eml2_3::soap_eml23__LengthUom2s(gsoapProxy2_3->soap, uom); + datumElevation->Elevation = lengthMeasure; + datumElevation->Datum = verticalCrs->newEml23Reference(); + well->WellheadElevation = datumElevation; +} + void Well::setTimeZone(bool direction, unsigned short hours, unsigned short minutes) { if (hours > 23) { throw invalid_argument("You cannot set a time zone superior to 23 hours"); } @@ -200,57 +252,40 @@ unsigned short Well::getTimeZoneMinutes() const { return result; } -double Well::getLocationProjectedX(unsigned int locationIndex) +double Well::getLocationProjectedX(uint64_t locationIndex) { - witsml21__Well* well = static_cast(gsoapProxy2_3); + auto* surfaceLocation = static_cast(gsoapProxy2_3)->WellSurfaceLocation.at(locationIndex); - if (well->WellSurfaceLocation.size() <= locationIndex) { - throw range_error("The well location index is out of range."); - } - if (well->WellSurfaceLocation[locationIndex]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__Projected2dPosition){ - throw invalid_argument("The well location is not a projected one."); + if (surfaceLocation->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__LocalEngineering2dPosition){ + throw invalid_argument("The well location is not a LocalEngineering2dPosition one."); } - return static_cast(well->WellSurfaceLocation[locationIndex])->Coordinate1; + return static_cast(surfaceLocation)->Coordinate1; } -double Well::getLocationProjectedY(unsigned int locationIndex) +double Well::getLocationProjectedY(uint64_t locationIndex) { - witsml21__Well* well = static_cast(gsoapProxy2_3); + auto* surfaceLocation = static_cast(gsoapProxy2_3)->WellSurfaceLocation.at(locationIndex); - if (well->WellSurfaceLocation.size() <= locationIndex) { - throw range_error("The well location index is out of range."); - } - if (well->WellSurfaceLocation[locationIndex]->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__Projected2dPosition){ - throw invalid_argument("The well location is not a projected one."); + if (surfaceLocation->soap_type() != SOAP_TYPE_gsoap_eml2_3_eml23__LocalEngineering2dPosition){ + throw invalid_argument("The well location is not a LocalEngineering2dPosition one."); } - return static_cast(well->WellSurfaceLocation[locationIndex])->Coordinate2; + return static_cast(surfaceLocation)->Coordinate2; } -void Well::pushBackLocation( - double projectedX, - double projectedY) +void Well::pushBackLocation(double projectedX, double projectedY, EML2_3_NS::LocalEngineering2dCrs* crs) { witsml21__Well* well = static_cast(gsoapProxy2_3); - eml23__Projected2dPosition* location = soap_new_eml23__Projected2dPosition(gsoapProxy2_3->soap); + eml23__LocalEngineering2dPosition* location = soap_new_eml23__LocalEngineering2dPosition(gsoapProxy2_3->soap); location->Coordinate1 = projectedX; location->Coordinate2 = projectedY; - location->ProjectedCrs = soap_new_eml23__DataObjectReference(gsoapProxy2_3->soap); - location->ProjectedCrs->Uuid.assign("00000000-0000-0000-0000-000000000001"); - location->ProjectedCrs->QualifiedType.assign("eml23.ProjectedCrs"); - location->ProjectedCrs->Title.assign("Fake Projected CRS"); + location->LocalEngineering2dCrs = crs->newEml23Reference(); well->WellSurfaceLocation.push_back(location); } -unsigned int Well::geLocationCount() const { - const size_t result = static_cast(gsoapProxy2_3)->WellSurfaceLocation.size(); - - if (result > (std::numeric_limits::max)()) { - throw std::range_error("There are too much locations"); - } - - return static_cast(result); +uint64_t Well::geLocationCount() const { + return static_cast(gsoapProxy2_3)->WellSurfaceLocation.size(); } diff --git a/src/witsml2_1/Well.h b/src/witsml2_1/Well.h index c7530abd2..c96bd2f26 100644 --- a/src/witsml2_1/Well.h +++ b/src/witsml2_1/Well.h @@ -102,6 +102,7 @@ namespace WITSML2_1_NS FINAL_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(WaterDepth, gsoap_eml2_3::eml23__LengthUom) FINAL_GETTER_PRESENCE_ATTRIBUTE(GroundElevation) + FINAL_GETTER_PRESENCE_ATTRIBUTE(WellheadElevation) FINAL_GETTER_AND_SETTER_MEASURE_OPTIONAL_ATTRIBUTE(PcInterest, gsoap_eml2_3::eml23__DimensionlessUom) @@ -114,10 +115,11 @@ namespace WITSML2_1_NS * * @exception std::invalid_argument If @p value is undefined. * - * @param value The elevation value. - * @param uom The elevation unit of measure. + * @param value The elevation value. + * @param uom The elevation unit of measure. + * @param verticalCrs The vertical CRS which is used as the datum for the ground elevation */ - DLL_IMPORT_OR_EXPORT void setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom) final; + DLL_IMPORT_OR_EXPORT void setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) final; /** * @brief Gets the ground level elevation value @@ -136,6 +138,49 @@ namespace WITSML2_1_NS * @returns The ground level elevation unit of measure. */ DLL_IMPORT_OR_EXPORT gsoap_eml2_3::eml23__LengthUom getGroundElevationUom() const final; + + /** + * Gets the data object reference of the datum of this ground elevation. + * + * @returns The data object reference of the datum of this ground elevation. + */ + DLL_IMPORT_OR_EXPORT COMMON_NS::DataObjectReference getGroundElevationDatumDor() const final; + + /** + * @brief Sets the well head elevation + * + * @exception std::invalid_argument If @p value is undefined. + * + * @param value The elevation value. + * @param uom The elevation unit of measure. + * @param verticalCrs The vertical CRS which is used as the datum for the well head elevation + */ + DLL_IMPORT_OR_EXPORT virtual void setWellheadElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) final; + + /** + * @brief Gets the well head elevation value + * + * @exception std::invalid_argument If the well head elevation does not exist. + * + * @returns The well head elevation value. + */ + DLL_IMPORT_OR_EXPORT virtual double getWellheadElevationValue() const final; + + /** + * @brief Gets the well head elevation unit of measure + * + * @exception std::invalid_argument If the well head elevation does not exist. + * + * @returns The well head elevation unit of measure. + */ + DLL_IMPORT_OR_EXPORT virtual gsoap_eml2_3::eml23__LengthUom getWellheadElevationUom() const final; + + /** + * Gets the data object reference of the datum of this well head elevation. + * + * @returns The data object reference of the datum of this well head elevation. + */ + DLL_IMPORT_OR_EXPORT virtual COMMON_NS::DataObjectReference getWellheadElevationDatumDor() const final; /** * Set the time zone in which the well is located.It is the deviation in hours and minutes from @@ -181,7 +226,7 @@ namespace WITSML2_1_NS * * @returns The location projected x coordinate. */ - DLL_IMPORT_OR_EXPORT double getLocationProjectedX(unsigned int locationIndex) final; + DLL_IMPORT_OR_EXPORT double getLocationProjectedX(uint64_t locationIndex) final; /** * Gets location projected y coordinate @@ -190,24 +235,23 @@ namespace WITSML2_1_NS * * @returns The location projected y coordinate. */ - DLL_IMPORT_OR_EXPORT double getLocationProjectedY(unsigned int locationIndex) final; + DLL_IMPORT_OR_EXPORT double getLocationProjectedY(uint64_t locationIndex) final; /** * Pushes a back location * - * @param projectedX The projected x coordinate. - * @param projectedY The projected y coordinate. + * @param projectedX The projected x coordinate. + * @param projectedY The projected y coordinate. + * @param crs The CRS of the X and Y coordinates. */ - DLL_IMPORT_OR_EXPORT void pushBackLocation( - double projectedX, - double projectedY) final; + DLL_IMPORT_OR_EXPORT void pushBackLocation(double projectedX, double projectedY, EML2_3_NS::LocalEngineering2dCrs* crs) final; /** * Ge location count * * @returns An int. */ - DLL_IMPORT_OR_EXPORT unsigned int geLocationCount() const final; + DLL_IMPORT_OR_EXPORT uint64_t geLocationCount() const final; /** * The standard XML namespace for serializing this data object. diff --git a/swig/swigEml2Include.i b/swig/swigEml2Include.i index ba5958bb6..833bc8cb6 100644 --- a/swig/swigEml2Include.i +++ b/swig/swigEml2Include.i @@ -17,6 +17,7 @@ specific language governing permissions and limitations under the License. -----------------------------------------------------------------------*/ %{ +#include "../src/eml2/AbstractLocal3dCrs.h" #include "../src/eml2/Activity.h" #include "../src/eml2/ActivityTemplate.h" #include "../src/eml2/GraphicalInformationSet.h" @@ -26,6 +27,7 @@ under the License. #if defined(SWIGJAVA) || defined(SWIGCSHARP) %nspace EML2_NS::AbstractHdfProxy; + %nspace EML2_NS::AbstractLocal3dCrs; %nspace EML2_NS::Activity; %nspace EML2_NS::ActivityTemplate; %nspace EML2_NS::EpcExternalPartReference; @@ -547,6 +549,687 @@ namespace EML2_NS }; + /** @brief Proxy class for an abstract local 3D coordinate reference system (CRS). */ +#if defined(SWIGPYTHON) + %rename(Eml2_AbstractLocal3dCrs) AbstractLocal3dCrs; +#endif + class AbstractLocal3dCrs : public COMMON_NS::AbstractObject + { + public: + virtual ~AbstractLocal3dCrs(); + + /** + * Gets the first origin ordinal of this local CRS. This is the X location of the origin of the + * local areal axes relative to the projected CRS origin. The unit of measure is defined by the + * unit of measure for the projected 2d CRS. + * + * @returns The first origin ordinal of this local CRS. + */ + double getOriginOrdinal1() const; + + /** + * Gets the second origin ordinal of this local CRS. This is the Y location of the origin of the + * local areal axes relative to the projected CRS origin. The unit of measure is defined by the + * unit of measure for the projected 2d CRS. + * + * @returns The second origin ordinal of this local CRS. + */ + double getOriginOrdinal2() const; + + /** + * Get the depth or elevation origin of this local CRS. This is Z offset of the origin of the + * local vertical axis relative to the vertical CRS origin. According to CRS type (depth or time) + * it corresponds to the depth or time datum. If this local CRS is a time CRS, this value + * defines the seismic reference datum. The unit of measure is defined by the unit of measure + * for the vertical CRS + * + * @returns The origin depth or elevation. + */ + double getOriginDepthOrElevation() const; + + /** + * Get the rotation in radians of the local Y axis relative to the global projected Y axis which + * is 90 degrees counter-clockwise from the other global axis. A positive value indicates a + * clockwise rotation from the global axis. A negative value indicates a counterclockwise + * rotation form the global axis. + * + * @returns The areal rotation. + */ + double getArealRotation() const; + + /** + * Indicates that Z values correspond to depth values and are increasing downward, as opposite + * to elevation values increasing upward. When the vertical CRS is known, it must correspond to + * the axis orientation of the vertical CRS. + * + * @returns True if Z values are depth oriented, false if not. + */ + bool isDepthOriented() const; + + /** + * Indicates either the associated projected CRS is identified by means of an EPSG code or not. + * + * @returns True if the projected CRS is defined with an EPSG code, false if not. + */ + bool isProjectedCrsDefinedWithEpsg() const; + + /** + * Indicates either the associated projected CRS is unknown or not. + * + * @returns True if projected CRS is unknown, false if not. + */ + virtual bool isProjectedCrsUnknown() const; + + /** + * Gets the reason why the projected CRS is unknown. + * + * @exception std::invalid_argument If the associated projected CRS is not unknown. + * + * @returns The projected CRS unknown reason. + */ + std::string getProjectedCrsUnknownReason() const; + + /** + * Gets the EPSG code of the projected CRS + * + * @exception std::invalid_argument If the associated projected CRS is not an EPSG one. + * + * @returns The projected CRS EPSG code. + */ + int64_t getProjectedCrsEpsgCode() const; + + /** + * Indicates either the associated vertical CRS is identified by means of EPSG or not. + * + * @returns True if the vertical CRS is defined with an EPSG code, false if not. + */ + bool isVerticalCrsDefinedWithEpsg() const; + + /** + * Indicates either the associated vertical CRS is unknown or not. + * + * @returns True if vertical CRS is unknown, false if not. + */ + bool isVerticalCrsUnknown() const; + + /** + * Gets the reason why the vertical CRS is unknown. + * + * @exception std::invalid_argument If the associated vertical CRS is not unknown. + * + * @returns The vertical CRS unknown reason. + */ + std::string getVerticalCrsUnknownReason() const; + + /** + * Gets the EPSG code of the vertical CRS + * + * @exception std::invalid_argument If the associated projected CRS is not an EPSG one. + * + * @returns The vertical CRS EPSG code. + */ + int64_t getVerticalCrsEpsgCode() const; + + /** + * Gets the projected CRS unit of measure. + * + * @returns The projected CRS unit unit of measure. + */ + gsoap_resqml2_0_1::eml20__LengthUom getProjectedCrsUnit() const; + + /** + * Gets the projected CRS unit of measure as a string + * + * @returns The projected CRS unit of measure as string. + */ + std::string getProjectedCrsUnitAsString() const; + + /** + * Gets the vertical CRS unit of measure. + * + * @returns The vertical CRS unit of measure. + */ + gsoap_resqml2_0_1::eml20__LengthUom getVerticalCrsUnit() const; + + /** + * Gets the vertical CRS unit of measure as a string + * + * @returns The vertical CRS unit of measure as string. + */ + std::string getVerticalCrsUnitAsString() const; + + /** + * Check if the third axis of this local 3d CRS is in timeor not. + * + * @returns True if this local 3d CRS is a time one. False if it is a depth/elevation one. + */ + virtual bool isATimeCrs() const; + + /** + * Gets the unit of measure of the third axis of this local CRS if it is a time CRS. + * Otherwise throw an exception (if isATimeCrs() returns false) + * + * @returns The time unit of measure of the third axis. + */ + virtual gsoap_resqml2_0_1::eml20__TimeUom getTimeUom() const; + + /** + * Gets the unit of measure as a sting of the third axis of this local CRS if it is a time CRS. + * Otherwise throw an exception (if isATimeCrs() returns false) + * + * @returns The time unit of measure of the third axis. + */ + std::string getTimeUomAsString() const; + + /** + * Gets the axis order of the projected CRS. + * + * @returns The axis order of the projected CRS. + */ + gsoap_eml2_3::eml23__AxisOrder2d getAxisOrder() const; + + /** + * Sets the axis order of the projected CRS. It defines the coordinate system axis order of the + * global projected CRS when the projected CRS is an unknown CRS, else it must correspond to the + * axis order of the projected CRS. + * + * @param axisOrder The axis order to set. + */ + void setAxisOrder(gsoap_eml2_3::eml23__AxisOrder2d axisOrder) const; + + /** + * Convert some xyz points from local to global CRS. + * + * @param [in,out] xyzPoints An array of xyz points. The i-th point is defined by + * (x, y, z) = (xyzPoints[i], xyzPoints[i+1], + * xyzPoints[i+2]). + * @param xyzPointCount The number of xyz points. Must be equal to the size of @p + * xyzPoints divided by 3. + * @param withoutTranslation (Optional) True to only compute the rotation (no + * translation is computed). Default value if false. + */ + void convertXyzPointsToGlobalCrs(double * xyzPoints, uint64_t xyzPointCount, bool withoutTranslation = false) const; + }; + + /************ Activity **************/ + + class ActivityTemplate : public COMMON_NS::AbstractObject + { + public: + /** + * Pushes back a parameter in this activity template instance. This parameter has an + * unconstrained type. + * + * @exception std::invalid_argument If @p maxOccurs is strictly lesser than @p minOccurs. + * + * @param title The title of the parameter to push back. + * @param isInput True if the parameter is an input parameter, false if not. + * @param isOutput True if the parameter is an output parameter, false if not. + * @param minOccurs The minimum number of occurrences of this parameter. + * @param maxOccurs The maximum number of occurrences of this parameter. + */ + void pushBackParameter(const std::string & title, + bool isInput, bool isOutput, + uint64_t minOccurs, int64_t maxOccurs); + + /** + * Pushes back a parameter in the activity template instance. This parameter must be of a RESQML + * object kind. + * + * @exception std::invalid_argument If @p maxOccurs is strictly lesser than @p minOccurs. + * + * @param title The title of the parameter to push back. + * @param isInput True if the parameter is an input parameter, false if not. + * @param isOutput True if the parameter is an output parameter, false if not. + * @param minOccurs The minimum number of occurrences of this parameter. + * @param maxOccurs The maximum number of occurrences of this parameter. + * @param resqmlObjectContentType The content type of the RESQML object kind of the parameter. + * If empty, there is no constraint on the content type of this + * parameter. + */ + void pushBackParameter(const std::string & title, + bool isInput, bool isOutput, + uint64_t minOccurs, int64_t maxOccurs, + std::string resqmlObjectContentType); + + /** + * Checks if this instance contains a parameter with a particular title. + * + * @param paramTitle The title of the parameter we are looking for into this instance. + * + * @returns True if there exists a @p paramTitle parameter in this instance false if not. + */ + bool isAnExistingParameter(const std::string & paramTitle) const; + + /** + * Gets the parameter count. + * + * @returns The parameter count. + */ + uint64_t getParameterCount() const; + + /** + * Gets the title of a particular parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we look for the title. + * + * @returns The title of the parameter at position @p index. + */ + std::string getParameterTitle(uint64_t index) const; + + /** + * Gets parameter allowed kinds + * + * @param index Zero-based index of the. + * + * @returns The parameter allowed kinds. + */ + std::vector getParameterAllowedKinds(uint64_t index) const; + + /** + * Gets parameter allowed kinds + * + * @param paramTitle The parameter title. + * + * @returns The parameter allowed kinds. + */ + std::vector getParameterAllowedKinds(const std::string & paramTitle) const; + + /** + * Queries if a particular parameter is an input parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to know if it is an input one. + * + * @returns True is the parameter at @p index is an input parameter, false if not. + */ + bool getParameterIsInput(uint64_t index) const; + + /** + * Queries if a particular parameter is an input parameter. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameter we want to know if it is an input one. + * + * @returns True is the parameter @p paramTitle is an input parameter, false if not. + */ + bool getParameterIsInput(const std::string & paramTitle) const; + + /** + * Queries if a particular parameter is an output parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to know if it is an output one. + * + * @returns True is the parameter at @p index is an output parameter, false if not. + */ + bool getParameterIsOutput(uint64_t index) const; + + /** + * Queries if a particular parameter is an output parameter. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameter we want to know if it is an output one. + * + * @returns True is the parameter @p paramTitle is an output parameter, false if not. + */ + bool getParameterIsOutput(const std::string & paramTitle) const; + + /** + * Gets the minimum occurrences of a particular parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to know the minimum occurrences. + * + * @returns The parameter minimum occurrences. + */ + int64_t getParameterMinOccurences(uint64_t index) const; + + /** + * Gets the minimum occurrences of a particular parameter. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameter we want to know the minimum occurrences. + * + * @returns The parameter minimum occurrences. + */ + int64_t getParameterMinOccurences(const std::string & paramTitle) const; + + /** + * Gets the maximum occurrences of a particular parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to know the maximum occurrences. + * + * @returns The parameter maximum occurrences. + */ + int64_t getParameterMaxOccurences(uint64_t index) const; + + /** + * Gets the maximum occurrences of a particular parameter. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameter we want to know the maximum occurrences. + * + * @returns The parameter maximum occurrences. + */ + int64_t getParameterMaxOccurences(const std::string & paramTitle) const; + }; + + class Activity : public COMMON_NS::AbstractObject + { + public: + /** + * Pushes back a string parameter in this instance. This parameter must exist in the associated + * activity template. + * + * @exception std::invalid_argument If the parameter @p title does not exist in the + * associated activity template. + * @exception std::invalid_argument If the maximum number of occurrences has already been + * reached for parameter @p title. + * @exception std::invalid_argument If The parameter template @p title does not allow a + * string datatype. + * + * @param title The title of the parameter to push back. + * @param value The value of the parameter to push back. + */ + void pushBackParameter(const std::string title, const std::string & value); + + /** + * Pushes back an integer parameter in this instance. This parameter must exist in the associated + * activity template. + * + * @exception std::invalid_argument If the parameter @p title does not exist in the + * associated activity template. + * @exception std::invalid_argument If the maximum number of occurrences has already been + * reached for parameter @p title. + * @exception std::invalid_argument If The parameter template @p title does not allow a + * an integer datatype. + * + * @param title The title of the parameter to push back. + * @param value The value of the parameter to push back. + */ + void pushBackParameter(const std::string& title, int64_t value); + + /** + * Pushes back a RESQML object parameter in this instance. This parameter must exist in the + * associated activity template. + * + * @exception std::invalid_argument If @p resqmlObject is null. + * * @exception std::invalid_argument If the parameter @p + * title does not exist in the + * associated activity template. + * @exception std::invalid_argument If the maximum number of occurrences has already been + * reached for parameter @p title. + * @exception std::invalid_argument If The parameter template @p title does not allow a a + * data object datatype. + * + * @param title The title of the parameter to push back. + * @param [in] resqmlObject The RESQML object, value of the parameter to push back. + */ + void pushBackParameter(const std::string& title, COMMON_NS::AbstractObject* resqmlObject); + + + /** + * Get the count of all the parameters + * + * @returns The parameter count. + */ + uint64_t getParameterCount() const; + + /** + * Gets the count of all the parameters which have the same title. + * + * @param paramTitle The title of the parameters we look for. + * + * @returns The parameter count. + */ + uint64_t getParameterCount(const std::string& paramTitle) const; + + /** + * Gets the title of a given parameter + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter for which we look for the title. + * + * @returns The parameter title. + */ + std::string getParameterTitle(uint64_t index) const; + + /** + * Gets the indices of all the parameters sharing a given title. + * + * @param paramTitle The title of the parameters we look for. + * + * @returns A vector of parameter indices. + */ + std::vector getParameterIndexOfTitle(const std::string & paramTitle) const; + + /** + * Queries if all of the parameters sharing a given title are floating point quantity parameters. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameters we want to test the datatype. + * + * @returns True if all of the @p paramTitle parameters are floating point quantity parameters, + * false if not. + */ + bool isAFloatingPointQuantityParameter(const std::string & paramTitle) const; + + /** + * Queries if a given parameter is a floating point quantity parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to test the datatype. + * + * @returns True if the parameter at position @p index is a floating point quantity parameter, + * false if not. + */ + bool isAFloatingPointQuantityParameter(uint64_t index) const; + + /** + * Gets the values of all the floating point quantity parameters sharing a given title. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * @exception std::invalid_argument If one @p paramTitle parameter contains some non double + * values. + * + * @param paramTitle The title of the floating point parameters we look for the value. + * + * @returns A vector of the value of all the @p paramTitle floating point quantity parameters. + */ + std::vector getFloatingPointQuantityParameterValue(const std::string & paramTitle) const; + + /** + * Gets the floating point quantity value of a given parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * @exception std::invalid_argument If the parameter at @p index is not a floating point + * quantity parameter. + * + * @param index Zero-based index of the parameter we look for the value. This index is taken + * in the set of all parameters of this activity. + * + * @returns The floating point quantity value of the parameter at position @p index. + */ + double getFloatingPointQuantityParameterValue(uint64_t index) const; + + /** + * Queries if all of the parameters sharing a given title are integer quantity parameters. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameters we want to test the datatype. + * + * @returns True if all of the @p paramTitle parameters are integer quantity parameters, + * false if not. + */ + bool isAnIntegerQuantityParameter(const std::string & paramTitle) const; + + /** + * Queries if a given parameter is an integer quantity parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to test the datatype. + * + * @returns True if the parameter at position @p index is an integer quantity parameter, + * false if not. + */ + bool isAnIntegerQuantityParameter(uint64_t index) const; + + /** + * Gets the values of all the integer quantity parameters sharing a given title. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * @exception std::invalid_argument If one @p paramTitle parameter contains some non integer + * values. + * + * @param paramTitle The title of the integer parameters we look for the value. + * + * @returns A vector of the value of all the @p paramTitle integer quantity parameters. + */ + std::vector getIntegerQuantityParameterValue(const std::string & paramTitle) const; + + /** + * Gets the integer quantity value of a given parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * @exception std::invalid_argument If the parameter at @p index is not an integer quantity + * parameter. + * + * @param index Zero-based index of the parameter we look for the value. This index is taken + * in the set of all parameters of this activity. + * + * @returns The integer quantity value of the parameter at position @p index. + */ + int64_t getIntegerQuantityParameterValue(uint64_t index) const; + + /** + * @brief Queries if all of the parameters sharing a given title are string parameters. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameters we want to test the datatype. + * + * @returns True if all of the @p paramTitle parameters are string parameters, false if not. + */ + bool isAStringParameter(const std::string & paramTitle) const; + + /** + * Queries if a given parameter is a string parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to test the datatype. + * + * @returns True if the parameter at position @p index is a string parameter, + * false if not. + */ + bool isAStringParameter(uint64_t index) const; + + /** + * Gets the values of all the string parameters sharing a given title. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * @exception std::invalid_argument If one @p paramTitle parameter contains some non string + * values. + * + * @param paramTitle The title of the string parameters we look for the value. + * + * @returns A vector of the value of all the @p paramTitle string parameters. + */ + std::vector getStringParameterValue(const std::string & paramTitle) const; + + /** + * Gets the string value of a given parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * @exception std::invalid_argument If the parameter at @p index is not an string parameter. + * + * @param index Zero-based index of the parameter we look for the value. This index is taken + * in the set of all parameters of this activity. + * + * @returns The string value of the parameter at position @p index. + */ + std::string getStringParameterValue(uint64_t index) const; + + /** + * Queries if all of the parameters sharing a given title are RESQML object parameters. + * + * @exception std::invalid_argument If there exists no @p paramTitle parameter in this + * activity. + * + * @param paramTitle The title of the parameters we want to test the datatype. + * + * @returns True if all of the @p paramTitle parameters are RESQML object parameters, false if not. + */ + bool isAResqmlObjectParameter(const std::string & paramTitle) const; + + /** + * Queries if a given parameter is a RESQML object parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * + * @param index Zero-based index of the parameter we want to test the datatype. + * + * @returns True if the parameter at position @p index is a RESQML object parameter, + * false if not. + */ + bool isAResqmlObjectParameter(uint64_t index) const; + + /** + * Gets the RESQML object value of a given parameter. + * + * @exception std::out_of_range If @p index is not in the parameter range. + * @exception std::invalid_argument If the parameter at @p index is not an RESQML object + * parameter. + * + * @param index Zero-based index of the parameter we look for the value. This index is taken + * in the set of all parameters of this activity. + * + * @returns The RESQML object value of the parameter at position @p index. + */ + COMMON_NS::AbstractObject* getResqmlObjectParameterValue(uint64_t index) const; + + /** + * Sets the activity template of this activity. + * + * @param [in] activityTemplate If non-null, the activity template. + */ + void setActivityTemplate(ActivityTemplate* activityTemplate); + + /** + * Gets the activity template of this activity. + * + * @returns The activity template of this activity. + */ + ActivityTemplate* getActivityTemplate() const; + }; + /************ GraphicalInformationSet **************/ #if defined(SWIGPYTHON) @@ -1057,7 +1740,38 @@ namespace EML2_NS class PropertyKind : public COMMON_NS::AbstractObject { public: + /** + * Gets (in read only mode) the naming system of this property type. It is the name of the + * dictionary within which the property is unique. This also defines the name of the controlling + * authority. It is an URN of the form urn:x-resqml:domainOrEmail:dictionaryName + * + * @returns The naming system. + */ + std::string getNamingSystem() const; + + /** + * Get the base unit of measure for conversion of the values of this property kind as a string. + * + * @returns The unit or measure of the values of this property kind as a string. + */ std::string getBaseUomAsString() const; + + /** + * Gets the parent local property kind + * + * @exception std::invalid_argument If the parent property kind is not a local one (it is an + * Energistics standard one). + * + * @returns The parent local property kind. + */ + PropertyKind* getParentPropertyKind() const; + + /** + * Checks if this property kind is abstract or not + * + * @returns True if abstract, false if not. + */ + virtual bool isAbstract() const; }; class TimeSeries : public COMMON_NS::AbstractObject @@ -1107,97 +1821,8 @@ namespace EML2_NS */ time_t getTimestamp(uint64_t index) const; }; - - /************ Activity **************/ - - class ActivityTemplate : public COMMON_NS::AbstractObject - { - public: - void pushBackParameter(const std::string & title, - bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs); - void pushBackParameter(const std::string & title, - bool isInput, bool isOutput, - unsigned int minOccurs, int maxOccurs, - std::string resqmlObjectContentType); - bool isAnExistingParameter(const std::string & paramTitle) const; - - /** - * Gets parameter count - * - * @returns The parameter count. - */ - uint64_t getParameterCount() const; - const std::string & getParameterTitle(unsigned int index) const; - bool getParameterIsInput(unsigned int index) const; - bool getParameterIsInput(const std::string & paramTitle) const; - bool getParameterIsOutput(unsigned int index) const; - bool getParameterIsOutput(const std::string & paramTitle) const; - uint64_t getParameterMinOccurences(unsigned int index) const; - uint64_t getParameterMinOccurences(const std::string & paramTitle) const; - uint64_t getParameterMaxOccurences(unsigned int index) const; - uint64_t getParameterMaxOccurences(const std::string & paramTitle) const; - }; - - class Activity : public COMMON_NS::AbstractObject - { - public: - void pushBackParameter(const std::string& title, const std::string& value); - void pushBackParameter(const std::string& title, int64_t value); - void pushBackParameter(const std::string& title, COMMON_NS::AbstractObject* resqmlObject); - - /** - * Get the count of all the parameters - * - * @returns The parameter count. - */ - uint64_t getParameterCount() const; - - /** - * Get the count of all the parameters which have got the same title. - * - * @param paramTitle The parameter title. - * - * @returns The parameter count. - */ - uint64_t getParameterCount(const std::string& paramTitle) const; - - const std::string & getParameterTitle(unsigned int index) const; - - bool isAFloatingPointQuantityParameter(const std::string& paramTitle) const; - bool isAFloatingPointQuantityParameter(unsigned int index) const; - double getFloatingPointQuantityParameterValue(unsigned int index) const; - - bool isAnIntegerQuantityParameter(const std::string& paramTitle) const; - bool isAnIntegerQuantityParameter(unsigned int index) const; - - /** - * Gets the values of all the integer quantity parameters sharing a given title. - * - * @exception std::invalid_argument If there exists no @p paramTitle parameter in this - * activity. - * @exception std::invalid_argument If one @p paramTitle parameter contains some non integer - * values. - * - * @param paramTitle The title of the integer parameters we look for the value. - * - * @returns A vector of the value of all the @p paramTitle integer quantity parameters. - */ - std::vector getIntegerQuantityParameterValue(const std::string & paramTitle); - - int64_t getIntegerQuantityParameterValue(unsigned int index) const; - - bool isAStringParameter(const std::string& paramTitle) const; - bool isAStringParameter(unsigned int index) const; - const std::string & getStringParameterValue(unsigned int index) const; - - bool isAResqmlObjectParameter(const std::string& paramTitle) const; - bool isAResqmlObjectParameter(unsigned int index) const; - COMMON_NS::AbstractObject* getResqmlObjectParameterValue(unsigned int index) const; - - void setActivityTemplate(ActivityTemplate* activityTemplate); - ActivityTemplate* getActivityTemplate() const; - }; } +#ifdef WITH_RESQML2_2 %include "swigEml2_3Include.i" +#endif diff --git a/swig/swigEml2_3Include.i b/swig/swigEml2_3Include.i index 1b58a0ac5..7e416c16c 100644 --- a/swig/swigEml2_3Include.i +++ b/swig/swigEml2_3Include.i @@ -20,16 +20,20 @@ under the License. #include "../src/eml2_3/Activity.h" #include "../src/eml2_3/ActivityTemplate.h" #include "../src/eml2_3/GraphicalInformationSet.h" +#include "../src/eml2_3/LocalEngineeringCompoundCrs.h" #include "../src/eml2_3/PropertyKind.h" #include "../src/eml2_3/TimeSeries.h" +#include "../src/eml2_3/VerticalCrs.h" %} #if defined(SWIGJAVA) || defined(SWIGCSHARP) %nspace EML2_3_NS::Activity; %nspace EML2_3_NS::ActivityTemplate; %nspace EML2_3_NS::GraphicalInformationSet; + %nspace EML2_3_NS::LocalEngineeringCompoundCrs; %nspace EML2_3_NS::PropertyKind; %nspace EML2_3_NS::TimeSeries; + %nspace EML2_3_NS::VerticalCrs; #endif namespace std { @@ -2003,6 +2007,14 @@ namespace EML2_3_NS public: }; +#if defined(SWIGJAVA) || defined(SWIGPYTHON) + %rename(Eml23_LocalEngineeringCompoundCrs) LocalEngineeringCompoundCrs; +#endif + class LocalEngineeringCompoundCrs : public EML2_NS::AbstractLocal3dCrs + { + public: + }; + #if defined(SWIGJAVA) || defined(SWIGPYTHON) %rename(Eml23_PropertyKind) PropertyKind; #endif @@ -2018,5 +2030,13 @@ namespace EML2_3_NS { public: }; + +#if defined(SWIGJAVA) || defined(SWIGPYTHON) + %rename(Eml23_VerticalCrs) VerticalCrs; +#endif + class VerticalCrs : public COMMON_NS::AbstractObject + { + public: + }; } diff --git a/swig/swigModule.i b/swig/swigModule.i index ef8e58ad9..bb8c30396 100644 --- a/swig/swigModule.i +++ b/swig/swigModule.i @@ -289,43 +289,391 @@ namespace COMMON_NS public: enum class numericalDatatypeEnum { UNKNOWN = 0, DOUBLE = 1, FLOAT = 2, INT64 = 3, UINT64 = 4, INT32 = 5, UINT32 = 6, INT16 = 7, UINT16 = 8, INT8 = 9, UINT8 = 10}; - COMMON_NS::DataObjectRepository* getRepository() const; - virtual ~AbstractObject(); + /** + * Indicates if this data object is actually a partial object. A partial object just contains a mime + * type, an UUID and a title as a minimum amount of information. A partial object is never + * explicit in an EPC document: it is not a file + * + * @returns True if is partial, false if is not. + */ bool isPartial() const; + /** + * Gets the UUID (https://tools.ietf.org/html/rfc4122#page-3) of this data object. The UUID + * intends to give an id to the \"thing\" (i.e. the business object), not to this instance + * + * @exception std::invalid_argument If no available gSOAP proxy instance is associated to + * this data object. + * + * @returns The UUID of this data object. + */ std::string getUuid() const; + + /** + * Gets the title (i.e. the name) of this data object. This is the equivalent of + * @c CI_Citation.title in ISO 19115 + * + * @exception std::invalid_argument If no available gSOAP proxy instance is associated to + * this data object. + * + * @returns The title of this data object. + */ std::string getTitle() const; + + /** + * Gets the name (or other human-readable identifier) of the last person who updated the object. + * In ISO 19115, this is equivalent to the @c CI_Individual.name or the @c CI_Organization.name of + * the @c citedResponsibleParty whose role is @c editor + * + * @exception std::invalid_argument If this instance is actually a partial object. + * + * @returns The editor of this data object if it is defined, else empty string. + */ std::string getEditor() const; + + /** + * Gets the date and time the data object was created in the source application or, if that + * information is not available, when it was saved to the file. This is the equivalent of the + * ISO 19115 @c CI_Date where the @c CI_DateTypeCode is @c creation + * + * @exception std::invalid_argument If this instance is actually a partial object or if no + * available gSOAP proxy instance is associated to this data + * object. + * + * @returns The creation date and time of the data object. + */ time_t getCreation() const; + + /** + * Gets the name (or other human-readable identifier) of the person who initially originated + * this data object or document in the source application. If that information is not available, + * then this is the user of the session during the file creation. The originator remains the + * same as the object is subsequently edited. This is the equivalent in ISO 19115 to the @c + * CI_Individual.name or the @c CI_Organization.name of the @c citedResponsibleParty whose role + * is @c originator + * + * @exception std::invalid_argument If this instance is actually a partial object or if no + * available gSOAP proxy instance is associated to this data + * object. + * + * @returns The originator name or identifier. + */ std::string getOriginator() const; + + /** + * Gets the user descriptive comments about this data object. Intended for end-user use (human + * readable); not necessarily meant to be used by software. This is the equivalent of the ISO + * 19115 @c abstract.CharacterString + * + * @exception std::invalid_argument If this instance is actually a partial object. + * + * @returns The description of this data object if it is defined, else empty string. + */ std::string getDescription() const; + + /** + * Gets the date and time the data object was last modified in the source application or, if + * that information is not available, when it was last saved to the file. This is the equivalent + * of the ISO 19115 @c CI_Date where the @c CI_DateTypeCode is @c lastUpdate + * + * @exception std::invalid_argument If this instance is actually a partial object. + * + * @returns The last update date and time of the data object. + */ time_t getLastUpdate() const; + + /** + * Gets the identifier of the software or service that was used to originate the data object and + * to create the file. Must be human and machine readable and unambiguously identify the + * software by including the company name, software name and software version. This is the + * equivalent in ISO 19115 to the @c istributionFormat.MD_Format. The ISO format for this is + * [vendor:applicationName]/fileExtension where the application name includes the + * version number of the application. In our case, @c fileExtension is not relevant and will be + * ignored if present. @c vendor and @c applicationName are mandatory + * + * @exception std::invalid_argument If this instance is actually a partial object or if no + * available gSOAP proxy instance is associated to this data + * object. + * + * @returns The identifier of the software or service that was used to originate the data object + * and to create the file. + */ std::string getFormat() const; + + /** + * Gets the key words to describe the activity, for example, history match or volumetric + * calculations, relevant to this data object. Intended to be used in a search function by + * software. This is the equivalent in ISO 19115 of @c descriptiveKeywords.MD_Keywords + * + * @exception std::invalid_argument If this instance is actually a partial object. + * + * @returns The key words to describe the activity relevant to this data object if they are + * defined, else empty string. + */ std::string getDescriptiveKeywords() const; + + /** + * Gets the version of this data object. An empty version indicates that this is the latest (and + * ideally also the unique) version of this data object. + * + * @returns The version of this object, empty string means latest version. + */ std::string getVersion() const; - - void setMetadata(const std::string & title, const std::string & editor, time_t creation, const std::string & originator, const std::string & description, time_t lastUpdate, const std::string & descriptiveKeywords); + + /** + * Sets the title (i.e. the name) of this data object. This is the equivalent of + * @c CI_Citation.title in ISO 19115 + * + * @exception std::invalid_argument If this instance is actually a partial object. + * @exception std::range_error If @p title is more than 256 chars long. + * + * @param title The title to set to this data object. If empty then \"unknown\" title will be + * set. + */ void setTitle(const std::string & title); + + /** + * Sets the name (or other human-readable identifier) of the last person who updated the object. + * In ISO 19115, this is equivalent to the @c CI_Individual.name or the @c CI_Organization.name + * of the @c citedResponsibleParty whose role is @c editor + * + * @exception std::invalid_argument If this instance is actually a partial object. + * @exception std::range_error If @p editor is more than 64 chars long. + * + * @param editor The editor to set to this data object. + */ void setEditor(const std::string & editor); + + /** + * Sets the date and time the data object was created in the source application or, if that + * information is not available, when it was saved to the file. This is the equivalent of the + * ISO 19115 @c CI_Date where the @c CI_DateTypeCode is @c creation + * + * @exception std::invalid_argument If this instance is actually a partial object. + * + * @param creation The creation date and time to set to this data object. + */ void setCreation(time_t creation); + + /** + * Sets the name (or other human-readable identifier) of the person who initially originated + * this data object or document in the source application. If that information is not available, + * then this is the user of the session during the file creation. The originator remains the + * same as the object is subsequently edited. This is the equivalent in ISO 19115 to the @c + * CI_Individual.name or the @c CI_Organization.name of the @c citedResponsibleParty whose role + * is @c originator + * + * @exception std::invalid_argument If this instance is actually a partial object. + * @exception std::range_error If @p originator is more than 64 chars long. + * + * @param originator The originator name or identifier to set to this data object. If empty, + * the user id is set if available, \"unknown\" if it is not. + */ void setOriginator(const std::string & originator); + + /** + * Sets a user descriptive comments about this data object. Intended for end-user use (human + * readable); not necessarily meant to be used by software. This is the equivalent of the ISO + * 19115 @c abstract.CharacterString + * + * @exception std::invalid_argument If this instance is actually a partial object. + * @exception std::range_error If @p description is too long (more than 4000 chars for + * RESQML2.0 or more than 2000 chars for EML2.1 and EML2.2). + * + * @param description The description to set to this data object. + */ void setDescription(const std::string & description); + + /** + * Sets the date and time the data object was last modified in the source application or, if + * that information is not available, when it was last saved to the file. This is the equivalent + * of the ISO 19115 @c CI_Date where the @c CI_DateTypeCode is @c lastUpdate + * + * @exception std::invalid_argument If this instance is actually a partial object. + * + * @param lastUpdate The last update date and time to set to this data object. + */ void setLastUpdate(time_t lastUpdate); + + /** + * Sets the default citation format which is going to be written in each created object. A + * maximum of 256 chars is allowed. + * + * @exception std::range_error If the format is more than 256 chars long. + * + * @param vendor The name of the vendor which is exporting the data + * objects. + * @param applicationName The name of the application which is exporting the data + * objects. + * @param applicationVersionNumber The version of the application which is exporting the + * data objects. + */ static void setFormat(const std::string & vendor, const std::string & applicationName, const std::string & applicationVersionNumber); + + /** + * Set the key words to describe the activity, for example, history match or volumetric + * calculations, relevant to this object. Intended to be used in a search function by software. + * This is the equivalent in ISO 19115 of descriptiveKeywords.MD_Keywords + * + * @exception std::invalid_argument If this instance is actually a partial object. + * @exception std::range_error If @p descriptiveKeywords is too long (more than 4000 chars for + * RESQML2.0 or more than 2000 chars for EML2.1 and EML2.2). + * + * @param descriptiveKeywords The key words to describe the activity relevant to this data + * object. + */ void setDescriptiveKeywords(const std::string & descriptiveKeywords); + + /** + * Set the version of this data object + * + * @exception std::invalid_argument If @p version is empty. + * @exception std::range_error If @p version is more than 64 chars long. + * + * @param version The version to set to this data object. + */ void setVersion(const std::string & version); - - std::string getXmlTag() const; + + /** + * Sets a title and other common metadata for this instance. + * + * @exception std::invalid_argument If this instance is actually a partial object. + * @exception std::range_error If @p title is more than 256 chars long. + * @exception std::range_error If @p editor title is more than 64 chars long. + * @exception std::range_error If @p originator title is more than 64 chars long. + * @exception std::range_error If @p description is too long (more than 4000 chars for + * RESQML2.0 or more than 2000 chars for EML2.1 and EML2.2). + * @exception std::range_error If @p descriptiveKeywords is too long (more than 4000 + * chars for RESQML2.0 or more than 2000 chars for EML2.1 + * and EML2.2). + * + * @param title The title to set to this instance. If empty then \"unknown\" + * title will be set. + * @param editor The editor to set to this instance. Set to empty string or zero + * if you don't want to use. + * @param creation The creation date and time to set to this instance. + * @param originator The originator name or identifier to set to this instance. If + * empty, the user id is set if available, \"unknown\" if it is not. + * @param description The description to set to this instance. Set to empty string or + * zero if you don't want to use. + * @param lastUpdate The last update date and time to set to this data object. + * @param descriptiveKeywords The key words to describe the activity relevant to this data + * object. Set to empty string or zero if you don't want to use. + */ + void setMetadata(const std::string & title, const std::string & editor, time_t creation, const std::string & originator, + const std::string & description, time_t lastUpdate, const std::string & descriptiveKeywords); + + /** + * Returns the data object repository which contains this instance + * + * @returns A pointer to the data object repository. + */ + COMMON_NS::DataObjectRepository* getRepository() const; + + /** + * Gets the XML namespace for the tags for the XML serialization of this instance + * + * @returns The XML namespace of this instance. + */ virtual std::string getXmlNamespace() const = 0; + + /** + * Gets the standard XML tag without XML namespace for serializing this data object. + * + * @returns The XML tag. + */ + std::string getXmlTag() const; + + /** + * Gets the version of the XML namespace (i.e. WITSML, RESQML, PRODML) for the XML serialization + * of this instance + * + * @returns The XML namespace version of this instance. + */ std::string getXmlNamespaceVersion() const; - + + /** + * Get the qualified type of the instance i.e. "namespace.datatype" + * + * @returns The qualified type of the instance i.e. "namespace.datatype" + */ + std::string getQualifiedType() const; + + /** + * Serializes the gSOAP proxy of this instance into a string + * + * @returns The string result of the serialization process. + */ + std::string serializeIntoString(); + + /** + * Adds an alias for this data object + * + * @exception std::invalid_argument If this instance is actually a partial object. + * @exception std::range_error If @p authority or @p title is more than 64 chars long. + * + * @param authority The authority of the alias. + * @param title The title of the alias. + */ void addAlias(const std::string & authority, const std::string & title); - unsigned int getAliasCount() const; - std::string getAliasAuthorityAtIndex(unsigned int index) const; - std::string getAliasTitleAtIndex(unsigned int index) const; - + + /** + * Gets the count of aliases in this instance + * + * @exception std::invalid_argument If this instance is actually a partial object. + * + * @returns The alias count of this instance. + */ + uint64_t getAliasCount() const; + + /** + * Gets the alias authority at a particular index in the aliases set + * + * @exception std::invalid_argument If this instance is actually a partial object or if there + * is no underlying gSOAP proxy. + * @exception std::out_of_range If @p index is out of range. + * + * @param index Zero-based index of the asked alias authority. + * + * @returns The alias authority at @p index. + */ + std::string getAliasAuthorityAtIndex(uint64_t index) const; + + /** + * Gets the alias title at a particular index in the aliases set + * + * @exception std::invalid_argument If this instance is actually a partial object or if there + * is no underlying gSOAP proxy. + * @exception std::out_of_range If @p index is out of range. + * + * @param index Zero-based index of the asked alias title. + * + * @returns The alias title at @p index. + */ + std::string getAliasTitleAtIndex(uint64_t index) const; + + /** + * Gets the count of the activities where this instance is involved + * + * @returns The count of all activities involving this instance. + */ + uint64_t getActivityCount() const; + + /** + * Gets an associated activity at a particular index + * + * @exception std::invalid_argument If this instance is actually a partial object or if there + * is no underlying gSOAP proxy. + * @exception std::out_of_range If @p index is out of range. + * + * @param index Zero-based index of the asked activity. + * + * @returns The associated activity at @p index. + */ + EML2_NS::Activity* getActivity(uint64_t index) const; + /** * Pushes back an extra metadata (not a standard one) onto this instance * @@ -394,11 +742,7 @@ namespace COMMON_NS /** * Get the EPC document absolute path or the ETP dataspace URI where this dataobject comes from. */ - const std::string& getUriSource() const; - - unsigned int getActivityCount() const; - - EML2_NS::Activity * getActivity (unsigned int index) const; + const std::string& getUriSource() const; }; %warnfilter(473) HdfProxyFactory::make; @@ -475,6 +819,7 @@ import com.f2i_consulting.fesapi.*; { public: + /** Values that represent the HDF5 file permission access */ enum class openingMode : std::int8_t { READ_ONLY = 0, READ_WRITE = 1, @@ -482,6 +827,7 @@ import com.f2i_consulting.fesapi.*; OVERWRITE = 3 }; + /** Enumeration for the various Energistics standards. */ enum class EnergisticsStandard : std::int8_t { RESQML2_0_1 = 0, EML2_0 = 1, @@ -492,22 +838,88 @@ import com.f2i_consulting.fesapi.*; }; DataObjectRepository(); + + /** + * Constructor + * + * @param propertyKindMappingFilesDirectory Pathname of the property kind mapping files + * directory. + */ DataObjectRepository(const std::string & propertyKindMappingFilesDirectory); + /** + * Set the used standard when creating a new dataobject + */ void setDefaultStandard(EnergisticsStandard version); + + /** + * Gets the default EML version used when creating a EML data object. + * + * @returns The default EML version. + */ EnergisticsStandard getDefaultEmlVersion() const; + + /** + * Gets the default PRODML version used when creating a PRODML data object. + * + * @returns The default PRODML version. + */ EnergisticsStandard getDefaultProdmlVersion() const; + + /** + * Gets the default RESQML version used when creating a RESQML data object. + * + * @returns The default RESQML version. + */ EnergisticsStandard getDefaultResqmlVersion() const; + + /** + * Gets the default WITSML version used when creating a WITSML data object. + * + * @returns The default WITSML version. + */ EnergisticsStandard getDefaultWitsmlVersion() const; + /** Removes and cleans all data objects from this repository */ void clear(); - RESQML2_NS::AbstractLocal3dCrs* getDefaultCrs() const; - void setDefaultCrs(RESQML2_NS::AbstractLocal3dCrs* crs); - + /** + * Gets the default CRS for writing. It is used in all writing methods if no explicit CRS is + * provided. + * + * @returns A pointer to the default CRS if it is defined, else null. + */ + EML2_NS::AbstractLocal3dCrs* getDefaultCrs() const; + + /** + * Sets a default CRS for writing. It will be used in all writing methods if no explicit CRS is + * provided + * + * @param [in] crs If non-null, the default CRS. + */ + void setDefaultCrs(EML2_NS::AbstractLocal3dCrs* crs); + + /** + * Gets the default HDF5 file proxy for writing. It is used in all writing methods if no + * explicit HDF5 file proxy is provided. + * + * @returns @c nullptr if no default HDF5 file proxy is defined, else a pointer to the default HDF5 file proxy. + */ EML2_NS::AbstractHdfProxy* getDefaultHdfProxy() const; + + /** + * Sets a default HDF5 file proxy for writing. It will be used in all writing methods if no + * explicit HDF5 file proxy is provided. + * + * @param [in] hdfProxy If non-null, the HDF5 file proxy. + */ void setDefaultHdfProxy(EML2_NS::AbstractHdfProxy* hdfProxy); - + + /** + * Set the factory used to create HDF proxy and takes ownership of this HDF Proxy factory (don't delete it!) + * + * @param [in] factory If non-null, the factory. + */ void setHdfProxyFactory(COMMON_NS::HdfProxyFactory * factory); /** @@ -525,10 +937,18 @@ import com.f2i_consulting.fesapi.*; * @returns Null if the content type of the data object cannot be wrapped by fesapi, else a * pointer the added or replaced data object. */ - COMMON_NS::AbstractObject* addOrReplaceGsoapProxy(const std::string & xml, const std::string & contentType, const std::string& uriSource); + COMMON_NS::AbstractObject* addOrReplaceGsoapProxy(const std::string& xml, const std::string& contentType, const std::string& uriSource); SWIG_GETTER_DATAOBJECTS(EML2_NS::TimeSeries, TimeSeries) SWIG_GETTER_DATAOBJECTS(EML2_NS::AbstractHdfProxy, HdfProxy) + SWIG_GETTER_DATAOBJECTS(EML2_NS::AbstractLocal3dCrs, Local3dCrs) + SWIG_GETTER_DATAOBJECTS(EML2_NS::Activity, Activity) + SWIG_GETTER_DATAOBJECTS(EML2_NS::ActivityTemplate, ActivityTemplate) + SWIG_GETTER_DATAOBJECTS(EML2_NS::GraphicalInformationSet, GraphicalInformationSet) + SWIG_GETTER_DATAOBJECTS(EML2_NS::PropertyKind, PropertyKind) + SWIG_GETTER_DATAOBJECTS(EML2_NS::TimeSeries, TimeSeries) + + SWIG_GETTER_DATAOBJECTS(RESQML2_0_1_NS::DeviationSurveyRepresentation, DeviationSurveyRepresentation) SWIG_GETTER_DATAOBJECTS(RESQML2_NS::AbstractSeismicLineFeature, SeismicLine) SWIG_GETTER_DATAOBJECTS(RESQML2_NS::AbstractIjkGridRepresentation, IjkGridRepresentation) @@ -546,8 +966,6 @@ import com.f2i_consulting.fesapi.*; SWIG_GETTER_DATAOBJECTS(RESQML2_NS::IjkGridParametricRepresentation, IjkGridParametricRepresentation) SWIG_GETTER_DATAOBJECTS(RESQML2_NS::IjkGridExplicitRepresentation, IjkGridExplicitRepresentation) SWIG_GETTER_DATAOBJECTS(RESQML2_NS::IjkGridLatticeRepresentation, IjkSeismicCubeGridRepresentation) - SWIG_GETTER_DATAOBJECTS(RESQML2_NS::LocalDepth3dCrs, LocalDepth3dCrs) - SWIG_GETTER_DATAOBJECTS(RESQML2_NS::LocalTime3dCrs, LocalTime3dCrs) SWIG_GETTER_DATAOBJECTS(RESQML2_NS::Model, Model) SWIG_GETTER_DATAOBJECTS(RESQML2_NS::PointSetRepresentation, PointSetRepresentation) SWIG_GETTER_DATAOBJECTS(RESQML2_NS::PolylineRepresentation, AllPolylineRepresentation) @@ -593,31 +1011,41 @@ import com.f2i_consulting.fesapi.*; SWIG_GETTER_DATAOBJECTS(PRODML2_2_NS::FluidSystem, FluidSystem) SWIG_GETTER_DATAOBJECTS(PRODML2_2_NS::FluidCharacterization, FluidCharacterization) + /** + * Gets a data object from the repository by means of its uuid. If several data object + * correspond to this uuid in the repository, the first one in memory will be arbitrarily + * returned. + * + * @param uuid The uuid of the requested data object. + * + * @returns A pointer to the data object which corresponds to the uuid, @c nullptr if there exists no + * such data object. + */ AbstractObject* getDataObjectByUuid(const std::string & uuid) const; - AbstractObject* getDataObjectByUuidAndVersion(const std::string & uuid, const std::string & version) const; - - template - std::vector getDataObjects() const - { - std::vector result; - - for (std::unordered_map< std::string, std::vector >::const_iterator it = dataObjects.begin(); it != dataObjects.end(); ++it) { - for (size_t i = 0; i < it->second.size(); ++i) { - if (dynamic_cast(it->second[i]) != nullptr) { - result.push_back(static_cast(it->second[i])); - } - } - } - return result; - } - -#ifdef WITH_RESQML2_2 - %template(getGraphicalInformationSets) getDataObjects; -#endif + /** + * Gets a data object from the repository by means of both its uuid and version. + * + * @param uuid The uuid of the requested data object. + * @param version The version of the requested data object. + * + * @returns A pointer to the data object which corresponds to both uuid and version, @c nullptr if there + * exists no such data object. + */ + AbstractObject* getDataObjectByUuidAndVersion(const std::string & uuid, const std::string & version) const; + /** + * Gets all the data object uuids which are part of this repository + * + * @returns A vector of uuids. + */ std::vector getUuids() const; - + + /** + * Create a partial object i.e. a data object reference (DOR) based on an UUID + a title + a content type + a version + */ + COMMON_NS::AbstractObject* createPartial(const std::string & uuid, const std::string & title, const std::string & contentType, const std::string & version = ""); + /** * @brief Creates a non parallel access to an HDF5 file for writing to it. Resulting HDF5 file * proxy is stored into this repository @@ -637,249 +1065,1425 @@ import com.f2i_consulting.fesapi.*; */ EML2_NS::AbstractHdfProxy* createHdfProxy(const std::string & guid, const std::string & title, const std::string & packageDirAbsolutePath, const std::string & filePath, DataObjectRepository::openingMode hdfPermissionAccess); - //************ CRS *******************/ + //************ CRS ******************* - RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + /** + * @brief Creates a local depth 3d CRS which is fully identified by means of an EPSG code. + * Resulting local depth 3d CRS is stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If projectedEpsgCode == 0 || verticalEpsgCode == + * 0. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then \"unknown\" + * title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth origin + * of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented If true, indicates that this depth CRS is actually an elevation + * CRS. + * + * @returns A pointer to the new local depth 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); - - RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + /** + * @brief Creates a local depth 3d CRS which is fully unknown. Resulting local depth 3d CRS is + * stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then + * \"unknown\" title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth + * origin of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided using EPSG + * or GML. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided using EPSG + * or GML. + * @param isUpOriented If true, indicates that this depth CRS is actually an + * elevation CRS. + * + * @returns A pointer to the new local depth 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); - - RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + /** + * @brief Creates a local depth 3d CRS which is identified by an EPSG code for its projected + * part and which is unknown for its vertical part. Resulting local depth 3d CRS is + * stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If projectedEpsgCode == 0. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then + * \"unknown\" title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth + * origin of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided using EPSG + * or GML. + * @param isUpOriented If true, indicates that this depth CRS is actually an + * elevation CRS. + * + * @returns A pointer to the new local depth 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, const bool & isUpOriented); - - - RESQML2_NS::LocalDepth3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, - double originOrdinal1, double originOrdinal2, double originOrdinal3, - double arealRotation, - gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, const bool & isUpOriented); - + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); - RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + /** + * @brief Creates a local depth 3d CRS which is unknown for its projected part and which is + * identified by an EPSG code for its vertical part. Resulting local depth 3d CRS is + * stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If verticalEpsgCode == 0. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then + * \"unknown\" title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth + * origin of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided using EPSG + * or GML. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented If true, indicates that this depth CRS is actually an + * elevation CRS. + * + * @returns A pointer to the new local depth 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalDepth3dCrs(const std::string & guid, const std::string & title, + double originOrdinal1, double originOrdinal2, double originOrdinal3, + double arealRotation, + gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); + + /** + * @brief Creates a local time 3d CRS which is fully identified by means of EPSG code. + * Resulting local time 3d CRS is stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If projectedEpsgCode == 0 || verticalEpsgCode == + * 0. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then \"unknown\" + * title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth origin + * of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented If true, indicates that the Z offset if an elevation when + * positive. If false, the Z offset if a depth when positive. + * + * @returns A pointer to the new local time 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, const bool & isUpOriented); - + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); - RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + /** + * @brief Creates a local time 3d CRS which is fully unknown. Resulting local time 3d CRS is + * stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then + * \"unknown\" title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth + * origin of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided using EPSG + * or GML. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided using EPSG + * or GML. + * @param isUpOriented If true, indicates that the Z offset if an elevation when + * positive. If false, the Z offset if a depth when positive. + * + * @returns A pointer to the new local time 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, const bool & isUpOriented); - + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); - RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + /** + * @brief Creates a local time 3d CRS which is identified by an EPSG code for its projected + * part and which is unknown for its vertical part. Resulting local time 3d CRS is + * stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If projectedEpsgCode == 0. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then + * \"unknown\" title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth + * origin of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedEpsgCode The EPSG code of the associated projected CRS. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalUnknownReason Indicates why the vertical CRS cannot be provided using EPSG + * or GML. + * @param isUpOriented If true, indicates that the Z offset if an elevation when + * positive. If false, the Z offset if a depth when positive. + * + * @returns A pointer to the new local time 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, uint64_t projectedEpsgCode, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, const bool & isUpOriented); - + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, const std::string & verticalUnknownReason, bool isUpOriented); - RESQML2_NS::LocalTime3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, + /** + * @brief Creates a local time 3d CRS which unknown for its projected part and which is + * identified by an EPSG code for its vertical part. Resulting local time 3d CRS is + * stored into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If verticalEpsgCode == 0. + * + * @param guid The guid to set to the local 3d CRS. If empty then a new guid + * will be generated. + * @param title The title to set to the local 3d CRS. If empty then + * \"unknown\" title will be set. + * @param originOrdinal1 The offset of the global 2d CRS on its first axis. + * @param originOrdinal2 The offset of the global 2d CRS on its second axis. + * @param originOrdinal3 The offset in depth of the local CRS regarding the depth + * origin of the vertical CRS. + * @param arealRotation The areal rotation in radians regarding the projected CRS. + * @param projectedUom The unit of measure of the projected axis of this instance. + * @param projectedUnknownReason Indicates why the projected CRS cannot be provided using EPSG + * or GML. + * @param timeUom The unit of measure of the Z offset of this instance. + * @param verticalUom The unit of measure of the vertical axis of this instance. + * @param verticalEpsgCode The EPSG code of the associated vertical CRS. + * @param isUpOriented If true, indicates that the Z offset if an elevation when + * positive. If false, the Z offset if a depth when positive. + * + * @returns A pointer to the new local time 3d CRS. + */ + EML2_NS::AbstractLocal3dCrs* createLocalTime3dCrs(const std::string & guid, const std::string & title, double originOrdinal1, double originOrdinal2, double originOrdinal3, double arealRotation, gsoap_resqml2_0_1::eml20__LengthUom projectedUom, const std::string & projectedUnknownReason, gsoap_resqml2_0_1::eml20__TimeUom timeUom, - gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, const bool & isUpOriented); + gsoap_resqml2_0_1::eml20__LengthUom verticalUom, unsigned int verticalEpsgCode, bool isUpOriented); + /** + * @brief Creates a reference point (such as a MD datum) into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the reference point. If empty then a new + * guid will be generated. + * @param title The title to set to the reference point. If empty then + * \"unknown\" title will be set. + * @param [in] locCrs The local 3d CRS associated to this reference point if non-null, + * else the default local 3d CRS. + * @param originKind The reference location of the reference point. + * @param referenceLocationOrdinal1 The first reference location ordinal relative to the + * local 3d CRS. + * @param referenceLocationOrdinal2 The second reference location ordinal relative to the + * local 3d CRS. + * @param referenceLocationOrdinal3 The third reference location ordinal relative to the + * local 3d CRS. + * + * @returns A pointer to the new reference point. + */ RESQML2_NS::MdDatum* createMdDatum(const std::string & guid, const std::string & title, - RESQML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, + EML2_NS::AbstractLocal3dCrs * locCrs, gsoap_eml2_3::eml23__ReferencePointKind originKind, double referenceLocationOrdinal1, double referenceLocationOrdinal2, double referenceLocationOrdinal3); - /* FEATURE */ + //************ FEATURE *************** + /** + * @brief Creates a boundary feature into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the boundary feature. If empty then a new guid will be + * generated. + * @param title The title to set to the boundary feature. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new boundary feature. + */ RESQML2_NS::BoundaryFeature* createBoundaryFeature(const std::string & guid, const std::string & title); + /** + * @brief @deprecated Use {@link createBoundaryFeature()} method for RESQML post v2.0.1 Creates + * a horizon into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the horizon. If empty then a new guid will be generated. + * @param title The title to set to the horizon. If empty then \"unknown\" title will be set. + * + * @returns A pointer to the new horizon. + */ RESQML2_NS::BoundaryFeature* createHorizon(const std::string & guid, const std::string & title); + /** + * @brief @deprecated Use {@link createBoundaryFeature()} method for RESQML post v2.0.1 Creates + * a geobody boundary feature into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the geobody boundary feature. If empty then a new guid + * will be generated. + * @param title The title to set to the geobody boundary feature. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new geobody boundary feature. + */ RESQML2_NS::BoundaryFeature* createGeobodyBoundaryFeature(const std::string & guid, const std::string & title); + /** + * @brief Creates a geobody feature into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the geobody feature. If empty then a new guid will be + * generated. + * @param title The title to set to the geobody feature. If empty then \"unknown\" title will + * be set. + * + * @returns A pointer to the new geobody feature. + */ RESQML2_NS::RockVolumeFeature* createGeobodyFeature(const std::string & guid, const std::string & title); + /** + * @brief @deprecated Use {@link createBoundaryFeature()} method for RESQML post v2.0.1 Creates + * a fault into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the fault. If empty then a new guid will be generated. + * @param title The title to set to the fault. If empty then \"unknown\" title will be set. + * + * @returns A pointer to the new fault. + */ RESQML2_NS::BoundaryFeature* createFault(const std::string & guid, const std::string & title); + /** + * @brief @deprecated Use {@link createBoundaryFeature()} method for RESQML post v2.0.1 Creates + * a fracture into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the fracture. If empty then a new guid will be generated. + * @param title The title to set to the fracture. If empty then \"unknown\" title will be set. + * + * @returns A pointer to the new fracture. + */ RESQML2_NS::BoundaryFeature* createFracture(const std::string & guid, const std::string & title); + /** + * @brief Creates a wellbore feature into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the wellbore feature. If empty then a new guid will be + * generated. + * @param title The title to set to the wellbore feature. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new wellbore feature. + */ RESQML2_NS::WellboreFeature* createWellboreFeature(const std::string & guid, const std::string & title); + /** + * @brief Creates a seismic lattice into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the seismic lattice. If empty then a new guid + * will be generated. + * @param title The title to set to the seismic lattice. If empty then + * \"unknown\" title will be set. + * @param inlineIncrement The constant index increment between two consecutive inlines of + * the seismic lattice. + * @param crosslineIncrement The constant index increment between two consecutive crosslines + * of the seismic lattice. + * @param originInline The index of the first inline of the seismic lattice. + * @param originCrossline The index of the first crossline of the seismic lattice. + * @param inlineCount Number of inlines. + * @param crosslineCount Number of crosslines. + * + * @returns A pointer to the new seismic lattice. + */ RESQML2_NS::SeismicLatticeFeature* createSeismicLattice(const std::string & guid, const std::string & title, int inlineIncrement, int crosslineIncrement, unsigned int originInline, unsigned int originCrossline, unsigned int inlineCount, unsigned int crosslineCount); + /** + * Creates a seismic line into this repository + * + * @param guid The guid to set to the seismic line. If empty then a new guid + * will be generated. + * @param title The title to set to the seismic line. If empty then \"unknown\" + * title will be set. + * @param traceIndexIncrement The constant index increment between two consecutive traces. + * @param firstTraceIndex The index of the first trace of the seismic line. + * @param traceCount Number of traces. + * + * @returns A pointer to the new seismic line. + */ RESQML2_0_1_NS::SeismicLineFeature* createSeismicLine(const std::string & guid, const std::string & title, int traceIndexIncrement, unsigned int firstTraceIndex, unsigned int traceCount); -#ifdef WITH_RESQML2_2 +#ifdef WITH_RESQML2_2 + /** + * @brief Creates a CMP line into this repository + * + * @param guid The guid to set to the CMP line. If empty then a + * new guid will be generated. + * @param title The title to set to the CMP line. If empty then + * \"unknown\" title will be set. + * @param nearestShotPointIndicesIncrement The constant index increment between two + * consecutive shot points indices. + * @param firstNearestShotPointIndex The index of the first shot point of the CMP line. + * @param nearestShotPointCount Number of shot point. + * + * @returns A pointer to the new CMP line. + */ RESQML2_NS::CmpLineFeature* createCmpLine(const std::string & guid, const std::string & title, int nearestShotPointIndicesIncrement, int firstNearestShotPointIndex, unsigned int nearestShotPointCount); - + + /** + * Creates a shot point line into this repository + * + * @param guid The guid to set to the shot point line. If empty then a new guid + * will be generated. + * @param title The title to set to the shot point line. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new CMP line. + */ RESQML2_NS::ShotPointLineFeature* createShotPointLine(const std::string & guid, const std::string & title); #endif + /** + * @brief Creates a seismic line set into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the seismic line set. If empty then a new guid will be + * generated. + * @param title The title to set to the seismic line set. If empty then \"unknown\". + * + * @returns A pointer to the new seismic line set. + */ RESQML2_NS::SeismicLineSetFeature* createSeismicLineSet(const std::string & guid, const std::string & title); + /** + * @brief Creates a cultural into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the cultural. If empty then a new guid will be generated. + * @param title The title to set to the cultural. If empty then \"unknown\" title will be set. + * @param kind (Optional) The kind to set to the cultural. It is defaulted to + * gsoap_eml2_3::resqml22__CulturalFeatureKind::project_x0020boundaries for + * easing 2.0.1 compatibility. + * + * @returns A pointer to the new cultural. + */ RESQML2_NS::CulturalFeature* createCultural(const std::string & guid, const std::string & title, - gsoap_eml2_3::resqml22__CulturalFeatureKind kind = gsoap_eml2_3::resqml22__CulturalFeatureKind__project_x0020boundaries); + gsoap_eml2_3::resqml22__CulturalFeatureKind kind = gsoap_eml2_3::resqml22__CulturalFeatureKind::project_x0020boundaries); + /** + * @brief @deprecated Use {@link createRockVolumeFeature()} method for RESQML post v2.0.1 + * Creates a stratigraphic unit into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the stratigraphic unit. If empty then a new guid will be + * generated. + * @param title The title to set to the stratigraphic unit. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new stratigraphic unit. + */ RESQML2_NS::RockVolumeFeature* createStratigraphicUnitFeature(const std::string & guid, const std::string & title); #ifdef WITH_RESQML2_2 RESQML2_NS::RockVolumeFeature* createRockVolumeFeature(const std::string & guid, const std::string & title); RESQML2_NS::Model* createModel(const std::string & guid, const std::string & title); #endif + + /** + * @brief @deprecated Use {@link createModel()} method for RESQML post v2.0.1 Creates a + * structural model into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the structural model. If empty then a new guid will be + * generated. + * @param title The title to set to the structural model. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new structural model. + */ RESQML2_NS::Model* createStructuralModel(const std::string & guid, const std::string & title); + /** + * @brief @deprecated Use {@link createModel()} method for RESQML post v2.0.1 Creates a + * stratigraphic model into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the stratigraphic model. If empty then a new guid will be + * generated. + * @param title The title to set to the stratigraphic model. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new stratigraphic model. + */ RESQML2_NS::Model* createStratigraphicModel(const std::string & guid, const std::string & title); + /** + * @brief @deprecated Use {@link createModel()} method for RESQML post v2.0.1 Creates a rock + * fluid model into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the rock fluid model. If empty then a new guid will be + * generated. + * @param title The title to set to the rock fluid model. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new rock fluid model. + */ RESQML2_NS::Model* createRockFluidModel(const std::string & guid, const std::string & title); + /** + * @brief @deprecated Use {@link createModel()} method for RESQML post v2.0.1 Creates an earth + * model into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the earth model. If empty then a new guid will be + * generated. + * @param title The title to set to the earth model. If empty then \"unknown\" title will be + * set. + * + * @returns A pointer to the new earth model. + */ RESQML2_NS::Model* createEarthModel(const std::string & guid, const std::string & title); + /** + * Creates a fluid boundary feature into this repository + * + * @param guid The guid to set to the fluid boundary feature. If empty then a new + * guid will be generated. + * @param title The title to set to the fluid boundary feature. If empty then + * \"unknown\" title will be set. + * @param fluidContact The fluid contact. + * + * @returns A pointer to the new fluid boundary feature. + */ RESQML2_0_1_NS::FluidBoundaryFeature* createFluidBoundaryFeature(const std::string & guid, const std::string & title, gsoap_resqml2_0_1::resqml20__FluidContact fluidContact); + /** + * Creates rock fluid unit into this repository + * + * @param guid The guid to set to the rock fluid unit. If empty then a + * new guid will be generated. + * @param title The title to set to the rock fluid unit. If empty then + * \"unknown\" title will be set. + * @param phase The phase to set to the rock fluid unit. + * @param [in] fluidBoundaryTop The rock fluid unit top boundary. It cannot be null. + * @param [in] fluidBoundaryBottom The rock fluid unit bottom boundary. It cannot be null. + * + * @returns A pointer to the new rock fluid unit. + */ RESQML2_0_1_NS::RockFluidUnitFeature* createRockFluidUnit(const std::string & guid, const std::string & title, gsoap_resqml2_0_1::resqml20__Phase phase, RESQML2_0_1_NS::FluidBoundaryFeature* fluidBoundaryTop, RESQML2_0_1_NS::FluidBoundaryFeature* fluidBoundaryBottom); - /* INTERPRETATION */ + //************ INTERPRETATION ******** + /** + * @brief Creates a generic feature interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If feature == nullptr. + * + * @param [in] feature The interpreted feature. It cannot be null. + * @param guid The guid to set to the generic feature interpretation. If empty then a + * new guid will be generated. + * @param title The title to set to the generic feature interpretation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new generic feature interpretation. + */ RESQML2_NS::GenericFeatureInterpretation* createGenericFeatureInterpretation(RESQML2_NS::AbstractFeature * feature, const std::string & guid, const std::string & title); + /** + * Creates a boundary feature interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p feature is @c nullptr. + * + * @param [in] feature The interpreted boundary feature. It cannot be null. + * @param guid The guid to set to the boundary feature interpretation. If empty then a + * new guid will be generated. + * @param title The title to set to the boundary feature interpretation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new boundary feature interpretation. + */ RESQML2_NS::BoundaryFeatureInterpretation* createBoundaryFeatureInterpretation(RESQML2_NS::BoundaryFeature * feature, const std::string & guid, const std::string & title); + /** + * @brief Creates a horizon interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If horizon == nullptr. + * + * @param [in] horizon The interpreted horizon. It cannot be null. + * @param guid The guid to set to the horizon interpretation. If empty then a new guid + * will be generated. + * @param title The title to set to the horizon interpretation. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new horizon interpretation. + */ RESQML2_NS::HorizonInterpretation* createHorizonInterpretation(RESQML2_NS::BoundaryFeature * horizon, const std::string & guid, const std::string & title); + /** + * @brief Creates a geobody boundary interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If geobodyBoundary == nullptr. + * + * @param [in] geobodyBoundary The interpreted geobody boundary. It cannot be null. + * @param guid The guid to set to the geobody boundary interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the geobody boundary interpretation. If empty + * then \"unknown\" title will be set. + * + * @returns A pointer to the new geobody boundary interpretation. + */ RESQML2_NS::GeobodyBoundaryInterpretation* createGeobodyBoundaryInterpretation(RESQML2_NS::BoundaryFeature * geobodyBoundary, const std::string & guid, const std::string & title); + /** + * @brief Creates a fault interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If fault == nullptr. + * + * @param [in] fault The interpreted fault. It cannot be null. + * @param guid The guid to set to the fault interpretation. If empty then a new guid + * will be generated. + * @param title The title to set to the fault interpretation. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new fault interpretation. + */ RESQML2_NS::FaultInterpretation* createFaultInterpretation(RESQML2_NS::BoundaryFeature * fault, const std::string & guid, const std::string & title); /** - * @brief Creates a fluid Boundary interpretation into this repository + * @brief Creates a fluid Boundary interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If fault == nullptr. + * + * @param [in] boundary The interpreted boundary. It cannot be null. + * @param guid The guid to set to the interpretation. If empty then a new guid + * will be generated. + * @param title The title to set to the interpretation. If empty then \"unknown\" + * title will be set. + * @param fluidContact The fluid contact this boundary is. + * + * @returns A pointer to the new interpretation. + */ + RESQML2_NS::FluidBoundaryInterpretation* createFluidBoundaryInterpretation(RESQML2_NS::BoundaryFeature * boundary, const std::string & guid, const std::string & title, gsoap_eml2_3::resqml22__FluidContact fluidContact); + + /** + * @brief Creates a wellbore interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p wellbore is @c nullptr. + * + * @param [in] wellbore The interpreted wellbore feature. It cannot be null. + * @param guid The guid to set to the wellbore interpretation. If empty then a new + * guid will be generated. + * @param title The title to set to the wellbore interpretation. If empty then + * \"unknown\" title will be set. + * @param isDrilled Indicate if the wellbore is interpreted wether as drilled (true) or + * not (false). + * + * @returns A pointer to the new wellbore interpretation. + */ + RESQML2_NS::WellboreInterpretation* createWellboreInterpretation(RESQML2_NS::WellboreFeature * wellbore, const std::string & guid, const std::string & title, bool isDrilled); + + /** + * @brief Creates an earth model interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the earth model interpretation. If empty then a new + * guid will be generated. + * @param title The title to set to the earth model interpretation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new earth model interpretation. + */ + RESQML2_NS::EarthModelInterpretation* createEarthModelInterpretation(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); + + /** + * @brief Creates a structural organization interpretation ordered by age into this repository. + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a structural organization. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the structural organization interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the structural organization interpretation. If empty + * then \"unknown\" title will be set. + * + * @returns A pointer to the new structural organization interpretation. + */ + RESQML2_NS::StructuralOrganizationInterpretation* createStructuralOrganizationInterpretationInAge(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); + + /** + * @brief Creates a structural organization interpretation ordered by apparent depth into this + * repository. + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a structural organization. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the structural organization interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the structural organization interpretation. If empty + * then \"unknown\" title will be set. + * + * @returns A pointer to the new structural organization interpretation. + */ + RESQML2_NS::StructuralOrganizationInterpretation* createStructuralOrganizationInterpretationInApparentDepth(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); + + /** + * @brief Creates a structural organization interpretation ordered by measured depth into this + * repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a structural organization. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the structural organization interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the structural organization interpretation. If empty + * then \"unknown\" title will be set. + * + * @returns A pointer to the new structural organization interpretation. + */ + RESQML2_NS::StructuralOrganizationInterpretation* createStructuralOrganizationInterpretationInMeasuredDepth(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); + + /** + * @brief Creates a rock fluid organization interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a fluid organization. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the rock fluid organization interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the rock fluid organization interpretation. If empty + * then \"unknown\" title will be set. + * + * @returns A pointer to the new rock fluid organization interpretation. + */ + RESQML2_NS::RockFluidOrganizationInterpretation* createRockFluidOrganizationInterpretation(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); + + /** + * @brief Creates a rock fluid unit interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If feature == nullptr. + * + * @param [in] rockFluidUnitFeature The interpreted rock fluid unit. It cannot be null. + * @param guid The guid to set to the rock fluid unit interpretation. If + * empty then a new guid will be generated. + * @param title The title to set to the rock fluid unit interpretation. + * If empty then \"unknown\" title will be set. + * + * @returns A pointer to the new rock fluid unit interpretation. + */ + RESQML2_NS::RockFluidUnitInterpretation* createRockFluidUnitInterpretation(RESQML2_NS::RockVolumeFeature * rockFluidUnitFeature, const std::string & guid, const std::string & title); + + /** + * @brief Creates a geobody interpretation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If geobody == nullptr or if in a RESQML v2.0 + * context, @p geobody is not an actual geobody feature. + * + * @param [in] geobody The interpreted geobody. It cannot be null. + * @param guid The guid to set to the geobody interpretation. If empty then a new guid + * will be generated. + * @param title The title to set to the geobody interpretation. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new geobody interpretation. + */ + RESQML2_NS::GeobodyInterpretation* createGeobodyInterpretation(RESQML2_NS::RockVolumeFeature* geobody, const std::string & guid, const std::string & title); + + /** + * @brief Creates a stratigraphic unit interpretation into this repository. + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If stratiUnitFeature == nullptr. + * + * @param [in] stratiUnitFeature The interpreted stratigraphic unit. It cannot be null. + * @param guid The guid to set to the stratigraphic unit interpretation. If + * empty then a new guid will be generated. + * @param title The title to set to the stratigraphic unit interpretation. If + * empty then \"unknown\" title will be set. + * + * @returns A pointer to the new stratigraphic unit interpretation. + */ + RESQML2_NS::StratigraphicUnitInterpretation* createStratigraphicUnitInterpretation(RESQML2_NS::RockVolumeFeature * stratiUnitFeature, const std::string & guid, const std::string & title); + + /** + * @brief Creates stratigraphic column into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the stratigraphic column. If empty then a new guid will be + * generated. + * @param title The title to set to the stratigraphic column. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new stratigraphic column. + */ + RESQML2_NS::StratigraphicColumn* createStratigraphicColumn(const std::string & guid, const std::string & title); + + /** + * @brief Creates a stratigraphic column rank interpretation ordered by age into this + * repository. + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a stratigraphic organization. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the stratigraphic column rank interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the stratigraphic column rank interpretation. If + * empty then \"unknown\" title will be set. + * @param rank The rank of the stratigraphic column rank interpretation. + * + * @returns A pointer to the new stratigraphic column rank interpretation. + */ + RESQML2_NS::StratigraphicColumnRankInterpretation* createStratigraphicColumnRankInterpretationInAge(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title, uint64_t rank); + + /** + * @brief Creates a stratigraphic column rank interpretation ordered by apparent depth into + * this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a stratigraphic organization. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the stratigraphic column rank interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the stratigraphic column rank interpretation. If + * empty then \"unknown\" title will be set. + * @param rank The rank of the stratigraphic column rank interpretation. + * + * @returns A pointer to the new stratigraphic column rank interpretation. + */ + RESQML2_NS::StratigraphicColumnRankInterpretation* createStratigraphicColumnRankInterpretationInApparentDepth(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title, uint64_t rank); + + /** + * @brief Creates a stratigraphic occurrence interpretation ordered by age into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a stratigraphic organization. + * + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the stratigraphic occurrence interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the stratigraphic occurrence interpretation. If empty + * then \"unknown\" title will be set. + * + * @returns A pointer to the new stratigraphic occurrence interpretation. + */ + RESQML2_NS::StratigraphicOccurrenceInterpretation* createStratigraphicOccurrenceInterpretationInAge(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); + + /** + * @brief Creates a stratigraphic occurrence interpretation ordered by apparent depth into this + * repository * * @exception std::invalid_argument If the default RESQML version is unrecognized. - * @exception std::invalid_argument If fault == nullptr. + * @exception std::invalid_argument If orgFeat == nullptr or if in a RESQML v2.0 + * context, @p orgFeat is not a stratigraphic organization. * - * @param [in] boundary The interpreted boundary. It cannot be null. - * @param guid The guid to set to the interpretation. If empty then a new guid - * will be generated. - * @param title The title to set to the interpretation. If empty then \"unknown\" - * title will be set. - * @param fluidContact The fluid contact this boundary is. + * @param [in] orgFeat The interpreted organization. It cannot be null. + * @param guid The guid to set to the stratigraphic occurrence interpretation. If empty + * then a new guid will be generated. + * @param title The title to set to the stratigraphic occurrence interpretation. If empty + * then \"unknown\" title will be set. * - * @returns A pointer to the new interpretation. + * @returns A pointer to the new stratigraphic occurrence interpretation. */ - RESQML2_NS::FluidBoundaryInterpretation* createFluidBoundaryInterpretation(RESQML2_NS::BoundaryFeature * boundary, const std::string & guid, const std::string & title, gsoap_eml2_3::resqml22__FluidContact fluidContact); - - RESQML2_NS::WellboreInterpretation* createWellboreInterpretation(RESQML2_NS::WellboreFeature * wellbore, const std::string & guid, const std::string & title, bool isDrilled); - - RESQML2_NS::EarthModelInterpretation* createEarthModelInterpretation(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); - - RESQML2_NS::StructuralOrganizationInterpretation* createStructuralOrganizationInterpretationInAge(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); - RESQML2_NS::StructuralOrganizationInterpretation* createStructuralOrganizationInterpretationInApparentDepth(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); - RESQML2_NS::StructuralOrganizationInterpretation* createStructuralOrganizationInterpretationInMeasuredDepth(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); - - RESQML2_NS::RockFluidOrganizationInterpretation* createRockFluidOrganizationInterpretation(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); - RESQML2_NS::RockFluidUnitInterpretation* createRockFluidUnitInterpretation(RESQML2_NS::RockVolumeFeature * rockFluidUnitFeature, const std::string & guid, const std::string & title); - - RESQML2_NS::GeobodyInterpretation* createGeobodyInterpretation(RESQML2_NS::RockVolumeFeature * geobody, const std::string & guid, const std::string & title); - - RESQML2_NS::StratigraphicUnitInterpretation* createStratigraphicUnitInterpretation(RESQML2_NS::RockVolumeFeature * stratiUnitFeature, const std::string & guid, const std::string & title); - RESQML2_NS::StratigraphicColumn* createStratigraphicColumn(const std::string & guid, const std::string & title); - RESQML2_NS::StratigraphicColumnRankInterpretation* createStratigraphicColumnRankInterpretationInAge(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title, uint64_t rank); - RESQML2_NS::StratigraphicColumnRankInterpretation* createStratigraphicColumnRankInterpretationInApparentDepth(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title, uint64_t rank); - RESQML2_NS::StratigraphicOccurrenceInterpretation* createStratigraphicOccurrenceInterpretationInAge(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); RESQML2_NS::StratigraphicOccurrenceInterpretation* createStratigraphicOccurrenceInterpretationInApparentDepth(RESQML2_NS::Model * orgFeat, const std::string & guid, const std::string & title); - /* REPRESENTATION */ + //************ REPRESENTATION ******** + /** + * @brief Creates a triangulated set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the triangulated set representation. If empty then a new + * guid will be generated. + * @param title The title to set to the triangulated set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new triangulated set representation. + */ RESQML2_NS::TriangulatedSetRepresentation* createTriangulatedSetRepresentation(const std::string & guid, const std::string & title); - + + /** + * @brief Creates a triangulated set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. You can alternatively + * use {@link createTriangulatedSetRepresentation} if no interpretation is + * associated to this representation. + * @param guid The guid to set to the triangulated set representation. If empty then a + * new guid will be generated. + * @param title The title to set to the triangulated set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new triangulated set representation. + */ RESQML2_NS::TriangulatedSetRepresentation* createTriangulatedSetRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title); + /** + * @brief Creates a polyline set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the polyline set representation. If empty then a new guid + * will be generated. + * @param title The title to set to the polyline set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new polyline set representation. + */ RESQML2_NS::PolylineSetRepresentation* createPolylineSetRepresentation(const std::string & guid, const std::string & title); + /** + * @brief Creates a polyline set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. You can alternatively + * use {@link createPolylineSetRepresentation} if no interpretation is + * associated to this representation. + * @param guid The guid to set to the polyline set representation. If empty then a new + * guid will be generated. + * @param title The title to set to the polyline set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new polyline set representation. + */ RESQML2_NS::PolylineSetRepresentation* createPolylineSetRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title); + /** + * @brief Creates a polyline set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * @exception std::invalid_argument If in a RESQML v2.0 context, @p roleKind is a break line + * role. + * + * @param [in] interp The represented interpretation. It cannot be null. You can + * alternatively use {@link createPolylineSetRepresentation} if no + * interpretation is associated to this representation. + * @param guid The guid to set to the polyline set representation. If empty then a + * new guid will be generated. + * @param title The title to set to the polyline set representation. If empty then + * \"unknown\" title will be set. + * @param roleKind The polyline set role kind. + * + * @returns A pointer to the new polyline set representation. + */ RESQML2_NS::PolylineSetRepresentation* createPolylineSetRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title, gsoap_eml2_3::resqml22__LineRole roleKind); + /** + * @brief Creates a point set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the point set representation. If empty then a new guid + * will be generated. + * @param title The title to set to the point set representation. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new point set representation. + */ RESQML2_NS::PointSetRepresentation* createPointSetRepresentation(const std::string & guid, const std::string & title); + /** + * @brief Creates a point set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the point set representation. If empty then a new guid + * will be generated. + * @param title The title to set to the point set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new point set representation. + */ RESQML2_NS::PointSetRepresentation* createPointSetRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title); + /** + * @brief Creates a plane set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the plane set representation. If empty then a new guid + * will be generated. + * @param title The title to set to the plane set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new plane set representation. + */ RESQML2_NS::PlaneSetRepresentation* createPlaneSetRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title); + /** + * @brief Creates a polyline representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the polyline representation. If empty then a new guid + * will be generated. + * @param title The title to set to the polyline representation. If empty then + * \"unknown\" title will be set. + * @param isClosed (Optional) True if the polyline is closed, false (default) if it is not. + * + * @returns A pointer to the new polyline representation. + */ RESQML2_NS::PolylineRepresentation* createPolylineRepresentation(const std::string & guid, const std::string & title, bool isClosed = false); + /** + * @brief Creates a polyline representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. You can + * alternatively use {@link createPolylineRepresentation} if no + * interpretation is associated to this representation. + * @param guid The guid to set to the polyline representation. If empty then a new + * guid will be generated. + * @param title The title to set to the polyline representation. If empty then + * \"unknown\" title will be set. + * @param isClosed (Optional) True if the polyline is closed, false (default) if it is + * not. + * + * @returns A pointer to the new polyline representation. + */ RESQML2_NS::PolylineRepresentation* createPolylineRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title, bool isClosed = false); + /** + * @brief Creates a polyline representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. You can + * alternatively use {@link createPolylineRepresentation} if no + * interpretation is associated to this representation. + * @param guid The guid to set to the polyline representation. If empty then a new + * guid will be generated. + * @param title The title to set to the polyline representation. If empty then + * \"unknown\" title will be set. + * @param roleKind The polyline role kind. + * @param isClosed (Optional) True if the polyline is closed, false (default) if it is + * not. + * + * @returns A pointer to the new polyline representation. + */ RESQML2_NS::PolylineRepresentation* createPolylineRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title, gsoap_eml2_3::resqml22__LineRole roleKind, bool isClosed = false); + /** + * Creates a 2d grid representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the 2d grid representation. If empty then a new guid + * will be generated. + * @param title The title to set to the 2d grid representation. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new 2d grid representation. + */ RESQML2_NS::Grid2dRepresentation* createGrid2dRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title); - RESQML2_NS::WellboreTrajectoryRepresentation* createWellboreTrajectoryRepresentation(RESQML2_NS::WellboreInterpretation * interp, const std::string & guid, const std::string & title, RESQML2_NS::MdDatum * mdInfo); + /** + * @brief Creates a wellbore trajectory representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p interp or @p mdInfo is @c nullptr. + * + * @param [in] interp The represented wellbore interpretation. It cannot be null. + * @param guid The guid to set to the wellbore trajectory representation. If empty then + * a new guid will be generated. + * @param title The title to set to the wellbore trajectory representation. If empty then + * \"unknown\" title will be set. + * @param [in] mdDatum The MD datum of the trajectory, mainly the well reference point. It cannot be null. + * + * @returns A pointer to the new wellbore trajectory representation. + */ + RESQML2_NS::WellboreTrajectoryRepresentation* createWellboreTrajectoryRepresentation(RESQML2_NS::WellboreInterpretation* interp, const std::string& guid, const std::string& title, RESQML2_NS::MdDatum * mdInfo); + + /** + * Creates a wellbore trajectory representation (with an existing deviation survey as its + * origin) into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p interp or @p deviationSurvey is @c nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the wellbore trajectory representation. If + * empty then a new guid will be generated. + * @param title The title to set to the wellbore trajectory representation. If + * empty then \"unknown\" title will be set. + * @param [in] deviationSurvey The deviation survey on which this wellbore trajectory relies on. + * MD data will be retrieve from it. It cannot be null. + * + * @returns A pointer to the new wellbore trajectory representation. + */ RESQML2_NS::WellboreTrajectoryRepresentation* createWellboreTrajectoryRepresentation(RESQML2_NS::WellboreInterpretation * interp, const std::string & guid, const std::string & title, RESQML2_NS::DeviationSurveyRepresentation * deviationSurvey); + /** + * @brief Creates a deviation survey representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr or mdInfo == + * nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the deviation survey representation. If empty then a + * new guid will be generated. + * @param title The title to set to the deviation survey representation. If empty then + * \"unknown\" title will be set. + * @param isFinal Used to indicate that this is a final version of the deviation survey + * (true), as distinct from the interim interpretations (false). + * @param [in] refPoint The reference point which acts as a datum for this deviation survey representation. + * It canot be null. + * + * @returns A pointer to the new deviation survey representation. + */ RESQML2_NS::DeviationSurveyRepresentation* createDeviationSurveyRepresentation(RESQML2_NS::WellboreInterpretation * interp, const std::string & guid, const std::string & title, const bool & isFinal, RESQML2_NS::MdDatum * mdInfo); + /** + * @brief Creates a wellbore frame representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p interp or @p traj is @c nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the wellbore frame representation. If empty then a new + * guid will be generated. + * @param title The title to set to the wellbore frame representation. If empty then + * \"unknown\" title will be set. + * @param [in] traj The wellbore trajectory that refers this wellbore frame. It cannot be + * null. + * + * @returns A pointer to the new wellbore frame representation. + */ RESQML2_NS::WellboreFrameRepresentation* createWellboreFrameRepresentation(RESQML2_NS::WellboreInterpretation* interp, const std::string& guid, const std::string& title, RESQML2_NS::WellboreTrajectoryRepresentation* traj); #ifdef WITH_RESQML2_2 + /** + * @brief Creates a seismic wellbore frame representation into this repository + * + * @exception std::invalid_argument If @p interp, @p traj or @p crs is @c nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the seismic wellbore frame + * representation. If empty then a new guid will be + * generated. + * @param title The title to set to the seismic wellbore frame + * representation. If empty then \"unknown\" title will be + * set. + * @param [in] traj The wellbore trajectory that refers this seismic wellbore + * frame. It cannot be null. + * @param seismicReferenceDatum The Z value where the seismic time is equal to zero for + * this survey wellbore frame. + * @param weatheringVelocity The weathering velocity. Sometimes also called seismic + * velocity replacement. + * @param [in] crs The local time 3d CRS that refers this seismic wellbore + * frame. + * + * @returns A pointer to the new seismic wellbore frame representation. + */ RESQML2_NS::SeismicWellboreFrameRepresentation* createSeismicWellboreFrameRepresentation( - RESQML2_NS::WellboreInterpretation* interp, + RESQML2_NS::WellboreInterpretation* interp, const std::string& guid, const std::string& title, RESQML2_NS::WellboreTrajectoryRepresentation* traj, double seismicReferenceDatum, double weatheringVelocity, - RESQML2_NS::LocalTime3dCrs* crs); + EML2_NS::AbstractLocal3dCrs* crs); #endif + /** + * Creates a wellbore marker frame representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p interp of @p traj is @c nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the wellbore marker frame representation. If empty + * then a new guid will be generated. + * @param title The title to set to the wellbore marker frame representation. If empty + * then \"unknown\" title will be set. + * @param [in] traj The wellbore trajectory that refers this wellbore marker frame. It cannot + * be null. + * + * @returns A pointer to the new wellbore marker frame representation. + */ RESQML2_NS::WellboreMarkerFrameRepresentation* createWellboreMarkerFrameRepresentation(RESQML2_NS::WellboreInterpretation * interp, const std::string & guid, const std::string & title, RESQML2_NS::WellboreTrajectoryRepresentation * traj); + /** + * @brief Creates a wellbore marker within a given wellbore marker frame representation. + * + * @exception std::invalid_argument If wellboreMarkerFrame == nullptr. + * + * @param [in] wellboreMarkerFrame The wellbore marker frame representation where to push back + * the wellbore marker. + * @param guid The guid to set to the wellbore marker. If empty then a new + * guid will be generated. + * @param title The title to set to the wellbore marker. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new wellbore marker. + */ RESQML2_NS::WellboreMarker* createWellboreMarker(RESQML2_NS::WellboreMarkerFrameRepresentation* wellboreMarkerFrame, const std::string& guid, const std::string& title); + /** + * @brief Creates a wellbore marker within a given wellbore marker frame representation. + * + * @exception std::invalid_argument If wellboreMarkerFrame == nullptr. + * + * @param [in] wellboreMarkerFrame The wellbore marker frame representation where to push + * back the wellbore marker. + * @param guid The guid to set to the wellbore marker. If empty then a + * new guid will be generated. + * @param title The title to set to the wellbore marker. If empty then + * \"unknown\" title will be set. + * @param geologicBoundaryKind The geologic boundary kind. + * + * @returns A pointer to the new wellbore marker. + */ RESQML2_NS::WellboreMarker* createWellboreMarker(RESQML2_NS::WellboreMarkerFrameRepresentation* wellboreMarkerFrame, const std::string& guid, const std::string& title, gsoap_resqml2_0_1::resqml20__GeologicBoundaryKind geologicBoundaryKind); + /** + * @brief Creates a blocked wellbore representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If traj == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the blocked wellbore representation. If empty then a + * new guid will be generated. + * @param title The title to set to the blocked wellbore representation. If empty then + * \"unknown\" title will be set. + * @param [in] traj The wellbore trajectory that refers this blocked wellbore representation. + * It cannot be null. + * + * @returns A pointer to the new blocked wellbore representation. + */ RESQML2_NS::BlockedWellboreRepresentation* createBlockedWellboreRepresentation(RESQML2_NS::WellboreInterpretation * interp, const std::string & guid, const std::string & title, RESQML2_NS::WellboreTrajectoryRepresentation * traj); + /** + * @brief Creates a representation set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. You can alternatively + * use {@link createRepresentationSetRepresentation} if no interpretation + * is associated to this representation. + * @param guid The guid to set to the representation set representation. If empty then a + * new guid will be generated. + * @param title The title to set to the representation set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new representation set representation. + */ RESQML2_NS::RepresentationSetRepresentation* createRepresentationSetRepresentation( RESQML2_NS::AbstractOrganizationInterpretation* interp, const std::string & guid, const std::string & title); + /** + * @brief Creates a representation set representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the representation set representation. If empty then a new + * guid will be generated. + * @param title The title to set to the representation set representation. If empty then + * \"unknown\" title will be set. + * + * @returns A pointer to the new representation set representation. + */ RESQML2_NS::RepresentationSetRepresentation* createRepresentationSetRepresentation( const std::string & guid, const std::string & title); + /** + * @brief Creates a non sealed surface framework representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the non sealed surface framework representation. If + * empty then a new guid will be generated. + * @param title The title to set to the non sealed surface framework representation. If + * empty then \"unknown\" title will be set. + * + * @returns A pointer to the new non sealed surface framework representation. + */ RESQML2_NS::NonSealedSurfaceFrameworkRepresentation* createNonSealedSurfaceFrameworkRepresentation( RESQML2_NS::StructuralOrganizationInterpretation* interp, const std::string & guid, const std::string & title); + /** + * @brief Creates a sealed surface framework representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the sealed surface framework representation. If empty + * then a new guid will be generated. + * @param title The title to set to the sealed surface framework representation. If empty + * then \"unknown\" title will be set. + * + * @returns A pointer to the new sealed surface framework representation. + */ RESQML2_NS::SealedSurfaceFrameworkRepresentation* createSealedSurfaceFrameworkRepresentation( RESQML2_NS::StructuralOrganizationInterpretation* interp, const std::string & guid, const std::string & title); + /** + * @brief Creates a sealed volume framework representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If interp == nullptr or ssf == nullptr. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param guid The guid to set to the sealed volume framework representation. If empty + * then a new guid will be generated. + * @param title The title to set to the sealed volume framework representation. If empty + * then \"unknown\" title will be set. + * @param [in] ssf The sealed surface framework that refers this sealed volume framework. It + * cannot be null. + * + * @returns A pointer to the new sealed volume framework representation. + */ RESQML2_NS::SealedVolumeFrameworkRepresentation* createSealedVolumeFrameworkRepresentation( RESQML2_NS::StratigraphicColumnRankInterpretation* interp, const std::string & guid, @@ -895,7 +2499,7 @@ import com.f2i_consulting.fesapi.*; * * @returns A pointer to the new partial ijk grid representation. */ - RESQML2_NS::AbstractIjkGridRepresentation* createPartialIjkGridRepresentation(const std::string & guid, const std::string & title); + RESQML2_NS::AbstractIjkGridRepresentation* createPartialIjkGridRepresentation(const std::string& guid, const std::string& title); /** * Creates a partial truncated ijk grid representation into this repository @@ -905,7 +2509,7 @@ import com.f2i_consulting.fesapi.*; * * @returns A pointer to the new partial truncated ijk grid representation. */ - RESQML2_NS::AbstractIjkGridRepresentation* createPartialTruncatedIjkGridRepresentation(const std::string & guid, const std::string & title); + RESQML2_NS::AbstractIjkGridRepresentation* createPartialTruncatedIjkGridRepresentation(const std::string& guid, const std::string& title); /** * @brief Creates an ijk grid explicit representation into this repository @@ -1198,7 +2802,39 @@ import com.f2i_consulting.fesapi.*; RESQML2_NS::GridConnectionSetRepresentation* createGridConnectionSetRepresentation(RESQML2_NS::AbstractFeatureInterpretation* interp, const std::string & guid, const std::string & title); - /* PROPERTIES */ + /** + * @brief Creates a streamlines feature into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the streamlines feature. If empty then a new guid will be + * generated. + * @param title The title to set to the streamlines feature. If empty then \"unknown\" title + * will be set. + * @param timeIndex The time index in the time series of the this streamlines feature. + * @param timeSeries The time series where the time index of this streamlines feature is given. + * + * @returns A pointer to the new wellbore feature. + */ + RESQML2_NS::StreamlinesFeature* createStreamlinesFeature(const std::string & guid, const std::string & title, uint64_t timeIndex, EML2_NS::TimeSeries* timeSeries); + + /** + * @brief Creates a streamlines representation into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param [in] interp The represented interpretation. It cannot be null. + * @param [in] guid The guid to set to the streamlines representation. If empty then a new guid will be + * generated. + * @param [in] title The title to set to the streamlines representation. If empty then \"unknown\" title + * will be set. + * @param [in] lineCount The count of line in this representation + * + * @returns A pointer to the new wellbore feature. + */ + RESQML2_NS::StreamlinesRepresentation* createStreamlinesRepresentation(RESQML2_NS::GenericFeatureInterpretation* interp, const std::string & guid, const std::string & title, uint64_t lineCount); + + //************* PROPERTIES *********** /** * @brief Creates a time series into this repository @@ -1242,45 +2878,344 @@ import com.f2i_consulting.fesapi.*; */ RESQML2_NS::StringTableLookup* createStringTableLookup(const std::string & guid, const std::string & title); + /** + * Creates a RESQML2.0.1 only property kind into this repository + * + * @param guid The guid to set to the property kind. If empty then a + * new guid will be generated. + * @param title The title to set to the property kind. If empty then + * \"unknown\" title will be set. + * @param namingSystem The name of the dictionary within which the property + * is unique. This also defines the name of the + * controlling authority. Use a URN of the form urn:x- + * resqml:domainOrEmail:dictionaryName. + * @param uom The property kind unit of measure taken from the + * standard RESQML units of measure catalog. + * @param parentEnergisticsPropertyKind The parent property kind taken from the standard set + * of RESQML property kinds. + * + * @returns A pointer to the new property kind. + */ RESQML2_0_1_NS::PropertyKind* createPropertyKind(const std::string & guid, const std::string & title, const std::string & namingSystem, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind parentEnergisticsPropertyKind); + /** + * @brief Creates a RESQML2.0.1 only property kind into this repository + * + * @exception std::invalid_argument If parentPropType == nullptr. + * + * @param guid The guid to set to the property kind. If empty then a new guid + * will be generated. + * @param title The title to set to the property kind. If empty then \"unknown\" + * title will be set. + * @param namingSystem The name of the dictionary within which the property is unique. + * This also defines the name of the controlling authority. Use a + * URN of the form \"urn:x- resqml:domainOrEmail:dictionaryName\". + * @param uom The property kind unit of measure taken from the standard RESQML + * units of measure catalog. + * @param [in] parentPropType The parent property kind. It cannot be null. + * + * @returns A pointer to the new property kind. + */ RESQML2_0_1_NS::PropertyKind* createPropertyKind(const std::string & guid, const std::string & title, const std::string & namingSystem, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, EML2_NS::PropertyKind * parentPropType); + /** + * Creates a RESQML2.0.1 only property kind into this repository. + * + * @param guid The guid to set to the property kind. If empty then a + * new guid will be generated. + * @param title The title to set to the property kind. If empty then + * \"unknown\" title will be set. + * @param namingSystem The name of the dictionary within which the property + * is unique. This also defines the name of the + * controlling authority. Use a URN of the form \"urn:x- + * resqml:domainOrEmail:dictionaryName\". + * @param nonStandardUom The property kind unit of measure. + * @param parentEnergisticsPropertyKind The parent property kind taken from the standard set + * of RESQML property kinds. + * + * @returns A pointer to the new property kind. + */ RESQML2_0_1_NS::PropertyKind* createPropertyKind(const std::string & guid, const std::string & title, const std::string & namingSystem, const std::string & nonStandardUom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind parentEnergisticsPropertyKind); + /** + * Creates a RESQML2.0.1 only property kind into this repository + * + * @param guid The guid to set to the property kind. If empty then a new guid + * will be generated. + * @param title The title to set to the property kind. If empty then \"unknown\" + * title will be set. + * @param namingSystem The name of the dictionary within which the property is unique. + * This also defines the name of the controlling authority. Use a + * URN of the form \"urn:x- resqml:domainOrEmail:dictionaryName\". + * @param nonStandardUom The property kind unit of measure. + * @param [in] parentPropType The parent property kind. It cannot be null. + * + * @returns A pointer to the new property kind. + */ RESQML2_0_1_NS::PropertyKind* createPropertyKind(const std::string & guid, const std::string & title, const std::string & namingSystem, const std::string & nonStandardUom, EML2_NS::PropertyKind * parentPropType); + /** + * @brief Creates a property kind starting with EML2.1 version into this repository. + * Don't use it at all if you want a full RESQML2.0.1 EPC!!! Use other same name methods instead please. + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * + * @param guid The guid to set to the property kind. If empty then a new + * guid will be generated. + * @param title The title to set to the property kind. If empty then + * \"unknown\" title will be set. + * @param quantityClass A reference to the name of a quantity class in the + * Energistics units of measure dictionary. + * @param isAbstract (Optional) Indicates whether the property kind should be used + * as a real (default) property or not. + * @param [in] parentPropertyKind (Optional) If non-null, the parent property kind. If null, a + * default partial parent property kind will be created. + * + * @returns A pointer to the new property kind. + */ EML2_NS::PropertyKind* createPropertyKind(const std::string & guid, const std::string & title, gsoap_eml2_3::eml23__QuantityClassKind quantityClass, bool isAbstract = false, EML2_NS::PropertyKind* parentPropertyKind = nullptr); + /** + * @brief Creates a property set into this repository. + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If, in a RESQML v2.0 context, @p timeSetKind is single + * time series. + * + * @param guid The guid to set to the property set. If empty then a new guid + * will be generated. + * @param title The title to set to the property set. If empty then + * \"unknown\" title will be set. + * @param hasMultipleRealizations True if the set contains properties with defined realization + * indices, false if not. + * @param hasSinglePropertyKind True if the set contains only property values associated with + * a single property kind, false if not. + * @param timeSetKind The time relationship that share the properties of this set, + * if any. + * + * @returns A pointer to the new property set. + */ RESQML2_0_1_NS::PropertySet* createPropertySet(const std::string & guid, const std::string & title, bool hasMultipleRealizations, bool hasSinglePropertyKind, gsoap_resqml2_0_1::resqml20__TimeSetKind timeSetKind); + /** + * Creates a comment property (which is of a well known Energistics property kind) into this + * repository. + * + * @exception std::invalid_argument If @p rep is null. + * + * @param [in] rep The representation on which this property is attached to. + * It cannot be null. + * @param guid The guid to set to the property. If empty then a new guid + * will be generated. + * @param title The title to set to the property. If empty then + * \"unknown\" title will be set. + * @param attachmentKind The topological element on which the property values are + * attached to. + * @param energisticsPropertyKind The property kind of these property values which must be + * defined in the standard Energistics property type + * dictionary. + * + * @returns A pointer to the new comment property. + */ RESQML2_0_1_NS::CommentProperty* createCommentProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind); + /** + * Creates a comment property (which is of a local property kind) into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p rep or @p localPropKind is null. + * + * @param [in] rep The representation on which this property is attached to. It + * cannot be null. + * @param guid The guid to set to the property. If empty then a new guid will be + * generated. + * @param title The title to set to the property. If empty then \"unknown\" title + * will be set. + * @param attachmentKind The topological element on which the property values are attached + * to. + * @param [in] localPropType The property kind of these property values which must be defined + * in the EPC document as a local property kind. It cannot be null. + * + * @returns A pointer to the new comment property. + */ RESQML2_NS::CommentProperty* createCommentProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::PropertyKind * localPropType); + /** + * Creates a continuous property (which is of well known Energistics unit of measure and + * property kind) into this repository + * + * @exception std::invalid_argument If @p rep is null. + * + * @param [in] rep The representation on which this property is attached to. + * It cannot be null. + * @param guid The guid to set to the property. If empty then a new guid + * will be generated. + * @param title The title to set to the property. If empty then + * \"unknown\" title will be set. + * @param attachmentKind The topological element on which the property values are + * attached to. + * @param uom The property unit of measure taken from the standard + * Energistics units of measure catalog. Please check + * COMMON_NS::EnumStringMapper::getEnergisticsUnitOfMeasure + * in order to minimize the use of non standard unit of + * measure. + * @param energisticsPropertyKind The property kind of these property values which must be + * defined in the standard Energistics property type + * dictionary. + * @param dimensions The dimensions of each value of this property. If this parameter + * is empty, then it is assumed this property is a scalar one. + * + * @returns A pointer to the new continuous property. + */ RESQML2_0_1_NS::ContinuousProperty* createContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind); + /** + * Creates a continuous property (which is of a well known unit of measure and a local property + * kind) into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p rep or @p localPropType is null. + * + * @param [in] rep The representation on which this property is attached to. It + * cannot be null. + * @param guid The guid to set to the property. If empty then a new guid will be + * generated. + * @param title The title to set to the property. If empty then \"unknown\" title + * will be set. + * @param attachmentKind The topological element on which the property values are attached + * to. + * @param uom The property unit of measure taken from the standard Energistics + * units of measure catalog. Please check + * COMMON_NS::EnumStringMapper::getEnergisticsUnitOfMeasure in order + * to minimize the use of non standard unit of measure. + * @param [in] localPropType The property kind of these property values which must be defined + * in the EPC document as a local property kind. It cannot be null. + * @param dimensions The dimensions of each value of this property. If this parameter + * is empty, then it is assumed this property is a scalar one. + * + * @returns A pointer to the new continuous property. + */ RESQML2_NS::ContinuousProperty* createContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, EML2_NS::PropertyKind * localPropType); + /** + * Creates a continuous property (which is of a local unit of measure and a well known property + * kind) into this repository + * + * @exception std::invalid_argument If @p rep is null. + * + * @param [in] rep The representation on which this property is attached to. + * It cannot be null. + * @param guid The guid to set to the property. If empty then a new guid + * will be generated. + * @param title The title to set to the property. If empty then + * \"unknown\" title will be set. + + + * @param attachmentKind The topological element on which the property values are + * attached to. + * @param nonStandardUom The property unit of measure. Please check + * COMMON_NS::EnumStringMapper::getEnergisticsUnitOfMeasure + * in order to minimize the use of non standard unit of + * measure. + * @param energisticsPropertyKind The property kind of these property values which must be + * defined in the standard Energistics property type + * dictionary. + * @param dimensions The dimensions of each value of this property. If this parameter + * is empty, then it is assumed this property is a scalar one. + * + * @returns A pointer to the new continuous property. + */ RESQML2_0_1_NS::ContinuousProperty* createContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, std::string nonStandardUom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind); + /** + * Creates a continuous property (which is of local unit of measure and property kind) into this + * repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p rep or @p localPropType is null. + * + * @param [in] rep The representation on which this property is attached to. It + * cannot be null. + * @param guid The guid to set to the property. If empty then a new guid will be + * generated. + * @param title The title to set to the property. If empty then \"unknown\" title + * will be set. + * @param attachmentKind The topological element on which the property values are attached + * to. + * @param nonStandardUom The property unit of measure. Please check + * COMMON_NS::EnumStringMapper::getEnergisticsUnitOfMeasure in order + * to minimize the use of non standard unit of measure. + * @param [in] localPropType The property kind of these property values which must be defined + * in the EPC document as a local property kind. It cannot be null. + * @param dimensions The dimensions of each value of this property. If this parameter + * is empty, then it is assumed this property is a scalar one. + * + * @returns A pointer to the new continuous property. + */ RESQML2_NS::ContinuousProperty* createContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, const std::string & nonStandardUom, EML2_NS::PropertyKind * localPropType); + /** + * Creates a discrete property (which is of a well known Energistics property kind) into this + * repository + * + * @exception std::invalid_argument If @p rep is null. + * + * @param [in] rep The representation on which this property is attached to. + * It cannot be null. + * @param guid The guid to set to the property. If empty then a new guid + * will be generated. + * @param title The title to set to the property. If empty then + * \"unknown\" title will be set. + + + * @param attachmentKind The topological element on which the property values are + * attached to. + + + * @param energisticsPropertyKind The property kind of these property values which must be + * defined in the standard Energistics property type + * dictionary. + * @param dimensions The dimensions of each value of this property. If this parameter + * is empty, then it is assumed this property is a scalar one. + * + * @returns A pointer to the new discrete property. + */ RESQML2_0_1_NS::DiscreteProperty* createDiscreteProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind); + /** + * Creates a discrete property (which is of a local property kind) into this repository + * + * @exception std::invalid_argument If the default RESQML version is unrecognized. + * @exception std::invalid_argument If @p or @p localPropKind is null. + * + * @param [in] rep The representation on which this property is attached to. It + * cannot be null. + * @param guid The guid to set to the property. If empty then a new guid will be + * generated. + * @param title The title to set to the property. If empty then \"unknown\" title + * will be set. + * @param attachmentKind The topological element on which the property values are attached + * to. + * @param [in] localPropType The property kind of these property values which must be defined + * in the EPC document as a local property kind. It cannot be null. + * @param dimensions The dimensions of each value of this property. If this parameter + * is empty, then it is assumed this property is a scalar one. + * + * @returns A pointer to the new discrete property. + */ RESQML2_NS::DiscreteProperty* createDiscreteProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::PropertyKind * localPropType); @@ -1415,7 +3350,7 @@ import com.f2i_consulting.fesapi.*; * @returns A pointer to the new points property. */ RESQML2_0_1_NS::PointsProperty* createPointsProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind = gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind__length); /** @@ -1440,13 +3375,39 @@ import com.f2i_consulting.fesapi.*; * @returns A pointer to the new points property. */ RESQML2_NS::PointsProperty* createPointsProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title, - unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, RESQML2_NS::AbstractLocal3dCrs* localCrs, + unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, EML2_NS::AbstractLocal3dCrs* localCrs, EML2_NS::PropertyKind * localPropType); //************* ACTIVITIES ***********/ + /** + * @brief Creates an activity template into this repository + * + * @exception std::invalid_argument If the default EML version is unrecognized. + * + * @param guid The guid to set to the activity template. If empty then a new guid will be + * generated. + * @param title The title to set to the activity template. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new activity template. + */ EML2_NS::ActivityTemplate* createActivityTemplate(const std::string & guid, const std::string & title); + /** + * @brief Creates an activity into this repository + * + * @exception std::invalid_argument If the default EML version is unrecognized. + * @exception std::invalid_argument If activityTemplate == nullptr. + * + * @param [in] activityTemplate The activity template on which this activity is based on. + * @param guid The guid to set to the activity. If empty then a new guid + * will be generated. + * @param title The title to set to the activity. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new activity. + */ EML2_NS::Activity* createActivity(EML2_NS::ActivityTemplate* activityTemplate, const std::string & guid, const std::string & title); //*************** WITSML *************/ @@ -1748,23 +3709,62 @@ import com.f2i_consulting.fesapi.*; //************ EML2.3 ****************/ //************************************/ + /** + * Creates a graphical information set into this repository + * + * @param guid The guid to set to the graphical information set. If empty then a new guid will + * be generated. + * @param title The title to set to the graphical information set. If empty then \"unknown\" + * title will be set. + * + * @returns A pointer to the new graphical information set. + */ EML2_NS::GraphicalInformationSet* createGraphicalInformationSet(const std::string & guid, const std::string & title); + /** + * Creates a discrete color map into this repository + * + * @param guid The guid to set to the discrete color map. If empty then a new guid will be + * generated. + * @param title The title to set to the discrete color map. If empty then \"unknown\" title + * will be set. + * + * @returns A pointer to the new discrete color map. + */ RESQML2_NS::DiscreteColorMap* createDiscreteColorMap(const std::string& guid, const std::string& title); + /** + * Creates a continuous color map into this repository + * + * @param guid The guid to set to the continuous color map. If empty then a new + * guid will be generated. + * @param title The title to set to the continuous color map. If empty then + * \"unknown\" title will be set. + * @param interpolationDomain The interpolation domain (the color space). + * @param interpolationMethod The interpolation method. + * + * @returns A pointer to the new continuous color map. + */ RESQML2_NS::ContinuousColorMap* createContinuousColorMap(const std::string& guid, const std::string& title, gsoap_eml2_3::resqml22__InterpolationDomain interpolationDomain, gsoap_eml2_3::resqml22__InterpolationMethod interpolationMethod); #endif //************************************/ //***** STANDARD PROP KIND ***********/ //************************************/ - + + /** + * Gets the property kind mapper if it was given at repository construction time + * + * @returns The property kind mapper, or @c nullptr if no property kind mapper was given at + * repository construction time. + */ RESQML2_0_1_NS::PropertyKindMapper* getPropertyKindMapper() const; //************************************/ //************* WARNINGS *************/ //************************************/ + /** Clears the warnings from the repository */ void clearWarnings(); const std::vector & getWarnings() const; @@ -1876,12 +3876,43 @@ import java.lang.AutoCloseable; class EpcDocument { public: - + + /** + * Constructor + * + * @param fileName Full pathname of the EPC document. + */ EpcDocument(const std::string & fileName); - + + /** + * Sets the EPC document file path which will be used for future serialization and + * deserialization. This method will add the standard @c .epc extension if it is not already + * present. + * + * @exception std::invalid_argument if the HDF5 file error handling cannot be disabled. + * + * @param fp Full pathname of the EPC document. + */ void setFilePath(const std::string & fp); + /** + * Serializes the content of a data object repository into this EPC document. It also allows to + * optionally zip this EPC document. + * + * @param repo A data object repository. + * @param useZip64 (Optional) True to zip the EPC document, else false (default). + */ virtual void serializeFrom(const DataObjectRepository & repo, bool useZip64 = false); + + /** + * Deserializes this package (data objects and relationships) into a data object repository + * + * @param [in,out] repo A data object repository. + * @param hdfPermissionAccess (Optional) The HDF5 file permission access. It is read + * only by default. + * + * @returns An empty string if success otherwise the warning string. + */ virtual std::string deserializeInto(DataObjectRepository & repo, DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY); // JAVA uses autocloseable and consequently cannot use a second "close" method @@ -1891,7 +3922,18 @@ import java.lang.AutoCloseable; #endif void close(); + /** + * Gets the absolute path of the directory where the EPC document is stored. + * + * @returns The EPC document storage directory. + */ std::string getStorageDirectory() const; + + /** + * Gets the name of the EPC document + * + * @returns The name of the EPC document without the @c .epc extension. + */ std::string getName() const; /** @@ -1925,10 +3967,48 @@ import java.lang.AutoCloseable; public : EnumStringMapper(); + /** + * Get the name of a RESQML2.0 property kind as a string based on the property kind enumerated + * value + * + * @param energisticsPropertyKind A RESQML2.0 property kind. + * + * @returns A string corresponding to @p energisticsPropertyKind if successful. The empty string + * if no correspondence is found. + */ std::string getEnergisticsPropertyKindName(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind) const; + + /** + * Get the RESQML2.0 property kind enumerated value from the name of a property kind + * + * @param energisticsPropertyKindName The name of a RESQML2.0 property kind. + * + * @returns The RESQML2.0 property kind enumerated value corresponding to @p + * energisticsPropertyKindName if successful. The most abstract RESQML2.0 property kind + * enumerated value if no correspondence is found. + */ gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind getEnergisticsPropertyKind(const std::string & energisticsPropertyKindName) const; + /** + * Get the name of a RESQML2.0 unit of measure as a string based on the unit of measure + * enumerated value + * + * @param energisticsUom A RESQML2.0 unit of measure. + * + * @returns A string corresponding to @p energisticsUom if successful. The empty string if no + * correspondence is found. + */ std::string getEnergisticsUnitOfMeasureName(gsoap_resqml2_0_1::resqml20__ResqmlUom energisticsUom) const; + + /** + * Get the RESQML2.0 unit of measure enumerated value from the name of a unit of measure + * + * @param energisticsUomName The name of a RESQML2.0 unit of measure. + * + * @returns The RESQML2.0 unit of measure enumerated value corresponding to @p energisticsUomName + * if successful. The Euclidian (no unit of measure) RESQML2.0 unit of measure if no + * correspondence is found. + */ gsoap_resqml2_0_1::resqml20__ResqmlUom getEnergisticsUnitOfMeasure(const std::string & energisticsUomName) const; /** @@ -1951,10 +4031,37 @@ import java.lang.AutoCloseable; */ gsoap_eml2_3::eml23__FacetKind getFacet(const std::string & facet) const; + /** + * Get the name of an EML2.1 length unit of measure as a string based on the unit of measure + * enumerated value + * + * @param witsmlUom An EML2.1 length unit of measure. + * + * @returns A string corresponding to @p witsmlUom if successful. The empty string if no + * correspondence is found. + */ std::string lengthUomToString(gsoap_eml2_3::eml23__LengthUom witsmlUom) const; + /** + * Get the name of an EML2.1 vertical coordinate unit of measure as a string based on the unit + * of measure enumerated value + * + * @param witsmlUom An EML2.1 vertical coordinate unit of measure. + * + * @returns A string corresponding to @p witsmlUom if successful. The empty string if no + * correspondence is found. + */ std::string verticalCoordinateUomToString(gsoap_eml2_3::eml23__VerticalCoordinateUom witsmlUom) const; + /** + * Get the name of an EML2.1 plane angle unit of measure as a string based on the unit of + * measure enumerated value + * + * @param witsmlUom An EML2.1 plane angle unit of measure. + * + * @returns A string corresponding to @p witsmlUom if successful. The empty string if no + * correspondence is found. + */ std::string planeAngleUomToString(gsoap_eml2_3::eml23__PlaneAngleUom witsmlUom) const; }; } diff --git a/swig/swigResqml2Include.i b/swig/swigResqml2Include.i index 4bb88b2d9..c9c6338f6 100644 --- a/swig/swigResqml2Include.i +++ b/swig/swigResqml2Include.i @@ -37,7 +37,6 @@ under the License. %nspace RESQML2_NS::AbstractFeatureInterpretation; %nspace RESQML2_NS::AbstractGridRepresentation; %nspace RESQML2_NS::AbstractIjkGridRepresentation; - %nspace RESQML2_NS::AbstractLocal3dCrs; %nspace RESQML2_NS::AbstractOrganizationInterpretation; %nspace RESQML2_NS::AbstractProperty; %nspace RESQML2_NS::AbstractRepresentation; @@ -73,8 +72,6 @@ under the License. %nspace RESQML2_NS::IjkGridLatticeRepresentation; %nspace RESQML2_NS::IjkGridNoGeometryRepresentation; %nspace RESQML2_NS::IjkGridParametricRepresentation; - %nspace RESQML2_NS::LocalDepth3dCrs; - %nspace RESQML2_NS::LocalTime3dCrs; %nspace RESQML2_NS::MdDatum; %nspace RESQML2_NS::Model; %nspace RESQML2_NS::NonSealedSurfaceFrameworkRepresentation; @@ -1967,59 +1964,59 @@ namespace gsoap_resqml2_0_1 } namespace gsoap_eml2_3 { -enum class resqml22__Shape3d { - sheet = 0, - dyke = 1, - dome = 2, - mushroom = 3, - channel = 4, - delta = 5, - dune = 6, - fan = 7, - reef = 8, - wedge = 9 -}; -enum class resqml22__ContactVerb { - stops = 0, - splits = 1, - crosses = 2 -}; -enum class resqml22__ContactMode { - conformable = 0, - extended = 1, - unconformable = 2 -}; -enum class resqml22__Phase { - aquifer = 0, - gas_x0020cap = 1, - oil_x0020column = 2, - seal = 3 -}; -enum class resqml22__LineRole { - fault_x0020center_x0020line = 0, - pick = 1, - inner_x0020ring = 2, - outer_x0020ring = 3, - trajectory = 4, - interpretation_x0020line = 5, - contact = 6, - depositional_x0020line = 7, - erosion_x0020line = 8, - contour = 9, - pillar = 10, - break_x0020line = 11, - structural_x0020closure = 12, - culture = 13 -}; -enum class eml23__FacetKind { - conditions = 0, - side = 1, - direction = 2, - netgross = 3, - qualifier = 4, - statistics = 5, - what = 6 -}; + enum class resqml22__Shape3d { + sheet = 0, + dyke = 1, + dome = 2, + mushroom = 3, + channel = 4, + delta = 5, + dune = 6, + fan = 7, + reef = 8, + wedge = 9 + }; + enum class resqml22__ContactVerb { + stops = 0, + splits = 1, + crosses = 2 + }; + enum class resqml22__ContactMode { + conformable = 0, + extended = 1, + unconformable = 2 + }; + enum class resqml22__Phase { + aquifer = 0, + gas_x0020cap = 1, + oil_x0020column = 2, + seal = 3 + }; + enum class resqml22__LineRole { + fault_x0020center_x0020line = 0, + pick = 1, + inner_x0020ring = 2, + outer_x0020ring = 3, + trajectory = 4, + interpretation_x0020line = 5, + contact = 6, + depositional_x0020line = 7, + erosion_x0020line = 8, + contour = 9, + pillar = 10, + break_x0020line = 11, + structural_x0020closure = 12, + culture = 13 + }; + enum class eml23__FacetKind { + conditions = 0, + side = 1, + direction = 2, + netgross = 3, + qualifier = 4, + statistics = 5, + what = 6 + }; } namespace RESQML2_NS @@ -2154,64 +2151,19 @@ namespace RESQML2_NS gsoap_eml2_3::resqml22__InterpolationMethod getInterpolationMethod(); std::string getInterpolationMethodAsString(); - }; - -#if defined(SWIGPYTHON) - %rename(Resqml2_AbstractLocal3dCrs) AbstractLocal3dCrs; -#endif - class AbstractLocal3dCrs : public COMMON_NS::AbstractObject - { - public: - double getOriginOrdinal1() const; - double getOriginOrdinal2() const; - double getOriginDepthOrElevation() const; - double getArealRotation() const; - bool isDepthOriented() const; - - bool isProjectedCrsDefinedWithEpsg() const; - bool isProjectedCrsUnknown() const; - const std::string & getProjectedCrsUnknownReason() const; - uint64_t getProjectedCrsEpsgCode() const; - - bool isVerticalCrsDefinedWithEpsg() const; - bool isVerticalCrsUnknown() const; - const std::string & getVerticalCrsUnknownReason() const; - uint64_t getVerticalCrsEpsgCode() const; - - gsoap_resqml2_0_1::eml20__LengthUom getProjectedCrsUnit() const; - std::string getProjectedCrsUnitAsString() const; - gsoap_resqml2_0_1::eml20__LengthUom getVerticalCrsUnit() const; - std::string getVerticalCrsUnitAsString() const; - - gsoap_resqml2_0_1::eml20__AxisOrder2d getAxisOrder() const; - void setAxisOrder(gsoap_resqml2_0_1::eml20__AxisOrder2d axisOrder) const; - }; - -#ifdef SWIGPYTHON - %rename(Resqml2_LocalDepth3dCrs) LocalDepth3dCrs; -#endif - class LocalDepth3dCrs : public AbstractLocal3dCrs - { - public: - }; -#ifdef SWIGPYTHON - %rename(Resqml2_LocalTime3dCrs) LocalTime3dCrs; -#endif - class LocalTime3dCrs : public AbstractLocal3dCrs - { - public: - gsoap_resqml2_0_1::eml20__TimeUom getUnit() const; - std::string getUnitAsString() const; + void setNanHsvColor(double hue, double saturation, double value, double alpha = 1, std::string const& colorTitle = ""); + void setNanRgbColor(double red, double green, double blue, double alpha = 1, std::string const& colorTitle = ""); + void setNanRgbColor(unsigned int red, unsigned int green, unsigned int blue, double alpha = 1, std::string const& colorTitle = ""); }; - + #ifdef SWIGPYTHON - %rename(Resqml2_MdDatum) LocalTime3dCrs; + %rename(Resqml2_MdDatum) MdDatum; #endif class MdDatum : public COMMON_NS::AbstractObject { public: - AbstractLocal3dCrs * getLocalCrs() const; + EML2_NS::AbstractLocal3dCrs * getLocalCrs() const; double getX() const; double getXInGlobalCrs() const; @@ -2789,7 +2741,7 @@ namespace RESQML2_NS * * @returns Null if it fails, else the local CRS associated to the @p patchIndex patch. */ - AbstractLocal3dCrs * getLocalCrs(unsigned int patchIndex); + EML2_NS::AbstractLocal3dCrs * getLocalCrs(unsigned int patchIndex); /** * Set a time index in a time series for all point geometries of all existing patches of this representation. @@ -3158,12 +3110,12 @@ namespace RESQML2_NS double xOrigin, double yOrigin, double zOrigin, double xOffsetInFastestDirection, double yOffsetInFastestDirection, double zOffsetInFastestDirection, double xOffsetInSlowestDirection, double yOffsetInSlowestDirection, double zOffsetInSlowestDirection, - double spacingInFastestDirection, double spacingInSlowestDirection, AbstractLocal3dCrs * localCrs = nullptr); + double spacingInFastestDirection, double spacingInSlowestDirection, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometryAsArray2dOfExplicitZ( double * zValues, unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, - Grid2dRepresentation * supportingGrid2dRepresentation, AbstractLocal3dCrs * localCrs = nullptr, + Grid2dRepresentation * supportingGrid2dRepresentation, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr, unsigned int startIndexI = 0, unsigned int startIndexJ = 0, int indexIncrementI = 1, int indexIncrementJ = 1); @@ -3172,7 +3124,7 @@ namespace RESQML2_NS unsigned int numI, unsigned int numJ, EML2_NS::AbstractHdfProxy* proxy, double originX, double originY, double originZ, double offsetIX, double offsetIY, double offsetIZ, double spacingI, - double offsetJX, double offsetJY, double offsetJZ, double spacingJ, AbstractLocal3dCrs * localCrs = nullptr); + double offsetJX, double offsetJY, double offsetJZ, double spacingJ, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); Grid2dRepresentation* getSupportingRepresentation(); }; @@ -3190,12 +3142,12 @@ namespace RESQML2_NS void pushBackGeometryPatch( unsigned int * nodeCountPerPolyline, double * nodes, uint64_t polylineCount, bool allPolylinesClosedFlag, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); void pushBackGeometryPatch( unsigned int * nodeCountPerPolyline, double * nodes, uint64_t polylineCount, bool * polylineClosedFlags, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); bool areAllPolylinesClosedOfPatch(unsigned int patchIndex) const; bool areAllPolylinesClosedOfAllPatches() const; @@ -3216,7 +3168,7 @@ namespace RESQML2_NS public: void pushBackGeometryPatch( unsigned int xyzPointCount, double * xyzPoints, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs * localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); }; #ifdef SWIGPYTHON @@ -3225,13 +3177,13 @@ namespace RESQML2_NS class PlaneSetRepresentation : public AbstractRepresentation { public: - void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, AbstractLocal3dCrs* localCrs = nullptr); + void pushBackHorizontalPlaneGeometryPatch(double zCoordinate, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); void pushBackTiltedPlaneGeometryPatch( double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, - AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); }; #ifdef SWIGPYTHON @@ -3240,7 +3192,7 @@ namespace RESQML2_NS class PolylineRepresentation : public AbstractRepresentation { public: - void setGeometry(double * points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + void setGeometry(double * points, unsigned int pointCount, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); bool isClosed() const; bool hasALineRole() const; gsoap_eml2_3::resqml22__LineRole getLineRole() const; @@ -3257,7 +3209,7 @@ namespace RESQML2_NS uint64_t getTriangleCountOfAllPatches() const; void getTriangleNodeIndicesOfPatch(unsigned int patchIndex, unsigned int * triangleNodeIndices) const; void getTriangleNodeIndicesOfAllPatches(unsigned int * triangleNodeIndices) const; - void pushBackTrianglePatch(unsigned int nodeCount, double * nodes, unsigned int triangleCount, unsigned int * triangleNodeIndices, EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + void pushBackTrianglePatch(unsigned int nodeCount, double * nodes, unsigned int triangleCount, unsigned int * triangleNodeIndices, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); }; #ifdef SWIGPYTHON @@ -3285,7 +3237,7 @@ namespace RESQML2_NS class NonSealedSurfaceFrameworkRepresentation : public AbstractSurfaceFrameworkRepresentation { public: - void pushBackNonSealedContactRepresentation(unsigned int pointCount, double * points, EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + void pushBackNonSealedContactRepresentation(unsigned int pointCount, double * points, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); }; #ifdef SWIGPYTHON @@ -3549,28 +3501,28 @@ namespace RESQML2_NS void setGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, const std::string& faceIndicesPerCell, const std::string& faceIndicesCumulativeCountPerCell, uint64_t faceCount, const std::string& nodeIndicesPerFace, const std::string& nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, AbstractLocal3dCrs * localCrs = nullptr); + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, EML2_NS::AbstractHdfProxy* proxy, uint64_t * faceIndicesPerCell, uint64_t * faceIndicesCumulativeCountPerCell, uint64_t faceCount, uint64_t * nodeIndicesPerFace, uint64_t * nodeIndicesCumulativeCountPerFace, - gsoap_resqml2_0_1::resqml20__CellShape cellShape, AbstractLocal3dCrs * localCrs = nullptr); + gsoap_resqml2_0_1::resqml20__CellShape cellShape, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setTetrahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, AbstractLocal3dCrs * localCrs = nullptr); + const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setTetrahedraOnlyGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, AbstractLocal3dCrs * localCrs = nullptr); + uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setHexahedraOnlyGeometryUsingExistingDatasets(const std::string& cellFaceIsRightHanded, const std::string& points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, AbstractLocal3dCrs * localCrs = nullptr); + const std::string& faceIndicesPerCell, const std::string& nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setHexahedraOnlyGeometry(uint8_t * cellFaceIsRightHanded, double * points, uint64_t pointCount, uint64_t faceCount, EML2_NS::AbstractHdfProxy* proxy, - uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, AbstractLocal3dCrs * localCrs = nullptr); + uint64_t * faceIndicesPerCell, uint64_t * nodeIndicesPerFace, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); }; #ifdef SWIGPYTHON @@ -4155,7 +4107,7 @@ namespace RESQML2_NS double originX, double originY, double originZ, double directionIX, double directionIY, double directionIZ, double spacingI, double directionJX, double directionJY, double directionJZ, double spacingJ, - double directionKX, double directionKY, double directionKZ, double spacingK, AbstractLocal3dCrs * localCrs = nullptr); + double directionKX, double directionKY, double directionKZ, double spacingK, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void addSeismic3dCoordinatesToPatch( unsigned int patchIndex, @@ -4261,14 +4213,14 @@ namespace RESQML2_NS double const* points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, unsigned int const* pillarOfCoordinateLine = nullptr, unsigned int const* splitCoordinateLineColumnCumulativeCount = nullptr, unsigned int const* splitCoordinateLineColumns = nullptr, - int8_t const* definedPillars = nullptr, AbstractLocal3dCrs * localCrs = nullptr); + int8_t const* definedPillars = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometryAsCoordinateLineNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & points, EML2_NS::AbstractHdfProxy* proxy = nullptr, uint64_t splitCoordinateLineCount = 0, const std::string & pillarOfCoordinateLine = "", const std::string & splitCoordinateLineColumnCumulativeCount = "", const std::string & splitCoordinateLineColumns = "", - const std::string & definedPillars = "", AbstractLocal3dCrs * localCrs = nullptr); + const std::string & definedPillars = "", EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); }; #ifdef SWIGPYTHON @@ -4287,35 +4239,35 @@ namespace RESQML2_NS void setGeometryAsParametricNonSplittedPillarNodes( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double * parameters, double * controlPoints, double * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short * pillarKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs * localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometryAsParametricNonSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs * localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometryAsParametricSplittedPillarNodes( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, bool isRightHanded, double * parameters, double * controlPoints, double * controlPointParameters, unsigned int controlPointMaxCountPerPillar, short * pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, unsigned int * pillarOfCoordinateLine, - unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns, AbstractLocal3dCrs * localCrs = nullptr); + unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__PillarShape mostComplexPillarGeometry, gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointMaxCountPerPillar, const std::string & pillarKind, const std::string & definedPillars, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, AbstractLocal3dCrs * localCrs = nullptr); + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometryAsParametricSplittedPillarNodes(bool isRightHanded, double * parameters, double * controlPoints, double * controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, unsigned int * pillarOfCoordinateLine, - unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns, AbstractLocal3dCrs * localCrs = nullptr); + unsigned int * splitCoordinateLineColumnCumulativeCount, unsigned int * splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); void setGeometryAsParametricSplittedPillarNodesUsingExistingDatasets( gsoap_resqml2_0_1::resqml20__KDirection kDirectionKind, bool isRightHanded, const std::string & parameters, const std::string & controlPoints, const std::string & controlPointParameters, unsigned int controlPointCountPerPillar, short pillarKind, EML2_NS::AbstractHdfProxy* proxy, uint64_t splitCoordinateLineCount, const std::string & pillarOfCoordinateLine, - const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, AbstractLocal3dCrs * localCrs = nullptr); + const std::string & splitCoordinateLineColumnCumulativeCount, const std::string & splitCoordinateLineColumns, EML2_NS::AbstractLocal3dCrs * localCrs = nullptr); }; #ifdef SWIGPYTHON @@ -4844,7 +4796,7 @@ namespace RESQML2_NS */ void setGeometry( uint32_t const * nodeCountPerPolyline, double const * xyzPoints, - EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, RESQML2_NS::AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractHdfProxy* hdfProxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); /** * For each interval of the lines of the representation, gets the index of the grid it is associated to. @@ -7457,7 +7409,7 @@ namespace RESQML2_NS * CRS of the data object repository will be arbitrarily * selected. */ - void setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + void setGeometry(double const* controlPoints, double startMd, double endMd, uint64_t controlPointCount, int lineKind, EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); /** * Sets the geometry of the representation by means of a parametric line with MD information. @@ -7498,7 +7450,7 @@ namespace RESQML2_NS * arbitrarily selected. */ void setGeometry(double const* controlPoints, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); /** * Sets the geometry of the representation by means of a parametric line with MD and tangent @@ -7548,7 +7500,7 @@ namespace RESQML2_NS */ void setGeometry(double const* controlPoints, double const* tangentVectors, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); /** * Sets the geometry of the representation by means of a parametric line with MD and tangent @@ -7598,7 +7550,7 @@ namespace RESQML2_NS */ void setGeometry(double const* controlPoints, double const* inclinations, double const* azimuths, double const* controlPointParameters, uint64_t controlPointCount, int lineKind, - EML2_NS::AbstractHdfProxy* proxy = nullptr, AbstractLocal3dCrs* localCrs = nullptr); + EML2_NS::AbstractHdfProxy* proxy = nullptr, EML2_NS::AbstractLocal3dCrs* localCrs = nullptr); /** * Sets the MD datum of this trajectory. diff --git a/swig/swigResqml2_0_1Include.i b/swig/swigResqml2_0_1Include.i index d3ffebf85..f74c3b57e 100644 --- a/swig/swigResqml2_0_1Include.i +++ b/swig/swigResqml2_0_1Include.i @@ -660,7 +660,7 @@ namespace RESQML2_0_1_NS #if defined(SWIGJAVA) || defined(SWIGPYTHON) %rename(Resqml20_LocalDepth3dCrs) LocalDepth3dCrs; #endif - class LocalDepth3dCrs : public RESQML2_NS::LocalDepth3dCrs + class LocalDepth3dCrs : public EML2_NS::LocalDepth3dCrs { public: }; @@ -668,7 +668,7 @@ namespace RESQML2_0_1_NS #if defined(SWIGJAVA) || defined(SWIGPYTHON) %rename(Resqml20_LocalTime3dCrs) LocalTime3dCrs; #endif - class LocalTime3dCrs : public RESQML2_NS::LocalTime3dCrs + class LocalTime3dCrs : public EML2_NS::LocalTime3dCrs { public: }; diff --git a/swig/swigWitsml2Include.i b/swig/swigWitsml2Include.i index 67618e918..7aba7c676 100644 --- a/swig/swigWitsml2Include.i +++ b/swig/swigWitsml2Include.i @@ -346,10 +346,11 @@ namespace WITSML2_NS * * @exception std::invalid_argument If @p value is undefined. * - * @param value The elevation value. - * @param uom The elevation unit of measure. + * @param value The elevation value. + * @param uom The elevation unit of measure. + * @param verticalCrs The vertical CRS which is used as the datum for the ground elevation */ - virtual void setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom) = 0; + virtual void setGroundElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) = 0; /** * @brief Gets the ground level elevation value @@ -369,6 +370,49 @@ namespace WITSML2_NS */ virtual gsoap_eml2_3::eml23__LengthUom getGroundElevationUom() const = 0; + /** + * Gets the vertical CRS which acts as the datum of this ground elevation. + * + * @returns The vertical CRS which acts as the datum of this ground elevation.. + */ + EML2_3_NS::VerticalCrs* getGroundElevationDatum() const; + + /** + * @brief Sets the well head elevation + * + * @exception std::invalid_argument If @p value is undefined. + * + * @param value The elevation value. + * @param uom The elevation unit of measure. + * @param verticalCrs The vertical CRS which is used as the datum for the well head elevation + */ + virtual void setWellheadElevation(double value, gsoap_eml2_3::eml23__LengthUom uom, EML2_3_NS::VerticalCrs* verticalCrs) = 0; + + /** + * @brief Gets the well head elevation value + * + * @exception std::invalid_argument If the well head elevation does not exist. + * + * @returns The well head elevation value. + */ + virtual double getWellheadElevationValue() const = 0; + + /** + * @brief Gets the well head elevation unit of measure + * + * @exception std::invalid_argument If the well head elevation does not exist. + * + * @returns The well head elevation unit of measure. + */ + virtual gsoap_eml2_3::eml23__LengthUom getWellheadElevationUom() const = 0; + + /** + * Gets the vertical CRS which acts as the datum of this well head elevation. + * + * @returns The vertical CRS which acts as the datum of this well head elevation.. + */ + EML2_3_NS::VerticalCrs* getWellheadElevationDatum() const; + /** * Set the time zone in which the well is located.It is the deviation in hours and minutes from * UTC.This should be the normal time zone at the well and not a seasonally-adjusted value, @@ -413,7 +457,7 @@ namespace WITSML2_NS * * @returns The location projected x coordinate. */ - double getLocationProjectedX(unsigned int locationIndex); + double getLocationProjectedX(uint64_t locationIndex); /** * Gets location projected y coordinate @@ -422,23 +466,23 @@ namespace WITSML2_NS * * @returns The location projected y coordinate. */ - double getLocationProjectedY(unsigned int locationIndex); + double getLocationProjectedY(uint64_t locationIndex); /** * Pushes a back location * - * @param projectedX The projected x coordinate. - * @param projectedY The projected y coordinate. + * @param projectedX The projected x coordinate. + * @param projectedY The projected y coordinate. + * @param crs The CRS of the X and Y coordinates. */ - void pushBackLocation( - double projectedX, - double projectedY); + void pushBackLocation(double projectedX, double projectedY, EML2_3_NS::LocalEngineering2dCrs* crs); /** * Get location count * * @returns An int. - */unsigned int geLocationCount() const; + */ + uint64_t geLocationCount() const; SWIG_GETTER_DATAOBJECTS(RESQML2_NS::WellboreFeature, ResqmlWellboreFeature) SWIG_GETTER_DATAOBJECTS(WITSML2_NS::Wellbore, Wellbore)