|
VMTK
|
Provides static utility mathematical functions to avoid repeating code across classes. More...
#include <vtkvmtkMath.h>
Public Types | |
| typedef vtkObject | Superclass |
Public Member Functions | |
| virtual int | IsA (const char *type) |
| vtkvmtkMath * | NewInstance () const |
Static Public Member Functions | |
| static int | IsTypeOf (const char *type) |
| static vtkvmtkMath * | SafeDownCast (vtkObjectBase *o) |
| static vtkvmtkMath * | New () |
| static double | Cotangent (double point0[3], double point1[3], double point2[3]) |
| static double | TriangleArea (double point0[3], double point1[3], double point2[3]) |
| static int | IsAngleObtuse (double point0[3], double point1[3], double point2[3]) |
| static int | IsTriangleObtuse (double point0[3], double point1[3], double point2[3]) |
| static double | VoronoiSectorArea (double point0[3], double point1[3], double point2[3]) |
| static double | TriangleGradient (double point0[3], double point1[3], double point2[3], double scalar0, double scalar1, double scalar2, double gradient[3]) |
| static void | TwoSphereIntersection (double center0[3], double radius0, double center1[3], double radius1, double origin[3], double normal[3]) |
| static double | AngleBetweenNormals (double normal0[3], double normal1[3]) |
| static double | EvaluateSphereFunction (double center[3], double radius, double point[3]) |
Protected Member Functions | |
| virtual vtkObjectBase * | NewInstanceInternal () const |
| vtkvmtkMath () | |
| ~vtkvmtkMath () | |
Static Protected Member Functions | |
| static double | GetTolerance (float cookie) |
| static double | GetTolerance (double cookie) |
| static double | GetLarge (float cookie) |
| static double | GetLarge (double cookie) |
Provides static utility mathematical functions to avoid repeating code across classes.
All arguments expect doubles.
Definition at line 37 of file vtkvmtkMath.h.
| typedef vtkObject vtkvmtkMath::Superclass |
Definition at line 41 of file vtkvmtkMath.h.
|
inlineprotected |
Definition at line 114 of file vtkvmtkMath.h.
|
inlineprotected |
Definition at line 115 of file vtkvmtkMath.h.
|
static |
|
virtual |
|
static |
|
protectedvirtual |
| vtkvmtkMath * vtkvmtkMath::NewInstance | ( | ) | const |
|
static |
|
static |
Compute the cotangent of the angle at point1 subtended by the segments point1-point0 and point1-point2 (i.e. the angle at the vertex shared by the two segments). Degenerate (zero-area) configurations return either 0.0 or a large sentinel value (see VTK_VMTK_LARGE_DOUBLE), depending on whether the segments are also aligned (dot product near zero).
Definition at line 28 of file vtkvmtkMath.cxx.
|
static |
Compute the area of the triangle formed by point0, point1, point2, via the norm of the cross product of two of its edge vectors.
Definition at line 61 of file vtkvmtkMath.cxx.
|
static |
Return 1 if the angle at point1 subtended by point0 and point2 is obtuse (the dot product of the two edge vectors from point1 is negative, within tolerance), 0 otherwise.
Definition at line 77 of file vtkvmtkMath.cxx.
|
static |
Classify the triangle (point0, point1, point2) according to which, if any, of its angles is obtuse. Returns VTK_VMTK_OBTUSE_IN_POINT if the angle at point1 is obtuse, VTK_VMTK_OBTUSE_NOT_IN_POINT if the angle at point0 or point2 is obtuse instead, or VTK_VMTK_NON_OBTUSE if the triangle is non-obtuse. Used to select between the Voronoi and simple barycentric/mixed area formulas when computing per-vertex mesh areas (e.g. in Voronoi/mixed-area curvature or stencil weighting schemes).
Definition at line 85 of file vtkvmtkMath.cxx.
|
static |
Compute the contribution of point1 to the (non-obtuse) Voronoi region area within the triangle (point0, point1, point2), using the cotangent-weighted formula 1/8 * (|point0-point1|^2 * cot(angle at point2) + |point2-point1|^2 * cot(angle at point0)) (Meyer et al.). Only meaningful when the triangle is non-obtuse; callers typically dispatch on IsTriangleObtuse() first and fall back to a simpler area split for obtuse triangles.
Definition at line 95 of file vtkvmtkMath.cxx.
|
static |
Compute the gradient, over the triangle (point0, point1, point2), of a scalar field linearly interpolated from the per-vertex values scalar0, scalar1, scalar2. The gradient vector (constant over the triangle) is stored in gradient and its magnitude is returned. If the triangle is degenerate (zero area), returns 0.0 when the scalar values are all equal, or a large sentinel value otherwise.
Definition at line 114 of file vtkvmtkMath.cxx.
|
static |
Compute the center (origin) and axis (normal) of the circle formed by the intersection of two spheres (center0, radius0) and (center1, radius1); origin lies on the line joining the two centers. If the two centers coincide, origin is set to center1 and normal to the zero vector.
Definition at line 166 of file vtkvmtkMath.cxx.
|
static |
Compute the angle, in radians, between two (not necessarily unit-length) normal vectors, using the numerically stable formula 2*atan2(|normal0-normal1|, |normal0+normal1|) (equivalent to acos of the normalized dot product, but well-conditioned for angles near 0 or pi).
Definition at line 209 of file vtkvmtkMath.cxx.
|
static |
Evaluate the implicit sphere function of center/radius at point: the squared distance from point to center minus radius squared. Negative inside the sphere, positive outside, zero on the sphere.
Definition at line 227 of file vtkvmtkMath.cxx.
|
inlinestaticprotected |
Definition at line 117 of file vtkvmtkMath.h.
|
inlinestaticprotected |
Definition at line 122 of file vtkvmtkMath.h.
|
inlinestaticprotected |
Definition at line 127 of file vtkvmtkMath.h.
|
inlinestaticprotected |
Definition at line 132 of file vtkvmtkMath.h.