worked on 2D/3D raytracing
adjusted BVH improved 2D/3D BVH new bounding volumes new test cases renamed some test-cases for grouping reasons made GPC header-only using slight adjustments
This commit is contained in:
37
tests/ray/TestRayTrace2.cpp
Normal file
37
tests/ray/TestRayTrace2.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifdef WITH_TESTS
|
||||
|
||||
#include "../Tests.h"
|
||||
#include "../../wifi/estimate/ray2d/WiFiRayTrace2D.h"
|
||||
#include "../../floorplan/v2/FloorplanReader.h"
|
||||
#include <fstream>
|
||||
|
||||
TEST(RayTrace2, test) {
|
||||
|
||||
//std::string file = "/mnt/data/workspaces/raytest2.xml";
|
||||
//Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(file);
|
||||
//Floorplan::AccessPoint* ap = map->floors[0]->accesspoints[0];
|
||||
|
||||
//std::string file = "/apps/SHL39.xml";
|
||||
std::string file = "/mnt/data/workspaces/IndoorMap/maps/SHL39.xml";
|
||||
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(file);
|
||||
Floorplan::Floor* floor = map->floors[0];
|
||||
Floorplan::AccessPoint* ap = floor->accesspoints[4];
|
||||
|
||||
// ModelFactory fac(map);
|
||||
// std::ofstream outOBJ("/tmp/vm/map.obj");
|
||||
// outOBJ << fac.toOBJ();
|
||||
// outOBJ.close();
|
||||
|
||||
const int gs_cm = 50;
|
||||
|
||||
WiFiRaytrace2D rt(floor, gs_cm, ap->pos.xy());
|
||||
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> start = std::chrono::high_resolution_clock::now();
|
||||
const DataMapSignal& dms = rt.estimate();
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> end = std::chrono::high_resolution_clock::now();
|
||||
auto result = std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count();
|
||||
std::cout << "it took: " << result << " msec" << std::endl;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user