Skip to content

Commit 77a4895

Browse files
Fix several minor bugs reported by Claude Opus
1 parent 0e51908 commit 77a4895

8 files changed

Lines changed: 109 additions & 118 deletions

File tree

src/common/AbstractObject.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,8 @@ void AbstractObject::readArrayNdOfFloatValues(gsoap_resqml2_0_1::resqml20__Abstr
894894
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DoubleLatticeArray)
895895
{
896896
gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput);
897-
if (latticeArray->Offset.size() > 1) {
898-
throw invalid_argument("The integer lattice array contains more than one offset.");
897+
if (latticeArray->Offset.size() != 1) {
898+
throw invalid_argument("The double lattice array contains zero or more than one offset.");
899899
}
900900
if (latticeArray->StartValue < (std::numeric_limits<float>::min)() || latticeArray->StartValue > (std::numeric_limits<float>::max)()) {
901901
throw out_of_range("The double start value of the lattice array " + std::to_string(latticeArray->StartValue) + " is out of float range value");
@@ -938,7 +938,7 @@ void AbstractObject::readArrayNdOfFloatValues(gsoap_eml2_3::eml23__AbstractFloat
938938
{
939939
gsoap_eml2_3::eml23__FloatingPointLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput);
940940
if (latticeArray->Offset.empty() || latticeArray->Offset.size() > 1) {
941-
throw invalid_argument("The integer lattice array of UUID " + getUuid() + " contains zero or more than one offset.");
941+
throw invalid_argument("The floating point lattice array of UUID " + getUuid() + " contains zero or more than one offset.");
942942
}
943943
if (latticeArray->StartValue < (std::numeric_limits<float>::min)() || latticeArray->StartValue >(std::numeric_limits<float>::max)()) {
944944
throw out_of_range("The double start value of the lattice array " + std::to_string(latticeArray->StartValue) + " is out of float range value");
@@ -998,8 +998,8 @@ void AbstractObject::readArrayNdOfDoubleValues(gsoap_resqml2_0_1::resqml20__Abst
998998
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DoubleLatticeArray)
999999
{
10001000
gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput);
1001-
if (latticeArray->Offset.size() > 1) {
1002-
throw invalid_argument("The integer lattice array contains more than one offset.");
1001+
if (latticeArray->Offset.size() != 1) {
1002+
throw invalid_argument("The double lattice array contains zero or more than one offset.");
10031003
}
10041004

10051005
const double start = latticeArray->StartValue;
@@ -1035,8 +1035,8 @@ void AbstractObject::readArrayNdOfDoubleValues(gsoap_eml2_3::eml23__AbstractFloa
10351035
case SOAP_TYPE_gsoap_eml2_3_eml23__FloatingPointLatticeArray:
10361036
{
10371037
gsoap_eml2_3::eml23__FloatingPointLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput);
1038-
if (latticeArray->Offset.size() > 1) {
1039-
throw invalid_argument("The integer lattice array contains more than one offset.");
1038+
if (latticeArray->Offset.size() != 1) {
1039+
throw invalid_argument("The floating point lattice array contains zero or more than one offset.");
10401040
}
10411041
const double start = latticeArray->StartValue;
10421042
const double step = latticeArray->Offset[0]->Value;
@@ -1410,8 +1410,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_resqml2_0_1::resqml20__AbstractVa
14101410
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray)
14111411
{
14121412
gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*>(arrayInput);
1413-
if (latticeArray->Offset.size() > 1) {
1414-
throw invalid_argument("The integer lattice array contains more than one offset.");
1413+
if (latticeArray->Offset.size() != 1) {
1414+
throw invalid_argument("The integer lattice array contains zero or more than one offset.");
14151415
}
14161416
return latticeArray->Offset[0]->Count + 1;
14171417
}
@@ -1431,8 +1431,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_resqml2_0_1::resqml20__AbstractVa
14311431
else if (soapType == SOAP_TYPE_gsoap_resqml2_0_1_resqml20__DoubleLatticeArray)
14321432
{
14331433
gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput);
1434-
if (latticeArray->Offset.size() > 1) {
1435-
throw invalid_argument("The lattice array contains more than one offset.");
1434+
if (latticeArray->Offset.size() != 1) {
1435+
throw invalid_argument("The double lattice array contains zero or more than one offset.");
14361436
}
14371437
return static_cast<gsoap_resqml2_0_1::resqml20__DoubleLatticeArray const*>(arrayInput)->Offset[0]->Count + 1;
14381438
}
@@ -1481,8 +1481,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_eml2_3::eml23__AbstractValueArray
14811481
else if (soapType == SOAP_TYPE_gsoap_eml2_3_eml23__IntegerLatticeArray)
14821482
{
14831483
gsoap_eml2_3::eml23__IntegerLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__IntegerLatticeArray const*>(arrayInput);
1484-
if (latticeArray->Offset.size() > 1) {
1485-
throw invalid_argument("The lattice array contains more than one offset.");
1484+
if (latticeArray->Offset.size() != 1) {
1485+
throw invalid_argument("The integer lattice array contains zero or more than one offset.");
14861486
}
14871487
return latticeArray->Offset[0]->Count + 1ull;
14881488
}
@@ -1507,8 +1507,8 @@ uint64_t AbstractObject::getCountOfArray(gsoap_eml2_3::eml23__AbstractValueArray
15071507
else if (soapType == SOAP_TYPE_gsoap_eml2_3_eml23__FloatingPointLatticeArray)
15081508
{
15091509
gsoap_eml2_3::eml23__FloatingPointLatticeArray const* latticeArray = static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput);
1510-
if (latticeArray->Offset.size() > 1) {
1511-
throw invalid_argument("The lattice array contains more than one offset.");
1510+
if (latticeArray->Offset.size() != 1) {
1511+
throw invalid_argument("The floating point lattice array contains zero or more than one offset.");
15121512
}
15131513
return static_cast<gsoap_eml2_3::eml23__FloatingPointLatticeArray const*>(arrayInput)->Offset[0]->Count + 1;
15141514
}

src/common/AbstractObject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,8 @@ namespace COMMON_NS
866866
case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray:
867867
{
868868
gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const* latticeArray = static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*>(arrayInput);
869-
if (latticeArray->Offset.size() > 1) {
870-
throw std::invalid_argument("The integer lattice array contains more than one offset.");
869+
if (latticeArray->Offset.size() != 1) {
870+
throw std::invalid_argument("The integer lattice array contains zero or more than one offset.");
871871
}
872872
if constexpr (std::is_signed_v<T>) {
873873
if (latticeArray->StartValue < (std::numeric_limits<T>::min)() || latticeArray->Offset[0]->Value < (std::numeric_limits<T>::min)()) {

src/eml2/AbstractLocal3dCrs.cpp

Lines changed: 53 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,50 @@ void AbstractLocal3dCrs::convertXyzPointsToGlobalCrs(double * xyzPoints, uint64_
5959
}
6060
}
6161

62+
EML2_3_NS::LocalEngineering2dCrs& AbstractLocal3dCrs::getAssociatedLocalEngineering2dCrs() const
63+
{
64+
if (gsoapProxy2_3 == nullptr) {
65+
throw logic_error("A non EML2.3 CRS cannot have an associated LocalEngineering2dCrs.");
66+
}
67+
68+
auto const* gsoapLocalEngineering2dCrs = static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs;
69+
if (gsoapLocalEngineering2dCrs == nullptr) {
70+
throw logic_error("The EML2.3 CRS has not an associated LocalEngineering2dCrs.");
71+
}
72+
73+
if (auto* ptr = getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(gsoapLocalEngineering2dCrs->Uuid)) {
74+
return *ptr;
75+
}
76+
77+
throw logic_error("The associated LocalEngineering2dCrs was not found in the dataobject repository");
78+
}
79+
80+
EML2_3_NS::VerticalCrs& AbstractLocal3dCrs::getAssociatedVerticalCrs() const
81+
{
82+
if (gsoapProxy2_3 == nullptr) {
83+
throw logic_error("A non EML2.3 CRS cannot have an associated VerticalCrs.");
84+
}
85+
86+
auto const* gsoapVerticalCrs = static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->VerticalCrs;
87+
if (gsoapVerticalCrs == nullptr) {
88+
throw logic_error("The EML2.3 CRS has not an associated VerticalCrs.");
89+
}
90+
91+
if (auto* ptr = getRepository()->getDataObjectByUuid<EML2_3_NS::VerticalCrs>(gsoapVerticalCrs->Uuid)) {
92+
return *ptr;
93+
}
94+
95+
throw logic_error("The associated LocalEngineering2dCrs was not found in the dataobject repository");
96+
}
97+
6298
double AbstractLocal3dCrs::getOriginOrdinal1() const
6399
{
64100
cannotBePartial();
65101

66102
if (gsoapProxy2_0_1 != nullptr) {
67103
return static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->XOffset;
68104
}
69-
else if (gsoapProxy2_3 != nullptr) {
70-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getOriginOrdinal1();
71-
}
72-
73-
throw logic_error("Not implemented yet.");
105+
else return getAssociatedLocalEngineering2dCrs().getOriginOrdinal1();
74106
}
75107

76108
double AbstractLocal3dCrs::getOriginOrdinal2() const
@@ -80,11 +112,7 @@ double AbstractLocal3dCrs::getOriginOrdinal2() const
80112
if (gsoapProxy2_0_1 != nullptr) {
81113
return static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->YOffset;
82114
}
83-
else if (gsoapProxy2_3 != nullptr) {
84-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getOriginOrdinal2();
85-
}
86-
87-
throw logic_error("Not implemented yet.");
115+
else return getAssociatedLocalEngineering2dCrs().getOriginOrdinal2();
88116
}
89117

90118
double AbstractLocal3dCrs::getOriginDepthOrElevation() const
@@ -108,11 +136,7 @@ double AbstractLocal3dCrs::getArealRotation() const
108136
if (gsoapProxy2_0_1 != nullptr) {
109137
return static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->ArealRotation->__item;
110138
}
111-
else if (gsoapProxy2_3 != nullptr) {
112-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getAzimuth();
113-
}
114-
115-
throw logic_error("Not implemented yet.");
139+
else return getAssociatedLocalEngineering2dCrs().getAzimuth();
116140
}
117141

118142
gsoap_resqml2_0_1::eml20__PlaneAngleUom AbstractLocal3dCrs::getArealRotationUom() const
@@ -155,11 +179,7 @@ bool AbstractLocal3dCrs::isProjectedCrsDefinedWithEpsg() const
155179
if (gsoapProxy2_0_1 != nullptr) {
156180
return static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->ProjectedCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__ProjectedCrsEpsgCode;
157181
}
158-
else if (gsoapProxy2_3 != nullptr) {
159-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->isProjectedCrsDefinedWithEpsg();
160-
}
161-
162-
throw logic_error("Not implemented yet.");
182+
else return getAssociatedLocalEngineering2dCrs().isProjectedCrsDefinedWithEpsg();
163183
}
164184

165185
bool AbstractLocal3dCrs::isProjectedCrsDefinedWithWkt() const
@@ -177,11 +197,7 @@ bool AbstractLocal3dCrs::isProjectedCrsDefinedWithWkt() const
177197
}
178198
return false;
179199
}
180-
else if (gsoapProxy2_3 != nullptr) {
181-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->isProjectedCrsDefinedWithWkt();
182-
}
183-
184-
throw logic_error("Not implemented yet.");
200+
else return getAssociatedLocalEngineering2dCrs().isProjectedCrsDefinedWithWkt();
185201
}
186202

187203
bool AbstractLocal3dCrs::isProjectedCrsUnknown() const
@@ -192,11 +208,7 @@ bool AbstractLocal3dCrs::isProjectedCrsUnknown() const
192208
return static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->ProjectedCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__ProjectedUnknownCrs &&
193209
!isProjectedCrsDefinedWithWkt();
194210
}
195-
else if (gsoapProxy2_3 != nullptr) {
196-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->isProjectedCrsUnknown();
197-
}
198-
199-
throw logic_error("Not implemented yet.");
211+
else return getAssociatedLocalEngineering2dCrs().isProjectedCrsUnknown();
200212
}
201213

202214
std::string AbstractLocal3dCrs::getProjectedCrsUnknownReason() const
@@ -209,11 +221,7 @@ std::string AbstractLocal3dCrs::getProjectedCrsUnknownReason() const
209221
if (gsoapProxy2_0_1 != nullptr) {
210222
return static_cast<gsoap_resqml2_0_1::eml20__ProjectedUnknownCrs*>(static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->ProjectedCrs)->Unknown;
211223
}
212-
else if (gsoapProxy2_3 != nullptr) {
213-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getProjectedCrsUnknownReason();
214-
}
215-
216-
throw logic_error("Not implemented yet.");
224+
else return getAssociatedLocalEngineering2dCrs().getProjectedCrsUnknownReason();
217225
}
218226

219227
std::string AbstractLocal3dCrs::getProjectedCrsWkt() const
@@ -230,11 +238,7 @@ std::string AbstractLocal3dCrs::getProjectedCrsWkt() const
230238
}
231239
}
232240
}
233-
else if (gsoapProxy2_3 != nullptr) {
234-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getProjectedCrsWkt();
235-
}
236-
237-
throw logic_error("Not implemented yet.");
241+
else return getAssociatedLocalEngineering2dCrs().getProjectedCrsWkt();
238242
}
239243

