Open
Graph Drawing
Framework

 v.2012.07
 

ogdf::DRect Class Reference

Rectangles with real coordinates. More...

#include <ogdf/basic/geometry.h>

List of all members.

Public Member Functions

 DRect ()
 Creates a rectangle with lower left and upper right point (0,0).
 DRect (const DPoint &p1, const DPoint &p2)
 Creates a rectangle with lower left point p1 and upper right point p2.
 DRect (double x1, double y1, double x2, double y2)
 Creates a rectangle with lower left point (x1,y1) and upper right point (x1,y2).
 DRect (const DLine &dl)
 Creates a rectangle defined by the end points of line dl.
 DRect (const DRect &dr)
 Copy constructor.
const DLine bottomLine () const
 Returns the bottom side of the rectangle.
bool contains (const DPoint &p) const
 Returns true iff p lies within this rectangle.
double height () const
 Returns the height of the rectangle.
const DLine leftLine () const
 Returns the left side of the rectangle.
void normalize ()
 Normalizes the rectangle.
bool operator!= (const DRect &dr) const
 Inequality operator.
DRectoperator= (const DRect &dr)
 Assignment operator.
bool operator== (const DRect &dr) const
 Equality operator.
const DPointp1 () const
 Returns the lower left point of the rectangle.
const DPointp2 () const
 Returns the upper right point of the rectangle.
const DLine rightLine () const
 Returns the right side of the rectangle.
const DLine topLine () const
 Returns the top side of the rectangle.
double width () const
 Returns the width of the rectangle.
void xInvert ()
 Swaps the x-coordinates of the two points.
void yInvert ()
 Swaps the y-coordinates of the two points.

Private Attributes

DPoint m_p1
 The lower left point of the rectangle.
DPoint m_p2
 The upper right point of the rectangle.

Detailed Description

Rectangles with real coordinates.

Definition at line 497 of file geometry.h.


Constructor & Destructor Documentation

ogdf::DRect::DRect ( )
inline

Creates a rectangle with lower left and upper right point (0,0).

Definition at line 505 of file geometry.h.

ogdf::DRect::DRect ( const DPoint p1,
const DPoint p2 
)
inline

Creates a rectangle with lower left point p1 and upper right point p2.

Definition at line 508 of file geometry.h.

ogdf::DRect::DRect ( double  x1,
double  y1,
double  x2,
double  y2 
)
inline

Creates a rectangle with lower left point (x1,y1) and upper right point (x1,y2).

Definition at line 512 of file geometry.h.

ogdf::DRect::DRect ( const DLine dl)
inline

Creates a rectangle defined by the end points of line dl.

Definition at line 518 of file geometry.h.

ogdf::DRect::DRect ( const DRect dr)
inline

Copy constructor.

Definition at line 522 of file geometry.h.


Member Function Documentation

const DLine ogdf::DRect::bottomLine ( ) const
inline

Returns the bottom side of the rectangle.

Definition at line 587 of file geometry.h.

bool ogdf::DRect::contains ( const DPoint p) const
inline

Returns true iff p lies within this rectangle.

Definition at line 598 of file geometry.h.

double ogdf::DRect::height ( ) const
inline

Returns the height of the rectangle.

Definition at line 550 of file geometry.h.

const DLine ogdf::DRect::leftLine ( ) const
inline

Returns the left side of the rectangle.

Definition at line 582 of file geometry.h.

void ogdf::DRect::normalize ( )
inline

Normalizes the rectangle.

Makes sure that the lower left point lies below and left of the upper right point.

Definition at line 560 of file geometry.h.

bool ogdf::DRect::operator!= ( const DRect dr) const
inline

Inequality operator.

Definition at line 531 of file geometry.h.

DRect& ogdf::DRect::operator= ( const DRect dr)
inline

Assignment operator.

Definition at line 536 of file geometry.h.

bool ogdf::DRect::operator== ( const DRect dr) const
inline

Equality operator.

Definition at line 526 of file geometry.h.

const DPoint& ogdf::DRect::p1 ( ) const
inline

Returns the lower left point of the rectangle.

Definition at line 566 of file geometry.h.

const DPoint& ogdf::DRect::p2 ( ) const
inline

Returns the upper right point of the rectangle.

Definition at line 569 of file geometry.h.

const DLine ogdf::DRect::rightLine ( ) const
inline

Returns the right side of the rectangle.

Definition at line 577 of file geometry.h.

const DLine ogdf::DRect::topLine ( ) const
inline

Returns the top side of the rectangle.

Definition at line 572 of file geometry.h.

double ogdf::DRect::width ( ) const
inline

Returns the width of the rectangle.

Definition at line 545 of file geometry.h.

void ogdf::DRect::xInvert ( )
inline

Swaps the x-coordinates of the two points.

Definition at line 595 of file geometry.h.

void ogdf::DRect::yInvert ( )
inline

Swaps the y-coordinates of the two points.

Definition at line 592 of file geometry.h.


Member Data Documentation

DPoint ogdf::DRect::m_p1
private

The lower left point of the rectangle.

Definition at line 500 of file geometry.h.

DPoint ogdf::DRect::m_p2
private

The upper right point of the rectangle.

Definition at line 501 of file geometry.h.


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