Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::DRect Class Reference

Rectangles with real coordinates. More...

#include <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.
bool operator== (const DRect &dr) const
 Equality operator.
bool operator!= (const DRect &dr) const
 Inequality operator.
DRectoperator= (const DRect &dr)
 Assignment operator.
double width () const
 Returns the width of the rectangle.
double height () const
 Returns the height of the rectangle.
void normalize ()
 Normalizes the rectangle.
const DPointp1 () const
 Returns the lower left point of the rectangle.
const DPointp2 () const
 Returns the upper right point of the rectangle.
const DLine topLine () const
 Returns the top side of the rectangle.
const DLine rightLine () const
 Returns the right side of the rectangle.
const DLine leftLine () const
 Returns the left side of the rectangle.
const DLine bottomLine () const
 Returns the bottom side of the rectangle.
void yInvert ()
 Swaps the y-coordinates of the two points.
void xInvert ()
 Swaps the x-coordinates of the two points.
bool contains (const DPoint &p) const
 Returns true iff p lies within this rectangle.

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 498 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 506 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 509 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 513 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 519 of file geometry.h.

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

Copy constructor.

Definition at line 523 of file geometry.h.


Member Function Documentation

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

Equality operator.

Definition at line 527 of file geometry.h.

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

Inequality operator.

Definition at line 532 of file geometry.h.

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

Assignment operator.

Definition at line 537 of file geometry.h.

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

Returns the width of the rectangle.

Definition at line 546 of file geometry.h.

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

Returns the height of the rectangle.

Definition at line 551 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 561 of file geometry.h.

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

Returns the lower left point of the rectangle.

Definition at line 567 of file geometry.h.

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

Returns the upper right point of the rectangle.

Definition at line 570 of file geometry.h.

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

Returns the top side of the rectangle.

Definition at line 573 of file geometry.h.

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

Returns the right side of the rectangle.

Definition at line 578 of file geometry.h.

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

Returns the left side of the rectangle.

Definition at line 583 of file geometry.h.

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

Returns the bottom side of the rectangle.

Definition at line 588 of file geometry.h.

void ogdf::DRect::yInvert (  )  [inline]

Swaps the y-coordinates of the two points.

Definition at line 593 of file geometry.h.

void ogdf::DRect::xInvert (  )  [inline]

Swaps the x-coordinates of the two points.

Definition at line 596 of file geometry.h.

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

Returns true iff p lies within this rectangle.

Definition at line 599 of file geometry.h.


Member Data Documentation

DPoint ogdf::DRect::m_p1 [private]

The lower left point of the rectangle.

Definition at line 501 of file geometry.h.

DPoint ogdf::DRect::m_p2 [private]

The upper right point of the rectangle.

Definition at line 502 of file geometry.h.


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

© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:07 2007 by doxygen 1.5.4.