library of assembled shared sources |
http://lass.cocamware.com |
#include <ray_2d.h>
Data Structures | |
struct | Rebind |
Public Types | |
enum | { dimension = TPoint::dimension } |
typedef Ray2D< T, NormalizingPolicy, ParameterPolicy > | TSelf |
typedef NormalizingPolicy | TNormalizingPolicy |
typedef ParameterPolicy | TParameterPolicy |
typedef Point2D< T > | TPoint |
typedef TPoint::TVector | TVector |
typedef TPoint::TValue | TValue |
typedef TPoint::TParam | TParam |
typedef TPoint::TReference | TReference |
typedef TPoint::TConstReference | TConstReference |
typedef TPoint::TNumTraits | TNumTraits |
Public Member Functions | |
Ray2D () | |
Ray2D (const TPoint &iSupport, const TVector &iDirection) | |
Ray2D (const TPoint &iSupport, const TPoint &iLookAt) | |
const TPoint & | support () const |
return origin of ray. | |
TPoint & | support () |
access origin of ray the origin is also the support point of the ray. | |
const TVector & | direction () const |
Return direction of ray. | |
void | setDirection (const TVector &iDirection) |
Set direction and normalize it if that's the policy. | |
void | lookAt (const TPoint &iLookAt) |
Set direction from origin to look-at point. | |
const TPoint | point (TParam a_t) const |
Return point on ray by it's parameter. | |
const TValue | t (const TPoint &iPoint) const |
Return parameter of point on the ray that is the projection of the given point. | |
const TVector | project (const TVector &iVector) const |
Project vector on the axis of the ray. | |
const TVector | reject (const TVector &iVector) const |
Reject vector against the axis of the ray. | |
const TVector | reflect (const TVector &iVector) const |
Reflect vector against the axis of the ray. | |
const TPoint | project (const TPoint &iPoint) const |
Project point on the axis of the ray. | |
const TVector | reject (const TPoint &iPoint) const |
Reject point against the axis of the ray. | |
const TPoint | reflect (const TPoint &iPoint) const |
Reject point against the axis of the ray. | |
const Side | classify (const TPoint &iPoint) const |
Return on what side a point is located. | |
const bool | isValid () const |
Return true if ray is valid (direction isn't a zero vector). | |
Private Attributes | |
TPoint | support_ |
TVector | direction_ |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , typename MMPAabb , typename NPRay , typename PPRay > | |
Result | intersect (const Aabb2D< T, MMPAabb > &aabb, const Ray2D< T, NPRay, PPRay > &ray, T &t, const T &tMin=T()) |
Find the intersection of an AABB and ray by their parameter t on the ray. | |
template<typename T , class EP1 , class NP1 , class NP2 , class PP2 > | |
Result | intersect (const Line2D< T, EP1, NP1 > &line, const Ray2D< T, NP2, PP2 > &ray, T &t, const T &tMin=T()) |
Find the intersection of a line and ray by their parameter t on the ray. | |
template<typename T , class PP1 , class NP2 , class PP2 > | |
Result | intersect (const LineSegment2D< T, PP1 > &lineSegment, const Ray2D< T, NP2, PP2 > &ray, T &t, const T &tMin=T()) |
Find the intersection of a ray and a line segment by parameter t on the ray. | |
template<typename T , class NP > | |
std::ostream & | operator<< (std::ostream &ioOStream, const Ray2D< T, NP > &iRay) |
template<typename T , class NP > | |
io::XmlOStream & | operator<< (io::XmlOStream &ioOStream, const Ray2D< T, NP > &iRay) |
Definition at line 77 of file ray_2d.h.
typedef Ray2D<T, NormalizingPolicy, ParameterPolicy> lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TSelf |
typedef NormalizingPolicy lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TNormalizingPolicy |
typedef ParameterPolicy lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TParameterPolicy |
typedef Point2D<T> lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TPoint |
typedef TPoint::TVector lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TVector |
typedef TPoint::TValue lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TValue |
typedef TPoint::TParam lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TParam |
typedef TPoint::TReference lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TReference |
typedef TPoint::TConstReference lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TConstReference |
typedef TPoint::TNumTraits lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::TNumTraits |
anonymous enum |
lass::prim::Ray2D< T, NP, PP >::Ray2D | ( | ) | [inline] |
lass::prim::Ray2D< T, NP, PP >::Ray2D | ( | const TPoint & | iSupport, | |
const TVector & | iDirection | |||
) | [inline] |
Definition at line 73 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_.
lass::prim::Ray2D< T, NP, PP >::Ray2D | ( | const TPoint & | iSupport, | |
const TPoint & | iLookAt | |||
) | [inline] |
Definition at line 83 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_.
const Ray2D< T, NP, PP >::TPoint & lass::prim::Ray2D< T, NP, PP >::support | ( | ) | const [inline] |
return origin of ray.
the origin is also the support point of the ray.
Definition at line 97 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_.
Referenced by lass::prim::Triangle2D< T >::intersect(), lass::prim::SimplePolygon2D< T, DegeneratePolicy >::intersect(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::intersect(), lass::spat::PlanarMesh::pointShoot(), lass::spat::PlanarMesh::shoot(), and lass::spat::PlanarMesh::walkTillConstrained().
Ray2D< T, NP, PP >::TPoint & lass::prim::Ray2D< T, NP, PP >::support | ( | ) | [inline] |
access origin of ray the origin is also the support point of the ray.
Definition at line 109 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray2D< T, NP, PP >::TVector & lass::prim::Ray2D< T, NP, PP >::direction | ( | ) | const [inline] |
Return direction of ray.
Definition at line 120 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_.
Referenced by lass::prim::Triangle2D< T >::intersect(), lass::prim::SimplePolygon2D< T, DegeneratePolicy >::intersect(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::intersect(), and lass::spat::PlanarMesh::walkTillConstrained().
void lass::prim::Ray2D< T, NP, PP >::setDirection | ( | const TVector & | iDirection | ) | [inline] |
Set direction and normalize it if that's the policy.
Definition at line 130 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_.
void lass::prim::Ray2D< T, NP, PP >::lookAt | ( | const TPoint & | iLookAt | ) | [inline] |
Set direction from origin to look-at point.
Definition at line 141 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_, and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray2D< T, NP, PP >::TPoint lass::prim::Ray2D< T, NP, PP >::point | ( | TParam | iT | ) | const [inline] |
Return point on ray by it's parameter.
throw | an error if parameter is out of range t >= 0, if Bounded is used as ParameterPolicy . |
Definition at line 156 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_, lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_, and lass::num::NumTraits< C >::zero.
Referenced by lass::spat::impl::BrutePointLocator::findEdge(), lass::spat::PlanarMesh::locate(), lass::spat::PlanarMesh::pointShoot(), and lass::spat::PlanarMesh::shoot().
const Ray2D< T, NP, PP >::TValue lass::prim::Ray2D< T, NP, PP >::t | ( | const TPoint & | iPoint | ) | const [inline] |
Return parameter of point on the ray that is the projection of the given point.
Definition at line 169 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_, lass::prim::dot(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_.
Referenced by lass::spat::impl::BrutePointLocator::findEdge(), lass::spat::PlanarMesh::locate(), lass::spat::PlanarMesh::pointShoot(), lass::spat::PlanarMesh::safeSplitEdge(), and lass::spat::PlanarMesh::shoot().
const Ray2D< T, NP, PP >::TVector lass::prim::Ray2D< T, NP, PP >::project | ( | const TVector & | iVector | ) | const [inline] |
Project vector on the axis of the ray.
Definition at line 180 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_, and lass::prim::dot().
Referenced by lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::project(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reflect(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reject().
const Ray2D< T, NP, PP >::TVector lass::prim::Ray2D< T, NP, PP >::reject | ( | const TVector & | iVector | ) | const [inline] |
Reject vector against the axis of the ray.
Definition at line 191 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::project().
Referenced by lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reject().
const Ray2D< T, NP, PP >::TVector lass::prim::Ray2D< T, NP, PP >::reflect | ( | const TVector & | iVector | ) | const [inline] |
Reflect vector against the axis of the ray.
Definition at line 202 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::project().
Referenced by lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reflect().
const Ray2D< T, NP, PP >::TPoint lass::prim::Ray2D< T, NP, PP >::project | ( | const TPoint & | iPoint | ) | const [inline] |
Project point on the axis of the ray.
Definition at line 214 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::project(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray2D< T, NP, PP >::TVector lass::prim::Ray2D< T, NP, PP >::reject | ( | const TPoint & | iPoint | ) | const [inline] |
Reject point against the axis of the ray.
Definition at line 225 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reject(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Ray2D< T, NP, PP >::TPoint lass::prim::Ray2D< T, NP, PP >::reflect | ( | const TPoint & | iPoint | ) | const [inline] |
Reject point against the axis of the ray.
Definition at line 236 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reflect(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_.
const Side lass::prim::Ray2D< T, NP, PP >::classify | ( | const TPoint & | iPoint | ) | const [inline] |
Return on what side a point is located.
Definition at line 246 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_, lass::prim::doubleTriangleArea(), lass::prim::sLeft, lass::prim::sRight, lass::prim::sSurface, lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_, and lass::stde::T.
Referenced by lass::spat::PlanarMesh::pointShoot(), and lass::spat::PlanarMesh::shoot().
const bool lass::prim::Ray2D< T, NP, PP >::isValid | ( | ) | const [inline] |
Return true if ray is valid (direction isn't a zero vector).
Definition at line 260 of file ray_2d.inl.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_, and lass::prim::Vector2D< T >::isZero().
Referenced by lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::intersect().
Result intersect | ( | const Aabb2D< T, MMPAabb > & | aabb, | |
const Ray2D< T, NPRay, PPRay > & | ray, | |||
T & | t, | |||
const T & | tMin = T() | |||
) | [related] |
Find the intersection of an AABB and ray by their parameter t on the ray.
aabb | [in] the AABB | |
ray | [in] the ray | |
t | [out] the parameter of the intersection point > tMin. | |
tMin | [in] the minimum t that may be returned as valid intersection. |
Definition at line 70 of file aabb_2d_ray_2d.h.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::impl::interectSlab(), lass::prim::Aabb2D< T, MinMaxPolicy >::isEmpty(), lass::prim::Aabb2D< T, MinMaxPolicy >::max(), lass::prim::Aabb2D< T, MinMaxPolicy >::min(), lass::prim::rNone, lass::prim::rOne, lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support(), and lass::stde::T.
Result intersect | ( | const Line2D< T, EP1, NP1 > & | line, | |
const Ray2D< T, NP2, PP2 > & | ray, | |||
T & | t, | |||
const T & | tMin = T() | |||
) | [related] |
Find the intersection of a line and ray by their parameter t on the ray.
line | [in] the line | |
ray | [in] the ray | |
t | [out] the parameter of the intersection point > tMin. | |
tMin | [in] the minimum t that may be returned as valid intersection. |
Definition at line 74 of file line_2d_ray_2d.h.
References lass::prim::Line2D< T, EquationPolicy, NormalizingPolicy >::classify(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::impl::Line2DCartesian< T, NormalizingPolicy >::equation(), lass::num::isNaN(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::isValid(), lass::prim::impl::Line2DCartesian< T, NormalizingPolicy >::isValid(), LASS_ASSERT, lass::prim::impl::Line2DCartesian< T, NormalizingPolicy >::normal(), lass::prim::perpDot(), lass::prim::rInfinite, lass::prim::rInvalid, lass::prim::rNone, lass::prim::rOne, lass::prim::sBack, lass::prim::sFront, lass::prim::sSurface, and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support().
Result intersect | ( | const LineSegment2D< T, PP1 > & | lineSegment, | |
const Ray2D< T, NP2, PP2 > & | ray, | |||
T & | t, | |||
const T & | tMin = T() | |||
) | [related] |
Find the intersection of a ray and a line segment by parameter t on the ray.
lineSegment | [in] the line segment | |
ray | [in] the ray | |
t | [out] the parameter of the intersection point > tMin. | |
tMin | [in] the minimum t that may be returned as valid intersection. |
Definition at line 70 of file line_segment_2d_ray_2d.h.
References lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::LineSegment2D< T, ParameterPolicy >::head(), lass::prim::impl::intersectEdge2D(), lass::prim::rNone, lass::prim::rOne, lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support(), and lass::prim::LineSegment2D< T, ParameterPolicy >::tail().
std::ostream & operator<< | ( | std::ostream & | ioOStream, | |
const Ray2D< T, NP > & | iRay | |||
) | [related] |
io::XmlOStream & operator<< | ( | io::XmlOStream & | ioOStream, | |
const Ray2D< T, NP > & | iRay | |||
) | [related] |
TPoint lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support_ [private] |
Definition at line 131 of file ray_2d.h.
Referenced by lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::classify(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::lookAt(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::point(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::project(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::Ray2D(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reflect(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::reject(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::support(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::t().
TVector lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction_ [private] |
Definition at line 132 of file ray_2d.h.
Referenced by lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::classify(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::isValid(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::lookAt(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::point(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::project(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::Ray2D(), lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::setDirection(), and lass::prim::Ray2D< T, NormalizingPolicy, ParameterPolicy >::t().
Generated on Mon Nov 10 14:22:14 2008 for Library of Assembled Shared Sources by 1.5.7.1 |