240244
uint64_t AbstractLocal3dCrs::getProjectedCrsEpsgCode() const
@@ -247,11 +251,7 @@ uint64_t AbstractLocal3dCrs::getProjectedCrsEpsgCode() const
247251
if (gsoapProxy2_0_1 != nullptr) {
248252
return static_cast<gsoap_resqml2_0_1::eml20__ProjectedCrsEpsgCode*>(static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->ProjectedCrs)->EpsgCode;
249253
}
250-
else if (gsoapProxy2_3 != nullptr) {
251-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getProjectedCrsEpsgCode();
252-
}
253-
254-
throw logic_error("Not implemented yet.");
254+
else return getAssociatedLocalEngineering2dCrs().getProjectedCrsEpsgCode();
255255
}
256256

257257
bool AbstractLocal3dCrs::isVerticalCrsDefinedWithEpsg() const
@@ -261,11 +261,7 @@ bool AbstractLocal3dCrs::isVerticalCrsDefinedWithEpsg() const
261261
if (gsoapProxy2_0_1 != nullptr) {
262262
return static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->VerticalCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__VerticalCrsEpsgCode;
263263
}
264-
else if (gsoapProxy2_3 != nullptr) {
265-
return getRepository()->getDataObjectByUuid<EML2_3_NS::VerticalCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->VerticalCrs->Uuid)->isVerticalCrsDefinedWithEpsg();
266-
}
267-
268-
throw logic_error("Not implemented yet.");
264+
else return getAssociatedVerticalCrs().isVerticalCrsDefinedWithEpsg();
269265
}
270266

