45 #include <visp3/core/vpRect.h>
46 #include <visp3/core/vpDebug.h>
65 : left(l), top(t), width(w), height(h)
78 : left(topLeft.get_u()), top(topLeft.get_v()), width(w), height(h)
87 : left(topLeft.get_u()), top(topLeft.get_v()), width(0), height(0)
89 this->left = topLeft.
get_u();
90 this->top = topLeft.
get_v();
100 : left(0), top(0), width(0), height(0)
113 this->width = r.width;
114 this->height = r.height;
124 : left(0), top(0), width(0), height(0)
166 left = topLeft.
get_u();
167 top = topLeft.
get_v();
181 "At least 1 point is requested to build a rectangle"));
184 minu = maxu = ip[0].get_u();
185 minv = maxv = ip[0].get_v();
187 for(
size_t i=1; i<ip.size(); i++) {
188 double u = ip[i].get_u();
189 double v = ip[i].get_v();
190 if ( u < minu ) minu = u;
191 else if (u > maxu) maxu = u;
192 if ( v < minv ) minv = v;
193 else if (v > maxv) maxv = v;
211 this->left = topLeft.
get_u();
212 this->top = topLeft.
get_v();
233 return (std::fabs(top-r.top) <= std::fabs(top)*std::numeric_limits<double>::epsilon()
234 && std::fabs(left-r.left) <= std::fabs(left)*std::numeric_limits<double>::epsilon()
235 && std::fabs(width-r.width) <= std::fabs(width)*std::numeric_limits<double>::epsilon()
236 && std::fabs(height-r.height) <= std::fabs(height)*std::numeric_limits<double>::epsilon());
250 return !(*
this == r);
258 double x1 = std::max(left, r.left);
259 double y1 = std::max(top, r.top);
260 width = std::min(left + width, r.left + r.width) - x1;
261 height = std::min(top + height, r.top + r.height) - y1;
265 if (width <= 0 || height <= 0) {
bool operator==(const vpRect &r) const
error that can be emited by ViSP classes.
void set(double left, double top, double width, double height)
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
void setRight(double pos)
Defines a rectangle in the plane.
bool isInside(const vpImagePoint &ip) const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
vpRect & operator&=(const vpRect &r)
bool operator!=(const vpRect &r) const
vpRect & operator=(const vpRect &r)
void setBottom(double pos)
vpRect operator&(const vpRect &r) const