48 this->
Data[2] = width;
56 void Set(
const T& x,
const T& y,
const T& width,
const T&
height)
60 this->
Data[2] = width;
69 const T&
GetX()
const {
return this->
Data[0]; }
75 const T&
GetY()
const {
return this->
Data[1]; }
139 if (point[0] < this->
GetX())
141 T dx = this->
GetX() - point[0];
142 this->
SetX(point[0]);
145 else if (point[0] > this->
GetX())
148 T dx = point[0] - this->
GetX();
153 if (point[1] < this->
GetY())
155 T dy = this->
GetY() - point[1];
156 this->
SetY(point[1]);
159 else if (point[1] > this->
GetY())
162 T dy = point[1] - this->
GetY();
186 else if (rect.
GetX() > this->
GetX())
205 else if (rect.
GetY() > this->
GetY())
225 bool intersects =
true;
231 intersects &= (dx < rect.
GetWidth());
233 else if (rect.
GetX() > this->
GetX())
236 intersects &= (dx < this->
GetWidth());
244 else if (rect.
GetY() > this->
GetY())
templated base type for storage of vectors.
const T & GetBottom() const
vtkRectd(const double *init)
templated base type for storage of 2D rectangles.
void AddPoint(const T point[2])
const T & GetLeft() const
bool IntersectsWith(const vtkRect< T > &rect)
void AddRect(const vtkRect< T > &rect)
void SetWidth(const T &width)
const T & GetWidth() const
vtkVector2< T > GetBottomLeft() const
vtkVector< T, 2 > GetTopRight() const
void Set(const T &x, const T &y, const T &width, const T &height)
vtkRectf(float x, float y, float width, float height)
vtkVector< T, 2 > GetBottomRight() const
vtkRecti(int x, int y, int width, int height)
vtkRecti(const int *init)
void SetHeight(const T &height)
vtkVector< T, 2 > GetTopLeft() const
const T & GetHeight() const
vtkRectd(double x, double y, double width, double height)
static T Max(const T &a, const T &b)
vtkRect(const T &x, const T &y, const T &width, const T &height)
vtkRectf(const float *init)