Blender
V3.3
|
#include <GHOST_Rect.h>
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.h.
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.h.
|
inlinevirtual |
Destructor.
Definition at line 37 of file GHOST_Rect.h.
|
virtual |
|
inlinevirtual |
Access to rectangle height.
Definition at line 174 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 41 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 169 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().
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 10 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 187 of file GHOST_Rect.h.
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 274 of file GHOST_Rect.h.
References m_b, m_l, m_r, m_t, x, and y.
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 179 of file GHOST_Rect.h.
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 79 of file GHOST_Rect.cpp.
|
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 229 of file GHOST_Rect.h.
References getHeight(), getWidth(), GHOST_kAxisX, GHOST_kAxisY, m_b, m_l, m_r, m_t, w(), x, and y.
Referenced by GHOST_SystemCocoa::handleMouseEvent(), and GHOST_SystemWayland::window_cursor_grab_set().
int32_t GHOST_Rect::m_b |
Bottom coordinate of the rectangle
Definition at line 162 of file GHOST_Rect.h.
Referenced by clampPoint(), clip(), getHeight(), getVisibility(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), 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 156 of file GHOST_Rect.h.
Referenced by clampPoint(), clip(), getVisibility(), getWidth(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), 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 160 of file GHOST_Rect.h.
Referenced by clampPoint(), clip(), getVisibility(), getWidth(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), 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 158 of file GHOST_Rect.h.
Referenced by clampPoint(), clip(), getHeight(), getVisibility(), GHOST_GetCursorGrabState(), GHOST_GetRectangle(), GHOST_SystemCocoa::handleMouseEvent(), inset(), isInside(), isValid(), set(), setCenter(), unionPoint(), unionRect(), GHOST_SystemWayland::window_cursor_grab_set(), and wrapPoint().