Skip to content

Commit

Permalink
fixing style #22
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Feb 24, 2024
1 parent dca1aa7 commit f741fae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/microsim/transportables/MSPModel_JuPedSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,11 @@ MSPModel_JuPedSim::preparePolygonForDrawing(const GEOSGeometry* polygon, const s
JPS_Geometry
MSPModel_JuPedSim::buildJPSGeometryFromGEOSGeometry(const GEOSGeometry* polygon) {
// For the moment, JuPedSim only supports one connected component, select the one with max area.
int nbrConnectedComponents = GEOSGetNumGeometries(polygon);
const int nbrConnectedComponents = GEOSGetNumGeometries(polygon);
myMaxAreaConnectedComponentPolygon = nullptr;
double maxArea = 0.0;
double totalArea = 0.0;
for (unsigned int i = 0; i < (unsigned int)nbrConnectedComponents; i++) {
for (int i = 0; i < nbrConnectedComponents; i++) {
const GEOSGeometry* connectedComponentPolygon = GEOSGetGeometryN(polygon, i);
const std::string polygonId = std::string("jupedsim.pedestrian_network.") + std::to_string(i);
double area;
Expand All @@ -877,7 +877,7 @@ MSPModel_JuPedSim::buildJPSGeometryFromGEOSGeometry(const GEOSGeometry* polygon)
nbrConnectedComponents, maxArea / totalArea * 100.0, "%");
}
#ifdef DEBUG_GEOMETRY_GENERATION
dumpGeometry(maxAreaConnectedComponentPolygon, "pedestrianNetwork.wkt");
dumpGeometry(myMaxAreaConnectedComponentPolygon, "pedestrianNetwork.wkt");
#endif
JPS_GeometryBuilder geometryBuilder = JPS_GeometryBuilder_Create();
preparePolygonForJPS(myMaxAreaConnectedComponentPolygon, geometryBuilder);
Expand Down

0 comments on commit f741fae

Please sign in to comment.