From: Jiri Vlasak Date: Thu, 20 Jan 2022 18:18:10 +0000 (+0100) Subject: Rename entries to ispaths X-Git-Tag: v0.9.0~2^2~4 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/hubacji1/bcar.git/commitdiff_plain/bb03217d452d66cb67d85fb0d3846399cbd0c2ae Rename entries to ispaths In-slot paths is better name as the variable is a vector of vectors. Moreover, entries will be used for just entries in the following patches. --- diff --git a/incl/pslot.hh b/incl/pslot.hh index 7cf2b42..5423412 100644 --- a/incl/pslot.hh +++ b/incl/pslot.hh @@ -32,7 +32,7 @@ private: Line _curb; Line _front; public: - std::vector> _entries; + std::vector> _ispaths; /*! \brief Set parking slot. \param p Point with `x`, `y` coordinates of entry side's corner. diff --git a/src/entry_positions_range.cc b/src/entry_positions_range.cc index e0e18d2..a868570 100644 --- a/src/entry_positions_range.cc +++ b/src/entry_positions_range.cc @@ -52,10 +52,10 @@ int main(int argc, char** argv) double d = 0; double fd = 0; unsigned int cd = 0; - if (s._entries.size() > 0) { - for (unsigned int i = 1; i < s._entries.size(); i++) { - double dd = std::abs(s._entries[i].front().h() - - s._entries[i - 1].front().h()); + if (s._ispaths.size() > 0) { + for (unsigned int i = 1; i < s._ispaths.size(); i++) { + double dd = std::abs(s._ispaths[i].front().h() + - s._ispaths[i - 1].front().h()); if (dd <= 0.0001) { d += dd; } else { diff --git a/src/gen_for_gnuplot.cc b/src/gen_for_gnuplot.cc index 8b6a5cb..491b42c 100644 --- a/src/gen_for_gnuplot.cc +++ b/src/gen_for_gnuplot.cc @@ -117,7 +117,7 @@ main() P(RR_POINT) for (auto& m: V) { - m.c = s._entries.front().front(); + m.c = s._ispaths.front().front(); m.c.sp(m.c.sp() * -1.0); m.c.st(m.c.st() * -1.0); } diff --git a/src/prove_parallel_slot.cc b/src/prove_parallel_slot.cc index fe361d3..dd46f45 100644 --- a/src/prove_parallel_slot.cc +++ b/src/prove_parallel_slot.cc @@ -87,9 +87,9 @@ int main(int argc, char** argv) && pr.e() == 0.0)) { std::cout << w << " " << len << " "; std::cout << max_cusp << " "; - std::cout << s._entries.size() << " "; - auto f = s._entries.front().front(); - auto b = s._entries.back().front(); + std::cout << s._ispaths.size() << " "; + auto f = s._ispaths.front().front(); + auto b = s._ispaths.back().front(); std::cout << f.x() << " " << f.y() << " "; std::cout << f.h() << " "; std::cout << b.x() << " " << b.y() << " "; diff --git a/src/pslot.cc b/src/pslot.cc index b1a17da..f791e15 100644 --- a/src/pslot.cc +++ b/src/pslot.cc @@ -386,18 +386,18 @@ ParkingSlot::fe(BicycleCar c) for (auto s: starts) { auto r = this->drive_in_slot(s); if (r.size() > 0) { - this->_entries.push_back(r); + this->_ispaths.push_back(r); } } - if (this->_entries.size() == 0) { + if (this->_ispaths.size() == 0) { return PoseRange(Pose(0.0, 0.0, 0.0), Pose(0.0, 0.0, 0.0)); } - if (this->_entries.size() == 1) { - auto f = this->_entries.front().front(); + if (this->_ispaths.size() == 1) { + auto f = this->_ispaths.front().front(); return PoseRange(f, f); } - auto& c1 = this->_entries.front().front(); - auto& c2 = this->_entries.back().front(); + auto& c1 = this->_ispaths.front().front(); + auto& c2 = this->_ispaths.back().front(); PoseRange p(c1, c2); if (swapped) { this->swap_side();