271267
bool AbstractLocal3dCrs::isVerticalCrsDefinedWithWkt() const
@@ -283,11 +279,7 @@ bool AbstractLocal3dCrs::isVerticalCrsDefinedWithWkt() const
283279
}
284280
return false;
285281
}
286-
else if (gsoapProxy2_3 != nullptr) {
287-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->isProjectedCrsDefinedWithWkt();
288-
}
289-
290-
throw logic_error("Not implemented yet.");
282+
else return getAssociatedVerticalCrs().isVerticalCrsDefinedWithWkt();
291283
}
292284

293285
bool AbstractLocal3dCrs::isVerticalCrsUnknown() const
@@ -297,11 +289,7 @@ bool AbstractLocal3dCrs::isVerticalCrsUnknown() const
297289
if (gsoapProxy2_0_1 != nullptr) {
298290
return static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->VerticalCrs->soap_type() == SOAP_TYPE_gsoap_resqml2_0_1_eml20__VerticalUnknownCrs;
299291
}
300-
else if (gsoapProxy2_3 != nullptr) {
301-
return getRepository()->getDataObjectByUuid<EML2_3_NS::VerticalCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->VerticalCrs->Uuid)->isVerticalCrsUnknown();
302-
}
303-
304-
throw logic_error("Not implemented yet.");
292+
else return getAssociatedVerticalCrs().isVerticalCrsUnknown();
305293
}
306294

