49 this->
Data[2] = width;
59 void Set(
const T& x,
const T& y,
const T& width,
const T&
height)
63 this->
Data[2] = width;
76 const T&
GetX()
const {
return this->
Data[0]; }
86 const T&
GetY()
const {
return this->
Data[1]; }
168 if (point[0] < this->
GetX())
170 T dx = this->
GetX() - point[0];
171 this->
SetX(point[0]);
174 else if (point[0] > this->
GetX())
177 T dx = point[0] - this->
GetX();
182 if (point[1] < this->
GetY())
184 T dy = this->
GetY() - point[1];
185 this->
SetY(point[1]);
188 else if (point[1] > this->
GetY())
191 T dy = point[1] - this->
GetY();
219 else if (rect.
GetX() > this->
GetX())
238 else if (rect.
GetY() > this->
GetY())
259 bool intersects =
true;
264 intersects &= (dx < rect.
GetWidth());
266 else if (rect.
GetX() > this->
GetX())
269 intersects &= (dx < this->
GetWidth());
277 else if (rect.
GetY() > this->
GetY())
T Data[Size]
The only thing stored in memory!
templated base type for storage of vectors.
const T & GetBottom() const
Get the bottom boundary of the rectangle along the Y direction.
void SetY(const T &y)
Set the y component of the rectangle bottom corner, i.e.
vtkRectd(const double *init)
templated base type for storage of 2D rectangles.
void AddPoint(const T point[2])
Expand this rect to contain the point passed in.
const T & GetLeft() const
Get the left boundary of the rectangle along the X direction.
bool IntersectsWith(const vtkRect< T > &rect)
Returns true if the rect argument overlaps this rect.
void AddRect(const vtkRect< T > &rect)
Expand this rect to contain the rect passed in.
void SetWidth(const T &width)
Set the width of the rectanle, i.e.
const T & GetWidth() const
Get the width of the rectangle, i.e.
T GetRight() const
Get the right boundary of the rectangle along the X direction.
T GetTop() const
Get the top boundary of the rectangle along the Y direction.
vtkVector2< T > GetBottomLeft() const
Get the bottom left corner of the rect as a vtkVector.
vtkVector< T, 2 > GetTopRight() const
Get the bottom left corner of the rect as a vtkVector.
void Set(const T &x, const T &y, const T &width, const T &height)
Set the x, y components of the rectangle, and the width/height.
vtkRectf(float x, float y, float width, float height)
const T & GetY() const
Get the y component of the rectangle bottom corner, i.e.
vtkVector< T, 2 > GetBottomRight() const
Get the bottom right corner of the rect as a vtkVector.
vtkRecti(int x, int y, int width, int height)
void AddPoint(T x, T y)
Expand this rect to contain the point passed in.
vtkRecti(const int *init)
void SetHeight(const T &height)
Set the height of the rectangle, i.e.
const T & GetX() const
Get the x component of the rectangle bottom corner, i.e.
void SetX(const T &x)
Set the x component of the rectangle bottom corner, i.e.
vtkVector< T, 2 > GetTopLeft() const
Get the top left corner of the rect as a vtkVector.
const T & GetHeight() const
Get the height of the rectangle, i.e.
vtkRectd(double x, double y, double width, double height)
static T Max(const T &a, const T &b)
Returns the maximum of the two arugments provided.
vtkRect(const T &x, const T &y, const T &width, const T &height)
vtkRectf(const float *init)