library of assembled shared sources |
http://lass.cocamware.com |
#include <parallelogram_3d.h>
Data Structures | |
struct | Rebind |
Public Types | |
enum | { dimension = TPoint::dimension } |
typedef Parallelogram3D< T > | TSelf |
typedef Point3D< T > | TPoint |
typedef Point3DH< T > | TPointH |
typedef TPoint::TVector | TVector |
typedef Point2D< T > | TUV |
typedef Plane3D< T, Cartesian, Normalized > | TPlane |
typedef TPoint::TValue | TValue |
typedef TPoint::TParam | TParam |
typedef TPoint::TReference | TReference |
typedef TPoint::TConstReference | TConstReference |
typedef TPoint::TNumTraits | TNumTraits |
Public Member Functions | |
Parallelogram3D () | |
constructs an empty parallelogram. | |
Parallelogram3D (const TPoint &iSupport, const TVector &iSizeX, const TVector &iSizeY) | |
Constructs a parallelogram with a support and two sizes. | |
const TPoint & | support () const |
TPoint & | support () |
const TVector & | sizeU () const |
TVector & | sizeU () |
const TVector & | sizeV () const |
TVector & | sizeV () |
const TPlane | plane () const |
const TValue | squaredArea () const |
returns squared area of parallelogram to avoid the square root. | |
const TValue | area () const |
const TValue | perimeter () const |
const TPoint | point (TParam iU, TParam iV) const |
const TPoint | point (const TUV &iUV) const |
const TUV | uv (const TPoint &iPoint) const |
const bool | isSimple () const |
const bool | isConvex () const |
const bool | isReflex (int iIndexOfVertex) const |
Private Attributes | |
TPoint | support_ |
TVector | sizeU_ |
TVector | sizeV_ |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T > | |
io::XmlOStream & | operator<< (io::XmlOStream &ioOStream, const Parallelogram3D< T > &iParallelogram) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &ioOStream, const Parallelogram3D< T > &iParallelogram) |
template<typename T , class NP , class PP > | |
Result | intersect (const Parallelogram3D< T > ¶llelogram, const Ray3D< T, NP, PP > &ray, T &u, T &v, T &t, const T &tMin=T()) |
Find the intersection of a ray and a parallelogram by their parameter t on the ray and it's coordinates (u,v) on the parallelogram. | |
template<typename T , class NP , class PP > | |
Result | intersect (const Parallelogram3D< T > ¶llelogram, const Ray3D< T, NP, PP > &ray, T &t, const T &tMin=T()) |
Find the intersection of a ray and a parallelogram by their parameter t on the ray. |
Definition at line 63 of file parallelogram_3d.h.
typedef Parallelogram3D<T> lass::prim::Parallelogram3D< T >::TSelf |
Definition at line 67 of file parallelogram_3d.h.
typedef Point3D<T> lass::prim::Parallelogram3D< T >::TPoint |
Definition at line 69 of file parallelogram_3d.h.
typedef Point3DH<T> lass::prim::Parallelogram3D< T >::TPointH |
Definition at line 70 of file parallelogram_3d.h.
typedef TPoint::TVector lass::prim::Parallelogram3D< T >::TVector |
Definition at line 71 of file parallelogram_3d.h.
typedef Point2D<T> lass::prim::Parallelogram3D< T >::TUV |
Definition at line 72 of file parallelogram_3d.h.
typedef Plane3D<T, Cartesian, Normalized> lass::prim::Parallelogram3D< T >::TPlane |
Definition at line 73 of file parallelogram_3d.h.
typedef TPoint::TValue lass::prim::Parallelogram3D< T >::TValue |
Definition at line 75 of file parallelogram_3d.h.
typedef TPoint::TParam lass::prim::Parallelogram3D< T >::TParam |
Definition at line 76 of file parallelogram_3d.h.
typedef TPoint::TReference lass::prim::Parallelogram3D< T >::TReference |
Definition at line 77 of file parallelogram_3d.h.
typedef TPoint::TConstReference lass::prim::Parallelogram3D< T >::TConstReference |
Definition at line 78 of file parallelogram_3d.h.
typedef TPoint::TNumTraits lass::prim::Parallelogram3D< T >::TNumTraits |
Definition at line 79 of file parallelogram_3d.h.
anonymous enum |
lass::prim::Parallelogram3D< T >::Parallelogram3D | ( | ) | [inline] |
constructs an empty parallelogram.
support is origin and sizes are zero.
Definition at line 61 of file parallelogram_3d.inl.
lass::prim::Parallelogram3D< T >::Parallelogram3D | ( | const TPoint & | iSupport, | |
const TVector & | iSizeX, | |||
const TVector & | iSizeY | |||
) | [inline] |
Constructs a parallelogram with a support and two sizes.
Definition at line 70 of file parallelogram_3d.inl.
const Parallelogram3D< T >::TPoint & lass::prim::Parallelogram3D< T >::support | ( | ) | const [inline] |
Definition at line 82 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::support_.
Referenced by lass::prim::Aabb3D< T, MinMaxPolicy >::aabb(), and lass::prim::Parallelogram3D< T >::intersect().
Parallelogram3D< T >::TPoint & lass::prim::Parallelogram3D< T >::support | ( | ) | [inline] |
Definition at line 91 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::support_.
const Parallelogram3D< T >::TVector & lass::prim::Parallelogram3D< T >::sizeU | ( | ) | const [inline] |
Definition at line 100 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::sizeU_.
Referenced by lass::prim::Aabb3D< T, MinMaxPolicy >::aabb(), and lass::prim::Parallelogram3D< T >::intersect().
Parallelogram3D< T >::TVector & lass::prim::Parallelogram3D< T >::sizeU | ( | ) | [inline] |
Definition at line 109 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::sizeU_.
const Parallelogram3D< T >::TVector & lass::prim::Parallelogram3D< T >::sizeV | ( | ) | const [inline] |
Definition at line 118 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::sizeV_.
Referenced by lass::prim::Aabb3D< T, MinMaxPolicy >::aabb(), and lass::prim::Parallelogram3D< T >::intersect().
Parallelogram3D< T >::TVector & lass::prim::Parallelogram3D< T >::sizeV | ( | ) | [inline] |
Definition at line 127 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::sizeV_.
const Parallelogram3D< T >::TPlane lass::prim::Parallelogram3D< T >::plane | ( | ) | const [inline] |
Definition at line 136 of file parallelogram_3d.inl.
References lass::prim::cross(), lass::prim::Parallelogram3D< T >::sizeU_, lass::prim::Parallelogram3D< T >::sizeV_, and lass::prim::Parallelogram3D< T >::support_.
const Parallelogram3D< T >::TValue lass::prim::Parallelogram3D< T >::squaredArea | ( | ) | const [inline] |
returns squared area of parallelogram to avoid the square root.
Definition at line 148 of file parallelogram_3d.inl.
References lass::prim::cross(), lass::prim::Parallelogram3D< T >::sizeU_, and lass::prim::Parallelogram3D< T >::sizeV_.
Referenced by lass::prim::Parallelogram3D< T >::area().
const Parallelogram3D< T >::TValue lass::prim::Parallelogram3D< T >::area | ( | ) | const [inline] |
return area of the polygons surface.
The area of a surface is the amount of material needed to "cover" it completely, Eric W. Weisstein. "Area." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Area.html
Definition at line 159 of file parallelogram_3d.inl.
References sqrt(), and lass::prim::Parallelogram3D< T >::squaredArea().
const Parallelogram3D< T >::TValue lass::prim::Parallelogram3D< T >::perimeter | ( | ) | const [inline] |
return sum of the lengths of all edges
Definition at line 170 of file parallelogram_3d.inl.
References lass::prim::Vector3D< T >::norm(), lass::prim::Parallelogram3D< T >::sizeU_, and lass::prim::Parallelogram3D< T >::sizeV_.
const Parallelogram3D< T >::TPoint lass::prim::Parallelogram3D< T >::point | ( | TParam | iU, | |
TParam | iV | |||
) | const [inline] |
Definition at line 179 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::sizeU_, lass::prim::Parallelogram3D< T >::sizeV_, and lass::prim::Parallelogram3D< T >::support_.
Referenced by lass::prim::Parallelogram3D< T >::point().
const Parallelogram3D< T >::TPoint lass::prim::Parallelogram3D< T >::point | ( | const TUV & | iUV | ) | const [inline] |
Definition at line 188 of file parallelogram_3d.inl.
References lass::prim::Parallelogram3D< T >::point(), lass::prim::Point2D< T >::x, and lass::prim::Point2D< T >::y.
const Parallelogram3D< T >::TUV lass::prim::Parallelogram3D< T >::uv | ( | const TPoint & | iPoint | ) | const [inline] |
const bool lass::prim::Parallelogram3D< T >::isSimple | ( | ) | const [inline] |
return true if polygon is simple, false if not.
A polygon P is said to be simple (or Jordan) if the only points of the plane belonging to two polygon edges of P are the polygon vertices of P. Such a polygon has a well defined interior and exterior. Simple polygons are topologically equivalent to a disk., Eric W. Weisstein. "Simple Polygon." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/SimplePolygon.html
In 3D, we test if the 2D mapping on the major axis is simple.
Definition at line 213 of file parallelogram_3d.inl.
const bool lass::prim::Parallelogram3D< T >::isConvex | ( | ) | const [inline] |
return true if polygon is convex, false if not.
A simple polygon is convex if all the cross products of adjacent edges will be the same sign (we ignore zero signs, only + or - are taken in account), a concave polygon will have a mixture of cross product signs.
A polygon with less than three vertices is always convex. A polygon with all colinear vertices is considered convex (not very usefull maybe, but convex).
Definition at line 225 of file parallelogram_3d.inl.
const bool lass::prim::Parallelogram3D< T >::isReflex | ( | int | iIndexOfVertex | ) | const [inline] |
return true if inner angle of vertex is reflex (is > 180 degrees).
Definition at line 237 of file parallelogram_3d.inl.
io::XmlOStream & operator<< | ( | io::XmlOStream & | ioOStream, | |
const Parallelogram3D< T > & | iParallelogram | |||
) | [related] |
std::ostream & operator<< | ( | std::ostream & | ioOStream, | |
const Parallelogram3D< T > & | iParallelogram | |||
) | [related] |
Result intersect | ( | const Parallelogram3D< T > & | parallelogram, | |
const Ray3D< T, NP, PP > & | ray, | |||
T & | u, | |||
T & | v, | |||
T & | t, | |||
const T & | tMin = T() | |||
) | [related] |
Find the intersection of a ray and a parallelogram by their parameter t on the ray and it's coordinates (u,v) on the parallelogram.
A maximum of two possible intersections with t > 0.
parallelogram | [in] the parallelogram | |
ray | [in] the ray | |
oU | [out] the parameter of the intersection point on the parallelogram. | |
oV | [out] the parameter of the intersection point on the parallelogram. | |
t | [out] the parameter of the intersection point > tMin. | |
tMin | [in] the minimum t that may be returned as valid intersection. |
Definition at line 79 of file parallelogram_3d_ray_3d.h.
References lass::prim::cross(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::direction(), lass::prim::dot(), lass::num::inv(), lass::prim::rNone, lass::prim::rOne, lass::prim::Parallelogram3D< T >::sizeU(), lass::prim::Parallelogram3D< T >::sizeV(), lass::prim::Parallelogram3D< T >::support(), and lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::support().
Result intersect | ( | const Parallelogram3D< T > & | parallelogram, | |
const Ray3D< T, NP, PP > & | ray, | |||
T & | t, | |||
const T & | tMin = T() | |||
) | [related] |
Find the intersection of a ray and a parallelogram by their parameter t on the ray.
A maximum of two possible intersections with t > 0.
parallelogram | [in] the parallelogram | |
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 141 of file parallelogram_3d_ray_3d.h.
References lass::prim::intersect(), and lass::stde::T.
TPoint lass::prim::Parallelogram3D< T >::support_ [private] |
Definition at line 116 of file parallelogram_3d.h.
Referenced by lass::prim::Parallelogram3D< T >::plane(), lass::prim::Parallelogram3D< T >::point(), lass::prim::Parallelogram3D< T >::support(), and lass::prim::Parallelogram3D< T >::uv().
TVector lass::prim::Parallelogram3D< T >::sizeU_ [private] |
Definition at line 117 of file parallelogram_3d.h.
Referenced by lass::prim::Parallelogram3D< T >::perimeter(), lass::prim::Parallelogram3D< T >::plane(), lass::prim::Parallelogram3D< T >::point(), lass::prim::Parallelogram3D< T >::sizeU(), lass::prim::Parallelogram3D< T >::squaredArea(), and lass::prim::Parallelogram3D< T >::uv().
TVector lass::prim::Parallelogram3D< T >::sizeV_ [private] |
Definition at line 118 of file parallelogram_3d.h.
Referenced by lass::prim::Parallelogram3D< T >::perimeter(), lass::prim::Parallelogram3D< T >::plane(), lass::prim::Parallelogram3D< T >::point(), lass::prim::Parallelogram3D< T >::sizeV(), lass::prim::Parallelogram3D< T >::squaredArea(), and lass::prim::Parallelogram3D< T >::uv().
Generated on Mon Nov 10 14:22:13 2008 for Library of Assembled Shared Sources by 1.5.7.1 |