From 5d2216f2050299f9a1b6eb35eb169236be93a577 Mon Sep 17 00:00:00 2001 From: Markus Bullmann Date: Tue, 31 Jul 2018 15:36:01 +0200 Subject: [PATCH 1/2] Added some MSVC compiler switches --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 712531c..4b21660 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,12 @@ if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio*") -D_USE_MATH_DEFINES -DUNICODE -D_UNICODE + -DNOGDI ) + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") else() # system specific compiler flags ADD_DEFINITIONS( From 3aaa4704223e1bf48583e5840e8713abca1cf38c Mon Sep 17 00:00:00 2001 From: Markus Bullmann Date: Tue, 31 Jul 2018 15:36:18 +0200 Subject: [PATCH 2/2] Added 3D boxKDE --- Settings.h | 8 +++++++- main.cpp | 5 +++-- navMesh/filter.h | 6 ++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Settings.h b/Settings.h index 20a8468..1a9d43e 100644 --- a/Settings.h +++ b/Settings.h @@ -38,9 +38,15 @@ namespace Settings { } namespace KDE { - const Point2 bandwidth(100,100); + const Point2 bandwidth(1,1); + const float gridSize = 0.2; } + namespace KDE3D { + const Point3 bandwidth(1, 1, 1); + const Point3 gridSize(0.2, 0.2, 1); // in meter + } + //const GridPoint destination = GridPoint(70*100, 35*100, 0*100); // use destination const GridPoint destination = GridPoint(0,0,0); // do not use destination diff --git a/main.cpp b/main.cpp index eddb18c..6b3fe5b 100755 --- a/main.cpp +++ b/main.cpp @@ -122,9 +122,10 @@ Stats::Statistics run(Settings::DataSetup setup, int numFile, std::string //auto resample = std::make_unique>(); auto resample = std::make_unique>(); - //auto estimate = std::make_unique>(map, 0.2, Point2(1,1)); + //auto estimate = std::make_unique>(map, Settings::KDE::gridSize, Settings::KDE::bandwidth); //auto estimate = std::make_unique>(); - auto estimate = std::make_unique>(); + //auto estimate = std::make_unique>(); + auto estimate = std::make_unique>(map, Settings::KDE3D::gridSize, Settings::KDE3D::bandwidth); // setup MyFilter pf(numParticles, std::move(init)); diff --git a/navMesh/filter.h b/navMesh/filter.h index f7b65fe..ef306de 100644 --- a/navMesh/filter.h +++ b/navMesh/filter.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,11 @@ struct MyState { return pos.pos.y; } + + float getZ() { + return pos.pos.z; + } + float getBinValue(const int dim) const { switch (dim) { case 0: return this->pos.pos.x;