Graphics::Region Class Reference

Represents the intersection of two rectangles. More...

#include <Types.h>

Collaboration diagram for Graphics::Region:

Public Member Functions

constexpr Region ()=default
 
constexpr Region (const Region &other)=default
 
constexpr Region (const Rect &r)
 
Regionoperator+= (const Rect &r)
 Add rectangle to this region. More...
 
Regionoperator-= (const Rect &r)
 Remove rectangle from this region. More...
 
Rect bounds () const
 
void clear ()
 
 operator bool () const
 
String toString () const
 

Public Attributes

Rect rects [4] {}
 

Detailed Description

Represents the intersection of two rectangles.

This produces up to 4 separate, non-overlapping rectangles.

Constructor & Destructor Documentation

◆ Region() [1/3]

constexpr Graphics::Region::Region ( )
constexprdefault

◆ Region() [2/3]

constexpr Graphics::Region::Region ( const Region other)
constexprdefault

◆ Region() [3/3]

constexpr Graphics::Region::Region ( const Rect r)
inlineconstexpr

Member Function Documentation

◆ bounds()

Rect Graphics::Region::bounds ( ) const
inline

◆ clear()

void Graphics::Region::clear ( void  )
inline

◆ operator bool()

Graphics::Region::operator bool ( ) const
inlineexplicit

◆ operator+=()

Region& Graphics::Region::operator+= ( const Rect r)
inline

Add rectangle to this region.

Produces a single enclosing rectangle.

◆ operator-=()

Region& Graphics::Region::operator-= ( const Rect r)
inline

Remove rectangle from this region.

Operation is currently performed on bounding box ONLY. TODO: Implement region updates using existing information.

◆ toString()

String Graphics::Region::toString ( ) const

Member Data Documentation

◆ rects

Rect Graphics::Region::rects[4] {}

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