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]. Emptiness, however, is defined as having zero area, meaning an empty rectangle may still contain points. Infinities are also permitted.

Definition at line 90 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 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
bool intersects (Rect const &r) const
bool isEmpty () 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)
 Rect (Rect const &r)
 Rect (NRRect const &r)
void round (int places=0)
 Remove some precision from the Rect.

Static Public Member Functions

static Maybe< Rectintersection (Rect const &a, Rect const &b)
static Rect union_bounds (Rect const &a, Rect const &b)

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<Dim2 axis>
bool isEmpty () const

Private Attributes

Point _max
Point _min


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

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

Generated by  Doxygen 1.6.0   Back to index