]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Add slot frame point and side getters
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 20 Jul 2021 13:14:31 +0000 (15:14 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 20 Jul 2021 14:49:17 +0000 (16:49 +0200)
incl/pslot.hh
src/pslot.cc

index 8602e891beae8654ed3eac63098bf8aba604f829..655eb5e7e01c52feedec5d9664530710eb586803 100644 (file)
@@ -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);
 
index 4644375e20c6e22871690cf62439f6ac21d40c30..91bf5e9a53819fc884f82f24900b60cddacc98a7 100644 (file)
@@ -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)
 {