]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - incl/bcar.hh
Add and use point, pose translate method
[hubacji1/bcar.git] / incl / bcar.hh
index 5370934e011dc4586a9cee57415dc29fbe06a998..7591d7213682ce162ccee308350c1a27bb31f90a 100644 (file)
@@ -58,6 +58,12 @@ public:
         */
        bool on_right_side_of(Line const& li) const;
 
+       /*! \brief Translate self.
+        *
+        * \param p `Point` offset to translate by.
+        */
+       void translate(Point const& p);
+
        /*! \brief Rotate self around the point.
 
        \param c Rotation center `Point`.
@@ -156,23 +162,24 @@ public:
 
 class PoseRange : public virtual Pose {
 private:
-       double e_ = 0.0;
-       using Pose::h;
+       Pose bp_;
+       Pose ep_;
+       void set_xyh();
 public:
+       PoseRange(Pose bp, Pose ep);
+       PoseRange(double x, double y, double b, double e);
+
+       Pose bp() const;
+       Pose ep() const;
+
        /*! Get heading's begin in the interval [-pi, +pi] radians. */
        double b() const;
 
-       /*! Set heading's begin in radians. It's recomputed to [-pi, +pi]. */
-       void b(double b);
-
        /*! Get heading's end in the interval [-pi, +pi] radians. */
        double e() const;
 
-       /*! Set heading's end in radians. It's recomputed to [-pi, +pi]. */
-       void e(double e);
-
+       void translate(Point const& p);
        void rotate(Point const& c, double const angl);
-
        void reflect(Line const& li);
 
        friend std::ostream& operator<<(std::ostream& out, PoseRange const& p);