307295
std::string AbstractLocal3dCrs::getVerticalCrsUnknownReason() const
@@ -315,11 +303,7 @@ std::string AbstractLocal3dCrs::getVerticalCrsUnknownReason() const
315303
if (gsoapProxy2_0_1 != nullptr) {
316304
return static_cast<gsoap_resqml2_0_1::eml20__VerticalUnknownCrs*>(static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->VerticalCrs)->Unknown;
317305
}
318-
else if (gsoapProxy2_3 != nullptr) {
319-
return getRepository()->getDataObjectByUuid<EML2_3_NS::VerticalCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->VerticalCrs->Uuid)->getVerticalCrsUnknownReason();
320-
}
321-
322-
throw logic_error("Not implemented yet.");
306+
else return getAssociatedVerticalCrs().getVerticalCrsUnknownReason();
323307
}
324308

325309
std::string AbstractLocal3dCrs::getVerticalCrsWkt() const
@@ -336,11 +320,7 @@ std::string AbstractLocal3dCrs::getVerticalCrsWkt() const
336320
}
337321
}
338322
}
339-
else if (gsoapProxy2_3 != nullptr) {
340-
return getRepository()->getDataObjectByUuid<EML2_3_NS::VerticalCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->VerticalCrs->Uuid)->getVerticalCrsWkt();
341-
}
342-
343-
throw logic_error("Not implemented yet.");
323+
else return getAssociatedVerticalCrs().getVerticalCrsWkt();
344324
}
345325

