library of assembled shared sources

http://lass.cocamware.com

lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy > Class Template Reference

convex or concave polygon in 3D (not selfintersecting, no holes) More...

#include <simple_polygon_3d.h>

Collaboration diagram for lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >:

Collaboration graph
[legend]

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 TPointoperator[] (size_t iIndexOfVertex) const
 return vertex of polygon by its index, not wrapped, no bounds check.
TPointoperator[] (size_t iIndexOfVertex)
 return vertex of polygon by its index, not wrapped, no bounds check.
const TPointat (int iIndexOfVertex) const
 return vertex of polygon by its index, but wrap around the bounds.
TPointat (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 TPlaneplane () const
 return support plane of polygon.
TPlaneplane ()
 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< TPointTVertices

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::XmlOStreamoperator<< (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)

Detailed Description

template<typename T, class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
class lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >

convex or concave polygon in 3D (not selfintersecting, no holes)

Author:
Bram de Greve [BdG]
Warning:
SimplePolygon3D only assumes it's simple. there's no guarantee at any time. It's your own responsibility to keep it simple. We do it this way because it's just to costly to check it at every access to the polygon. However, we provide some methods to check it yourself.

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.


Member Typedef Documentation

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef SimplePolygon3D<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TSelf

Definition at line 83 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef Point3D<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TPoint

Definition at line 85 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef Point3DH<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TPointH

Definition at line 86 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef TPoint::TVector lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TVector

Definition at line 87 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef LineSegment3D<T> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TLineSegment

Definition at line 88 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef Plane3D<T, PlaneEquationPolicy, PlaneNormalizingPolicy> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TPlane

Definition at line 89 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef TPoint::TValue lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TValue

Definition at line 91 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef TPoint::TParam lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TParam

Definition at line 92 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef TPoint::TReference lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TReference

Definition at line 93 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef TPoint::TConstReference lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TConstReference

Definition at line 94 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef TPoint::TNumTraits lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TNumTraits

Definition at line 95 of file simple_polygon_3d.h.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
typedef std::vector<TPoint> lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::TVertices [private]

Definition at line 149 of file simple_polygon_3d.h.


Member Enumeration Documentation

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
anonymous enum

Enumerator:
dimension 

Definition at line 97 of file simple_polygon_3d.h.


Constructor & Destructor Documentation

template<typename T , class EP , class NP >
lass::prim::SimplePolygon3D< T, EP, NP >::SimplePolygon3D ( const TPlane iPlane  )  [inline]

Definition at line 57 of file simple_polygon_3d.inl.

template<typename T , class EP , class NP >
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.


Member Function Documentation

template<typename T , class EP , class NP >
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_.

template<typename T , class EP , class NP >
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_.

template<typename T , class EP , class NP >
const SimplePolygon3D< T, EP, NP >::TPoint & lass::prim::SimplePolygon3D< T, EP, NP >::at ( int  iIndexOfVertex  )  const [inline]

template<typename T , class EP , class NP >
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_.

template<typename T , class EP , class NP >
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().

template<typename T , class EP , class NP >
const SimplePolygon3D< T, EP, NP >::TVector lass::prim::SimplePolygon3D< T, EP, NP >::vector ( int  iIndexOfTailVertex  )  const [inline]

template<typename T , class EP , class NP >
const SimplePolygon3D< T, EP, NP >::TPlane & lass::prim::SimplePolygon3D< T, EP, NP >::plane (  )  const [inline]

template<typename T , class EP , class NP >
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_.

template<typename T , class EP , class NP >
const SimplePolygon3D< T, EP, NP >::TVector lass::prim::SimplePolygon3D< T, EP, NP >::normal (  )  const [inline]

template<typename T , class EP , class NP >
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().

template<typename T , class EP , class NP >
void lass::prim::SimplePolygon3D< T, EP, NP >::add ( const TPoint iVertex  )  [inline]

template<typename T , class EP , class NP >
void lass::prim::SimplePolygon3D< T, EP, NP >::insert ( int  iIndexOfVertex,
const TPoint iVertex 
) [inline]

template<typename T , class EP , class NP >
void lass::prim::SimplePolygon3D< T, EP, NP >::remove ( int  iIndexOfVertex  )  [inline]

template<typename T , class EP , class NP >
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_.

template<typename T , class EP , class NP >
const size_t lass::prim::SimplePolygon3D< T, EP, NP >::size (  )  const [inline]

template<typename T , class EP , class NP >
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

Algorithm:
comp.graphics.algorithms Frequently Asked Questions: Subject 2.01: "How do I find the area of a polygon?" http://www.faqs.org/faqs/graphics/algorithms-faq/

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().

template<typename T , class EP , class NP >
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().

template<typename T , class EP , class NP >
const SimplePolygon3D< T, EP, NP >::TValue lass::prim::SimplePolygon3D< T, EP, NP >::perimeter (  )  const [inline]

template<typename T , class EP , class NP >
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.

Warning:
for non-convex polygons, it's NOT guaranteed that this center is inside the polygon.

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().

template<typename T , class EP , class NP >
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

Algorithm:
comp.graphics.algorithms Frequently Asked Questions: Subject 2.02: "How can the centroid of a polygon be computed?" http://www.faqs.org/faqs/graphics/algorithms-faq/
Warning:
for non-convex polygons, it's NOT guaranteed that this center is inside the polygon.

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_.

template<typename T , class EP , class NP >
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.

Warning:
this is a brute force test. we simple test for all edges if they are not intersecting Hence, this is O(n^2).

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().

template<typename T , class EP , class NP >
const bool lass::prim::SimplePolygon3D< T, EP, NP >::isConvex (  )  const [inline]

return true if polygon is convex, false if not.

Warning:
assumes polygon is simple
A planar polygon is convex if it contains all the line segments connecting any pair of its points. Thus, for example, a regular pentagon is convex, while an indented pentagon is not. A planar polygon that is not convex is said to be a concave polygon, Eric W. Weisstein. "Convex Polygon." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ConvexPolygon.html

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.

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
const bool lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::isConcave (  )  const

template<typename T , class EP , class NP >
const Orientation lass::prim::SimplePolygon3D< T, EP, NP >::orientation (  )  const [inline]

template<typename T , class EP , class NP >
const bool lass::prim::SimplePolygon3D< T, EP, NP >::isReflex ( int  iIndexOfVertex  )  const [inline]

template<typename T , class EP , class NP >
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).

Todo:
explain this better

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().

template<typename T , class EP , class NP >
const Side lass::prim::SimplePolygon3D< T, EP, NP >::classify ( const TPoint iP  )  const [inline]

template<typename T , class EP , class NP >
const bool lass::prim::SimplePolygon3D< T, EP, NP >::contains ( const TPoint iP  )  const [inline]

template<typename T , class EP , class NP >
void lass::prim::SimplePolygon3D< T, EP, NP >::flip (  )  [inline]

template<typename T , class EP , class NP >
const bool lass::prim::SimplePolygon3D< T, EP, NP >::isInRange ( int  iIndexOfVertex  )  const [inline, private]


Friends And Related Function Documentation

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 
) [related]

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 
) [related]

Find the intersection of a ray and a simple polygon by their parameter t on the ray.

Parameters:
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.
Returns:
  • rNone no intersections with t > tMin found t is not assigned.
  • rOne a intersection with t > tMin is found t is assigned.

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.

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 
) [related]

Find the intersection of a line segment and a simple polygon by their parameter t on the line segment.

Parameters:
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.
Returns:
  • rNone no intersections with oT > iMinT found oT is not assigned.
  • rOne a intersection with oT > iMinT is found oT is assigned.

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.

template<typename T , class EP , class NP >
io::XmlOStream & operator<< ( io::XmlOStream ioOStream,
const SimplePolygon3D< T, EP, NP > &  iPolygon 
) [related]

Definition at line 703 of file simple_polygon_3d.inl.

References LASS_ENFORCE_STREAM.

template<typename T , class EP , class NP >
std::ostream & operator<< ( std::ostream &  ioOStream,
const SimplePolygon3D< T, EP, NP > &  iPolygon 
) [related]

Definition at line 719 of file simple_polygon_3d.inl.

References LASS_ENFORCE_STREAM.


Field Documentation

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
TVertices lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::vertices_ [private]

template<typename T , class PlaneEquationPolicy = Cartesian, class PlaneNormalizingPolicy = Normalized>
TPlane lass::prim::SimplePolygon3D< T, PlaneEquationPolicy, PlaneNormalizingPolicy >::plane_ [private]


The documentation for this class was generated from the following files:

Generated on Mon Nov 10 14:22:14 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo