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
 

Detailed Description

Examples:
server_example_canonical_window_manager.cpp, and server_example_window_management.cpp.

Constructor & Destructor Documentation

§ Rectangle() [1/2]

constexpr mir::geometry::Rectangle::Rectangle ( )
default

§ Rectangle() [2/2]

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

Member Function Documentation

§ bottom()

Y mir::geometry::Rectangle::bottom ( ) const
inline

§ bottom_left()

Point mir::geometry::Rectangle::bottom_left ( ) const

§ bottom_right()

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

§ contains() [1/2]

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

§ contains() [2/2]

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.

§ intersection_with()

Rectangle mir::geometry::Rectangle::intersection_with ( Rectangle const &  r) const

§ left()

X mir::geometry::Rectangle::left ( ) const
inline

§ overlaps()

bool mir::geometry::Rectangle::overlaps ( Rectangle const &  r) const

§ right()

X mir::geometry::Rectangle::right ( ) const
inline

§ top()

Y mir::geometry::Rectangle::top ( ) const
inline

§ top_right()

Point mir::geometry::Rectangle::top_right ( ) const

Member Data Documentation

§ size

Size mir::geometry::Rectangle::size
Examples:
render_surfaces.cpp.

§ top_left

Point mir::geometry::Rectangle::top_left

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

Copyright © 2012-2016 Canonical Ltd.
Generated on Sat Dec 3 12:48:59 UTC 2016