|
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 36 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 43 of file half_line.h.
References m_seg.
Referenced by Intersect(), and operator==().
Definition at line 45 of file half_line.h.
References m_seg.
| bool HALF_LINE::Contains | ( | const VECTOR2I & | aPoint | ) | const |
Definition at line 37 of file half_line.cpp.
References m_seg, and VectorsInSameQuadrant().
|
inline |
Get one (of the infinite number) of points that the ray passes through.
Definition at line 58 of file half_line.h.
References m_seg.
|
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 83 of file half_line.h.
References m_seg.
Referenced by Intersect(), and Intersect().
|
inline |
Get the start point of the ray.
Definition at line 53 of file half_line.h.
References m_seg.
Referenced by KIGEOM::ClipHalfLineToBox().
| OPT_VECTOR2I HALF_LINE::Intersect | ( | const HALF_LINE & | aOther | ) | const |
Definition at line 82 of file half_line.cpp.
References SEG::A, SEG::B, GetContainedSeg(), HALF_LINE(), m_seg, and VectorsInSameQuadrant().
| OPT_VECTOR2I HALF_LINE::Intersect | ( | const SEG & | aSeg | ) | const |
Definition at line 53 of file half_line.cpp.
References 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 106 of file half_line.cpp.
References 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 76 of file half_line.h.
References HALF_LINE(), and m_seg.
|
private |
Internally, we can represent a just a segment that the ray passes through.
Definition at line 87 of file half_line.h.
Referenced by Contains(), GetContainedPoint(), GetContainedSeg(), GetStart(), HALF_LINE(), HALF_LINE(), Intersect(), Intersect(), NearestPoint(), and operator==().