source
newtonian
test_2d
clip_grid.cpp
1
#include <boost/foreach.hpp>
2
#include "
clip_grid.hpp
"
3
4
vector<Vector2D>
clip_grid
(
const
Shape2D
& shape,
5
const
vector<Vector2D>& original)
6
{
7
vector<Vector2D> res;
8
BOOST_FOREACH(
Vector2D
point, original)
9
{
10
if
(shape(point))
11
res.push_back(point);
12
}
13
return
res;
14
}
clip_grid
vector< Vector2D > clip_grid(const Shape2D &shape, const vector< Vector2D > &original)
Removes all the points outside a shape.
Definition:
clip_grid.cpp:4
Vector2D
2D Mathematical vector
Definition:
geometry.hpp:15
Shape2D
Abstract type for a two dimensional shape.
Definition:
shape_2d.hpp:12
clip_grid.hpp
A function that removes all points outside a shape.
Generated on Thu Jun 4 2020 18:12:15 by
1.8.13