|
Blender V4.3
|
#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 () |
| 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.
|
inlinevirtual |
Destructor.
Definition at line 37 of file GHOST_Rect.hh.
|
virtual |
|
inlinevirtual |
Access to rectangle height.
Definition at line 172 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(), and wrapPoint().
|
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, isInside(), m_b, m_l, m_r, m_t, and v.
|
inlinevirtual |
Access to rectangle width.
Definition at line 167 of file GHOST_Rect.hh.
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 11 of file GHOST_Rect.cc.
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 185 of file GHOST_Rect.hh.
References getHeight(), and getWidth().
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 272 of file GHOST_Rect.hh.
References m_b, m_l, m_r, and m_t.
Referenced by getVisibility(), and GHOST_WindowWin32::loadWintab().
|
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 177 of file GHOST_Rect.hh.
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.
|
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 227 of file GHOST_Rect.hh.
References getHeight(), getWidth(), GHOST_kAxisX, GHOST_kAxisY, m_b, m_l, m_r, m_t, and w().
Referenced by getCursorPositionClientRelative_impl(), GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemWayland::window_cursor_grab_set().
| int32_t GHOST_Rect::m_b |
Bottom coordinate of the rectangle
Definition at line 160 of file GHOST_Rect.hh.
Referenced by clampPoint(), clip(), getCursorPositionClientRelative_impl(), getHeight(), getVisibility(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), 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(), getCursorPositionClientRelative_impl(), getVisibility(), getWidth(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), setCenter(), GHOST_Window::setCursorGrab(), GHOST_WindowCocoa::setWindowCursorGrab(), 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(), getCursorPositionClientRelative_impl(), getVisibility(), getWidth(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), setCenter(), GHOST_Window::setCursorGrab(), GHOST_WindowCocoa::setWindowCursorGrab(), 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(), getCursorPositionClientRelative_impl(), getHeight(), getVisibility(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), setCenter(), unionPoint(), unionRect(), GHOST_SystemWayland::window_cursor_grab_set(), and wrapPoint().