Logo Search packages:      
Sourcecode: inkscape version File versions

NR::Rect Class Reference

#include <nr-rect.h>

List of all members.

Detailed Description

A rectangle is always aligned to the X and Y axis. This means it can be defined using only 4 coordinates, and determining intersection is very efficient. The points inside a rectangle are min[dim] <= _pt[dim] <= max[dim]. A rectangle may be empty, in the sense of having zero area, but it will always contain at least one point. Infinities are also permitted.

Definition at line 38 of file nr-rect.h.

Public Member Functions

double area () const
bool contains (Point const &p) const
bool contains (Rect const &r) const
Point corner (unsigned i) const
Point cornerFarthestFrom (Point const &p) const
Point dimensions () const
void expandTo (Rect const &r)
void expandTo (Point p)
double extent (unsigned i) const throw (std::out_of_range)
double extent (Dim2 const axis) const
void growBy (gdouble by)
bool intersects (Rect const &r) const
bool isEmpty (double epsilon=1e-6) const
Point const & max () const
double maxExtent () const
Point midpoint () const
Point const & min () const
void move_bottom (gdouble by)
void move_left (gdouble by)
void move_right (gdouble by)
void move_top (gdouble by)
void offset (Point p)
Rect operator* (Matrix const m) const
Rect operator* (double const s) const
bool operator== (Rect const &in_rect)
 Rect (Point const &p0, Point const &p1)
void round (int places=0)
 Remove some precision from the Rect.

Private Member Functions

template<Dim2 axis>
bool contains (Point const &p) const
template<Dim2 axis>
bool contains (Rect const &r) const
template<NR::Dim2 axis>
double extent () const
template<Dim2 axis>
bool intersects (Rect const &r) const
template<NR::Dim2 axis>
bool isEmpty (double epsilon) const
 Rect (Nothing)

Static Private Member Functions

static double _inf ()

Private Attributes

Point _max
Point _min


Maybe< Rectintersection (Maybe< Rect > const &, Maybe< Rect > const &)
class MaybeStorage< Rect >
std::ostream & operator<< (std::ostream &out_file, NR::Rect const &in_rect)
Rect union_bounds (Rect const &, Rect const &)

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

Generated by  Doxygen 1.6.0   Back to index