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

#include <rectangle_generic.h>

Inheritance diagram for mir::geometry::generic::Rectangle< P, S >:
[legend]

Public Member Functions

constexpr Rectangle ()=default
 
constexpr Rectangle (P const &top_left, S const &size)
 
bottom_right () const
 The bottom right boundary point of the rectangle. More...
 
top_right () const
 
bottom_left () const
 
bool contains (P const &p) const
 
bool contains (Rectangle< P, S > const &r) const
 Test if the rectangle contains another. More...
 
bool overlaps (Rectangle< P, S > const &r) const
 
Corresponding< P, XTagleft () const
 
Corresponding< P, XTagright () const
 
Corresponding< P, YTagtop () const
 
Corresponding< P, YTagbottom () const
 

Public Attributes

top_left
 
size
 

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

template<typename P , typename S >
constexpr mir::geometry::generic::Rectangle< P, S >::Rectangle ( )
constexprdefault

◆ Rectangle() [2/2]

template<typename P , typename S >
constexpr mir::geometry::generic::Rectangle< P, S >::Rectangle ( P const &  top_left,
S const &  size 
)
inlineconstexpr

Member Function Documentation

◆ bottom()

template<typename P , typename S >
Corresponding<P, YTag> mir::geometry::generic::Rectangle< P, S >::bottom ( ) const
inline

◆ bottom_left()

template<typename P , typename S >
P mir::geometry::generic::Rectangle< P, S >::bottom_left ( ) const
inline

◆ bottom_right()

template<typename P , typename S >
P mir::geometry::generic::Rectangle< P, S >::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 P , typename S >
bool mir::geometry::generic::Rectangle< P, S >::contains ( P const &  p) const
inline

◆ contains() [2/2]

template<typename P , typename S >
bool mir::geometry::generic::Rectangle< P, S >::contains ( Rectangle< P, S > 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 P , typename S >
Corresponding<P, XTag> mir::geometry::generic::Rectangle< P, S >::left ( ) const
inline

◆ overlaps()

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

◆ right()

template<typename P , typename S >
Corresponding<P, XTag> mir::geometry::generic::Rectangle< P, S >::right ( ) const
inline

◆ top()

template<typename P , typename S >
Corresponding<P, YTag> mir::geometry::generic::Rectangle< P, S >::top ( ) const
inline

◆ top_right()

template<typename P , typename S >
P mir::geometry::generic::Rectangle< P, S >::top_right ( ) const
inline

Member Data Documentation

◆ size

template<typename P , typename S >
S mir::geometry::generic::Rectangle< P, S >::size

◆ top_left

template<typename P , typename S >
P mir::geometry::generic::Rectangle< P, S >::top_left

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

Copyright © 2012-2022 Canonical Ltd.
Generated on śro, 1 cze 2022, 16:52:55 UTC
This documentation is licensed under the GPL version 2 or 3.