1 #ifndef SimTK_SIMMATH_GEO_POINT_H_ 
    2 #define SimTK_SIMMATH_GEO_POINT_H_ 
   93 {   
return (p2-p1).normSqr(); }
 
  115     const RealP scale = 
std::max(tol, maxcoord*tol); 
 
  125                  int& most, RealP& mostCoord);
 
  132                          int& most, RealP& mostCoord);
 
  140                   int& least, 
int& most,
 
  141                   RealP& leastCoord, RealP& mostCoord);
 
  148                           int& least, 
int& most,
 
  149                           RealP& leastCoord, RealP& mostCoord);
 
  202                              int least[3], 
int most[3],
 
  209                                      int least[3], 
int most[3],
 
  258                           int least[3], 
int most[3],
 
  266                                   int least[3], 
int most[3],
 
Defines geometric primitive shapes and algorthms.
 
Includes internal headers providing declarations for the basic SimTK Core classes,...
 
This is the header file that every Simmath compilation unit should include first.
 
#define SimTK_SIMMATH_EXPORT
Definition: SimTKmath/include/simmath/internal/common.h:64
 
This Array_ helper class is the base class for ArrayView_ which is the base class for Array_; here we...
Definition: Array.h:324
 
The Array_<T> container class is a plug-compatible replacement for the C++ standard template library ...
Definition: Array.h:1520
 
void push_back(const T &value)
This method increases the size of the Array by one element at the end and initializes that element by...
Definition: Array.h:2399
 
void clear()
Erase all the elements currently in this array without changing the capacity; equivalent to erase(beg...
Definition: Array.h:2598
 
A 3d box aligned with an unspecified frame F and centered at a given point measured from that frame's...
Definition: Geo_Box.h:457
 
TODO: A 3d box oriented and positioned with respect to an unspecified frame F.
Definition: Geo_Box.h:528
 
A 3d point primitive represented by a Vec3 from the origin of an unspecified frame,...
Definition: Geo_Point.h:46
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p0, const Vec3P &p1)
Create a minimal bounding sphere around two points.
Definition: Geo_Point.h:340
 
static Sphere_< P > calcApproxBoundingSphereIndirect(const Array_< const Vec3P * > &points)
Alternate signature works with an array of pointers to points.
 
Point_(const Vec3P &location)
Construct a Point with the given location. Also serves as implicit conversion from Vec3 to Geo::Point...
Definition: Geo_Point.h:60
 
const Vec3P & getLocation() const
Get the location of this Point.
Definition: Geo_Point.h:66
 
static void calcPrincipalComponentsIndirect(const Array_< const Vec3P * > &points_F, TransformP &X_FP)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static void findExtremePoints(const Array_< Vec3P > &points, const UnitVec3P &direction, int &least, int &most, RealP &leastCoord, RealP &mostCoord)
Given a set of points, find the two points that are the most extreme along a given direction (not nec...
 
static void calcCovarianceIndirect(const Array_< const Vec3P * > &points_F, Vec3P ¢roid, SymMat33P &covariance)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
Point_()
Construct an uninitialized Point object; the location will be garbage.
Definition: Geo_Point.h:57
 
static Vec3P calcCentroid(const Array_< Vec3P > &points_F)
Given a set of points, calculate the centroid (average location) of those points.
 
static void findAxisAlignedExtremePointsIndirect(const Array_< const Vec3P * > &points, int least[3], int most[3], Vec3P &low, Vec3P &high)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static Geo::AlignedBox_< P > calcAxisAlignedBoundingBox(const Array_< Vec3P > &points)
Alternate signature doesn't return support points.
Definition: Geo_Point.h:220
 
Point_ & setLocation(const Vec3P &location)
Change the location of this point.
Definition: Geo_Point.h:63
 
static RealP calcDistance(const Vec3P &p1, const Vec3P &p2)
Calculate the distance between two points (expensive).
Definition: Geo_Point.h:87
 
RealP calcDistance(const Vec3P &p2) const
Calculate the distance between this point and another one whose location is expressed in the same fra...
Definition: Geo_Point.h:70
 
static bool pointsAreNumericallyCoincident(const Vec3P &p1, const Vec3P &p2, RealP tol)
Alternate signature with explicitly-supplied tolerance.
Definition: Geo_Point.h:112
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p0, const Vec3P &p1, const Vec3P &p2, const Vec3P &p3)
Create a minimal bounding sphere around four points.
Definition: Geo_Point.h:355
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p)
Create a tiny bounding sphere around a single point.
Definition: Geo_Point.h:333
 
