|
Blender
V2.93
|
#include <GHOST_Rect.h>
Public Member Functions | |
| GHOST_Rect (GHOST_TInt32 l=0, GHOST_TInt32 t=0, GHOST_TInt32 r=0, GHOST_TInt32 b=0) | |
| virtual | ~GHOST_Rect () |
| virtual GHOST_TInt32 | getWidth () const |
| virtual GHOST_TInt32 | getHeight () const |
| virtual void | set (GHOST_TInt32 l, GHOST_TInt32 t, GHOST_TInt32 r, GHOST_TInt32 b) |
| virtual bool | isEmpty () const |
| virtual bool | isValid () const |
| virtual void | inset (GHOST_TInt32 i) |
| virtual void | unionRect (const GHOST_Rect &r) |
| virtual void | unionPoint (GHOST_TInt32 x, GHOST_TInt32 y) |
| virtual void | wrapPoint (GHOST_TInt32 &x, GHOST_TInt32 &y, GHOST_TInt32 ofs, GHOST_TAxisFlag axis) |
| virtual bool | isInside (GHOST_TInt32 x, GHOST_TInt32 y) const |
| virtual GHOST_TVisibility | getVisibility (GHOST_Rect &r) const |
| virtual void | setCenter (GHOST_TInt32 cx, GHOST_TInt32 cy) |
| virtual void | setCenter (GHOST_TInt32 cx, GHOST_TInt32 cy, GHOST_TInt32 w, GHOST_TInt32 h) |
| virtual bool | clip (GHOST_Rect &r) const |
Public Attributes | |
| GHOST_TInt32 | m_l |
| GHOST_TInt32 | m_t |
| GHOST_TInt32 | m_r |
| GHOST_TInt32 | m_b |
Implements rectangle functionality. The four extreme coordinates are stored as left, top, right and bottom. To be valid, a rectangle should have a left coordinate smaller than or equal to right. To be valid, a rectangle should have a top coordinate smaller than or equal to bottom.
Definition at line 36 of file GHOST_Rect.h.
|
inline |
Constructs a rectangle with the given values.
| l | requested left coordinate of the rectangle. |
| t | requested top coordinate of the rectangle. |
| r | requested right coordinate of the rectangle. |
| b | requested bottom coordinate of the rectangle. |
Definition at line 45 of file GHOST_Rect.h.
|
inlinevirtual |
Destructor.
Definition at line 53 of file GHOST_Rect.h.
|
virtual |
|
inlinevirtual |
Access to rectangle height.
Definition at line 187 of file GHOST_Rect.h.
Referenced by GHOST_WindowCocoa::clientToScreen(), inset(), isEmpty(), GHOST_WindowCocoa::screenToClient(), GHOST_WindowCocoa::setClientHeight(), GHOST_WindowWin32::setClientHeight(), GHOST_WindowCocoa::setClientSize(), GHOST_WindowWin32::setClientSize(), GHOST_WindowCocoa::setClientWidth(), GHOST_WindowWin32::setClientWidth(), View(), and wrapPoint().
|
virtual |
Returns whether the rectangle is inside this rectangle.
| r | rectangle to test. |
Definition at line 57 of file GHOST_Rect.cpp.
References GHOST_kFullyVisible, GHOST_kNotVisible, GHOST_kPartiallyVisible, isInside(), m_b, m_l, m_r, m_t, r, and v.
|
inlinevirtual |
Access to rectangle width.
Definition at line 182 of file GHOST_Rect.h.
Referenced by inset(), isEmpty(), GHOST_WindowCocoa::setClientHeight(), GHOST_WindowWin32::setClientHeight(), GHOST_WindowCocoa::setClientSize(), GHOST_WindowWin32::setClientSize(), GHOST_WindowCocoa::setClientWidth(), GHOST_WindowWin32::setClientWidth(), GHOST_WindowCocoa::setNativePixelSize(), View(), and wrapPoint().
|
virtual |
Grows (or shrinks the rectangle). The method avoids negative insets making the rectangle invalid
| i | The amount of offset given to each extreme (negative values shrink the rectangle). |
Definition at line 26 of file GHOST_Rect.cpp.
References getHeight(), getWidth(), m_b, m_l, m_r, and m_t.
|
inlinevirtual |
Returns whether this rectangle is empty. Empty rectangles are rectangles that have width==0 and/or height==0.
Definition at line 200 of file GHOST_Rect.h.
References getHeight(), and getWidth().
|
inlinevirtual |
Returns whether the point is inside this rectangle. Point on the boundary is considered inside.
| x | x-coordinate of point to test. |
| y | y-coordinate of point to test. |
Definition at line 261 of file GHOST_Rect.h.
References m_b, m_l, m_r, m_t, x, and y.
Referenced by getVisibility().
|
inlinevirtual |
|
inlinevirtual |
Sets all members of the rectangle.
| l | requested left coordinate of the rectangle. |
| t | requested top coordinate of the rectangle. |
| r | requested right coordinate of the rectangle. |
| b | requested bottom coordinate of the rectangle. |
Definition at line 192 of file GHOST_Rect.h.
|
virtual |
|
virtual |
Sets rectangle members. Sets rectangle members such that it is centered at the given location, with the width requested.
| cx | requested center x-coordinate of the rectangle. |
| cy | requested center y-coordinate of the rectangle. |
| w | requested width of the rectangle. |
| h | requested height of the rectangle. |
Definition at line 95 of file GHOST_Rect.cpp.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Grows the rectangle to included a point.
| x | The x-coordinate of the point. |
| y | The y-coordinate of the point. |
Definition at line 234 of file GHOST_Rect.h.
References getHeight(), getWidth(), GHOST_kAxisX, GHOST_kGrabAxisY, m_b, m_l, m_r, m_t, w(), x, and y.
Referenced by GHOST_SystemCocoa::handleMouseEvent().
| GHOST_TInt32 GHOST_Rect::m_b |
Bottom coordinate of the rectangle
Definition at line 175 of file GHOST_Rect.h.
Referenced by clip(), getHeight(), getVisibility(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), unionPoint(), unionRect(), and wrapPoint().
| GHOST_TInt32 GHOST_Rect::m_l |
Left coordinate of the rectangle
Definition at line 169 of file GHOST_Rect.h.
Referenced by clip(), getVisibility(), getWidth(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), GHOST_Window::setCursorGrab(), GHOST_WindowCocoa::setWindowCursorGrab(), GHOST_WindowX11::setWindowCursorGrab(), unionPoint(), unionRect(), and wrapPoint().
| GHOST_TInt32 GHOST_Rect::m_r |
Right coordinate of the rectangle
Definition at line 173 of file GHOST_Rect.h.
Referenced by clip(), getVisibility(), getWidth(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), GHOST_Window::setCursorGrab(), GHOST_WindowCocoa::setWindowCursorGrab(), GHOST_WindowX11::setWindowCursorGrab(), unionPoint(), unionRect(), and wrapPoint().
| GHOST_TInt32 GHOST_Rect::m_t |
Top coordinate of the rectangle
Definition at line 171 of file GHOST_Rect.h.
Referenced by clip(), getHeight(), getVisibility(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), unionPoint(), unionRect(), and wrapPoint().