TTK
|
Classes | |
struct | ProjectionInput |
Stores the findProjection() input. More... | |
struct | ProjectionResult |
Stores the findProjection() result. More... | |
Functions | |
template<typename T > | |
T | angle (const T *vA0, const T *vA1, const T *vB0, const T *vB1) |
template<typename T > | |
T | angle2D (const T *vA0, const T *vA1, const T *vB0, const T *vB1) |
template<typename T > | |
double | angle2DUndirected (const T *vA, const T *vB, const T *vC) |
template<typename T > | |
bool | areVectorsColinear (const T *vA0, const T *vA1, const T *vB0, const T *vB1, std::array< T, 3 > *coefficients=nullptr, const T *tolerance=NULL) |
template<typename T > | |
bool | isTriangleColinear2D (const T *pptA, const T *pptB, const T *pptC, const T tolerance) |
template<typename T > | |
int | computeBarycentricCoordinates (const T *p0, const T *p1, const T *p, std::array< T, 2 > &baryCentrics, const int &dimension=3) |
template<typename T > | |
int | computeBarycentricCoordinates (const T *p0, const T *p1, const T *p2, const T *p, std::array< T, 3 > &baryCentrics) |
template<typename T > | |
bool | computeSegmentIntersection (const T &xA, const T &yA, const T &xB, const T &yB, const T &xC, const T &yC, const T &xD, const T &yD, T &x, T &y) |
template<typename T > | |
int | computeTriangleAngles (const T *p0, const T *p1, const T *p2, std::array< T, 3 > &angles) |
template<typename T > | |
int | computeTriangleAngleFromSides (const T s0, const T s1, const T s2, T &angle) |
template<typename T > | |
int | computeTriangleArea (const T *p0, const T *p1, const T *p2, T &area) |
template<typename T > | |
int | computeTriangleAreaFromSides (const T s0, const T s1, const T s2, T &area) |
template<typename T > | |
int | crossProduct (const T *vA0, const T *vA1, const T *vB0, const T *vB1, std::array< T, 3 > &crossProduct) |
template<typename T > | |
int | crossProduct (const T *vA, const T *vB, T *crossProduct) |
template<typename T > | |
T | distance (const T *p0, const T *p1, const int &dimension=3) |
template<typename T > | |
T | distance (const std::vector< T > &p0, const std::vector< T > &p1) |
template<typename T > | |
T | distance2D (const T *p0, const T *p1) |
template<typename T > | |
T | distanceFlatten (const std::vector< std::vector< T > > &p0, const std::vector< std::vector< T > > &p1) |
template<typename T > | |
T | dotProduct (const T *vA0, const T *vA1, const T *vB0, const T *vB1) |
template<typename T > | |
T | dotProduct (const T *vA, const T *vB, const int &dimension=3) |
template<typename T > | |
T | dotProduct (const std::vector< T > &vA, const std::vector< T > &vB) |
template<typename T > | |
T | dotProductFlatten (const std::vector< std::vector< T > > &vA, const std::vector< std::vector< T > > &vB) |
template<typename T , typename Container , size_t dim> | |
int | getBoundingBox (const Container &points, std::array< std::pair< T, T >, dim > &bBox) |
template<typename T > | |
bool | isPointInTriangle (const T *p0, const T *p1, const T *p2, const T *p) |
template<typename T > | |
bool | isPointOnSegment (const T &x, const T &y, const T &xA, const T &yA, const T &xB, const T &yB) |
template<typename T > | |
bool | isPointOnSegment (const T *p, const T *pA, const T *pB, const int &dimension=3) |
template<typename T > | |
bool | isTriangleColinear (const T *p0, const T *p1, const T *p2, const T *tolerance=nullptr) |
template<typename T > | |
T | magnitude (const T *v, const int &dimension=3) |
template<typename T > | |
T | magnitude (const std::vector< T > &v) |
template<typename T > | |
T | magnitudeFlatten (const std::vector< std::vector< T > > &v) |
template<typename T > | |
T | magnitude (const T *o, const T *d) |
template<typename T > | |
T | powInt (const T val, const int n) |
template<typename T = double> | |
T | powIntTen (const int n) |
Compute the nth power of ten. | |
template<typename T1 , typename T2 > | |
T1 | pow (const T1 val, const T2 n) |
template<typename T > | |
void | projectOnTrianglePlane (const T *p, const T *a, const T *normTri, T *out) |
Compute euclidean projection in a triangle plane. | |
template<typename T > | |
void | projectOnEdge (const T *p, const T *a, const T *b, T *out) |
Compute euclidean projection on a 3D segment. | |
template<typename T > | |
void | computeTriangleNormal (const T *a, const T *b, const T *c, T *out) |
Compute normal vector to triangle. | |
template<typename T , typename triangulationType > | |
SimplexId | getNearestSurfaceVertex (const T *pa, std::vector< T > &dists, const triangulationType &triangulation) |
Find nearest vertex on the surface. | |
template<typename T > | |
int | subtractVectors (const T *a, const T *b, T *out, const int &dimension=3) |
template<typename T > | |
int | subtractVectors (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &out) |
template<typename T > | |
int | addVectors (const T *a, const T *b, T *out, const int &dimension=3) |
template<typename T > | |
int | addVectors (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &out) |
template<typename T > | |
int | multiAddVectors (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
int | multiAddVectorsFlatten (const std::vector< std::vector< std::vector< T > > > &a, const std::vector< std::vector< std::vector< T > > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
int | scaleVector (const T *a, const T factor, T *out, const int &dimension=3) |
template<typename T > | |
int | scaleVector (const std::vector< T > &a, const T factor, std::vector< T > &out) |
template<typename T > | |
int | vectorProjection (const T *a, const T *b, T *out, const int &dimension=3) |
template<typename T > | |
int | vectorProjection (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &out) |
template<typename T > | |
void | addVectorsProjection (const std::vector< T > &a, const std::vector< T > &b, std::vector< T > &a_out, std::vector< T > &b_out) |
template<typename T > | |
void | gramSchmidt (const std::vector< std::vector< T > > &a, std::vector< std::vector< T > > &out) |
template<typename T > | |
bool | isVectorUniform (const std::vector< T > &a) |
template<typename T > | |
bool | isVectorNull (const std::vector< T > &a) |
template<typename T > | |
bool | isVectorNullFlatten (const std::vector< std::vector< T > > &a) |
template<typename T > | |
int | flattenMultiDimensionalVector (const std::vector< std::vector< T > > &a, std::vector< T > &out) |
template<typename T > | |
int | multiFlattenMultiDimensionalVector (const std::vector< std::vector< std::vector< T > > > &a, std::vector< std::vector< T > > &out) |
template<typename T > | |
int | unflattenMultiDimensionalVector (const std::vector< T > &a, std::vector< std::vector< T > > &out, const int &no_columns=2) |
template<typename T > | |
void | matrixMultiplication (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | subtractMatrices (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | addMatrices (const std::vector< std::vector< T > > &a, const std::vector< std::vector< T > > &b, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | scaleMatrix (const std::vector< std::vector< T > > &a, const T factor, std::vector< std::vector< T > > &out) |
template<typename T > | |
void | transposeMatrix (const std::vector< std::vector< T > > &a, std::vector< std::vector< T > > &out) |
template<typename triangulationType > | |
std::array< float, 3 > | computeSurfaceNormalAtPoint (const SimplexId a, const triangulationType &triangulation) |
Compute (mean) surface normal at given surface vertex. | |
template<typename triangulationType0 , typename triangulationType1 > | |
ProjectionResult | findProjection (const ProjectionInput &pi, VisitedMask &trianglesTested, std::vector< float > &dists, std::stack< SimplexId > &trianglesToTest, const bool reverseProjection, const triangulationType0 &triangulationToSmooth, const triangulationType1 &triangulation) |
void ttk::Geometry::addMatrices | ( | const std::vector< std::vector< T > > & | a, |
const std::vector< std::vector< T > > & | b, | ||
std::vector< std::vector< T > > & | out | ||
) |
Computes the element wise addition of two matrices
a | the first matrix |
b | the second matrix |
out | the resulting matrix |
Definition at line 798 of file Geometry.cpp.
int ttk::Geometry::addVectors | ( | const std::vector< T > & | a, |
const std::vector< T > & | b, | ||
std::vector< T > & | out | ||
) |
Computes the addition of two vectors.
a | coordinates of the first vector |
b | coordinates of the second vector |
out | the addition between the two vectors |
Definition at line 617 of file Geometry.cpp.
int ttk::Geometry::addVectors | ( | const T * | a, |
const T * | b, | ||
T * | out, | ||
const int & | dimension = 3 |
||
) |
Computes the addition of two vectors.
a | coordinates of the first vector |
b | coordinates of the second vector |
out | the addition between the two vectors |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 610 of file Geometry.cpp.
void ttk::Geometry::addVectorsProjection | ( | const std::vector< T > & | a, |
const std::vector< T > & | b, | ||
std::vector< T > & | a_out, | ||
std::vector< T > & | b_out | ||
) |
Adds two vectors and project them into it
a | coordinates of the first vector |
b | coordinates of the second vector |
a_out | the projection of a |
b_out | the projection of b |
Definition at line 690 of file Geometry.cpp.
T ttk::Geometry::angle | ( | const T * | vA0, |
const T * | vA1, | ||
const T * | vB0, | ||
const T * | vB1 | ||
) |
Compute the angle between two std::vectors
vA0 | xyz coordinates of vA's origin |
vA1 | xyz coordinates of vA's destination |
vB0 | xyz coordinates of vB's origin |
vB1 | xyz coordinates of vB's destination |
Definition at line 13 of file Geometry.cpp.
T ttk::Geometry::angle2D | ( | const T * | vA0, |
const T * | vA1, | ||
const T * | vB0, | ||
const T * | vB1 | ||
) |
Definition at line 20 of file Geometry.cpp.
|
inline |
Definition at line 33 of file Geometry.h.
bool ttk::Geometry::areVectorsColinear | ( | const T * | vA0, |
const T * | vA1, | ||
const T * | vB0, | ||
const T * | vB1, | ||
std::array< T, 3 > * | coefficients = nullptr , |
||
const T * | tolerance = NULL |
||
) |
Check if two 3D std::vectors vA and vB are colinear.
vA0 | xyz coordinates of vA's origin |
vA1 | xyz coordinates of vA's destination |
vB0 | xyz coordinates of vB's origin |
vB1 | xyz coordinates of vB's destination |
coefficients | Optional output std::array of colinearity coefficients. |
tolerance | Optional tolerance value (default: PREC_FLT) |
Definition at line 27 of file Geometry.cpp.
int ttk::Geometry::computeBarycentricCoordinates | ( | const T * | p0, |
const T * | p1, | ||
const T * | p, | ||
std::array< T, 2 > & | baryCentrics, | ||
const int & | dimension = 3 |
||
) |
Compute the barycentric coordinates of point p
with regard to the edge defined by the 3D points p0
and p1
.
p0 | xyz coordinates of the first vertex of the edge |
p1 | xyz coordinates of the second vertex of the edge |
p | xyz coordinates of the queried point |
baryCentrics | Output barycentric coordinates (all in [0, 1] if p belongs to the edge). |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 142 of file Geometry.cpp.
int ttk::Geometry::computeBarycentricCoordinates | ( | const T * | p0, |
const T * | p1, | ||
const T * | p2, | ||
const T * | p, | ||
std::array< T, 3 > & | baryCentrics | ||
) |
Compute the barycentric coordinates of point p
with regard to the triangle defined by the 3D points p0
, p1
, and p2
.
p0 | xyz coordinates of the first vertex of the triangle |
p1 | xyz coordinates of the second vertex of the triangle |
p2 | xyz coordinates of the third vertex of the triangle |
p | xyz coordinates of the queried point |
baryCentrics | Output barycentric coordinates (all in [0, 1] if p belongs to the triangle). |
Definition at line 190 of file Geometry.cpp.
bool ttk::Geometry::computeSegmentIntersection | ( | const T & | xA, |
const T & | yA, | ||
const T & | xB, | ||
const T & | yB, | ||
const T & | xC, | ||
const T & | yC, | ||
const T & | xD, | ||
const T & | yD, | ||
T & | x, | ||
T & | y | ||
) |
Compute the intersection between two 2D segments AB and CD.
xA | x coordinate of the first vertex of the first segment (AB) |
yA | y coordinate of the first vertex of the first segment (AB) |
xB | x coordinate of the second vertex of the first segment (AB) |
yB | y coordinate of the second vertex of the first segment (AB) |
xC | x coordinate of the first vertex of the second segment (CD) |
yC | y coordinate of the first vertex of the second segment (CD) |
xD | x coordinate of the second vertex of the second segment (CD) |
yD | y coordinate of the second vertex of the second segment (CD) |
x | x coordinate of the output intersection (if any). |
y | y coordinate of the output intersection (if any). |
Definition at line 248 of file Geometry.cpp.
std::array< float, 3 > ttk::Geometry::computeSurfaceNormalAtPoint | ( | const SimplexId | a, |
const triangulationType & | triangulation | ||
) |
Compute (mean) surface normal at given surface vertex.
[in] | a | Surface vertex id |
[in] | triangulation | Mesh |
a
Definition at line 754 of file Geometry.h.
int ttk::Geometry::computeTriangleAngleFromSides | ( | const T | s0, |
const T | s1, | ||
const T | s2, | ||
T & | angle | ||
) |
s0 | length of the first side of the triangle |
s1 | length of the second side of the triangle |
s2 | length of the third side of the triangle |
angle | Angle opposite to edge s2 |
Definition at line 321 of file Geometry.cpp.
int ttk::Geometry::computeTriangleAngles | ( | const T * | p0, |
const T * | p1, | ||
const T * | p2, | ||
std::array< T, 3 > & | angles | ||
) |
Compute the angles of a triangle
p0 | xyz coordinates of the first vertex of the triangle |
p1 | xyz coordinates of the second vertex of the triangle |
p2 | xyz coordinates of the third vertex of the triangle |
angles | Angles (p0p1, p1p2) (p1p2, p2p0) (p2p0, p0p1) |
Definition at line 308 of file Geometry.cpp.
int ttk::Geometry::computeTriangleArea | ( | const T * | p0, |
const T * | p1, | ||
const T * | p2, | ||
T & | area | ||
) |
Compute the area of a 3D triangle.
p0 | xyz coordinates of the first vertex of the triangle |
p1 | xyz coordinates of the second vertex of the triangle |
p2 | xyz coordinates of the third vertex of the triangle |
area | Output area. |
Definition at line 281 of file Geometry.cpp.
int ttk::Geometry::computeTriangleAreaFromSides | ( | const T | s0, |
const T | s1, | ||
const T | s2, | ||
T & | area | ||
) |
Compute the area of a triangle given length of its sides
s0 | length of the first side of the triangle |
s1 | length of the second side of the triangle |
s2 | length of the third side of the triangle |
area | Output area. |
Definition at line 296 of file Geometry.cpp.
void ttk::Geometry::computeTriangleNormal | ( | const T * | a, |
const T * | b, | ||
const T * | c, | ||
T * | out | ||
) |
Compute normal vector to triangle.
[in] | a | First triangle vertex coordinates |
[in] | b | Second triangle vertex coordinates |
[in] | c | Third triangle vertex coordinates |
[out] | out | Result |
Definition at line 564 of file Geometry.cpp.
int ttk::Geometry::crossProduct | ( | const T * | vA, |
const T * | vB, | ||
T * | crossProduct | ||
) |
Compute the cross product of two 3D std::vectors
vA | xyz coordinates of vA std::vector |
vB | xyz coordinates of vB std::vector |
crossProduct | Output cross product. |
Definition at line 354 of file Geometry.cpp.
int ttk::Geometry::crossProduct | ( | const T * | vA0, |
const T * | vA1, | ||
const T * | vB0, | ||
const T * | vB1, | ||
std::array< T, 3 > & | crossProduct | ||
) |
Compute the cross product of two 3D std::vectors
vA0 | xyz coordinates of vA's origin |
vA1 | xyz coordinates of vA's destination |
vB0 | xyz coordinates of vB's origin |
vB1 | xyz coordinates of vB's destination |
crossProduct | Output cross product. |
Definition at line 332 of file Geometry.cpp.
T ttk::Geometry::distance | ( | const std::vector< T > & | p0, |
const std::vector< T > & | p1 | ||
) |
Compute the Euclidean distance between two points
p0 | xyz coordinates of the first input point. |
p1 | xyz coordinates of the second input point. |
Definition at line 374 of file Geometry.cpp.
T ttk::Geometry::distance | ( | const T * | p0, |
const T * | p1, | ||
const int & | dimension = 3 |
||
) |
Compute the Euclidean distance between two points
p0 | xyz coordinates of the first input point. |
p1 | xyz coordinates of the second input point. |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 362 of file Geometry.cpp.
|
inline |
Definition at line 200 of file Geometry.h.
T ttk::Geometry::distanceFlatten | ( | const std::vector< std::vector< T > > & | p0, |
const std::vector< std::vector< T > > & | p1 | ||
) |
Compute the Euclidean distance between two vectors by first flattening them
p0 | xyz coordinates of the first input point. |
p1 | xyz coordinates of the second input point. |
Definition at line 379 of file Geometry.cpp.
T ttk::Geometry::dotProduct | ( | const std::vector< T > & | vA, |
const std::vector< T > & | vB | ||
) |
Compute the dot product of two std::vectors
vA | coordinates of vA std::vector |
vB | coordinates of vB std::vector |
Definition at line 407 of file Geometry.cpp.
T ttk::Geometry::dotProduct | ( | const T * | vA, |
const T * | vB, | ||
const int & | dimension = 3 |
||
) |
Compute the dot product of two std::vectors
vA | coordinates of vA std::vector |
vB | coordinates of vB std::vector |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 399 of file Geometry.cpp.
T ttk::Geometry::dotProduct | ( | const T * | vA0, |
const T * | vA1, | ||
const T * | vB0, | ||
const T * | vB1 | ||
) |
Compute the dot product of two 3D std::vectors
vA0 | xyz coordinates of vA's origin |
vA1 | xyz coordinates of vA's destination |
vB0 | xyz coordinates of vB's origin |
vB1 | xyz coordinates of vB's destination |
Definition at line 388 of file Geometry.cpp.
T ttk::Geometry::dotProductFlatten | ( | const std::vector< std::vector< T > > & | vA, |
const std::vector< std::vector< T > > & | vB | ||
) |
Compute the dot product of two multi dimensional std::vectors by first flattening them
vA | coordinates of vA std::vector |
vB | coordinates of vB std::vector |
Definition at line 412 of file Geometry.cpp.
ProjectionResult ttk::Geometry::findProjection | ( | const ProjectionInput & | pi, |
VisitedMask & | trianglesTested, | ||
std::vector< float > & | dists, | ||
std::stack< SimplexId > & | trianglesToTest, | ||
const bool | reverseProjection, | ||
const triangulationType0 & | triangulationToSmooth, | ||
const triangulationType1 & | triangulation | ||
) |
Definition at line 891 of file Geometry.h.
int ttk::Geometry::flattenMultiDimensionalVector | ( | const std::vector< std::vector< T > > & | a, |
std::vector< T > & | out | ||
) |
Flatten a multi dimensional vector (representing a rectangular/square matrix)
a | multi dimensional vector |
out | flattened vector |
Definition at line 742 of file Geometry.cpp.
int ttk::Geometry::getBoundingBox | ( | const Container & | points, |
std::array< std::pair< T, T >, dim > & | bBox | ||
) |
Compute the bounding box of a point set.
points | Vector of points. Each entry is a std::array<float, dim> whose size is equal to the dimension of the space embedding the points. |
bBox | Output bounding box. The number of entries in this std::array is equal to the dimension of the space embedding the points. |
Definition at line 273 of file Geometry.h.
SimplexId ttk::Geometry::getNearestSurfaceVertex | ( | const T * | pa, |
std::vector< T > & | dists, | ||
const triangulationType & | triangulation | ||
) |
Find nearest vertex on the surface.
[in] | pa | Input point |
[in] | dists | Pre-allocated distances vector |
[in] | triangulation | Surface triangulation |
Definition at line 517 of file Geometry.h.
void ttk::Geometry::gramSchmidt | ( | const std::vector< std::vector< T > > & | a, |
std::vector< std::vector< T > > & | out | ||
) |
Computes the Gram-Schmidt orthogonalization process. That is, given a set of vectors, it returns a set (of same size) of orthogonal vectors spanning the same subspace.
a | the set of vectors to orthogonalize |
out | the orthogonalized vectors |
Definition at line 701 of file Geometry.cpp.
bool ttk::Geometry::isPointInTriangle | ( | const T * | p0, |
const T * | p1, | ||
const T * | p2, | ||
const T * | p | ||
) |
Check if the point p
is inside the triangle (p0
, p1
, p2
).
p0 | xyz coordinates of the first vertex of the triangle |
p1 | xyz coordinates of the second vertex of the triangle |
p2 | xyz coordinates of the third vertex of the triangle |
p | xyz coordinates of the queried point |
p
is in the triangle, false otherwise. Definition at line 421 of file Geometry.cpp.
bool ttk::Geometry::isPointOnSegment | ( | const T & | x, |
const T & | y, | ||
const T & | xA, | ||
const T & | yA, | ||
const T & | xB, | ||
const T & | yB | ||
) |
Check if a 2D point xy
lies on a 2D segment AB
.
x | x coordinate of the input point. |
y | y coordinate of the input point. |
xA | x coordinate of the first vertex of the segment [AB] |
yA | y coordinate of the first vertex of the segment [AB] |
xB | x coordinate of the second vertex of the segment [AB] |
yB | y coordinate of the second vertex of the segment [AB] |
Definition at line 443 of file Geometry.cpp.
bool ttk::Geometry::isPointOnSegment | ( | const T * | p, |
const T * | pA, | ||
const T * | pB, | ||
const int & | dimension = 3 |
||
) |
Check if a point p
lies on a segment AB
.
p | xyz coordinates of the input point. |
pA | xyz coordinates of the first vertex of the segment [AB] |
pB | xyz coordinate of the second vertex of the segment [AB] |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 451 of file Geometry.cpp.
bool ttk::Geometry::isTriangleColinear | ( | const T * | p0, |
const T * | p1, | ||
const T * | p2, | ||
const T * | tolerance = nullptr |
||
) |
Check if all the edges of a triangle are colinear.
p0 | xyz coordinates of the first vertex of the triangle. |
p1 | xyz coordinates of the second vertex of the triangle. |
p2 | xyz coordinates of the third vertex of the triangle. |
tolerance | Optional tolerance value (default: PREC_FLT) |
Definition at line 466 of file Geometry.cpp.
bool ttk::Geometry::isTriangleColinear2D | ( | const T * | pptA, |
const T * | pptB, | ||
const T * | pptC, | ||
const T | tolerance | ||
) |
Definition at line 130 of file Geometry.cpp.
bool ttk::Geometry::isVectorNull | ( | const std::vector< T > & | a | ) |
Test if the vector is null (have all values almost equal to 0)
a | coordinates of the vector. |
Definition at line 727 of file Geometry.cpp.
bool ttk::Geometry::isVectorNullFlatten | ( | const std::vector< std::vector< T > > & | a | ) |
Test if the vector is null (have all values almost equal to 0) after flattening it
a | coordinates of the vector. |
Definition at line 735 of file Geometry.cpp.
bool ttk::Geometry::isVectorUniform | ( | const std::vector< T > & | a | ) |
Test if the vector have uniform values
a | coordinates of the vector. |
Definition at line 719 of file Geometry.cpp.
T ttk::Geometry::magnitude | ( | const std::vector< T > & | v | ) |
Compute the magnitude of a std::vector v
.
v | coordinates of the input std::vector. |
Definition at line 514 of file Geometry.cpp.
T ttk::Geometry::magnitude | ( | const T * | o, |
const T * | d | ||
) |
Compute the magnitude of a 3D std::vector.
o | xyz coordinates of the std::vector's origin |
d | xyz coordinates of the std::vector's destination |
Definition at line 526 of file Geometry.cpp.
T ttk::Geometry::magnitude | ( | const T * | v, |
const int & | dimension = 3 |
||
) |
Compute the magnitude of a std::vector v
.
v | coordinates of the input std::vector. |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 509 of file Geometry.cpp.
T ttk::Geometry::magnitudeFlatten | ( | const std::vector< std::vector< T > > & | v | ) |
Compute the magnitude of a multi dimensional std::vector v
by first flattening it
v | coordinates of the input std::vector. |
Definition at line 519 of file Geometry.cpp.
void ttk::Geometry::matrixMultiplication | ( | const std::vector< std::vector< T > > & | a, |
const std::vector< std::vector< T > > & | b, | ||
std::vector< std::vector< T > > & | out | ||
) |
Computes the matrix multiplication between two matrixes
a | the first matrix |
b | the second matrix |
out | the resulting matrix |
Definition at line 777 of file Geometry.cpp.
int ttk::Geometry::multiAddVectors | ( | const std::vector< std::vector< T > > & | a, |
const std::vector< std::vector< T > > & | b, | ||
std::vector< std::vector< T > > & | out | ||
) |
Computes the pairwise addition of pairs of two vectors.
a | coordinates of the first vectors |
b | coordinates of the second vectors |
out | the pairwise addition between the vectors |
Definition at line 625 of file Geometry.cpp.
int ttk::Geometry::multiAddVectorsFlatten | ( | const std::vector< std::vector< std::vector< T > > > & | a, |
const std::vector< std::vector< std::vector< T > > > & | b, | ||
std::vector< std::vector< T > > & | out | ||
) |
Computes the pairwise addition of pairs of two vectors by first flattening them.
a | coordinates of the first vectors |
b | coordinates of the second vectors |
out | the pairwise addition between the vectors |
Definition at line 635 of file Geometry.cpp.
int ttk::Geometry::multiFlattenMultiDimensionalVector | ( | const std::vector< std::vector< std::vector< T > > > & | a, |
std::vector< std::vector< T > > & | out | ||
) |
Flatten an ensemble of multi dimensional vector (representing a rectangular/square matrix)
a | multi dimensional vector |
out | flattened vector |
Definition at line 752 of file Geometry.cpp.
|
inline |
Compute the power of an arithmetic value (redirect to std::pow with a floating-point exponent and to Geometry::powInt with an integer exponent)
Definition at line 456 of file Geometry.h.
|
inline |
Compute the integer power of a floating-point value (std::pow is optimised for floating-point exponents)
Definition at line 383 of file Geometry.h.
|
inline |
Compute the nth power of ten.
Definition at line 405 of file Geometry.h.
void ttk::Geometry::projectOnEdge | ( | const T * | p, |
const T * | a, | ||
const T * | b, | ||
T * | out | ||
) |
Compute euclidean projection on a 3D segment.
[in] | p | Point to be projected |
[in] | a | First segment vertex coordinates |
[in] | b | Second segment vertex coordinates |
[out] | out | Result |
Definition at line 550 of file Geometry.cpp.
void ttk::Geometry::projectOnTrianglePlane | ( | const T * | p, |
const T * | a, | ||
const T * | normTri, | ||
T * | out | ||
) |
Compute euclidean projection in a triangle plane.
[in] | p | Point to be projected |
[in] | a | Triangle vertex coordinates |
[in] | normTri | Triangle normal vector |
[out] | out | Result |
Definition at line 538 of file Geometry.cpp.
void ttk::Geometry::scaleMatrix | ( | const std::vector< std::vector< T > > & | a, |
const T | factor, | ||
std::vector< std::vector< T > > & | out | ||
) |
Scale a matrix by a scalar value
a | the input matrix |
factor | scale factor |
out | the resulting matrix |
Definition at line 808 of file Geometry.cpp.
int ttk::Geometry::scaleVector | ( | const std::vector< T > & | a, |
const T | factor, | ||
std::vector< T > & | out | ||
) |
Scale a vector by a scalar value.
a | coordinates of the first vector |
factor | scale factor |
out | the scaled vector |
Definition at line 657 of file Geometry.cpp.
int ttk::Geometry::scaleVector | ( | const T * | a, |
const T | factor, | ||
T * | out, | ||
const int & | dimension = 3 |
||
) |
Scale a vector by a scalar value.
a | coordinates of the first vector |
factor | scale factor |
out | the scaled vector |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 647 of file Geometry.cpp.
void ttk::Geometry::subtractMatrices | ( | const std::vector< std::vector< T > > & | a, |
const std::vector< std::vector< T > > & | b, | ||
std::vector< std::vector< T > > & | out | ||
) |
Computes the element wise subtraction of two matrices (b
subtracted by a
)
a | the first matrix |
b | the second matrix |
out | the resulting matrix |
Definition at line 788 of file Geometry.cpp.
int ttk::Geometry::subtractVectors | ( | const std::vector< T > & | a, |
const std::vector< T > & | b, | ||
std::vector< T > & | out | ||
) |
Computes the difference between two vectors (b
subtracted by a
).
a | coordinates of the first vector |
b | coordinates of the second vector |
out | the difference between the two vectors |
Definition at line 602 of file Geometry.cpp.
int ttk::Geometry::subtractVectors | ( | const T * | a, |
const T * | b, | ||
T * | out, | ||
const int & | dimension = 3 |
||
) |
Computes the difference between two vectors (b
subtracted by a
).
a | coordinates of the first vector |
b | coordinates of the second vector |
out | the difference between the two vectors |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 592 of file Geometry.cpp.
void ttk::Geometry::transposeMatrix | ( | const std::vector< std::vector< T > > & | a, |
std::vector< std::vector< T > > & | out | ||
) |
Transpose a matrix
a | the input matrix |
out | the resulting matrix |
Definition at line 818 of file Geometry.cpp.
int ttk::Geometry::unflattenMultiDimensionalVector | ( | const std::vector< T > & | a, |
std::vector< std::vector< T > > & | out, | ||
const int & | no_columns = 2 |
||
) |
Unflatten a vector to a multi dimensional vector (representing a rectangular/square matrix)
a | vector |
out | multi dimensional vector |
no_columns | number of columns of the output multi dimensional vector |
Definition at line 762 of file Geometry.cpp.
int ttk::Geometry::vectorProjection | ( | const std::vector< T > & | a, |
const std::vector< T > & | b, | ||
std::vector< T > & | out | ||
) |
Computes the projection of vector a
onto the vector b
a | coordinates of the first vector |
b | coordinates of the second vector |
out | the projected vector |
Definition at line 682 of file Geometry.cpp.
int ttk::Geometry::vectorProjection | ( | const T * | a, |
const T * | b, | ||
T * | out, | ||
const int & | dimension = 3 |
||
) |
Computes the projection of vector a
onto the vector b
a | coordinates of the first vector |
b | coordinates of the second vector |
out | the projected vector |
dimension | Optional parameter that specifies the dimension of the point set (by default 3). |
Definition at line 665 of file Geometry.cpp.