|
Blender V4.5
|
#include <GHOST_Rect.hh>
Public Member Functions | |
| GHOST_Rect (int32_t l=0, int32_t t=0, int32_t r=0, int32_t b=0) | |
| virtual | ~GHOST_Rect ()=default |
| virtual int32_t | getWidth () const |
| virtual int32_t | getHeight () const |
| virtual void | set (int32_t l, int32_t t, int32_t r, int32_t b) |
| virtual bool | isEmpty () const |
| virtual bool | isValid () const |
| virtual void | inset (int32_t i) |
| virtual void | unionRect (const GHOST_Rect &r) |
| virtual void | unionPoint (int32_t x, int32_t y) |
| virtual void | wrapPoint (int32_t &x, int32_t &y, int32_t ofs, GHOST_TAxisFlag axis) |
| virtual void | clampPoint (int32_t &x, int32_t &y) |
| virtual bool | isInside (int32_t x, int32_t y) const |
| virtual GHOST_TVisibility | getVisibility (GHOST_Rect &r) const |
| virtual void | setCenter (int32_t cx, int32_t cy) |
| virtual void | setCenter (int32_t cx, int32_t cy, int32_t w, int32_t h) |
| virtual bool | clip (GHOST_Rect &r) const |
Public Attributes | |
| int32_t | m_l |
| int32_t | m_t |
| int32_t | m_r |
| int32_t | 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 20 of file GHOST_Rect.hh.
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 29 of file GHOST_Rect.hh.
References b, l, m_b, m_l, m_r, and m_t.
Referenced by clip(), getVisibility(), GHOST_GetClientBounds(), GHOST_GetWindowBounds(), GHOST_SetCursorGrab(), unionRect(), and ~GHOST_Rect().
|
virtualdefault |
Destructor.
References b, clampPoint(), clip(), getHeight(), getVisibility(), getWidth(), GHOST_Rect(), i, inset(), isEmpty(), isInside(), isValid(), l, set(), setCenter(), unionPoint(), unionRect(), w(), wrapPoint(), x, and y.
Confine x & y within the rectangle (inclusive).
| x | The x-coordinate of the point. |
| y | The y-coordinate of the point. |
Definition at line 253 of file GHOST_Rect.hh.
References m_b, m_l, m_r, m_t, x, and y.
Referenced by relative_pointer_handle_relative_motion_impl(), and ~GHOST_Rect().
|
virtual |
Clips a rectangle. Updates the rectangle given such that it will fit within this one. This can result in an empty rectangle.
| r | the rectangle to clip. |
Definition at line 92 of file GHOST_Rect.cc.
References GHOST_Rect(), m_b, m_l, m_r, and m_t.
Referenced by ~GHOST_Rect().
|
inlinevirtual |
Access to rectangle height.
Definition at line 170 of file GHOST_Rect.hh.
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(), wrapPoint(), and ~GHOST_Rect().
|
virtual |
Returns whether the rectangle is inside this rectangle.
| r | rectangle to test. |
Definition at line 42 of file GHOST_Rect.cc.
References GHOST_kFullyVisible, GHOST_kNotVisible, GHOST_kPartiallyVisible, GHOST_Rect(), isInside(), m_b, m_l, m_r, m_t, and v.
Referenced by ~GHOST_Rect().
|
inlinevirtual |
Access to rectangle width.
Definition at line 165 of file GHOST_Rect.hh.
Referenced by inset(), isEmpty(), GHOST_SystemWin32::processCursorEvent(), GHOST_WindowCocoa::setClientHeight(), GHOST_WindowWin32::setClientHeight(), GHOST_WindowCocoa::setClientSize(), GHOST_WindowWin32::setClientSize(), GHOST_WindowCocoa::setClientWidth(), GHOST_WindowWin32::setClientWidth(), GHOST_WindowCocoa::setNativePixelSize(), View(), wrapPoint(), and ~GHOST_Rect().
|
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 11 of file GHOST_Rect.cc.
References getHeight(), getWidth(), i, m_b, m_l, m_r, and m_t.
Referenced by ~GHOST_Rect().
|
inlinevirtual |
Returns whether this rectangle is empty. Empty rectangles are rectangles that have width==0 and/or height==0.
Definition at line 183 of file GHOST_Rect.hh.
References getHeight(), and getWidth().
Referenced by ~GHOST_Rect().
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 270 of file GHOST_Rect.hh.
References m_b, m_l, m_r, m_t, x, and y.
Referenced by getVisibility(), GHOST_System::getWindowUnderCursor(), GHOST_WindowWin32::loadWintab(), and ~GHOST_Rect().
|
inlinevirtual |
Returns whether this rectangle is valid. Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, empty rectangles are valid.
Definition at line 188 of file GHOST_Rect.hh.
References m_b, m_l, m_r, and m_t.
Referenced by ~GHOST_Rect().
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 175 of file GHOST_Rect.hh.
References b, l, m_b, m_l, m_r, and m_t.
Referenced by GHOST_WindowWayland::getClientBounds(), and ~GHOST_Rect().
Sets rectangle members. Sets rectangle members such that it is centered at the given location.
| cx | requested center x-coordinate of the rectangle. |
| cy | requested center y-coordinate of the rectangle. |
Definition at line 70 of file GHOST_Rect.cc.
References m_b, m_l, m_r, and m_t.
Referenced by ~GHOST_Rect().
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 80 of file GHOST_Rect.cc.
Grows the rectangle to included a point.
| x | The x-coordinate of the point. |
| y | The y-coordinate of the point. |
Definition at line 209 of file GHOST_Rect.hh.
References m_b, m_l, m_r, m_t, x, and y.
Referenced by ~GHOST_Rect().
|
inlinevirtual |
Does a union of the rectangle given and this rectangle. The result is stored in this rectangle.
| r | The rectangle that is input for the union operation. |
Definition at line 193 of file GHOST_Rect.hh.
References GHOST_Rect(), m_b, m_l, m_r, and m_t.
Referenced by ~GHOST_Rect().
|
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 225 of file GHOST_Rect.hh.
References getHeight(), getWidth(), GHOST_kAxisX, GHOST_kAxisY, m_b, m_l, m_r, m_t, w(), x, and y.
Referenced by getCursorPositionClientRelative_impl(), GHOST_SystemCocoa::handleMouseEvent(), GHOST_SystemWin32::processCursorEvent(), GHOST_SystemWayland::window_cursor_grab_set(), and ~GHOST_Rect().
| int32_t GHOST_Rect::m_b |
Bottom coordinate of the rectangle
Definition at line 160 of file GHOST_Rect.hh.
Referenced by clampPoint(), clip(), GHOST_WindowCocoa::getClientBounds(), GHOST_WindowSDL::getClientBounds(), GHOST_WindowWin32::getClientBounds(), GHOST_WindowX11::getClientBounds(), GHOST_Window::getCursorGrabState(), getCursorPositionClientRelative_impl(), getHeight(), getVisibility(), GHOST_WindowCocoa::getWindowBounds(), GHOST_WindowWin32::getWindowBounds(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_Rect(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), relative_pointer_handle_relative_motion_impl(), set(), setCenter(), setCenter(), unionPoint(), unionRect(), GHOST_SystemWayland::window_cursor_grab_set(), and wrapPoint().
| int32_t GHOST_Rect::m_l |
Left coordinate of the rectangle
Definition at line 154 of file GHOST_Rect.hh.
Referenced by clampPoint(), clip(), GHOST_WindowCocoa::getClientBounds(), GHOST_WindowSDL::getClientBounds(), GHOST_WindowWin32::getClientBounds(), GHOST_WindowX11::getClientBounds(), GHOST_Window::getCursorGrabBounds(), GHOST_Window::getCursorGrabState(), getCursorPositionClientRelative_impl(), getVisibility(), getWidth(), GHOST_WindowCocoa::getWindowBounds(), GHOST_WindowWin32::getWindowBounds(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_Rect(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), relative_pointer_handle_relative_motion_impl(), set(), setCenter(), setCenter(), GHOST_Window::setCursorGrab(), GHOST_WindowX11::setWindowCursorGrab(), unionPoint(), unionRect(), GHOST_SystemWayland::window_cursor_grab_set(), and wrapPoint().
| int32_t GHOST_Rect::m_r |
Right coordinate of the rectangle
Definition at line 158 of file GHOST_Rect.hh.
Referenced by clampPoint(), clip(), GHOST_WindowCocoa::getClientBounds(), GHOST_WindowSDL::getClientBounds(), GHOST_WindowWin32::getClientBounds(), GHOST_WindowX11::getClientBounds(), GHOST_Window::getCursorGrabBounds(), GHOST_Window::getCursorGrabState(), getCursorPositionClientRelative_impl(), getVisibility(), getWidth(), GHOST_WindowCocoa::getWindowBounds(), GHOST_WindowWin32::getWindowBounds(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_Rect(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), relative_pointer_handle_relative_motion_impl(), set(), setCenter(), setCenter(), GHOST_Window::setCursorGrab(), GHOST_WindowX11::setWindowCursorGrab(), unionPoint(), unionRect(), GHOST_SystemWayland::window_cursor_grab_set(), and wrapPoint().
| int32_t GHOST_Rect::m_t |
Top coordinate of the rectangle
Definition at line 156 of file GHOST_Rect.hh.
Referenced by clampPoint(), clip(), GHOST_WindowCocoa::getClientBounds(), GHOST_WindowSDL::getClientBounds(), GHOST_WindowWin32::getClientBounds(), GHOST_WindowX11::getClientBounds(), GHOST_Window::getCursorGrabState(), getCursorPositionClientRelative_impl(), getHeight(), getVisibility(), GHOST_WindowCocoa::getWindowBounds(), GHOST_WindowWin32::getWindowBounds(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_Rect(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), relative_pointer_handle_relative_motion_impl(), set(), setCenter(), setCenter(), unionPoint(), unionRect(), GHOST_SystemWayland::window_cursor_grab_set(), and wrapPoint().