346326
uint64_t AbstractLocal3dCrs::getVerticalCrsEpsgCode() const
@@ -354,11 +334,7 @@ uint64_t AbstractLocal3dCrs::getVerticalCrsEpsgCode() const
354334
if (gsoapProxy2_0_1 != nullptr) {
355335
return static_cast<gsoap_resqml2_0_1::eml20__VerticalCrsEpsgCode*>(static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->VerticalCrs)->EpsgCode;
356336
}
357-
else if (gsoapProxy2_3 != nullptr) {
358-
return getRepository()->getDataObjectByUuid<EML2_3_NS::VerticalCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->VerticalCrs->Uuid)->getVerticalCrsEpsgCode();
359-
}
360-
361-
throw logic_error("Not implemented yet.");
337+
else return getAssociatedVerticalCrs().getVerticalCrsEpsgCode();
362338
}
363339

364340
gsoap_resqml2_0_1::eml20__LengthUom AbstractLocal3dCrs::getProjectedCrsUnit() const
@@ -387,11 +363,7 @@ string AbstractLocal3dCrs::getProjectedCrsUnitAsString() const
387363
if (gsoapProxy2_0_1 != nullptr) {
388364
return gsoap_resqml2_0_1::soap_eml20__LengthUom2s(gsoapProxy2_0_1->soap, static_cast<gsoap_resqml2_0_1::resqml20__AbstractLocal3dCrs*>(gsoapProxy2_0_1)->ProjectedUom);
389365
}
390-
else if (gsoapProxy2_3 != nullptr) {
391-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getProjectedCrsUnitAsString();
392-
}
393-
394-
throw logic_error("Not implemented yet.");
366+
else return getAssociatedLocalEngineering2dCrs().getProjectedCrsUnitAsString();
395367
}
396368

397369
gsoap_resqml2_0_1::eml20__LengthUom AbstractLocal3dCrs::getVerticalCrsUnit() const
@@ -446,11 +418,7 @@ gsoap_eml2_3::eml23__AxisOrder2d AbstractLocal3dCrs::getAxisOrder() const
446418
}
447419
return result;
448420
}
449-
else if (gsoapProxy2_3 != nullptr) {
450-
return getRepository()->getDataObjectByUuid<EML2_3_NS::LocalEngineering2dCrs>(static_cast<gsoap_eml2_3::eml23__LocalEngineeringCompoundCrs*>(gsoapProxy2_3)->LocalEngineering2dCrs->Uuid)->getAxisOrder();
451-
}
452-
453-
throw logic_error("Not implemented yet.");
421+
else return getAssociatedLocalEngineering2dCrs().getAxisOrder();
454422
}
455423

456424
void AbstractLocal3dCrs::setAxisOrder(gsoap_eml2_3::eml23__AxisOrder2d axisOrder) const

src/eml2/AbstractLocal3dCrs.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ under the License.
2020

2121
#include "../common/AbstractObject.h"
2222

23+
namespace EML2_3_NS
24+
{
25+
class LocalEngineering2dCrs;
26+
class VerticalCrs;
27+
}
28+
2329
namespace EML2_NS
2430
{
2531
/** @brief Proxy class for an abstract local 3D coordinate reference system (CRS). */
@@ -298,5 +304,9 @@ namespace EML2_NS
298304
* @returns The z coordinate offset.
299305
*/
300306
virtual double getZOffset() const = 0;
307+
308+
private:
309+
EML2_3_NS::LocalEngineering2dCrs& getAssociatedLocalEngineering2dCrs() const;
310+
EML2_3_NS::VerticalCrs& getAssociatedVerticalCrs() const;
301311
};
302312
}

0 commit comments

Comments
 (0)