Mir
Public Member Functions | Public Attributes | List of all members
mir::geometry::generic::Rectangle< T > Struct Template Reference

#include <rectangle.h>

Public Member Functions

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

Public Attributes

Point< T > top_left
 
Size< T > size
 

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

template<typename T >
constexpr mir::geometry::generic::Rectangle< T >::Rectangle ( )
constexprdefault

◆ Rectangle() [2/2]

template<typename T >
constexpr mir::geometry::generic::Rectangle< T >::Rectangle ( Point< T > const &  top_left,
Size< T > const &  size 
)
inlineconstexpr

Member Function Documentation

◆ bottom()

template<typename T >
Y< T > mir::geometry::generic::Rectangle< T >::bottom ( ) const
inline

◆ bottom_left()

template<typename T >
Point< T > mir::geometry::generic::Rectangle< T >::bottom_left ( ) const
inline

◆ bottom_right()

template<typename T >
Point< T > mir::geometry::generic::Rectangle< T >::bottom_right ( ) const
inline

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).

◆ contains() [1/2]

template<typename T >
bool mir::geometry::generic::Rectangle< T >::contains ( Point< T > const &  p) const
inline

◆ contains() [2/2]

template<typename T >
bool mir::geometry::generic::Rectangle< T >::contains ( Rectangle< T > const &  r) const
inline

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.

◆ left()

template<typename T >
X< T > mir::geometry::generic::Rectangle< T >::left ( ) const
inline

◆ overlaps()

template<typename T >
bool mir::geometry::generic::Rectangle< T >::overlaps ( Rectangle< T > const &  r) const
inline

◆ right()

template<typename T >
X< T > mir::geometry::generic::Rectangle< T >::right ( ) const
inline

◆ top()

template<typename T >
Y< T > mir::geometry::generic::Rectangle< T >::top ( ) const
inline

◆ top_right()

template<typename T >
Point< T > mir::geometry::generic::Rectangle< T >::top_right ( ) const
inline

Member Data Documentation

◆ size

template<typename T >
Size<T> mir::geometry::generic::Rectangle< T >::size

◆ top_left

template<typename T >
Point<T> mir::geometry::generic::Rectangle< T >::top_left

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

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.