Skip to content

Commit

Permalink
ajout assert
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed May 31, 2024
1 parent 3d50c20 commit a4ce85d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/filter_grid_decimation/GridDecimationFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ void GridDecimationFilter::processOne(BOX2D bounds, PointRef& point, PointViewPt
double y = point.getFieldAs<double>(Dimension::Id::Y);
int id = point.getFieldAs<double>(Dimension::Id::PointId);

// if x==xmax of the cell, the point are in the bottom cell
// if y==ymax of the cell, the point are in the right cell

// if x==(xmax of the cell), the point are in the bottom cell
// if y==(ymax of the cell), the point are in the right cell
double d_width_pt = (x - bounds.minx) / m_args->m_edgeLength;
double d_height_pt = (y - bounds.miny) / m_args->m_edgeLength;

int width = static_cast<int>(d_width_pt);
int height = static_cast<int>(d_height_pt);

auto mptRefid = this->grid.find( std::make_pair(width,height) );
assert( mptRefid != this->grid.end() );
auto ptRefid = mptRefid->second;

if (ptRefid==-1)
Expand Down

0 comments on commit a4ce85d

Please sign in to comment.