This class provides an implementation of a clipping stack. More...
#include <Nimble/ClipStack.hpp>
Public Member Functions | |
| Nimble::Rect | boundingBox () const |
| Get the bounding box encompassing all the rectangles in the clipstack. More... | |
| ClipStack () | |
| Construct a new ClipStack. | |
| ClipStack (const ClipStack &other) | |
| Construct a copy of a ClipStack. More... | |
| bool | isVisible (const Nimble::Rectangle &r) const |
| Check if the given rectangle is visible. More... | |
| bool | isVisible (const Nimble::Vector2 &p) const |
| Check if the given point is visible. More... | |
| ClipStack & | operator= (const ClipStack &other) |
| Copy a ClipStack. More... | |
| ClipStack & | pop () |
| Pop a rectangle from the top of the ClipStack. More... | |
| ClipStack & | push (const Rectangle &r) |
| Push a rectangle to the top of the ClipStack. More... | |
| size_t | stackDepth () const |
| Get the depth of the clip stack. More... | |
| Nimble::Rectangle | stackRectangle (size_t index) const |
| Get a rectangle from the stack. More... | |
| ~ClipStack () | |
| Destroy a ClipStack. | |
This class provides an implementation of a clipping stack.
The stack is defined by a list of rectangles. Each rectangle defines the visible area on that stack level. The ClipStack is used, for example, by the rendering algorithm to determine which widgets are visible and need to be drawn.
| Nimble::ClipStack::ClipStack | ( | const ClipStack & | other | ) |
| Nimble::Rect Nimble::ClipStack::boundingBox | ( | ) | const |
Get the bounding box encompassing all the rectangles in the clipstack.
| bool Nimble::ClipStack::isVisible | ( | const Nimble::Rectangle & | r | ) | const |
Check if the given rectangle is visible.
A rectangle is visible, if the intersection of the given rectangle and every rectangle in stack is non-empty.
| r | rectangle to check |
| bool Nimble::ClipStack::isVisible | ( | const Nimble::Vector2 & | p | ) | const |
Check if the given point is visible.
| p | point to check |
| ClipStack& Nimble::ClipStack::pop | ( | ) |
| size_t Nimble::ClipStack::stackDepth | ( | ) | const |
Get the depth of the clip stack.
Returns the number of rectangles in the stack.
| Nimble::Rectangle Nimble::ClipStack::stackRectangle | ( | size_t | index | ) | const |
Get a rectangle from the stack.
The index ranges from zero (bottom of the stack) to stackDepth() - 1 (top of the stack).
| index | index of the rectangle in the stack |