rasdaman API
Public Member Functions | List of all members
r_Edge Class Reference

#include <polygon.hh>

Public Member Functions

 r_Edge (const r_Point &newStart, const r_Point &newEnd)
 constructor getting a 2-D start and end point. More...
 
const r_PointgetStart () const
 retrieve 2-D start point of edge. More...
 
const r_PointgetEnd () const
 retrieve 2-D end point of edge. More...
 
double getInvSlope () const
 calculate inverse slope of the edge. Note: may throw exception due to division by 0. More...
 
double getSlope () const
 calculate slope of the edge. Note: may throw exception due to division by 0. More...
 
double getCurrX (r_Range y) const
 retrieve x for a given y on a line with the slope of the edge. Calls getInvSlope(). More...
 
double getCurrY (r_Range x) const
 retrieve y for a given x on a line with the slope of the edge. Calls getSlope(). More...
 
void print_status (std::ostream &s=std::cout) const
 print start and end point of the edge. More...
 
bool isHorizontal () const
 returns true if the edge is parallel to the first axis More...
 

Constructor & Destructor Documentation

r_Edge::r_Edge ( const r_Point newStart,
const r_Point newEnd 
)

constructor getting a 2-D start and end point.

Member Function Documentation

double r_Edge::getCurrX ( r_Range  y) const

retrieve x for a given y on a line with the slope of the edge. Calls getInvSlope().

double r_Edge::getCurrY ( r_Range  x) const

retrieve y for a given x on a line with the slope of the edge. Calls getSlope().

const r_Point& r_Edge::getEnd ( ) const

retrieve 2-D end point of edge.

double r_Edge::getInvSlope ( ) const

calculate inverse slope of the edge. Note: may throw exception due to division by 0.

double r_Edge::getSlope ( ) const

calculate slope of the edge. Note: may throw exception due to division by 0.

const r_Point& r_Edge::getStart ( ) const

retrieve 2-D start point of edge.

Referenced by EdgeSortCriterion::operator()(), and ActiveEdgeSortCriterion::operator()().

bool r_Edge::isHorizontal ( ) const

returns true if the edge is parallel to the first axis

void r_Edge::print_status ( std::ostream &  s = std::cout) const

print start and end point of the edge.


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