library of assembled shared sources |
http://lass.cocamware.com |
#include <simple_polygon_3d.h>
Data Structures | |
struct | Rebind |
Public Types | |
enum | { dimension = TPoint::dimension } |
typedef SimplePolygon3D< T > | TSelf |
typedef Point3D< T > | TPoint |
typedef Point3DH< T > | TPointH |
typedef TPoint::TVector | TVector |
typedef LineSegment3D< T > | TLineSegment |
typedef Plane3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy > | TPlane |
typedef TPoint::TValue | TValue |
typedef TPoint::TParam | TParam |
typedef TPoint::TReference | TReference |
typedef TPoint::TConstReference | TConstReference |
typedef TPoint::TNumTraits | TNumTraits |
Public Member Functions | |
SimplePolygon3D (const TPlane &iPlane) | |
SimplePolygon3D (const TPoint &iA, const TPoint &iB, const TPoint &iC) | |
const TPoint & | operator[] (size_t iIndexOfVertex) const |
return vertex of polygon by its index, not wrapped, no bounds check. | |
TPoint & | operator[] (size_t iIndexOfVertex) |
return vertex of polygon by its index, not wrapped, no bounds check. | |
const TPoint & | at (int iIndexOfVertex) const |
return vertex of polygon by its index, but wrap around the bounds. | |
TPoint & | at (int iIndexOfVertex) |
return vertex of polygon by its index, but wrap around the bounds. | |
const TLineSegment | edge (int iIndexOfTailVertex) const |
return the edge of the polygon between vertices at(iIndex) and at(iIndex + 1). | |
const TVector | vector (int iIndexOfTailVertex) const |
return the vector between vertices at(iIndex) and at(iIndex + 1)\ | |
const TPlane & | plane () const |
return support plane of polygon. | |
TPlane & | plane () |
access support plane of polygon. | |
const TVector | normal () const |
return normal of plane | |
const XYZ | majorAxis () const |
determines the major axis of the normal vector. | |
void | add (const TPoint &iVertex) |
add a point at the "end" of the vertex list | |
void | insert (int iIndexOfVertex, const TPoint &iVertex) |
insert a vertex at iIndex (so it will sit before the current at(iIndex)). | |
void | remove (int iIndexOfVertex) |
remove the vertex at(iIndex) | |
const bool | isEmpty () const |
return true if polygon has no vertices | |
const size_t | size () const |
return number of vertices | |
const TValue | signedArea () const |
return signed polygon area. | |
const TValue | area () const |
return area of the polygons surface. | |
const TValue | perimeter () const |
return sum of the lengths of all edges | |
const TPointH | vertexCentroid () const |
return the barycenter of all vertices. | |
const TPointH | surfaceCentroid () const |
return the centroid of the filled polygon. | |
const bool | isSimple () const |
return true if polygon is simple, false if not. | |
const bool | isConvex () const |
return true if polygon is convex, false if not. | |
const bool | isConcave () const |
const Orientation | orientation () const |
return orientation of polygon | |
const bool | isReflex (int iIndexOfVertex) const |
return true if inner angle of vertex is reflex (is > 180 degrees). | |
const SimplePolygon2D< T > | mapping (XYZ iAxis) const |
maps a 3D polygon as a 2D polygon by ignoring the component along an axis. | |
const Side | classify (const TPoint &iP) const |
const bool | contains (const TPoint &iP) const |
return true if a point iP is inside the polygon, on condition iP is on the plane | |
void | flip () |
flip normal and reverse sequence of vertices | |
Private Types | |
typedef std::vector< TPoint > | TVertices |
Private Member Functions | |
const bool | isInRange (int iIndexOfVertex) const |
return if index of vertex is in range of the std::vector | |
Private Attributes | |
TVertices | vertices_ |
TPlane | plane_ |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T , class EP , class NP , class MMP > | |
SimplePolygon3D< T, EP, NP > | clip (const Aabb3D< T, MMP > &iAabb, const Plane3D< T, EP, NP > &iPlane) |
Clip a plane to an AABB and get a polygon. | |
template<typename T , class EP1 , class NP1 , class NP2 , class PP2 > | |
Result | intersect (const SimplePolygon3D< T, EP1, NP1 > &polygon, const Ray3D< T, NP2, PP2 > &triangle, T &t, const T &tMin) |
Find the intersection of a ray and a simple polygon by their parameter t on the ray. | |
template<typename T , class EP , class NP , class PP > | |
Result | intersect (const SimplePolygon3D< T, EP, NP > &iPolygon, const LineSegment3D< T, PP > &iSegment, T &oT, const T &iMinT) |
Find the intersection of a line segment and a simple polygon by their parameter t on the line segment. | |
template<typename T , class EP , class NP > | |
io::XmlOStream & | operator<< (io::XmlOStream &ioOStream, const SimplePolygon3D< T, EP, NP > &iPolygon) |
template<typename T , class EP , class NP > | |
std::ostream & | operator<< (std::ostream &ioOStream, const SimplePolygon3D< T, EP, NP > &iPolygon) |
also, SimplePolygon3D only assumes it's flat! It's up to you to feed it with vertices that are coplanar. However ... We provide tools to "flatten" it.
Definition at line 79 of file simple_polygon_3d.h.
typedef SimplePolygon3D<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TSelf |
Definition at line 83 of file simple_polygon_3d.h.
typedef Point3D<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TPoint |
Definition at line 85 of file simple_polygon_3d.h.
typedef Point3DH<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TPointH |
Definition at line 86 of file simple_polygon_3d.h.
typedef TPoint::TVector lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TVector |
Definition at line 87 of file simple_polygon_3d.h.
typedef LineSegment3D<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TLineSegment |
Definition at line 88 of file simple_polygon_3d.h.
typedef Plane3D<T, PlaneEquationPolicy, PlaneNormalizingPolicy> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TPlane |
Definition at line 89 of file simple_polygon_3d.h.
typedef TPoint::TValue lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TValue |
Definition at line 91 of file simple_polygon_3d.h.
typedef TPoint::TParam lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TParam |
Definition at line 92 of file simple_polygon_3d.h.
typedef TPoint::TReference lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TReference |
Definition at line 93 of file simple_polygon_3d.h.
typedef TPoint::TConstReference lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TConstReference |
Definition at line 94 of file simple_polygon_3d.h.
typedef TPoint::TNumTraits lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TNumTraits |
Definition at line 95 of file simple_polygon_3d.h.
typedef std::vector<TPoint> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TVertices [private] |
Definition at line 149 of file simple_polygon_3d.h.
anonymous enum |
lass::prim::SimplePolygon3D< T, EP, NP >::SimplePolygon3D | ( | const TPlane & | iPlane | ) | [inline] |
Definition at line 57 of file simple_polygon_3d.inl.
lass::prim::SimplePolygon3D< T, EP, NP >::SimplePolygon3D | ( | const TPoint & | iA, | |
const TPoint & | iB, | |||
const TPoint & | iC | |||
) | [inline] |
Definition at line 62 of file simple_polygon_3d.inl.
const SimplePolygon3D< T, EP, NP >::TPoint & lass::prim::SimplePolygon3D< T, EP, NP >::operator[] | ( | size_t | iIndexOfVertex | ) | const [inline] |
return vertex of polygon by its index, not wrapped, no bounds check.
Definition at line 75 of file simple_polygon_3d.inl.
References LASS_ASSERT, and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
SimplePolygon3D< T, EP, NP >::TPoint & lass::prim::SimplePolygon3D< T, EP, NP >::operator[] | ( | size_t | iIndexOfVertex | ) | [inline] |
return vertex of polygon by its index, not wrapped, no bounds check.
Definition at line 87 of file simple_polygon_3d.inl.
References LASS_ASSERT, and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
const SimplePolygon3D< T, EP, NP >::TPoint & lass::prim::SimplePolygon3D< T, EP, NP >::at | ( | int | iIndexOfVertex | ) | const [inline] |
return vertex of polygon by its index, but wrap around the bounds.
this->at(-1) will return the same vertex as this->at(this->size() - 1);
Definition at line 100 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isInRange(), LASS_ASSERT, lass::num::mod(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::edge(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::perimeter(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vector().
SimplePolygon3D< T, EP, NP >::TPoint & lass::prim::SimplePolygon3D< T, EP, NP >::at | ( | int | iIndexOfVertex | ) | [inline] |
return vertex of polygon by its index, but wrap around the bounds.
this->at(-1) will return the same vertex as this->at(this->size() - 1);
Definition at line 114 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isInRange(), LASS_ASSERT, lass::num::mod(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
const SimplePolygon3D< T, EP, NP >::TLineSegment lass::prim::SimplePolygon3D< T, EP, NP >::edge | ( | int | iIndexOfTailVertex | ) | const [inline] |
return the edge of the polygon between vertices at(iIndex) and at(iIndex + 1).
Definition at line 127 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::at().
const SimplePolygon3D< T, EP, NP >::TVector lass::prim::SimplePolygon3D< T, EP, NP >::vector | ( | int | iIndexOfTailVertex | ) | const [inline] |
return the vector between vertices at(iIndex) and at(iIndex + 1)\
Definition at line 138 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::at().
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isConvex(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isReflex().
const SimplePolygon3D< T, EP, NP >::TPlane & lass::prim::SimplePolygon3D< T, EP, NP >::plane | ( | ) | const [inline] |
return support plane of polygon.
Definition at line 149 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane_.
Referenced by lass::prim::Plane3D< T, EquationPolicy, NormalizingPolicy >::clip(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::intersect().
SimplePolygon3D< T, EP, NP >::TPlane & lass::prim::SimplePolygon3D< T, EP, NP >::plane | ( | ) | [inline] |
access support plane of polygon.
Definition at line 160 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane_.
const SimplePolygon3D< T, EP, NP >::TVector lass::prim::SimplePolygon3D< T, EP, NP >::normal | ( | ) | const [inline] |
return normal of plane
Definition at line 171 of file simple_polygon_3d.inl.
References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane_.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isReflex(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::signedArea(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::surfaceCentroid().
const XYZ lass::prim::SimplePolygon3D< T, EP, NP >::majorAxis | ( | ) | const [inline] |
determines the major axis of the normal vector.
The major axis is the one with the largest (absolute) component value. e.g. if the normal vector is (-1, 4, -8), this will be the z axis because abs(-8) > abs(4) > abs(-1). In case there's more than one major axis possible, the "highest" index is choosen. e.g. if the normal vector is (1, 1, 0), then y axis will be choosen, because y has a higher index than x .
Definition at line 186 of file simple_polygon_3d.inl.
References lass::prim::Plane3D< T, EquationPolicy, NormalizingPolicy >::majorAxis(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane_.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::contains(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isSimple().
void lass::prim::SimplePolygon3D< T, EP, NP >::add | ( | const TPoint & | iVertex | ) | [inline] |
add a point at the "end" of the vertex list
Definition at line 196 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
Referenced by lass::prim::Plane3D< T, EquationPolicy, NormalizingPolicy >::clip().
void lass::prim::SimplePolygon3D< T, EP, NP >::insert | ( | int | iIndexOfVertex, | |
const TPoint & | iVertex | |||
) | [inline] |
insert a vertex at iIndex (so it will sit before the current at(iIndex)).
Definition at line 205 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isInRange(), LASS_ASSERT, lass::num::mod(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
void lass::prim::SimplePolygon3D< T, EP, NP >::remove | ( | int | iIndexOfVertex | ) | [inline] |
remove the vertex at(iIndex)
Definition at line 217 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isInRange(), LASS_ASSERT, lass::num::mod(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
const bool lass::prim::SimplePolygon3D< T, EP, NP >::isEmpty | ( | ) | const [inline] |
return true if polygon has no vertices
Definition at line 229 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
const size_t lass::prim::SimplePolygon3D< T, EP, NP >::size | ( | ) | const [inline] |
return number of vertices
Definition at line 239 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
Referenced by lass::prim::Aabb3D< T, MinMaxPolicy >::aabb(), lass::prim::Plane3D< T, EquationPolicy, NormalizingPolicy >::clip(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::contains(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isConvex(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::mapping(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::perimeter(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::signedArea(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::surfaceCentroid(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertexCentroid().
const SimplePolygon3D< T, EP, NP >::TValue lass::prim::SimplePolygon3D< T, EP, NP >::signedArea | ( | ) | const [inline] |
return signed polygon area.
The area of a convex polygon is defined to be positive if the points are arranged in a counterclockwise order, and negative if they are in clockwise order., Eric W. Weisstein. "Polygon Area." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/PolygonArea.html
Definition at line 260 of file simple_polygon_3d.inl.
References lass::prim::cross(), lass::prim::dot(), lass::prim::Vector3D< T >::normal(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::normal(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_, and lass::num::NumTraits< C >::zero.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::area(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::orientation().
const SimplePolygon3D< T, EP, NP >::TValue lass::prim::SimplePolygon3D< T, EP, NP >::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 290 of file simple_polygon_3d.inl.
References lass::num::abs(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::signedArea().
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::orientation().
const SimplePolygon3D< T, EP, NP >::TValue lass::prim::SimplePolygon3D< T, EP, NP >::perimeter | ( | ) | const [inline] |
return sum of the lengths of all edges
Definition at line 301 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::at(), lass::prim::distance(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), and lass::num::NumTraits< C >::zero.
const SimplePolygon3D< T, EP, NP >::TPointH lass::prim::SimplePolygon3D< T, EP, NP >::vertexCentroid | ( | ) | const [inline] |
return the barycenter of all vertices.
The barycenter is the homogenous sum of all vertices.
Definition at line 319 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::surfaceCentroid().
const SimplePolygon3D< T, EP, NP >::TPointH lass::prim::SimplePolygon3D< T, EP, NP >::surfaceCentroid | ( | ) | const [inline] |
return the centroid of the filled polygon.
Eric W. Weisstein. "Geometric Centroid." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/GeometricCentroid.html
Definition at line 345 of file simple_polygon_3d.inl.
References lass::prim::cross(), lass::prim::dot(), lass::prim::Vector3D< T >::normal(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::normal(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertexCentroid(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
const bool lass::prim::SimplePolygon3D< T, EP, NP >::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 382 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::majorAxis(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::mapping().
const bool lass::prim::SimplePolygon3D< T, EP, NP >::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 406 of file simple_polygon_3d.inl.
References lass::prim::perpDot(), lass::num::sign(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vector(), and lass::num::NumTraits< C >::zero.
const bool lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isConcave | ( | ) | const |
const Orientation lass::prim::SimplePolygon3D< T, EP, NP >::orientation | ( | ) | const [inline] |
return orientation of polygon
Definition at line 439 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::area(), lass::prim::oClockWise, lass::prim::oCounterClockWise, lass::prim::oInvalid, lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::signedArea(), and lass::num::NumTraits< C >::zero.
const bool lass::prim::SimplePolygon3D< T, EP, NP >::isReflex | ( | int | iIndexOfVertex | ) | const [inline] |
return true if inner angle of vertex is reflex (is > 180 degrees).
Definition at line 462 of file simple_polygon_3d.inl.
References lass::prim::cross(), lass::prim::dot(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::normal(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vector().
const SimplePolygon2D< T > lass::prim::SimplePolygon3D< T, EP, NP >::mapping | ( | XYZ | iAxis | ) | const [inline] |
maps a 3D polygon as a 2D polygon by ignoring the component along an axis.
if iAxis is z, then it's easy. We ignore the z component and we get a polygon with only the x and y components.
if iAxis is x, then we have to keep the z axis while there's no z axis in 2D. We solve this by mapping the 3D y axis on the 2D x axis, and the 3D z axis on the 2D y axis.
if iAxis is y, then we have a similar problem. This time the 3D z axis is mapped on the 2D x axis, and the 3D x axis is mapped on the 2D y axis.
You can write this in short by saying the 2D x axis will correspond with 3D axis (iAxis + 1) and the 2D y axis with 3D axis (iAxis + 2).
Definition at line 487 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon2D< T, DegeneratePolicy >::add(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isSimple().
const Side lass::prim::SimplePolygon3D< T, EP, NP >::classify | ( | const TPoint & | iP | ) | const [inline] |
Definition at line 505 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::contains(), lass::prim::sInside, and lass::prim::sOutside.
const bool lass::prim::SimplePolygon3D< T, EP, NP >::contains | ( | const TPoint & | iP | ) | const [inline] |
return true if a point iP is inside the polygon, on condition iP is on the plane
Definition at line 520 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::majorAxis(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::classify(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::intersect().
void lass::prim::SimplePolygon3D< T, EP, NP >::flip | ( | ) | [inline] |
flip normal and reverse sequence of vertices
Definition at line 546 of file simple_polygon_3d.inl.
References lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::flip(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane_, and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
const bool lass::prim::SimplePolygon3D< T, EP, NP >::isInRange | ( | int | iIndexOfVertex | ) | const [inline, private] |
return if index of vertex is in range of the std::vector
Definition at line 559 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::at(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::insert(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::remove().
SimplePolygon3D< T, EP, NP > clip | ( | const Aabb3D< T, MMP > & | iAabb, | |
const Plane3D< T, EP, NP > & | iPlane | |||
) | [related] |
Clip a plane to an AABB and get a polygon.
iAabb | [in] the Aabb to clip to | |
iPlane | [in] the plane to be clipped |
Definition at line 80 of file aabb_3d_simple_polygon_3d.h.
References lass::prim::clip(), lass::prim::dot(), lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::getCartesian(), LASS_ENFORCE_UNREACHABLE, lass::prim::Plane3D< T, EquationPolicy, NormalizingPolicy >::majorAxis(), lass::prim::Aabb3D< T, MinMaxPolicy >::max(), lass::prim::Aabb3D< T, MinMaxPolicy >::min(), lass::prim::impl::Plane3DCartesian< T, NormalizingPolicy >::normal(), lass::prim::Point3D< T >::x, lass::prim::Vector3D< T >::x, lass::prim::Vector3D< T >::y, lass::prim::Point3D< T >::y, lass::prim::Vector3D< T >::z, and lass::prim::Point3D< T >::z.
Result intersect | ( | const SimplePolygon3D< T, EP1, NP1 > & | polygon, | |
const Ray3D< T, NP2, PP2 > & | triangle, | |||
T & | t, | |||
const T & | tMin | |||
) | [related] |
Find the intersection of a ray and a simple polygon by their parameter t on the ray.
polygon | [in] the simple polygon | |
triangle | [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 69 of file ray_3d_simple_polygon_3d.h.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::contains(), lass::prim::intersect(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane(), lass::prim::Ray3D< T, NormalizingPolicy, ParameterPolicy >::point(), lass::prim::rNone, and lass::prim::rOne.
Result intersect | ( | const SimplePolygon3D< T, EP, NP > & | iPolygon, | |
const LineSegment3D< T, PP > & | iSegment, | |||
T & | oT, | |||
const T & | iMinT | |||
) | [related] |
Find the intersection of a line segment and a simple polygon by their parameter t on the line segment.
iPolygon | [in] the simple polygon | |
iSegment | [in] the line segment | |
oT | [out] the parameter of the intersection point > iMinT. | |
iMinT | [in] the minimum t that may be returned as valid intersection. |
Definition at line 583 of file simple_polygon_3d.inl.
References lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::contains(), lass::prim::intersect(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane(), lass::prim::LineSegment3D< T, ParameterPolicy >::point(), lass::prim::rNone, and lass::prim::rOne.
io::XmlOStream & operator<< | ( | io::XmlOStream & | ioOStream, | |
const SimplePolygon3D< T, EP, NP > & | iPolygon | |||
) | [related] |
std::ostream & operator<< | ( | std::ostream & | ioOStream, | |
const SimplePolygon3D< T, EP, NP > & | iPolygon | |||
) | [related] |
TVertices lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_ [private] |
Definition at line 151 of file simple_polygon_3d.h.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::add(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::at(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::contains(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::flip(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::insert(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isEmpty(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isInRange(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::mapping(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::operator[](), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::remove(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::signedArea(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::size(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::surfaceCentroid(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertexCentroid().
TPlane lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane_ [private] |
Definition at line 152 of file simple_polygon_3d.h.
Referenced by lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::flip(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::majorAxis(), lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::normal(), and lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane().
Generated on Mon Nov 10 14:22:14 2008 for Library of Assembled Shared Sources by 1.5.7.1 |