]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - incl/bcar.hh
Refactor pose range
[hubacji1/bcar.git] / incl / bcar.hh
index 03609968aaecc6b80a9f417700a567476703af37..22e57d4ca2f7efb268e24b0aadcd8b3dcf956888 100644 (file)
@@ -65,9 +65,16 @@ public:
        */
        void rotate(Point const& c, double const angl);
 
+       /*! \brief Compute reflection of `this` around the `Line`.
+        *
+        * \param li The plane to reflect around is given by `li`.
+        */
+       void reflect(Line const& li);
+
        /*! Return Euclidean distance to `p`. */
        double edist(Point const& p) const;
 
+       bool operator==(Point const& p);
        friend std::ostream& operator<<(std::ostream& out, Point const& p);
 };
 
@@ -117,6 +124,8 @@ public:
 
        double len() const;
 
+       double h() const;
+
        friend std::ostream& operator<<(std::ostream& out, Line const& li);
 };
 
@@ -139,28 +148,33 @@ public:
 
        void rotate(Point const& c, double const angl);
 
+       void reflect(Line const& li);
+
+       bool operator==(Pose const& p);
        friend std::ostream& operator<<(std::ostream& out, Pose const& p);
 };
 
 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);
+
+       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 rotate(Point const& c, double const angl);
 
+       void reflect(Line const& li);
+
        friend std::ostream& operator<<(std::ostream& out, PoseRange const& p);
 };