fix some compiler warnings
This commit is contained in:
parent
0effea29bd
commit
30883e6487
7 changed files with 43 additions and 39 deletions
|
@ -20,7 +20,7 @@ if(OPENMP_FOUND)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# set compiler flags, see http://stackoverflow.com/questions/7724569/debug-vs-release-in-cmake
|
# set compiler flags, see http://stackoverflow.com/questions/7724569/debug-vs-release-in-cmake
|
||||||
set(CMAKE_CXX_FLAGS "-fopenmp -Ofast -fno-signed-zeros -fno-trapping-math -frename-registers -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2 -I/usr/lib/gcc/x86_64-linux-gnu/4.8/include/ -I/usr/lib/gcc/x86_64-linux-gnu/5/include/")
|
set(CMAKE_CXX_FLAGS "-fopenmp -Ofast -fno-signed-zeros -fno-trapping-math -frename-registers -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -DLOGLEVEL=3")
|
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -DLOGLEVEL=3")
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DLOGLEVEL=2")
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DLOGLEVEL=2")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DLOGLEVEL=2")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DLOGLEVEL=2")
|
||||||
|
@ -33,12 +33,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||||
if ((GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
|
if ((GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8))
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
elseif (GCC_VERSION VERSION_EQUAL 4.6)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
else ()
|
else ()
|
||||||
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.6 or greater.")
|
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.8 or greater!")
|
||||||
endif ()
|
endif ()
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11")
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11")
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8d255970a97c31891277f63ba8b39a3ea2b7e133
|
Subproject commit 3a462c37358da19f10e89f77fb7a277d69c6c4dc
|
|
@ -16,5 +16,5 @@ configure_file (
|
||||||
add_executable(pfaedle ${pfaedle_main})
|
add_executable(pfaedle ${pfaedle_main})
|
||||||
add_library(pfaedle_dep ${pfaedle_SRC})
|
add_library(pfaedle_dep ${pfaedle_SRC})
|
||||||
|
|
||||||
target_include_directories(pfaedle_dep PUBLIC ${PROJECT_SOURCE_DIR}/src/cppgtfs/src)
|
include_directories(pfaedle_dep PUBLIC ${PROJECT_SOURCE_DIR}/src/cppgtfs/src)
|
||||||
target_link_libraries(pfaedle pfaedle_dep util xml configparser ad_cppgtfs ${Boost_LIBRARIES} -lpthread)
|
target_link_libraries(pfaedle pfaedle_dep util xml configparser ad_cppgtfs ${Boost_LIBRARIES} -lpthread)
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Box {
|
||||||
|
|
||||||
bool operator==(const Box<T>& b) const {
|
bool operator==(const Box<T>& b) const {
|
||||||
return getLowerLeft() == b.getLowerLeft() &&
|
return getLowerLeft() == b.getLowerLeft() &&
|
||||||
getUpperRight == b.getUpperRight();
|
getUpperRight() == b.getUpperRight();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const Box<T>& p) const { return !(*this == p); }
|
bool operator!=(const Box<T>& p) const { return !(*this == p); }
|
||||||
|
|
|
@ -96,7 +96,7 @@ inline Point<T> centroid(const Box<T> box) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename Geometry>
|
template <typename T, template <typename> class Geometry>
|
||||||
inline Point<T> centroid(std::vector<Geometry<T>> multigeo) {
|
inline Point<T> centroid(std::vector<Geometry<T>> multigeo) {
|
||||||
Line<T> a;
|
Line<T> a;
|
||||||
for (const auto& g : multigeo) a.push_back(centroid(g));
|
for (const auto& g : multigeo) a.push_back(centroid(g));
|
||||||
|
@ -106,6 +106,7 @@ inline Point<T> centroid(std::vector<Geometry<T>> multigeo) {
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline Point<T> rotate(const Point<T>& p, double deg) {
|
inline Point<T> rotate(const Point<T>& p, double deg) {
|
||||||
|
UNUSED(deg);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +154,7 @@ inline Polygon<T> rotate(Polygon<T> geo, double deg, const Point<T>& c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename Geometry>
|
template <template <typename> class Geometry, typename T>
|
||||||
inline std::vector<Geometry<T>> rotate(std::vector<Geometry<T>> multigeo,
|
inline std::vector<Geometry<T>> rotate(std::vector<Geometry<T>> multigeo,
|
||||||
double deg, const Point<T>& c) {
|
double deg, const Point<T>& c) {
|
||||||
for (size_t i = 0; i < multigeo.size(); i++)
|
for (size_t i = 0; i < multigeo.size(); i++)
|
||||||
|
@ -162,7 +163,7 @@ inline std::vector<Geometry<T>> rotate(std::vector<Geometry<T>> multigeo,
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename Geometry>
|
template <template <typename> class Geometry, typename T>
|
||||||
inline std::vector<Geometry<T>> rotate(std::vector<Geometry<T>> multigeo,
|
inline std::vector<Geometry<T>> rotate(std::vector<Geometry<T>> multigeo,
|
||||||
double deg) {
|
double deg) {
|
||||||
auto c = centroid(multigeo);
|
auto c = centroid(multigeo);
|
||||||
|
@ -201,7 +202,7 @@ inline Polygon<T> move(Polygon<T> geo, T x, T y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename Geometry>
|
template <template <typename> class Geometry, typename T>
|
||||||
inline std::vector<Geometry<T>> move(std::vector<Geometry<T>> multigeo, T x,
|
inline std::vector<Geometry<T>> move(std::vector<Geometry<T>> multigeo, T x,
|
||||||
T y) {
|
T y) {
|
||||||
for (size_t i = 0; i < multigeo.size(); i++)
|
for (size_t i = 0; i < multigeo.size(); i++)
|
||||||
|
@ -382,8 +383,8 @@ inline bool contains(const Polygon<T>& poly, const Line<T>& l) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename GeometryA,
|
template <template <typename> class GeometryA,
|
||||||
template <typename> typename GeometryB>
|
template <typename> class GeometryB, typename T>
|
||||||
inline bool contains(const std::vector<GeometryA<T>>& multigeo,
|
inline bool contains(const std::vector<GeometryA<T>>& multigeo,
|
||||||
const GeometryB<T>& geo) {
|
const GeometryB<T>& geo) {
|
||||||
for (const auto& g : multigeo)
|
for (const auto& g : multigeo)
|
||||||
|
@ -758,6 +759,7 @@ inline std::string getWKT(const std::vector<Polygon<T>>& ls) {
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline double len(const Point<T>& g) {
|
inline double len(const Point<T>& g) {
|
||||||
|
UNUSED(g);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -772,24 +774,28 @@ inline double len(const Line<T>& g) {
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline Point<T> simplify(const Point<T>& g, double d) {
|
inline Point<T> simplify(const Point<T>& g, double d) {
|
||||||
|
UNUSED(d);
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline LineSegment<T> simplify(const LineSegment<T>& g, double d) {
|
inline LineSegment<T> simplify(const LineSegment<T>& g, double d) {
|
||||||
|
UNUSED(d);
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline Box<T> simplify(const Box<T>& g, double d) {
|
inline Box<T> simplify(const Box<T>& g, double d) {
|
||||||
|
UNUSED(d);
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline RotatedBox<T> simplify(const RotatedBox<T>& g, double d) {
|
inline RotatedBox<T> simplify(const RotatedBox<T>& g, double d) {
|
||||||
|
UNUSED(d);
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -935,7 +941,7 @@ inline double parallelity(const Box<T>& box, const MultiLine<T>& multiline) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename Geometry>
|
template <template <typename> class Geometry, typename T>
|
||||||
inline RotatedBox<T> getOrientedEnvelope(Geometry<T> pol) {
|
inline RotatedBox<T> getOrientedEnvelope(Geometry<T> pol) {
|
||||||
// TODO: implement this nicer, works for now, but inefficient
|
// TODO: implement this nicer, works for now, but inefficient
|
||||||
// see
|
// see
|
||||||
|
@ -1016,8 +1022,8 @@ inline Box<T> getBoundingBox(const Box<T>& b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename GeometryA>
|
template <template <typename> class Geometry, typename T>
|
||||||
inline Box<T> getBoundingBox(const std::vector<GeometryA<T>>& multigeo) {
|
inline Box<T> getBoundingBox(const std::vector<Geometry<T>>& multigeo) {
|
||||||
Box<T> b;
|
Box<T> b;
|
||||||
b = extendBox(multigeo, b);
|
b = extendBox(multigeo, b);
|
||||||
return b;
|
return b;
|
||||||
|
@ -1115,7 +1121,7 @@ inline Box<T> extendBox(const LineSegment<T>& ls, Box<T> b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename Geometry>
|
template <template <typename> class Geometry, typename T>
|
||||||
inline Box<T> extendBox(const std::vector<Geometry<T>>& multigeom, Box<T> b) {
|
inline Box<T> extendBox(const std::vector<Geometry<T>>& multigeom, Box<T> b) {
|
||||||
for (const auto& g : multigeom) b = extendBox(g, b);
|
for (const auto& g : multigeom) b = extendBox(g, b);
|
||||||
return b;
|
return b;
|
||||||
|
@ -1176,7 +1182,7 @@ inline double commonArea(const Box<T>& ba, const Box<T>& bb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename T, template <typename> typename Geometry>
|
template <template <typename> class Geometry, typename T>
|
||||||
inline RotatedBox<T> getFullEnvelope(Geometry<T> pol) {
|
inline RotatedBox<T> getFullEnvelope(Geometry<T> pol) {
|
||||||
Point<T> center = centroid(pol);
|
Point<T> center = centroid(pol);
|
||||||
Box<T> tmpBox = getBoundingBox(pol);
|
Box<T> tmpBox = getBoundingBox(pol);
|
||||||
|
|
|
@ -18,7 +18,7 @@ class GridException : public std::runtime_error {
|
||||||
GridException(std::string const& msg) : std::runtime_error(msg) {}
|
GridException(std::string const& msg) : std::runtime_error(msg) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
class Grid {
|
class Grid {
|
||||||
public:
|
public:
|
||||||
// initialization of a point grid with cell width w and cell height h
|
// initialization of a point grid with cell width w and cell height h
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// Author: Patrick Brosi <brosip@informatik.uni-freiburg.de>
|
// Author: Patrick Brosi <brosip@informatik.uni-freiburg.de>
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
Grid<V, G, T>::Grid(bool bldIdx)
|
Grid<V, G, T>::Grid(bool bldIdx)
|
||||||
: _width(0),
|
: _width(0),
|
||||||
_height(0),
|
_height(0),
|
||||||
|
@ -14,16 +14,16 @@ Grid<V, G, T>::Grid(bool bldIdx)
|
||||||
_hasValIdx(bldIdx) {}
|
_hasValIdx(bldIdx) {}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
Grid<V, G, T>::Grid() : Grid<V, G, T>(true) {}
|
Grid<V, G, T>::Grid() : Grid<V, G, T>(true) {}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
Grid<V, G, T>::Grid(double w, double h, const Box<T>& bbox)
|
Grid<V, G, T>::Grid(double w, double h, const Box<T>& bbox)
|
||||||
: Grid<V, G, T>(w, h, bbox, true) {}
|
: Grid<V, G, T>(w, h, bbox, true) {}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
Grid<V, G, T>::Grid(double w, double h, const Box<T>& bbox, bool bValIdx)
|
Grid<V, G, T>::Grid(double w, double h, const Box<T>& bbox, bool bValIdx)
|
||||||
: _cellWidth(fabs(w)),
|
: _cellWidth(fabs(w)),
|
||||||
_cellHeight(fabs(h)),
|
_cellHeight(fabs(h)),
|
||||||
|
@ -55,7 +55,7 @@ Grid<V, G, T>::Grid(double w, double h, const Box<T>& bbox, bool bValIdx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::add(G<T> geom, V val) {
|
void Grid<V, G, T>::add(G<T> geom, V val) {
|
||||||
Box<T> box = getBoundingBox(geom);
|
Box<T> box = getBoundingBox(geom);
|
||||||
size_t swX = getCellXFromX(box.getLowerLeft().getX());
|
size_t swX = getCellXFromX(box.getLowerLeft().getX());
|
||||||
|
@ -74,14 +74,14 @@ void Grid<V, G, T>::add(G<T> geom, V val) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::add(size_t x, size_t y, V val) {
|
void Grid<V, G, T>::add(size_t x, size_t y, V val) {
|
||||||
_grid[x][y].insert(val);
|
_grid[x][y].insert(val);
|
||||||
if (_hasValIdx) _index[val].insert(std::pair<size_t, size_t>(x, y));
|
if (_hasValIdx) _index[val].insert(std::pair<size_t, size_t>(x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::get(const Box<T>& box, std::set<V>* s) const {
|
void Grid<V, G, T>::get(const Box<T>& box, std::set<V>* s) const {
|
||||||
size_t swX = getCellXFromX(box.getLowerLeft().getX());
|
size_t swX = getCellXFromX(box.getLowerLeft().getX());
|
||||||
size_t swY = getCellYFromY(box.getLowerLeft().getY());
|
size_t swY = getCellYFromY(box.getLowerLeft().getY());
|
||||||
|
@ -94,7 +94,7 @@ void Grid<V, G, T>::get(const Box<T>& box, std::set<V>* s) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::get(const G<T>& geom, double d, std::set<V>* s) const {
|
void Grid<V, G, T>::get(const G<T>& geom, double d, std::set<V>* s) const {
|
||||||
Box<T> a = getBoundingBox(geom);
|
Box<T> a = getBoundingBox(geom);
|
||||||
Box<T> b(Point<T>(a.getLowerLeft().getX() - d,
|
Box<T> b(Point<T>(a.getLowerLeft().getX() - d,
|
||||||
|
@ -105,7 +105,7 @@ void Grid<V, G, T>::get(const G<T>& geom, double d, std::set<V>* s) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::get(size_t x, size_t y, std::set<V>* s) const {
|
void Grid<V, G, T>::get(size_t x, size_t y, std::set<V>* s) const {
|
||||||
if (_hasValIdx) {
|
if (_hasValIdx) {
|
||||||
s->insert(_grid[x][y].begin(), _grid[x][y].end());
|
s->insert(_grid[x][y].begin(), _grid[x][y].end());
|
||||||
|
@ -119,7 +119,7 @@ void Grid<V, G, T>::get(size_t x, size_t y, std::set<V>* s) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::remove(V val) {
|
void Grid<V, G, T>::remove(V val) {
|
||||||
if (_hasValIdx) {
|
if (_hasValIdx) {
|
||||||
auto i = _index.find(val);
|
auto i = _index.find(val);
|
||||||
|
@ -137,7 +137,7 @@ void Grid<V, G, T>::remove(V val) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::getNeighbors(const V& val, double d, std::set<V>* s) const {
|
void Grid<V, G, T>::getNeighbors(const V& val, double d, std::set<V>* s) const {
|
||||||
if (!_hasValIdx) throw GridException("No value index build!");
|
if (!_hasValIdx) throw GridException("No value index build!");
|
||||||
auto it = _index.find(val);
|
auto it = _index.find(val);
|
||||||
|
@ -152,7 +152,7 @@ void Grid<V, G, T>::getNeighbors(const V& val, double d, std::set<V>* s) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::getCellNeighbors(const V& val, size_t d,
|
void Grid<V, G, T>::getCellNeighbors(const V& val, size_t d,
|
||||||
std::set<V>* s) const {
|
std::set<V>* s) const {
|
||||||
if (!_hasValIdx) throw GridException("No value index build!");
|
if (!_hasValIdx) throw GridException("No value index build!");
|
||||||
|
@ -165,7 +165,7 @@ void Grid<V, G, T>::getCellNeighbors(const V& val, size_t d,
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
void Grid<V, G, T>::getCellNeighbors(size_t cx, size_t cy, size_t xPerm,
|
void Grid<V, G, T>::getCellNeighbors(size_t cx, size_t cy, size_t xPerm,
|
||||||
size_t yPerm, std::set<V>* s) const {
|
size_t yPerm, std::set<V>* s) const {
|
||||||
size_t swX = xPerm > cx ? 0 : cx - xPerm;
|
size_t swX = xPerm > cx ? 0 : cx - xPerm;
|
||||||
|
@ -182,7 +182,7 @@ void Grid<V, G, T>::getCellNeighbors(size_t cx, size_t cy, size_t xPerm,
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
std::set<std::pair<size_t, size_t> > Grid<V, G, T>::getCells(
|
std::set<std::pair<size_t, size_t> > Grid<V, G, T>::getCells(
|
||||||
const V& val) const {
|
const V& val) const {
|
||||||
if (!_hasValIdx) throw GridException("No value index build!");
|
if (!_hasValIdx) throw GridException("No value index build!");
|
||||||
|
@ -190,7 +190,7 @@ std::set<std::pair<size_t, size_t> > Grid<V, G, T>::getCells(
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
Box<T> Grid<V, G, T>::getBox(size_t x, size_t y) const {
|
Box<T> Grid<V, G, T>::getBox(size_t x, size_t y) const {
|
||||||
Point<T> sw(_bb.getLowerLeft().getX() + x * _cellWidth,
|
Point<T> sw(_bb.getLowerLeft().getX() + x * _cellWidth,
|
||||||
_bb.getLowerLeft().getY() + y * _cellHeight);
|
_bb.getLowerLeft().getY() + y * _cellHeight);
|
||||||
|
@ -200,7 +200,7 @@ Box<T> Grid<V, G, T>::getBox(size_t x, size_t y) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
size_t Grid<V, G, T>::getCellXFromX(double x) const {
|
size_t Grid<V, G, T>::getCellXFromX(double x) const {
|
||||||
float dist = x - _bb.getLowerLeft().getX();
|
float dist = x - _bb.getLowerLeft().getX();
|
||||||
if (dist < 0) dist = 0;
|
if (dist < 0) dist = 0;
|
||||||
|
@ -208,7 +208,7 @@ size_t Grid<V, G, T>::getCellXFromX(double x) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
size_t Grid<V, G, T>::getCellYFromY(double y) const {
|
size_t Grid<V, G, T>::getCellYFromY(double y) const {
|
||||||
float dist = y - _bb.getLowerLeft().getY();
|
float dist = y - _bb.getLowerLeft().getY();
|
||||||
if (dist < 0) dist = 0;
|
if (dist < 0) dist = 0;
|
||||||
|
@ -216,13 +216,13 @@ size_t Grid<V, G, T>::getCellYFromY(double y) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
size_t Grid<V, G, T>::getXWidth() const {
|
size_t Grid<V, G, T>::getXWidth() const {
|
||||||
return _xWidth;
|
return _xWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _____________________________________________________________________________
|
// _____________________________________________________________________________
|
||||||
template <typename V, template <typename> typename G, typename T>
|
template <typename V, template <typename> class G, typename T>
|
||||||
size_t Grid<V, G, T>::getYHeight() const {
|
size_t Grid<V, G, T>::getYHeight() const {
|
||||||
return _yHeight;
|
return _yHeight;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue