KiCad PCB EDA Suite
|
#include <half_line.h>
Public Member Functions | |
HALF_LINE (const SEG &aSeg) | |
Construct a ray from a segment - the ray will start at the segment's A point and extend infinitely in the direction of the segment, passing through its B point. | |
HALF_LINE (const VECTOR2I &aStart, const VECTOR2I &aOtherContainedPoint) | |
const VECTOR2I & | GetStart () const |
Get the start point of the ray. | |
const VECTOR2I & | GetContainedPoint () const |
Get one (of the infinite number) of points that the ray passes through. | |
bool | Contains (const VECTOR2I &aPoint) const |
OPT_VECTOR2I | Intersect (const SEG &aSeg) const |
OPT_VECTOR2I | Intersect (const HALF_LINE &aOther) const |
VECTOR2I | NearestPoint (const VECTOR2I &aPoint) const |
Get the nearest point on the ray to the given point. | |
bool | operator== (const HALF_LINE &aOther) const |
Based on the ray being identically defined. | |
const SEG & | GetContainedSeg () const |
Gets the (one of the infinite number of) segments that the ray passes through. | |
Private Attributes | |
SEG | m_seg |
Internally, we can represent a just a segment that the ray passes through. | |
Definition at line 40 of file half_line.h.
|
inline |
Construct a ray from a segment - the ray will start at the segment's A point and extend infinitely in the direction of the segment, passing through its B point.
Definition at line 47 of file half_line.h.
Definition at line 49 of file half_line.h.
bool HALF_LINE::Contains | ( | const VECTOR2I & | aPoint | ) | const |
Definition at line 41 of file half_line.cpp.
References SEG::A, SEG::B, SEG::LineDistance(), m_seg, and VectorsInSameQuadrant().
|
inline |
Get one (of the infinite number) of points that the ray passes through.
Definition at line 62 of file half_line.h.
|
inline |
Gets the (one of the infinite number of) segments that the ray passes through.
The segment's A point is the start of the ray, and the B point is on the ray.
Definition at line 87 of file half_line.h.
References m_seg.
Referenced by Intersect().
|
inline |
Get the start point of the ray.
Definition at line 57 of file half_line.h.
Referenced by KIGEOM::ClipHalfLineToBox().
OPT_VECTOR2I HALF_LINE::Intersect | ( | const HALF_LINE & | aOther | ) | const |
Definition at line 86 of file half_line.cpp.
References SEG::A, SEG::B, GetContainedSeg(), SEG::Intersect(), m_seg, and VectorsInSameQuadrant().
OPT_VECTOR2I HALF_LINE::Intersect | ( | const SEG & | aSeg | ) | const |
Definition at line 57 of file half_line.cpp.
References SEG::A, SEG::B, SEG::Contains(), GetContainedSeg(), SEG::Intersect(), m_seg, and VectorsInSameQuadrant().
Referenced by KIGEOM::ClipHalfLineToBox().
Get the nearest point on the ray to the given point.
This will be the start point of the ray for half the 2D plane.
Definition at line 110 of file half_line.cpp.
References SEG::A, SEG::B, VECTOR2< T >::Dot(), m_seg, rescale(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
inline |
Based on the ray being identically defined.
TODO: this is not geoemetrical equality?!
Definition at line 80 of file half_line.h.
References m_seg.
|
private |
Internally, we can represent a just a segment that the ray passes through.
Definition at line 91 of file half_line.h.
Referenced by Contains(), GetContainedPoint(), GetContainedSeg(), GetStart(), Intersect(), NearestPoint(), and operator==().