From 8f549b9d8ac7fd160d1a51f6893d7b87832c6a46 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Tue, 20 Jul 2021 15:14:31 +0200 Subject: [PATCH 1/1] Add slot frame point and side getters --- incl/pslot.hh | 24 ++++++++++++++++++++++++ src/pslot.cc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/incl/pslot.hh b/incl/pslot.hh index 8602e89..655eb5e 100644 --- a/incl/pslot.hh +++ b/incl/pslot.hh @@ -70,6 +70,30 @@ public: /*! Return parking slot's orientation. */ double h() const; + /*! Get parking slot's left front point. */ + Point lf() const; + + /*! Get parking slot's left rear point. */ + Point lr() const; + + /*! Get parking slot's right rear point. */ + Point rr() const; + + /*! Get parking slot's right front point. */ + Point rf() const; + + /*! Get parking slot's entry side. */ + Line entry() const; + + /*! Get parking slot's rear side. */ + Line rear() const; + + /*! Get parking slot's curb side. */ + Line curb() const; + + /*! Get parking slot's front side. */ + Line front() const; + /*! Car's next iteration distance. (Negative for backward.) */ void set_parking_speed(double s); diff --git a/src/pslot.cc b/src/pslot.cc index 4644375..91bf5e9 100644 --- a/src/pslot.cc +++ b/src/pslot.cc @@ -95,6 +95,54 @@ ParkingSlot::h() const return atan2(this->lfy() - this->lry(), this->lfx() - this->lrx()); } +Point +ParkingSlot::lf() const +{ + return Point(this->lfx(), this->lfy()); +} + +Point +ParkingSlot::lr() const +{ + return Point(this->lrx(), this->lry()); +} + +Point +ParkingSlot::rr() const +{ + return Point(this->rrx(), this->rry()); +} + +Point +ParkingSlot::rf() const +{ + return Point(this->rfx(), this->rfy()); +} + +Line +ParkingSlot::entry() const +{ + return this->entry_; +} + +Line +ParkingSlot::rear() const +{ + return this->rear_; +} + +Line +ParkingSlot::curb() const +{ + return this->curb_; +} + +Line +ParkingSlot::front() const +{ + return this->front_; +} + void ParkingSlot::set_parking_speed(double s) { -- 2.39.2