Inkscape
Vector Graphics Editor
Geom::OptRect Class Reference

Axis-aligned rectangle that can be empty. More...

#include <rect.h>

Inheritance diagram for Geom::OptRect:
Geom::GenericOptRect< Coord >

Public Member Functions

 OptRect ()
 
 OptRect (Rect const &a)
 
 OptRect (Point const &a, Point const &b)
 
 OptRect (Coord x0, Coord y0, Coord x1, Coord y1)
 
 OptRect (OptInterval const &x_int, OptInterval const &y_int)
 
 OptRect (Base const &b)
 
 OptRect (IntRect const &r)
 
 OptRect (OptIntRect const &r)
 
Affine transformTo (Rect const &viewport, Aspect const &aspect=Aspect())
 
bool operator== (OptRect const &other) const
 
bool operator== (Rect const &other) const
 
- Public Member Functions inherited from Geom::GenericOptRect< Coord >
Coord area () const
 Compute the rectangle's area. More...
 
bool hasZeroArea () const
 Check whether the rectangle has zero area. More...
 
OptCRect regularized () const
 Returns an empty optional (testing false) if the rectangle has zero area. More...
 
bool empty () const
 Check for emptiness. More...
 
bool intersects (CRect const &r) const
 Check whether the rectangles have any common points. More...
 
bool intersects (OptCRect const &r) const
 Check whether the rectangles have any common points. More...
 
bool contains (CRect const &r) const
 Check whether the rectangle includes all points in the given rectangle. More...
 
bool contains (OptCRect const &r) const
 Check whether the rectangle includes all points in the given rectangle. More...
 
bool contains (CPoint const &p) const
 Check whether the given point is within the rectangle. More...
 
void unionWith (CRect const &b)
 Enlarge the rectangle to contain the argument. More...
 
void unionWith (OptCRect const &b)
 Enlarge the rectangle to contain the argument. More...
 
void intersectWith (CRect const &b)
 Leave only the area overlapping with the argument. More...
 
void intersectWith (OptCRect const &b)
 Leave only the area overlapping with the argument. More...
 
void expandTo (CPoint const &p)
 Create or enlarge the rectangle to contain the given point. More...
 
GenericOptRect< Coord > & operator|= (OptCRect const &b)
 Union with b. More...
 
GenericOptRect< Coord > & operator&= (CRect const &b)
 Intersect with b. More...
 
GenericOptRect< Coord > & operator&= (OptCRect const &b)
 Intersect with b. More...
 
bool operator== (OptCRect const &other) const
 Test for equality. More...
 
bool operator== (CRect const &other) const
 
 GenericOptRect ()=default
 
 GenericOptRect (GenericRect< Coord > const &a)
 
 GenericOptRect (CPoint const &a, CPoint const &b)
 
 GenericOptRect (Coord x0, Coord y0, Coord x1, Coord y1)
 
 GenericOptRect (OptCInterval const &x_int, OptCInterval const &y_int)
 Creates an empty OptRect when one of the argument intervals is empty. More...
 

Private Types

typedef GenericOptRect< CoordBase
 

Additional Inherited Members

- Public Types inherited from Geom::GenericOptRect< Coord >
using D1Value = CInterval
 
using D1Reference = CInterval &
 
using D1ConstReference = CInterval const &
 
- Static Public Member Functions inherited from Geom::GenericOptRect< Coord >
static OptCRect from_range (InputIterator start, InputIterator end)
 Create a rectangle from a range of points. More...
 

Detailed Description

Axis-aligned rectangle that can be empty.

Definition at line 178 of file rect.h.

Member Typedef Documentation

◆ Base

Definition at line 181 of file rect.h.

Constructor & Destructor Documentation

◆ OptRect() [1/8]

Geom::OptRect::OptRect ( )
inline

Definition at line 183 of file rect.h.

◆ OptRect() [2/8]

Geom::OptRect::OptRect ( Rect const &  a)
inline

Definition at line 184 of file rect.h.

◆ OptRect() [3/8]

Geom::OptRect::OptRect ( Point const &  a,
Point const &  b 
)
inline

Definition at line 185 of file rect.h.

◆ OptRect() [4/8]

Geom::OptRect::OptRect ( Coord  x0,
Coord  y0,
Coord  x1,
Coord  y1 
)
inline

Definition at line 186 of file rect.h.

◆ OptRect() [5/8]

Geom::OptRect::OptRect ( OptInterval const &  x_int,
OptInterval const &  y_int 
)
inline

Definition at line 187 of file rect.h.

◆ OptRect() [6/8]

Geom::OptRect::OptRect ( Base const &  b)
inline

Definition at line 188 of file rect.h.

◆ OptRect() [7/8]

Geom::OptRect::OptRect ( IntRect const &  r)
inline

Definition at line 190 of file rect.h.

◆ OptRect() [8/8]

Geom::OptRect::OptRect ( OptIntRect const &  r)
inline

Definition at line 191 of file rect.h.

Member Function Documentation

◆ operator==() [1/2]

bool Geom::OptRect::operator== ( OptRect const &  other) const
inline

Definition at line 202 of file rect.h.

References Geom::GenericOptRect< Coord >::operator==().

◆ operator==() [2/2]

bool Geom::OptRect::operator== ( Rect const &  other) const
inline

Definition at line 205 of file rect.h.

References Geom::GenericOptRect< Coord >::operator==().

◆ transformTo()

Affine Geom::OptRect::transformTo ( Rect const &  viewport,
Aspect const &  aspect = Aspect() 
)
inline

Definition at line 195 of file rect.h.

References Geom::GenericOptRect< Coord >::empty(), and Geom::Affine::identity().


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