current TeX and code

This commit is contained in:
2017-05-08 14:38:14 +02:00
parent ea887af537
commit 7021034e6d
8 changed files with 107 additions and 43 deletions

View File

@@ -443,10 +443,26 @@ void plotAllFingerprints(Floorplan::IndoorMap* map) {
}
using Walk = std::vector<Point3>;
float getLength(const Walk& walk) {
float len = 0;
for (size_t i = 0; i < walk.size()-1; ++i) {
const Point3 p1 = walk[i+0];
const Point3 p2 = walk[i+1];
const float dist = p1.getDistance(p2);
len += dist;
}
return len;
}
/** show all walked paths */
void plotAllWalks(Floorplan::IndoorMap* map) {
using Walk = std::vector<Point3>;
Walk path1 = FloorplanHelper::getGroundTruth(map, Settings::GroundTruth::path1);
Walk path2 = FloorplanHelper::getGroundTruth(map, Settings::GroundTruth::path2);
@@ -456,6 +472,12 @@ void plotAllWalks(Floorplan::IndoorMap* map) {
Walk path_toni_inst_2 = FloorplanHelper::getGroundTruth(map, Settings::GroundTruth::path_toni_inst_2);
Walk path_toni_inst_3 = FloorplanHelper::getGroundTruth(map, Settings::GroundTruth::path_toni_inst_3);
std::cout << "path1: " << getLength(path1) << std::endl;
std::cout << "path2: " << getLength(path2) << std::endl;
std::cout << "inst_1: " << getLength(path_toni_inst_1) << std::endl;
std::cout << "inst_2: " << getLength(path_toni_inst_2) << std::endl;
std::cout << "inst_3: " << getLength(path_toni_inst_3) << std::endl;
const std::vector<Walk> walks = {
path1,
path2,
@@ -481,9 +503,14 @@ void plotAllWalks(Floorplan::IndoorMap* map) {
p->addStartIndicator(walk[0], colors[i]);
K::GnuplotSplotElementLines* line = new K::GnuplotSplotElementLines();
line->getStroke().setWidth(2);
line->getStroke().setWidth(4);
line->getStroke().getColor().setHexStr(colors[i]);
line->setTitle(titles[i]);
if (i == 4) {
line->getStroke().setType(K::GnuplotDashtype::DOTTED);
}
//line->getStroke().setType( (i > 3) ? K::GnuplotDashtype::DASHED : K::GnuplotDashtype::SOLID );
float oy = 0;
@@ -500,7 +527,7 @@ void plotAllWalks(Floorplan::IndoorMap* map) {
p->splot.getKey().setVisible(true);
//p->splot.getKey().setPosition(K::GnuplotKey::Hor::RIGHT, K::GnuplotKey::Ver::TOP);
p->splot.getKey().setPosition(K::GnuplotCoordinate2(0.99, 0.99, K::GnuplotCoordinateSystem::SCREEN));
p->splot.getKey().setSampleLength(0.5);
p->splot.getKey().setSampleLength(1.0);
//p->splot.getKey().setWidthIncrement(-4);
p->splot.setStringMod(new K::GnuplotStringModLaTeX());
@@ -1227,9 +1254,9 @@ int main(void) {
Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile(Settings::fMap);
//plotAllWalks(map);
plotAllWalks(map);
compareAll();
//compareAll();
return 0;