Skip to content

Commit

Permalink
additional diagnostics for #685
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenHilferink committed Mar 18, 2024
1 parent 555e8d6 commit 1b8e0ed
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 38 deletions.
2 changes: 1 addition & 1 deletion BuildSignAndCreateSetup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cls

set DMS_VERSION_MAJOR=14
set DMS_VERSION_MINOR=14
set DMS_VERSION_PATCH=0
set DMS_VERSION_PATCH=1

set geodms_rootdir=%cd%

Expand Down
86 changes: 51 additions & 35 deletions geo/dll/src/BoostGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "mci/ValueClass.h"
#include "mci/ValueWrap.h"
#include "utl/TypeListOper.h"
#include "xct/DmsException.h"

#include "ParallelTiles.h"

Expand Down Expand Up @@ -939,43 +940,50 @@ struct BufferSinglePolygonOperator : public AbstrBufferOperator

while (true)
{
if (!e2IsVoid)
bufferDistance = bufDistData[i];
if (!e3IsVoid)
pointsPerCircle = ppcData[i];
boost::geometry::strategy::buffer::distance_symmetric<Float64> distStrategy(bufferDistance);
boost::geometry::strategy::buffer::join_round joinStrategy(pointsPerCircle);
boost::geometry::strategy::buffer::end_round endStrategy(pointsPerCircle);
boost::geometry::strategy::buffer::point_circle circleStrategy(pointsPerCircle);
boost::geometry::strategy::buffer::side_straight sideStrategy;

std::vector<DPoint> ringClosurePoints;
boost::geometry::model::ring<DPoint> helperRing;
try {
if (!e2IsVoid)
bufferDistance = bufDistData[i];
if (!e3IsVoid)
pointsPerCircle = ppcData[i];
boost::geometry::strategy::buffer::distance_symmetric<Float64> distStrategy(bufferDistance);
boost::geometry::strategy::buffer::join_round joinStrategy(pointsPerCircle);
boost::geometry::strategy::buffer::end_round endStrategy(pointsPerCircle);
boost::geometry::strategy::buffer::point_circle circleStrategy(pointsPerCircle);
boost::geometry::strategy::buffer::side_straight sideStrategy;

std::vector<DPoint> ringClosurePoints;
boost::geometry::model::ring<DPoint> helperRing;

using bg_polygon_t = boost::geometry::model::polygon<DPoint>;
bg_polygon_t currPoly;
boost::geometry::model::multi_polygon<bg_polygon_t> resMP;

nextPointWithSameResRing:

assign_polygon(currPoly, polyData[i], true, helperRing);
if (!currPoly.outer().empty())
{

using bg_polygon_t = boost::geometry::model::polygon<DPoint>;
bg_polygon_t currPoly;
boost::geometry::model::multi_polygon<bg_polygon_t> resMP;
auto lb = MaxValue<DPoint>();
MakeLowerBound(lb, currPoly);
move(currPoly, -lb);

nextPointWithSameResRing:
boost::geometry::buffer(currPoly, resMP
, distStrategy, sideStrategy, joinStrategy, endStrategy, circleStrategy);
move(resMP, lb);

assign_polygon(currPoly, polyData[i], true, helperRing);
if (!currPoly.outer().empty())
store_multi_polygon(resData[i], resMP, ringClosurePoints);
}
if (++i == n)
break;
if (e2IsVoid && e3IsVoid)
goto nextPointWithSameResRing;
}
catch (DmsException& e)
{

auto lb = MaxValue<DPoint>();
MakeLowerBound(lb, currPoly);
move(currPoly, -lb);

boost::geometry::buffer(currPoly, resMP
, distStrategy, sideStrategy, joinStrategy, endStrategy, circleStrategy);
move(resMP, lb);

store_multi_polygon(resData[i], resMP, ringClosurePoints);
e.AsErrMsg()->TellExtraF("BufferSinglePolygonOperator::Calculate tile %d, offset %d", t, i);
throw;
}
if (++i == n)
break;
if (e2IsVoid && e3IsVoid)
goto nextPointWithSameResRing;
}
}
};
Expand Down Expand Up @@ -1078,10 +1086,18 @@ struct OuterSingePolygonOperator : public AbstrOuterOperator

for (SizeT i = 0, n = polyData.size(); i != n; ++i)
{
assign_polygon(currPoly, polyData[i], false, helperRing);
try {
assign_polygon(currPoly, polyData[i], false, helperRing);

if (!currPoly.outer().empty())
store_ring(resData[i], currPoly.outer());
}
catch (DmsException& e)
{
e.AsErrMsg()->TellExtraF("OuterSingePolygonOperator::Calculate tile %d, offset %d", t, i);
throw;
}

if (!currPoly.outer().empty())
store_ring(resData[i], currPoly.outer());
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion rtc/dll/src/RtcGeneratedVersion.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define DMS_VERSION_MAJOR 14
#define DMS_VERSION_MINOR 14
#define DMS_VERSION_PATCH 0
#define DMS_VERSION_PATCH 1
2 changes: 1 addition & 1 deletion tic/dll/src/Xml/XmlTreeOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ const TreeItem* GetExprOrSourceDescrAndReturnSourceItem(OutStreamBase& stream, c
if (!ti->HasCalculator())
{
const TreeItem* storageParent = ti->GetStorageParent(false);
if (storageParent)
if (storageParent && (IsUnit(ti) || IsDataItem(ti)))
{
const AbstrStorageManager* sm = storageParent->GetStorageManager();
dms_assert(sm); // because of POSTCONDITION of GetStorageParant
Expand Down

0 comments on commit 1b8e0ed

Please sign in to comment.