2 * SPDX-FileCopyrightText: 2021 Jiri Vlasak <jiri.vlasak.2@cvut.cz>
4 * SPDX-License-Identifier: GPL-3.0-only
16 #define INIT_V vector<M> V;
17 #define P(W) V.push_back(M(#W)); V.back().o.W = true;
22 static unsigned int cntr;
27 bcar::BicycleCar::GenPlotOpts o;
31 this->c.gen_gnuplot_to(this->f, this->o);
39 M(std::string fn) : fn(fn)
41 this->fc = std::to_string(this->cntr++);
42 this->f.open(this->fn + this->fc);
45 M(M const& m) : fn(m.fn), c(m.c), o(m.o)
47 this->fc = std::to_string(this->cntr++);
48 this->f.open(this->fn + this->fc);
55 friend void swap(M& f, M& t)
64 f.f.open(f.fn + f.fc);
65 t.f.open(t.fn + t.fc);
72 unsigned int M::cntr = 0;
75 gpl_slot(bcar::ParkingSlot& s, std::string fn = "")
77 if (fn.compare("") == 0) {
88 gen_pl_script(std::vector<M>& ms, std::string with_slot)
93 f << "#!/usr/bin/gnuplot" << endl;
94 f << "unset key" << endl;
95 f << "set size ratio -1" << endl;
96 if (with_slot.compare("") != 0) {
97 f << "plot '" << with_slot << "' w l,";
102 f << " '" << (m.fn + m.fc) << "'" << " w l,";
105 f << "pause -1" << endl;
116 bcar::ParkingSlot s(bcar::Point(0, 0), 0, 2.5, 6);
120 s.fe(bcar::BicycleCar());
124 for (auto e: s._entries) {
127 LC.st(LC.st() * -1.0);
131 for (unsigned int i = 0; i < STEPS; i++) {
136 gen_pl_script(V, sn);