|
FifeGUI 0.2.0
A C++ GUI library designed for games.
|
#include <rectangle.hpp>
Public Member Functions | |
| Rectangle | intersection (Rectangle const &rh) const |
| bool | isContaining (int x, int y) const |
| bool | isContaining (Rectangle const &other) const |
| bool | isEmpty () const |
| bool | isIntersecting (Rectangle const &rectangle) const |
| Rectangle | operator+ (Rectangle const &rh) const |
| Rectangle const & | operator+= (Rectangle const &rh) |
| Rectangle () | |
| Rectangle (int x, int y, int width, int height) | |
| void | setAll (int x, int y, int width, int height) |
Public Attributes | |
| int | height |
| int | width |
| int | x |
| int | y |
Friends | |
| std::ostream & | operator<< (std::ostream &out, Rectangle const &rectangle) |
Represents a rectangular area (X, Y, Width, Height).
Definition at line 19 of file rectangle.hpp.
| fcn::Rectangle::Rectangle | ( | ) |
Constructor.
The default rectangle is an empty rectangle at the coordinates (0,0).
Definition at line 11 of file rectangle.cpp.
References height, width, x, and y.
Referenced by fcn::ClipRectangle::ClipRectangle(), intersection(), isContaining(), isIntersecting(), operator+(), operator+=(), operator<<, and fcn::ClipRectangle::operator=().
| fcn::Rectangle::Rectangle | ( | int | x, |
| int | y, | ||
| int | width, | ||
| int | height ) |
Gets the intersection between two rectangles.
| rh | The rectangle to calculate the intersection with. |
Definition at line 109 of file rectangle.cpp.
References height, isEmpty(), Rectangle(), width, x, and y.
Referenced by fcn::Graphics::pushClipArea().
| bool fcn::Rectangle::isContaining | ( | int | x, |
| int | y ) const |
Checks the rectangle contains a point.
Definition at line 52 of file rectangle.cpp.
References height, isEmpty(), width, x, and y.
Referenced by fcn::sdl2::Graphics::drawPoint(), fcn::Widget::getWidgetAt(), fcn::Gui::handleHiddenWidgets(), and fcn::Gui::handleShownWidgets().
| bool fcn::Rectangle::isContaining | ( | Rectangle const & | other | ) | const |
Checks if the rectangle contains a rectangle.
| other | The rectangle to check. |
Definition at line 61 of file rectangle.cpp.
| bool fcn::Rectangle::isEmpty | ( | ) | const |
Checks whether the rectangle is empty or not.
A rectangle is considered empty when it's width or height is either zero or negative.
Definition at line 71 of file rectangle.cpp.
Referenced by fcn::ScrollArea::getChildrenArea(), intersection(), isContaining(), isContaining(), operator+(), operator+=(), and fcn::Graphics::pushClipArea().
| bool fcn::Rectangle::isIntersecting | ( | Rectangle const & | rectangle | ) | const |
Checks if another rectangle intersects with the rectangle.
| rectangle | Another rectangle to check for intersection. |
Definition at line 23 of file rectangle.cpp.
References height, Rectangle(), width, x, and y.
Referenced by fcn::Widget::_draw(), fcn::sdl2::Graphics::fillRectangle(), and fcn::Widget::getWidgetsIn().
Adds a rectangle to this rectangle.
The resulting rectangle is the union of the two rectangles.
| rh | The rectangle to add. |
Definition at line 76 of file rectangle.cpp.
Adds a rectangle to this rectangle.
This rectangle will be the union of the two rectangles.
| rh | The rectangle to add. |
Definition at line 89 of file rectangle.cpp.
| void fcn::Rectangle::setAll | ( | int | x, |
| int | y, | ||
| int | width, | ||
| int | height ) |
|
friend |
Output operator for output.
| out | The stream to output to. |
| rectangle | The rectangle to output. |
Definition at line 129 of file rectangle.cpp.
References height, operator<<, Rectangle(), width, x, and y.
Referenced by operator<<.
| int fcn::Rectangle::height |
Holds the height of the rectangle.
Definition at line 136 of file rectangle.hpp.
Referenced by fcn::sdl2::Graphics::_beginDraw(), fcn::Widget::_draw(), fcn::FlowContainer::adjustContent(), fcn::DropDown::adjustHeight(), fcn::TextBox::adjustSizeImpl(), fcn::ClipRectangle::ClipRectangle(), fcn::Button::draw(), fcn::DropDown::draw(), fcn::Icon::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::ListBox::draw(), fcn::Tab::draw(), fcn::CheckBox::drawBox(), fcn::DropDown::drawButton(), fcn::TextField::drawCaret(), fcn::CheckBox::drawCheckmark(), fcn::CheckBox::drawCross(), fcn::CheckBox::drawDot(), fcn::ScrollArea::drawDownButton(), fcn::ScrollArea::drawHBar(), fcn::ScrollArea::drawHMarker(), fcn::sdl2::Graphics::drawHorizontalLine(), fcn::ScrollArea::drawLeftButton(), fcn::CheckBox::drawMarkerImage(), fcn::opengl::Graphics::drawRectangle(), fcn::sdl2::Graphics::drawRectangle(), fcn::ScrollArea::drawRightButton(), fcn::ScrollArea::drawUpButton(), fcn::ScrollArea::drawVBar(), fcn::sdl2::Graphics::drawVerticalLine(), fcn::ScrollArea::drawVMarker(), fcn::Container::expandContent(), fcn::opengl::Graphics::fillRectangle(), fcn::sdl2::Graphics::fillRectangle(), fcn::Text::getCaretDimension(), fcn::AdjustingContainer::getChildrenArea(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::ScrollArea::getVerticalBarDimension(), fcn::ScrollArea::getVerticalMarkerDimension(), fcn::ScrollArea::getVerticalMaxScroll(), intersection(), isContaining(), isContaining(), isEmpty(), isIntersecting(), fcn::TextBox::keyPressed(), fcn::ScrollArea::mouseDragged(), operator+(), operator+=(), operator<<, fcn::ClipRectangle::operator=(), fcn::sdl2::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::sdl2::Graphics::pushClipArea(), Rectangle(), Rectangle(), fcn::Container::resizeToContent(), setAll(), fcn::Widget::setDimension(), fcn::Widget::setHeight(), fcn::ListBox::setSelected(), fcn::Widget::setSize(), and fcn::Widget::showWidgetPart().
| int fcn::Rectangle::width |
Holds the width of the rectangle.
Definition at line 131 of file rectangle.hpp.
Referenced by fcn::sdl2::Graphics::_beginDraw(), fcn::Widget::_draw(), fcn::FlowContainer::adjustContent(), fcn::TextBox::adjustSizeImpl(), fcn::TextField::adjustSizeImpl(), fcn::ClipRectangle::ClipRectangle(), fcn::Button::draw(), fcn::DropDown::draw(), fcn::Icon::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::Tab::draw(), fcn::CheckBox::drawBox(), fcn::DropDown::drawButton(), fcn::CheckBox::drawCheckmark(), fcn::CheckBox::drawCross(), fcn::CheckBox::drawDot(), fcn::ScrollArea::drawDownButton(), fcn::ScrollArea::drawHBar(), fcn::ScrollArea::drawHMarker(), fcn::sdl2::Graphics::drawHorizontalLine(), fcn::ScrollArea::drawLeftButton(), fcn::CheckBox::drawMarkerImage(), fcn::opengl::Graphics::drawRectangle(), fcn::sdl2::Graphics::drawRectangle(), fcn::ScrollArea::drawRightButton(), fcn::ScrollArea::drawUpButton(), fcn::ScrollArea::drawVBar(), fcn::sdl2::Graphics::drawVerticalLine(), fcn::ScrollArea::drawVMarker(), fcn::Container::expandContent(), fcn::opengl::Graphics::fillRectangle(), fcn::sdl2::Graphics::fillRectangle(), fcn::Text::getCaretDimension(), fcn::AdjustingContainer::getChildrenArea(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::ScrollArea::getHorizontalBarDimension(), fcn::ScrollArea::getHorizontalMarkerDimension(), fcn::ScrollArea::getHorizontalMaxScroll(), intersection(), isContaining(), isContaining(), isEmpty(), isIntersecting(), fcn::ScrollArea::mouseDragged(), operator+(), operator+=(), operator<<, fcn::ClipRectangle::operator=(), fcn::sdl2::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::sdl2::Graphics::pushClipArea(), Rectangle(), Rectangle(), fcn::Container::resizeToContent(), setAll(), fcn::Widget::setDimension(), fcn::Widget::setSize(), fcn::Widget::setWidth(), and fcn::Widget::showWidgetPart().
| int fcn::Rectangle::x |
Holds the x coordinate of the rectangle.
Definition at line 121 of file rectangle.hpp.
Referenced by fcn::sdl2::Graphics::_beginDraw(), fcn::Widget::_draw(), fcn::FlowContainer::adjustContent(), fcn::ClipRectangle::ClipRectangle(), fcn::Button::draw(), fcn::Icon::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::CheckBox::drawBox(), fcn::CheckBox::drawCheckmark(), fcn::CheckBox::drawCross(), fcn::CheckBox::drawDot(), fcn::sdl2::Graphics::drawHorizontalLine(), fcn::CheckBox::drawMarkerImage(), fcn::opengl::Graphics::drawRectangle(), fcn::sdl2::Graphics::drawRectangle(), fcn::sdl2::Graphics::drawVerticalLine(), fcn::Container::expandContent(), fcn::opengl::Graphics::fillRectangle(), fcn::sdl2::Graphics::fillRectangle(), fcn::Widget::getAbsolutePosition(), fcn::Text::getCaretDimension(), fcn::AdjustingContainer::getChildrenArea(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::ScrollArea::getHorizontalMarkerDimension(), fcn::ScrollArea::getVerticalMarkerDimension(), fcn::Widget::getWidgetAt(), intersection(), isContaining(), isContaining(), isIntersecting(), fcn::ScrollArea::mouseDragged(), fcn::ScrollArea::mousePressed(), operator+(), operator+=(), operator<<, fcn::ClipRectangle::operator=(), fcn::sdl2::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::sdl2::Graphics::pushClipArea(), Rectangle(), Rectangle(), fcn::Container::resizeToContent(), setAll(), fcn::Widget::setDimension(), fcn::Widget::setPosition(), fcn::Widget::setX(), and fcn::Widget::showWidgetPart().
| int fcn::Rectangle::y |
Holds the x coordinate of the rectangle.
Definition at line 126 of file rectangle.hpp.
Referenced by fcn::sdl2::Graphics::_beginDraw(), fcn::Widget::_draw(), fcn::FlowContainer::adjustContent(), fcn::ClipRectangle::ClipRectangle(), fcn::Button::draw(), fcn::Icon::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::CheckBox::drawBox(), fcn::CheckBox::drawCheckmark(), fcn::CheckBox::drawCross(), fcn::CheckBox::drawDot(), fcn::sdl2::Graphics::drawHorizontalLine(), fcn::CheckBox::drawMarkerImage(), fcn::opengl::Graphics::drawRectangle(), fcn::sdl2::Graphics::drawRectangle(), fcn::sdl2::Graphics::drawVerticalLine(), fcn::Container::expandContent(), fcn::opengl::Graphics::fillRectangle(), fcn::sdl2::Graphics::fillRectangle(), fcn::Widget::getAbsolutePosition(), fcn::Text::getCaretDimension(), fcn::AdjustingContainer::getChildrenArea(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::ScrollArea::getHorizontalMarkerDimension(), fcn::ScrollArea::getVerticalMarkerDimension(), fcn::Widget::getWidgetAt(), intersection(), isContaining(), isContaining(), isIntersecting(), fcn::ScrollArea::mouseDragged(), fcn::ScrollArea::mousePressed(), operator+(), operator+=(), operator<<, fcn::ClipRectangle::operator=(), fcn::sdl2::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::sdl2::Graphics::pushClipArea(), Rectangle(), Rectangle(), fcn::Container::resizeToContent(), setAll(), fcn::Widget::setDimension(), fcn::Widget::setPosition(), fcn::ListBox::setSelected(), fcn::Widget::setY(), and fcn::Widget::showWidgetPart().