]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - src/bcar.cc
Add and use point, pose translate method
[hubacji1/bcar.git] / src / bcar.cc
index 673ec198853baafcfec05e29f46e2b25c9dfc007..84a3bcb74699b2e64caf12b4efad3a16e1eb7736 100644 (file)
@@ -95,6 +95,13 @@ Point::on_right_side_of(Line const& li) const
        }
 }
 
+void
+Point::translate(Point const& p)
+{
+       this->x_ += p.x();
+       this->y_ += p.y();
+}
+
 void
 Point::rotate(Point const& c, double const angl)
 {
@@ -367,6 +374,14 @@ PoseRange::e() const
        return std::max(this->bp_.h(), this->ep_.h());
 }
 
+void
+PoseRange::translate(Point const& p)
+{
+       this->bp_.translate(p);
+       this->ep_.translate(p);
+       this->set_xyh();
+}
+
 void
 PoseRange::rotate(Point const& c, double const angl)
 {