static Sphere_< P > calcBoundingSphereIndirect(const Array_< const Vec3P * > &points, Array_< int > &which)
Alternate signature works with an array of pointers to points.
 
static void findOrientedExtremePointsIndirect(const Array_< const Vec3P * > &points_F, const RotationP &R_FB, int least[3], int most[3], Vec3P &low_B, Vec3P &high_B)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static Sphere_< P > calcApproxBoundingSphere(const std::vector< Vec3P > &points)
This signature takes an std::vector rather than a SimTK::Array_; no extra copying is required.
Definition: Geo_Point.h:449
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p0, Array_< int > &which)
Create one-point bounding sphere and return the (trivial) support point, of which there is always one...
Definition: Geo_Point.h:394
 
static Geo::OrientedBox_< P > calcOrientedBoundingBox(const Array_< Vec3P > &points, Array_< int > &support, bool optimize=true)
Calculate a tight-fitting oriented bounding box (OBB) that includes all n given points.
 
static Sphere_< P > calcApproxBoundingSphere(const Array_< Vec3P > &points)
Calculate an approximate bounding sphere. You should normally use calcBoundingSphere() which will giv...
 
static Sphere_< P > calcBoundingSphere(const Array_< Vec3P > &points, Array_< int > &which)
Create an optimal minimum sphere around a collection of n points.
 
static void findExtremePointsIndirect(const Array_< const Vec3P * > &points, const UnitVec3P &direction, int &least, int &most, RealP &leastCoord, RealP &mostCoord)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static Sphere_< P > calcBoundingSphere(const std::vector< const Vec3P * > &points)
This signature takes an std::vector rather than a SimTK::Array_; no extra copying is required.
Definition: Geo_Point.h:387
 
static Geo::AlignedBox_< P > calcAxisAlignedBoundingBoxIndirect(const Array_< const Vec3P * > &points)
Alternate signature doesn't return support points.
Definition: Geo_Point.h:232
 
static RealP findDistanceSqr(const Vec3P &p1, const Vec3P &p2)
Find the square of the distance between two points (cheap).
Definition: Geo_Point.h:92
 
static void findSupportPointIndirect(const Array_< const Vec3P * > &points, const UnitVec3P &direction, int &most, RealP &mostCoord)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static void calcPrincipalComponents(const Array_< Vec3P > &points_F, TransformP &X_FP)
Given a set of points in an unspecified frame F, find the principal component directions describing t...
 
static Vec3P calcCentroidIndirect(const Array_< const Vec3P * > &points_F)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static void findSupportPoint(const Array_< Vec3P > &points, const UnitVec3P &direction, int &most, RealP &mostCoord)
Given a set of points, find the one that is the furthest in a given direction, and return its index a...
 
RealP findDistanceSqr(const Vec3P &p2) const
Find the square of the distance between this point and another one whose location is expressed in the...
Definition: Geo_Point.h:75
 
static void findOrientedExtremePoints(const Array_< Vec3P > &points_F, const RotationP &R_FB, int least[3], int most[3], Vec3P &low_B, Vec3P &high_B)
Given a set of points, find the six points that are the most extreme along specified orientation dire...
 
static Geo::AlignedBox_< P > calcAxisAlignedBoundingBoxIndirect(const Array_< const Vec3P * > &points, Array_< int > &support)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static Geo::OrientedBox_< P > calcOrientedBoundingBoxIndirect(const Array_< const Vec3P * > &points, bool optimize=true)
Alternate signature doesn't return support points.
Definition: Geo_Point.h:292
 
