A two dimensional rectangle that keeps track of the extend of a drawing.
More...
#include <BoundingBox.h>
|
| BoundingBox () |
| Default constructor for ROOT compatibility. Cell weight defaults to 1.
|
|
| BoundingBox (float x1, float y1, float x2, float y2) |
| Initialises the bounds of the rectangle to the given values. Automatically swaps the x or y values if they are given in a decreasing.
|
|
void | operator&= (const BoundingBox &other) |
| Expands the bounding box such that it also covers the given bounding box.
|
|
void | expand (float delta) |
| Expands the rectangle in each direction by the given value delta.
|
|
float | getWidth () const |
| Getter for the width of the bounding box rectangle.
|
|
float | getHeight () const |
| Getter for the height of the bounding box rectangle.
|
|
float | getLeft () const |
| Getter for the location of the left of the bounding box rectangle (lower x bound). NAN if unset.
|
|
float | getBottom () const |
| Getter for the location of the bottom of the bounding box rectangle (lower y bound). NAN if unset.
|
|
float | getRight () const |
| Getter for the location of the right of the bounding box rectangle (upper x bound). NAN if unset.
|
|
float | getTop () const |
| Getter for the location of the top of the bounding box rectangle (upper y bound). NAN if unset.
|
|
void | clear () |
| Clears all bounds to NAN.
|
|
|
float | m_left |
| Memory for the lower x bound of the rectangle.
|
|
float | m_bottom |
| Memory for the lower y bound of the rectangle.
|
|
float | m_right |
| Memory for the upper x bound of the rectangle.
|
|
float | m_top |
| Memory for the upper y bound of the rectangle.
|
|
A two dimensional rectangle that keeps track of the extend of a drawing.
Definition at line 21 of file BoundingBox.h.
◆ BoundingBox() [1/2]
Default constructor for ROOT compatibility. Cell weight defaults to 1.
Definition at line 26 of file BoundingBox.h.
26 :
31 {}
float m_left
Memory for the lower x bound of the rectangle.
float m_bottom
Memory for the lower y bound of the rectangle.
float m_top
Memory for the upper y bound of the rectangle.
float m_right
Memory for the upper x bound of the rectangle.
◆ BoundingBox() [2/2]
Initialises the bounds of the rectangle to the given values. Automatically swaps the x or y values if they are given in a decreasing.
Definition at line 34 of file BoundingBox.h.
34 :
38 m_top(std::max(y1, y2))
39 {}
◆ clear()
◆ expand()
void expand |
( |
float |
delta | ) |
|
|
inline |
Expands the rectangle in each direction by the given value delta.
Definition at line 54 of file BoundingBox.h.
◆ getBottom()
float getBottom |
( |
| ) |
const |
|
inline |
Getter for the location of the bottom of the bounding box rectangle (lower y bound). NAN if unset.
Definition at line 75 of file BoundingBox.h.
◆ getHeight()
float getHeight |
( |
| ) |
const |
|
inline |
Getter for the height of the bounding box rectangle.
Definition at line 67 of file BoundingBox.h.
float getBottom() const
Getter for the location of the bottom of the bounding box rectangle (lower y bound)....
float getTop() const
Getter for the location of the top of the bounding box rectangle (upper y bound). NAN if unset.
◆ getLeft()
Getter for the location of the left of the bounding box rectangle (lower x bound). NAN if unset.
Definition at line 71 of file BoundingBox.h.
◆ getRight()
Getter for the location of the right of the bounding box rectangle (upper x bound). NAN if unset.
Definition at line 79 of file BoundingBox.h.
◆ getTop()
Getter for the location of the top of the bounding box rectangle (upper y bound). NAN if unset.
Definition at line 83 of file BoundingBox.h.
◆ getWidth()
Getter for the width of the bounding box rectangle.
Definition at line 63 of file BoundingBox.h.
float getRight() const
Getter for the location of the right of the bounding box rectangle (upper x bound)....
float getLeft() const
Getter for the location of the left of the bounding box rectangle (lower x bound)....
◆ operator&=()
Expands the bounding box such that it also covers the given bounding box.
Definition at line 42 of file BoundingBox.h.
43 {
44
47
49 m_top = std::isnan(
getTop()) ? other.getTop() : std::max(
getTop(), other.getTop());
50
51 }
◆ m_bottom
Memory for the lower y bound of the rectangle.
Definition at line 100 of file BoundingBox.h.
◆ m_left
Memory for the lower x bound of the rectangle.
Definition at line 97 of file BoundingBox.h.
◆ m_right
Memory for the upper x bound of the rectangle.
Definition at line 103 of file BoundingBox.h.
◆ m_top
Memory for the upper y bound of the rectangle.
Definition at line 106 of file BoundingBox.h.
The documentation for this class was generated from the following file: