OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimLine.h>
Public Member Functions | |
ossimLine (const ossimDpt &p1=ossimDpt(0, 0), const ossimDpt &p2=ossimDpt(0, 0)) | |
ossimDpt | getVector () const |
ossimDpt | intersectInfinite (const ossimLine &line) const |
ossimDpt | intersectSegment (const ossimLine &line) const |
ossimDpt | midPoint () const |
double | length () const |
ossimDpt | normal () const |
bool | isPointWithin (const ossimDpt &point, double delta=FLT_EPSILON) const |
bool | isPointOnInfiniteLine (const ossimDpt &point, double delta=FLT_EPSILON) const |
Public Attributes | |
ossimDpt | theP1 |
ossimDpt | theP2 |
Friends | |
OSSIM_DLL std::ostream & | operator<< (std::ostream &out, const ossimLine &rhs) |
Definition at line 14 of file ossimLine.h.
|
inline |
Definition at line 19 of file ossimLine.h.
|
inline |
Definition at line 27 of file ossimLine.h.
Computes the following equation:
Note: this object will be line a and the passed in object will be line b; and P1 and P2 coorespond to this object and P3 and P4 will coorespond to the passed in object.
Now find point formed at the intersection of line a and b:
Pa = P1 + ua ( P2 - P1 ) Pb = P3 + ub ( P4 - P3 ) const ossimDpt& ul_corner, const ossimDpt& lr_corner, ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED); x1 + ua (x2 - x1) = x3 + ub (x4 - x3) and y1 + ua (y2 - y1) = y3 + ub (y4 - y3)
Solve: ua = ((x4-x3)(y1-y3) - (y4-y3)(x1-x3))/ ((y4-y3)(x2-x1) - (x4-x3)(y2-y1)) ub = ((x2-x1)(y1-y3) - (y2-y1)(x1-x3))/ ((y4-y3)(x2-x1) - (x4-x3)(y2-y1)) substitute:
x = x1 + ua (x2 - x1) y = y1 + ua (y2 - y1)
Definition at line 20 of file ossimLine.cpp.
References FLT_EPSILON, ossimDpt::makeNan(), theP1, theP2, ossimDpt::x, and ossimDpt::y.
Referenced by ossimFeatherMosaic::ossimFeatherInputInformation::setVertexList().
Definition at line 40 of file ossimLine.cpp.
References FLT_EPSILON, length(), ossimDpt::makeNan(), theP1, theP2, ossimDpt::x, and ossimDpt::y.
bool ossimLine::isPointOnInfiniteLine | ( | const ossimDpt & | point, |
double | delta = FLT_EPSILON |
||
) | const |
Definition at line 99 of file ossimLine.cpp.
References FLT_EPSILON, ossimDpt::length(), ossimDpt::x, and ossimDpt::y.
bool ossimLine::isPointWithin | ( | const ossimDpt & | point, |
double | delta = FLT_EPSILON |
||
) | const |
Will return true if the point is on the line.
Definition at line 79 of file ossimLine.cpp.
References max, min, and ossimDrect::pointWithin().
Referenced by ossimPolyLine::isPointWithin().
double ossimLine::length | ( | ) | const |
ossimDpt ossimLine::midPoint | ( | ) | const |
Definition at line 74 of file ossimLine.cpp.
ossimDpt ossimLine::normal | ( | ) | const |
Definition at line 135 of file ossimLine.cpp.
References FLT_EPSILON, ossimDpt::length(), ossimDpt::x, and ossimDpt::y.
Referenced by ossimPolygon::clipLineSegment().
Definition at line 15 of file ossimLine.cpp.
ossimDpt ossimLine::theP1 |
Definition at line 77 of file ossimLine.h.
Referenced by ossimPolygon::clipLineSegment(), intersectInfinite(), intersectSegment(), and operator<<().
ossimDpt ossimLine::theP2 |
Definition at line 78 of file ossimLine.h.
Referenced by intersectInfinite(), intersectSegment(), and operator<<().