#include <HomgLineSeg2D.h>
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 HomgLine2D & | get_line () const |
Return the line through the two points. | |
const HomgPoint2D & | get_point1 () const |
Return the first point of the line segment. | |
const HomgPoint2D & | get_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_ |
Definition at line 23 of file HomgLineSeg2D.h.
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.
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] |
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] |
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 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] |
void Homg2D::set | ( | const vnl_vector_fixed< double, 3 > & | v | ) | [inline, inherited] |
void Homg2D::set | ( | const vnl_vector< double > & | v | ) | [inline, inherited] |
void Homg2D::set | ( | unsigned int | index, |
double | v | ||
) | [inline, inherited] |
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 | ( | ) | [inline, inherited] |
double& Homg2D::x | ( | ) | [inline, inherited] |
double& Homg2D::y | ( | ) | [inline, inherited] |
double Homg::infinitesimal_tol = 1e-12 [static, inherited] |
double Homg::infinity = 1.7976931348623157E+308 [static, inherited] |
HomgPoint2D HomgLineSeg2D::point1_ [private] |
Definition at line 25 of file HomgLineSeg2D.h.
HomgPoint2D HomgLineSeg2D::point2_ [private] |
Definition at line 26 of file HomgLineSeg2D.h.