static void calcCovariance(const Array_< Vec3P > &points_F, Vec3P ¢roid, SymMat33P &covariance)
Given a set of points, calculate the centroid (average location) and covariance matrix of those point...
 
static Sphere_< P > calcBoundingSphereIndirect(const Array_< const Vec3P * > &points)
Create a minimal bounding sphere around a collection of n points, given indirectly as an array of poi...
Definition: Geo_Point.h:379
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p0, const Vec3P &p1, const Vec3P &p2, const Vec3P &p3, bool forceCircumsphere, Array_< int > &which)
Create a minimum sphere around four points.
 
static bool pointsAreNumericallyCoincident(const Vec3P &p1, const Vec3P &p2)
Determine whether two points whose locations are known to an accuracy tol are numerically indistingui...
Definition: Geo_Point.h:106
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p0, const Vec3P &p1, const Vec3P &p2, bool forceCircumsphere, Array_< int > &which)
Create a minimum sphere around three points.
 
static Geo::AlignedBox_< P > calcAxisAlignedBoundingBox(const Array_< Vec3P > &points, Array_< int > &support)
Calculate the smallest axis-aligned bounding box including all n given points.
 
static void findAxisAlignedExtremePoints(const Array_< Vec3P > &points, int least[3], int most[3], Vec3P &low, Vec3P &high)
Given a set of points, find the six points that are the most extreme along the axial directions (not ...
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p0, const Vec3P &p1, const Vec3P &p2)
Create a minimal bounding sphere around three points.
Definition: Geo_Point.h:348
 
static Sphere_< P > calcBoundingSphere(const std::vector< Vec3P > &points)
This signature takes an std::vector rather than a SimTK::Array_; no extra copying is required.
Definition: Geo_Point.h:371
 
static Sphere_< P > calcBoundingSphere(const Array_< Vec3P > &points)
Create a minimal bounding sphere around a collection of n points.
Definition: Geo_Point.h:363
 
static Sphere_< P > calcApproxBoundingSphereIndirect(const std::vector< const Vec3P * > &points)
This signature takes an std::vector rather than a SimTK::Array_; no extra copying is required.
Definition: Geo_Point.h:461
 
static Geo::OrientedBox_< P > calcOrientedBoundingBoxIndirect(const Array_< const Vec3P * > &points, Array_< int > &support, bool optimize=true)
Alternate signature taking an array of pointers to points rather than the points themselves.
 
static Vec3P findMidpoint(const Vec3P &p1, const Vec3P &p2)
Find the point midway between two points.
Definition: Geo_Point.h:96
 
static Sphere_< P > calcBoundingSphere(const Vec3P &p0, const Vec3P &p1, Array_< int > &which)
Create a minimum sphere around two points.
 
static Geo::OrientedBox_< P > calcOrientedBoundingBox(const Array_< Vec3P > &points)
Alternate signature doesn't return support points.
Definition: Geo_Point.h:279
 
A geometric primitive representing a sphere by its radius and center point, and a collection of spher...
Definition: Geo_Sphere.h:47
 
Sphere_ & stretchBoundary()
Stretch this sphere in place by a small amount to ensure that there will be no roundoff problems if t...
Definition: Geo_Sphere.h:78
 
The Rotation class is a Mat33 that guarantees that the matrix can be interpreted as a legitimate 3x3 ...
Definition: Rotation.h:111
 
This class is a Vec3 plus an ironclad guarantee either that:
Definition: UnitVec.h:56
 
TAbs abs() const
Elementwise absolute value; that is, the return value has the same dimension as this Vec but with eac...
Definition: Vec.h:347
 
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
 
ELEM max(const VectorBase< ELEM > &v)
Definition: VectorMath.h:251
 
unsigned char square(unsigned char u)
Definition: Scalar.h:349