Commit b573ec4c authored by Jan Möbius's avatar Jan Möbius
Browse files

More Documentation grouping

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9330 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9f371b2e
......@@ -702,9 +702,9 @@ distLineLineSquared( const VectorT<Scalar,3>& _v00,
template < typename VectorT , typename ValueT >
inline
ValueT
distPlane(const VectorT& _porigin,
const VectorT& _pnormal,
const VectorT& _point)
distPointPlane(const VectorT& _porigin,
const VectorT& _pnormal,
const VectorT& _point)
{
assert( fabs(_pnormal.norm()) > 0.0000000001) ;
return( ( (_point - _porigin) | _pnormal ) );
......@@ -738,7 +738,7 @@ projectToPlane(const VectorT& _porigin,
const VectorT& _pnormal,
const VectorT& _point)
{
return (_point - _pnormal * dist_plane< VectorT , double >( _porigin , _pnormal , _point ) );
return (_point - _pnormal * distPointPlane< VectorT , double >( _porigin , _pnormal , _point ) );
}
//-----------------------------------------------------------------------------
......
......@@ -59,96 +59,7 @@ namespace Geometry {
//== 3D STUFF =================================================================
/** barycentric coord of _p w.r.t. (_u,_v,_w) in 3D
_p has to lie in plane (_u,_v,_w) **/
template<typename Scalar>
bool
baryCoord( const VectorT<Scalar,3>& _p,
const VectorT<Scalar,3>& _u,
const VectorT<Scalar,3>& _v,
const VectorT<Scalar,3>& _w,
VectorT<Scalar,3>& _result );
/// return area of triangle (_v0, _v1, _v2)
template <class Vec>
typename Vec::value_type
triangleArea( const Vec& _v0,
const Vec& _v1,
const Vec& _v2 )
{
return sqrt(triangleAreaSquared(_v0,_v1,_v2));
}
/// return squared area of triangle (_v0, _v1, _v2)
template <class Vec>
typename Vec::value_type
triangleAreaSquared( const Vec& _v0,
const Vec& _v1,
const Vec& _v2 );
/// construct min. enclosing sphere
template<typename Scalar>
bool
minSphere(const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2,
VectorT<Scalar,3>& _center,
Scalar& _radius);
/// return squared radius of min. enclosing circle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
minRadiusSquared( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 );
/// return radius of min. enclosing circle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
minRadius( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 )
{
return sqrt(minRadiusSquared(_v0, _v1, _v2));
}
/// return circumcenter of triangle (_v0,_v1,_v2)
template<typename Scalar>
bool
circumCenter( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2,
VectorT<Scalar,3>& _result );
/// return squared radius of circumcircle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
circumRadiusSquared( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 );
/// return radius of circumcircle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
circumRadius( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 )
{
return sqrt(circumRadiusSquared(_v0, _v1, _v2));
}
/// return circumcenter of tetrahedron (_v0,_v1,_v2,_v3)
template<typename Scalar>
......@@ -191,9 +102,6 @@ VectorT<Scalar,3>
perpendicular( const VectorT<Scalar,3>& _v );
//== 2D STUFF =================================================================
/// orientation of point _p w.r.t. line through _v0,_v1 in 2D
......@@ -208,8 +116,6 @@ pointLineOrientation( const VectorT<Scalar,2>& _p,
}
/// are 3 vertices in counterclockwise order? in 2D
template<typename Scalar>
bool
......@@ -248,7 +154,6 @@ lineIntersection( const VectorT<Scalar,2>& _v0,
* @{ */
//===========================================================================
/// distance from point _p to line (_v0,_v1)
template<class Vec>
typename Vec::value_type
......@@ -286,8 +191,30 @@ distPointTriangleSquared( const Vec& _p,
const Vec& _v1,
const Vec& _v2,
Vec& _nearestPoint );
/** \brief Checks the distance from a point to a plane
*
*
* @param _porigin Planes origin
* @param _pnormal Plane normal ( has to be normalized!)
* @param _point point to test
* @return distance
*/
template < typename VectorT , typename ValueT >
inline
ValueT
distPointPlane(const VectorT& _porigin,
const VectorT& _pnormal,
const VectorT& _point);
/** @} */
//===========================================================================
/** @name Distance Functions ( 3-Dimensional )
* @{ */
//===========================================================================
/// squared distance of lines (_v00, _v01) and (_v10, _v11)
template<typename Scalar>
Scalar
......@@ -314,23 +241,8 @@ distLineLine( const VectorT<Scalar,3>& _v00,
_min_v0, _min_v1));
}
/** \brief Checks the distance from a point to a plane
*
*
* @param _porigin Planes origin
* @param _pnormal Plane normal ( has to be normalized!)
* @param _point point to test
* @return distance
*/
template < typename VectorT , typename ValueT >
inline
ValueT
distPlane(const VectorT& _porigin,
const VectorT& _pnormal,
const VectorT& _point);
/** @} */
/** @} */
//===========================================================================
/** @name Projection Functions ( N-Dimensional )
......@@ -410,12 +322,110 @@ circumCenter( const VectorT<Scalar,2>& _v0,
/** @} */
//===========================================================================
/** @name Triangle Functions 3-Dimensional
* @{ */
//===========================================================================
/** barycentric coord of _p w.r.t. (_u,_v,_w) in 3D
_p has to lie in plane (_u,_v,_w) **/
template<typename Scalar>
bool
baryCoord( const VectorT<Scalar,3>& _p,
const VectorT<Scalar,3>& _u,
const VectorT<Scalar,3>& _v,
const VectorT<Scalar,3>& _w,
VectorT<Scalar,3>& _result );
/// construct min. enclosing sphere
template<typename Scalar>
bool
minSphere(const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2,
VectorT<Scalar,3>& _center,
Scalar& _radius);
/// return squared radius of min. enclosing circle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
minRadiusSquared( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 );
/// return radius of min. enclosing circle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
minRadius( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 )
{
return sqrt(minRadiusSquared(_v0, _v1, _v2));
}
/// return circumcenter of triangle (_v0,_v1,_v2)
template<typename Scalar>
bool
circumCenter( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2,
VectorT<Scalar,3>& _result );
/// return squared radius of circumcircle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
circumRadiusSquared( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 );
/// return radius of circumcircle of triangle (_v0,_v1,_v2)
template<typename Scalar>
Scalar
circumRadius( const VectorT<Scalar,3>& _v0,
const VectorT<Scalar,3>& _v1,
const VectorT<Scalar,3>& _v2 )
{
return sqrt(circumRadiusSquared(_v0, _v1, _v2));
}
/** @} */
//===========================================================================
/** @name Triangle Functions N-Dimensional
* @{ */
//===========================================================================
/** \brief return area of triangle (_v0, _v1, _v2)
*
*/
template <class Vec>
typename Vec::value_type
triangleArea( const Vec& _v0,
const Vec& _v1,
const Vec& _v2 )
{
return sqrt(triangleAreaSquared(_v0,_v1,_v2));
}
/** \brief return squared area of triangle (_v0, _v1, _v2)
*
*/
template <class Vec>
typename Vec::value_type
triangleAreaSquared( const Vec& _v0,
const Vec& _v1,
const Vec& _v2 );
/** \brief return aspect ratio of triangle
*
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment