Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
HomgLineSeg2D Class Reference

#include <HomgLineSeg2D.h>

Inheritance diagram for HomgLineSeg2D:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 HomgLineSeg2D ()
 HomgLineSeg2D (const HomgPoint2D &point1, const HomgPoint2D &point2)
 Constructor forming linesegment from start and end points.
 HomgLineSeg2D (double x0, double y0, double x1, double y1)
 Constructor forming linesegment (x0,y0) -> (x1,y1).
 ~HomgLineSeg2D ()
const HomgLine2Dget_line () const
 Return the line through the two points.
const HomgPoint2Dget_point1 () const
 Return the first point of the line segment.
const HomgPoint2Dget_point2 () const
 Return the second point of the line segment.
void set (const HomgPoint2D &point1, const HomgPoint2D &point2)
 Set the line segment given two points.
double picking_distance (const HomgPoint2D &point1) const
 Return distance to nearest point contained in lineseg.
bool ideal (double tol=1e-12) const
 Return true iff the line is the line at infinity.
HomgLineSeg2D clip (int x0, int y0, int x1, int y1) const
 Construct an ImplicitLine by clipping against the given bounding rectangle.
void get_2_points_on_line (HomgPoint2D *p1, HomgPoint2D *p2) const
 Return some two points which are on the line.
vnl_double_3 get_vector () const
vnl_double_3 & asVector ()
void get (double *x_ptr, double *y_ptr, double *w_ptr) const
 Retrieve components. Do not attempt to write into null pointers.
double x () const
 Return x.
double & x ()
 Return reference to x.
double y () const
 Return y.
double & y ()
 Return reference to y.
double w () const
 Return w.
double & w ()
 Return reference to w.
void set (double px, double py, double pw)
 Set x,y,w.
void set (const vnl_vector_fixed< double, 3 > &v)
 Set from vector.
void set (const vnl_vector< double > &v)
 Set from vector.
void set (unsigned int index, double v)
 Set element.

Static Public Member Functions

static void set_infinitesimal_tol (double tol)
 Static method to set the default tolerance used for infinitesimal checks.

Static Public Attributes

static double infinity = 1.7976931348623157E+308
 Standard placeholder for methods that wish to return infinity.
static double infinitesimal_tol = 1e-12
 The tolerance used in "near zero" tests in the Homg subclasses.

Private Attributes

HomgPoint2D point1_
HomgPoint2D point2_

Detailed Description

Definition at line 23 of file HomgLineSeg2D.h.


Constructor & Destructor Documentation

HomgLineSeg2D::HomgLineSeg2D ( ) [inline]

Definition at line 31 of file HomgLineSeg2D.h.

HomgLineSeg2D::HomgLineSeg2D ( const HomgPoint2D point1,
const HomgPoint2D point2 
)

Constructor forming linesegment from start and end points.

Definition at line 18 of file HomgLineSeg2D.cxx.

HomgLineSeg2D::HomgLineSeg2D ( double  x0,
double  y0,
double  x1,
double  y1 
)

Constructor forming linesegment (x0,y0) -> (x1,y1).

Definition at line 29 of file HomgLineSeg2D.cxx.

HomgLineSeg2D::~HomgLineSeg2D ( ) [inline]

Definition at line 34 of file HomgLineSeg2D.h.


Member Function Documentation

vnl_double_3& Homg2D::asVector ( ) [inline, inherited]

Definition at line 59 of file Homg2D.h.

HomgLineSeg2D HomgLine2D::clip ( int  rect1_x,
int  rect1_y,
int  rect2_x,
int  rect2_y 
) const [inherited]

Construct an ImplicitLine by clipping against the given bounding rectangle.

The return line has been allocated using new.

Definition at line 22 of file HomgLine2D.cxx.

void Homg2D::get ( double *  x_ptr,
double *  y_ptr,
double *  w_ptr 
) const [inline, inherited]

Retrieve components. Do not attempt to write into null pointers.

Definition at line 62 of file Homg2D.h.

void HomgLine2D::get_2_points_on_line ( HomgPoint2D p1,
HomgPoint2D p2 
) const [inherited]

Return some two points which are on the line.

The algorithm actually returns an orthonormal basis for the nullspace of l.

Definition at line 31 of file HomgLine2D.cxx.

const HomgLine2D & HomgLineSeg2D::get_line ( ) const [inline]

Return the line through the two points.

Definition at line 53 of file HomgLineSeg2D.h.

const HomgPoint2D & HomgLineSeg2D::get_point1 ( ) const [inline]

Return the first point of the line segment.

Definition at line 61 of file HomgLineSeg2D.h.

const HomgPoint2D & HomgLineSeg2D::get_point2 ( ) const [inline]

Return the second point of the line segment.

Definition at line 69 of file HomgLineSeg2D.h.

vnl_double_3 Homg2D::get_vector ( ) const [inline, inherited]

Definition at line 58 of file Homg2D.h.

bool HomgLine2D::ideal ( double  tol = 1e-12) const [inline, inherited]

Return true iff the line is the line at infinity.

If tol == 0, x() and y() must be exactly 0. Otherwise, tol is used as tolerance value (default: 1e-12), and $max(|x|,|y|) <= \mbox{tol} \times |w|$ is checked.

Definition at line 46 of file HomgLine2D.h.

double HomgLineSeg2D::picking_distance ( const HomgPoint2D point1) const

Return distance to nearest point contained in lineseg.

Definition at line 77 of file HomgLineSeg2D.cxx.

void HomgLineSeg2D::set ( const HomgPoint2D point1,
const HomgPoint2D point2 
)

Set the line segment given two points.

Definition at line 39 of file HomgLineSeg2D.cxx.

void Homg2D::set ( double  px,
double  py,
double  pw 
) [inline, inherited]

Set x,y,w.

Definition at line 96 of file Homg2D.h.

void Homg2D::set ( const vnl_vector_fixed< double, 3 > &  v) [inline, inherited]

Set from vector.

Definition at line 104 of file Homg2D.h.

void Homg2D::set ( const vnl_vector< double > &  v) [inline, inherited]

Set from vector.

Definition at line 107 of file Homg2D.h.

void Homg2D::set ( unsigned int  index,
double  v 
) [inline, inherited]

Set element.

Definition at line 110 of file Homg2D.h.

static void Homg::set_infinitesimal_tol ( double  tol) [static, inherited]

Static method to set the default tolerance used for infinitesimal checks.

The default is 1e-12.

double Homg2D::w ( ) const [inline, inherited]

Return w.

Definition at line 82 of file Homg2D.h.

double& Homg2D::w ( ) [inline, inherited]

Return reference to w.

Definition at line 84 of file Homg2D.h.

double Homg2D::x ( ) const [inline, inherited]

Return x.

Definition at line 72 of file Homg2D.h.

double& Homg2D::x ( ) [inline, inherited]

Return reference to x.

Definition at line 74 of file Homg2D.h.

double Homg2D::y ( ) const [inline, inherited]

Return y.

Definition at line 77 of file Homg2D.h.

double& Homg2D::y ( ) [inline, inherited]

Return reference to y.

Definition at line 79 of file Homg2D.h.


Member Data Documentation

double Homg::infinitesimal_tol = 1e-12 [static, inherited]

The tolerance used in "near zero" tests in the Homg subclasses.

Definition at line 32 of file Homg.h.

double Homg::infinity = 1.7976931348623157E+308 [static, inherited]

Standard placeholder for methods that wish to return infinity.

Definition at line 29 of file Homg.h.

Definition at line 25 of file HomgLineSeg2D.h.

Definition at line 26 of file HomgLineSeg2D.h.


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