Mir
Public Member Functions | Public Attributes | List of all members
mir::geometry::Rectangle Struct Reference

#include <rectangle.h>

Public Member Functions

constexpr Rectangle ()=default
 
constexpr Rectangle (Point const &top_left, Size const &size)
 
Point bottom_right () const
 The bottom right boundary point of the rectangle. More...
 
Point top_right () const
 
Point bottom_left () const
 
bool contains (Point const &p) const
 
bool contains (Rectangle const &r) const
 Test if the rectangle contains another. More...
 
bool overlaps (Rectangle const &r) const
 
Rectangle intersection_with (Rectangle const &r) const
 
X left () const
 
X right () const
 
Y top () const
 
Y bottom () const
 

Public Attributes

Point top_left
 
Size size
 

Constructor & Destructor Documentation

constexpr mir::geometry::Rectangle::Rectangle ( )
default
constexpr mir::geometry::Rectangle::Rectangle ( Point const &  top_left,
Size const &  size 
)
inline

Member Function Documentation

Y mir::geometry::Rectangle::bottom ( ) const
inline
Point mir::geometry::Rectangle::bottom_left ( ) const
Point mir::geometry::Rectangle::bottom_right ( ) const

The bottom right boundary point of the rectangle.

Note that the returned point is not included in the rectangle area, that is, the rectangle is represented as [top_left,bottom_right).

bool mir::geometry::Rectangle::contains ( Point const &  p) const
bool mir::geometry::Rectangle::contains ( Rectangle const &  r) const

Test if the rectangle contains another.

Note that an empty rectangle can still contain other empty rectangles, which are treated as points or lines of thickness zero.

Rectangle mir::geometry::Rectangle::intersection_with ( Rectangle const &  r) const
X mir::geometry::Rectangle::left ( ) const
inline
bool mir::geometry::Rectangle::overlaps ( Rectangle const &  r) const
X mir::geometry::Rectangle::right ( ) const
inline
Y mir::geometry::Rectangle::top ( ) const
inline
Point mir::geometry::Rectangle::top_right ( ) const

Member Data Documentation

Size mir::geometry::Rectangle::size
Point mir::geometry::Rectangle::top_left

The documentation for this struct was generated from the following file:

Copyright © 2012-2020 Canonical Ltd.
Generated on Thu Apr 16 16:51:04 UTC 2020
This documentation is licensed under the GPL version 2 or 3.