#include <MRCMisc/common.h>#include <MRCMisc/exports.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Typedefs | |
| typedef struct MR_std_array_MR_PreciseVertCoords_4 | MR_std_array_MR_PreciseVertCoords_4 |
| typedef enum MR_InSphereResult | MR_InSphereResult |
| the result of inSphere predicates | |
| typedef struct MR_InSphereTester_float | MR_InSphereTester_float |
| typedef struct MR_InSphereTester_double | MR_InSphereTester_double |
| typedef struct MR_InSphereTester_int | MR_InSphereTester_int |
Enumerations | |
| enum | MR_InSphereResult { MR_InSphereResult_NoSphere = 0 , MR_InSphereResult_Outside = 1 , MR_InSphereResult_OnSphere = 2 , MR_InSphereResult_Inside = 3 } |
| the result of inSphere predicates More... | |
| typedef enum MR_InSphereResult MR_InSphereResult |
the result of inSphere predicates
| typedef struct MR_InSphereTester_double MR_InSphereTester_double |
accelerates testing of many query points against one sphere given by the same three points and radius, pre-computing all the point-independent quantities once; the primary template works for floating-point T with the same case analysis as the precise specialization for int below, so the answers for the query points near the sphere's surface are subject to rounding errors, and OnSphere is returned only on the exact equality in the comparisons; the products inside have degree 16 in coordinates, so to avoid overflows any difference of two given points' coordinates as well as sqrt(rSq) must be below ~100 for T=float and ~1e18 for T=double; the one-call inSphere functions are implemented via this class Generated from class MR::InSphereTester<double>. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).
| typedef struct MR_InSphereTester_float MR_InSphereTester_float |
accelerates testing of many query points against one sphere given by the same three points and radius, pre-computing all the point-independent quantities once; the primary template works for floating-point T with the same case analysis as the precise specialization for int below, so the answers for the query points near the sphere's surface are subject to rounding errors, and OnSphere is returned only on the exact equality in the comparisons; the products inside have degree 16 in coordinates, so to avoid overflows any difference of two given points' coordinates as well as sqrt(rSq) must be below ~100 for T=float and ~1e18 for T=double; the one-call inSphere functions are implemented via this class Generated from class MR::InSphereTester<float>. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).
| typedef struct MR_InSphereTester_int MR_InSphereTester_int |
the specialization implementing the precise integer predicate, exact for any input; rSq must be given in the same integer grid units as the point coordinates Generated from class MR::InSphereTester<int>. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).
A fixed-size array of MR::PreciseVertCoords of size 4. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).
| enum MR_InSphereResult |
the result of inSphere predicates
| MRC_API MR_InSphereResult MR_inSphere_2 | ( | const MR_std_array_MR_PreciseVertCoords_4 * | vs, |
| int64_t | rSq ) |
checks whether the point vs[3] is strictly inside the sphere of radius sqrt(rSq) passing via points vs[0], vs[1], vs[2], with the center located on the positive side of plane vs[0]vs[1]vs[2] (same convention as in the overload above); resolves "vs[3] is exactly on the sphere" ties into Inside or Outside using simulation-of-simplicity: the points are symbolically perturbed (larger perturbations of points with smaller ids; per point the z-coordinate gets larger perturbation than y than x), and the first point whose perturbation moves vs[3] off the sphere decides the answer; known deviations from full simulation-of-simplicity semantics, all answered deterministically for now (covered by sosInSphereDeviations test, to be resolved by ids in the following PRs):
| MRC_API MR_InSphereResult MR_inSphere_5 | ( | const MR_Vector3i * | a, |
| const MR_Vector3i * | b, | ||
| const MR_Vector3i * | c, | ||
| const MR_Vector3i * | d, | ||
| int64_t | rSq ) |
checks whether the point D is strictly inside the sphere of radius sqrt(rSq) passing via points A, B, C, whose center is located on the positive side of plane ABC (in the half-space pointed at by cross( b - a, c - a ) from the plane); returns OnSphere when D is exactly on the sphere; cyclic permutations of (A, B, C) do not change the result, a swap of two of them selects the mirror sphere; rSq must be given in the same integer grid units as the point coordinates Generated from function MR::inSphere. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter c can not be null. It is a single object. Parameter d can not be null. It is a single object.
| MRC_API MR_InSphereResult MR_inSphere_double | ( | const MR_Vector3d * | a, |
| const MR_Vector3d * | b, | ||
| const MR_Vector3d * | c, | ||
| const MR_Vector3d * | d, | ||
| double | rSq ) |
checks whether the point d is strictly inside the sphere of radius sqrt(rSq) passing via points a, b, c, whose center is located on the positive side of plane abc, in floating-point; see the comment on InSphereTester above for the limitations Generated from function MR::inSphere<double>. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter c can not be null. It is a single object. Parameter d can not be null. It is a single object.
| MRC_API MR_InSphereResult MR_inSphere_float | ( | const MR_Vector3f * | a, |
| const MR_Vector3f * | b, | ||
| const MR_Vector3f * | c, | ||
| const MR_Vector3f * | d, | ||
| float | rSq ) |
checks whether the point d is strictly inside the sphere of radius sqrt(rSq) passing via points a, b, c, whose center is located on the positive side of plane abc, in floating-point; see the comment on InSphereTester above for the limitations Generated from function MR::inSphere<float>. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter c can not be null. It is a single object. Parameter d can not be null. It is a single object.
| MRC_API MR_InSphereTester_double * MR_InSphereTester_double_AssignFromAnother | ( | MR_InSphereTester_double * | _this, |
| const MR_InSphereTester_double * | _other ) |
Generated from method MR::InSphereTester<double>::operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it held previously.
| MRC_API MR_InSphereResult MR_InSphereTester_double_call | ( | const MR_InSphereTester_double * | _this, |
| const MR_Vector3d * | d ) |
returns the position of the point d relative to the sphere (never NoSphere); shall be called only after reset() returned true Generated from method MR::InSphereTester<double>::operator(). Parameter _this can not be null. It is a single object. Parameter d can not be null. It is a single object.
| MRC_API MR_InSphereTester_double * MR_InSphereTester_double_ConstructFromAnother | ( | const MR_InSphereTester_double * | _other | ) |
Generated from constructor MR::InSphereTester<double>::InSphereTester. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_InSphereTester_double_Destroy() to free it when you're done using it.
| MRC_API MR_InSphereTester_double * MR_InSphereTester_double_DefaultConstruct | ( | void | ) |
Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_InSphereTester_double_Destroy() to free it when you're done using it.
| MRC_API MR_InSphereTester_double * MR_InSphereTester_double_DefaultConstructArray | ( | size_t | num_elems | ) |
Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_InSphereTester_double_DestroyArray(). Use MR_InSphereTester_double_OffsetMutablePtr() and MR_InSphereTester_double_OffsetPtr() to access the array elements.
| MRC_API void MR_InSphereTester_double_Destroy | ( | const MR_InSphereTester_double * | _this | ) |
Destroys a heap-allocated instance of MR_InSphereTester_double. Does nothing if the pointer is null.
| MRC_API void MR_InSphereTester_double_DestroyArray | ( | const MR_InSphereTester_double * | _this | ) |
Destroys a heap-allocated array of MR_InSphereTester_double. Does nothing if the pointer is null.
| MRC_API MR_InSphereTester_double * MR_InSphereTester_double_OffsetMutablePtr | ( | MR_InSphereTester_double * | ptr, |
| ptrdiff_t | i ) |
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.
| MRC_API const MR_InSphereTester_double * MR_InSphereTester_double_OffsetPtr | ( | const MR_InSphereTester_double * | ptr, |
| ptrdiff_t | i ) |
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.
| MRC_API bool MR_InSphereTester_double_reset | ( | MR_InSphereTester_double * | _this, |
| const MR_Vector3d * | va, | ||
| const MR_Vector3d * | vb, | ||
| const MR_Vector3d * | vc, | ||
| double | sqRadius ) |
prepares the tester for the sphere of radius sqrt(rSq) passing via points a, b, c, with the center located on the positive side of plane abc (in the half-space pointed at by cross( b - a, c - a ) from the plane); returns false if no such sphere exists: the points are collinear or coincident, or rSq is less than the squared circumradius of triangle abc Generated from method MR::InSphereTester<double>::reset. Parameter _this can not be null. It is a single object. Parameter va can not be null. It is a single object. Parameter vb can not be null. It is a single object. Parameter vc can not be null. It is a single object.
| MRC_API MR_InSphereTester_float * MR_InSphereTester_float_AssignFromAnother | ( | MR_InSphereTester_float * | _this, |
| const MR_InSphereTester_float * | _other ) |
Generated from method MR::InSphereTester<float>::operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it held previously.
| MRC_API MR_InSphereResult MR_InSphereTester_float_call | ( | const MR_InSphereTester_float * | _this, |
| const MR_Vector3f * | d ) |
returns the position of the point d relative to the sphere (never NoSphere); shall be called only after reset() returned true Generated from method MR::InSphereTester<float>::operator(). Parameter _this can not be null. It is a single object. Parameter d can not be null. It is a single object.
| MRC_API MR_InSphereTester_float * MR_InSphereTester_float_ConstructFromAnother | ( | const MR_InSphereTester_float * | _other | ) |
Generated from constructor MR::InSphereTester<float>::InSphereTester. Parameter _other can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_InSphereTester_float_Destroy() to free it when you're done using it.
| MRC_API MR_InSphereTester_float * MR_InSphereTester_float_DefaultConstruct | ( | void | ) |
Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_InSphereTester_float_Destroy() to free it when you're done using it.
| MRC_API MR_InSphereTester_float * MR_InSphereTester_float_DefaultConstructArray | ( | size_t | num_elems | ) |
Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_InSphereTester_float_DestroyArray(). Use MR_InSphereTester_float_OffsetMutablePtr() and MR_InSphereTester_float_OffsetPtr() to access the array elements.
| MRC_API void MR_InSphereTester_float_Destroy | ( | const MR_InSphereTester_float * | _this | ) |
Destroys a heap-allocated instance of MR_InSphereTester_float. Does nothing if the pointer is null.
| MRC_API void MR_InSphereTester_float_DestroyArray | ( | const MR_InSphereTester_float * | _this | ) |
Destroys a heap-allocated array of MR_InSphereTester_float. Does nothing if the pointer is null.
| MRC_API MR_InSphereTester_float * MR_InSphereTester_float_OffsetMutablePtr | ( | MR_InSphereTester_float * | ptr, |
| ptrdiff_t | i ) |
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.
| MRC_API const MR_InSphereTester_float * MR_InSphereTester_float_OffsetPtr | ( | const MR_InSphereTester_float * | ptr, |
| ptrdiff_t | i ) |
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.
| MRC_API bool MR_InSphereTester_float_reset | ( | MR_InSphereTester_float * | _this, |
| const MR_Vector3f * | va, | ||
| const MR_Vector3f * | vb, | ||
| const MR_Vector3f * | vc, | ||
| float | sqRadius ) |
prepares the tester for the sphere of radius sqrt(rSq) passing via points a, b, c, with the center located on the positive side of plane abc (in the half-space pointed at by cross( b - a, c - a ) from the plane); returns false if no such sphere exists: the points are collinear or coincident, or rSq is less than the squared circumradius of triangle abc Generated from method MR::InSphereTester<float>::reset. Parameter _this can not be null. It is a single object. Parameter va can not be null. It is a single object. Parameter vb can not be null. It is a single object. Parameter vc can not be null. It is a single object.
| MRC_API MR_InSphereTester_int * MR_InSphereTester_int_AssignFromAnother | ( | MR_InSphereTester_int * | _this, |
| MR_PassBy | _other_pass_by, | ||
| MR_InSphereTester_int * | _other ) |
Generated from method MR::InSphereTester<int>::operator=. Parameter _this can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it held previously.
| MRC_API MR_InSphereResult MR_InSphereTester_int_call_MR_Vector3i | ( | const MR_InSphereTester_int * | _this, |
| const MR_Vector3i * | d ) |
returns the position of the point d relative to the sphere (never NoSphere); shall be called only after reset() returned true Generated from method MR::InSphereTester<int>::operator(). Parameter _this can not be null. It is a single object. Parameter d can not be null. It is a single object.
| MRC_API MR_InSphereResult MR_InSphereTester_int_call_std_array_MR_PreciseVertCoords_4 | ( | const MR_InSphereTester_int * | _this, |
| const MR_std_array_MR_PreciseVertCoords_4 * | vs ) |
returns the position of the point vs[3] relative to the sphere, resolving "exactly on the sphere" ties into Inside or Outside by simulation-of-simplicity as described at the inSphere overload above (never returns OnSphere or NoSphere); shall be called only after reset() returned true, and the points vs[0], vs[1], vs[2] must be the same a, b, c as in that reset() Generated from method MR::InSphereTester<int>::operator(). Parameter _this can not be null. It is a single object. Parameter vs can not be null. It is a single object.
| MRC_API MR_InSphereTester_int * MR_InSphereTester_int_ConstructFromAnother | ( | MR_PassBy | _other_pass_by, |
| MR_InSphereTester_int * | _other ) |
Generated from constructor MR::InSphereTester<int>::InSphereTester. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_InSphereTester_int_Destroy() to free it when you're done using it.
| MRC_API MR_InSphereTester_int * MR_InSphereTester_int_DefaultConstruct | ( | void | ) |
Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_InSphereTester_int_Destroy() to free it when you're done using it.
| MRC_API MR_InSphereTester_int * MR_InSphereTester_int_DefaultConstructArray | ( | size_t | num_elems | ) |
Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_InSphereTester_int_DestroyArray(). Use MR_InSphereTester_int_OffsetMutablePtr() and MR_InSphereTester_int_OffsetPtr() to access the array elements.
| MRC_API void MR_InSphereTester_int_Destroy | ( | const MR_InSphereTester_int * | _this | ) |
Destroys a heap-allocated instance of MR_InSphereTester_int. Does nothing if the pointer is null.
| MRC_API void MR_InSphereTester_int_DestroyArray | ( | const MR_InSphereTester_int * | _this | ) |
Destroys a heap-allocated array of MR_InSphereTester_int. Does nothing if the pointer is null.
| MRC_API MR_InSphereTester_int * MR_InSphereTester_int_OffsetMutablePtr | ( | MR_InSphereTester_int * | ptr, |
| ptrdiff_t | i ) |
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.
| MRC_API const MR_InSphereTester_int * MR_InSphereTester_int_OffsetPtr | ( | const MR_InSphereTester_int * | ptr, |
| ptrdiff_t | i ) |
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.
| MRC_API bool MR_InSphereTester_int_reset | ( | MR_InSphereTester_int * | _this, |
| const MR_Vector3i * | a, | ||
| const MR_Vector3i * | b, | ||
| const MR_Vector3i * | c, | ||
| int64_t | rSq ) |
prepares the tester for the sphere of radius sqrt(rSq) passing via points a, b, c, with the center located on the positive side of plane abc (in the half-space pointed at by cross( b - a, c - a ) from the plane); returns false if no such sphere exists: the points are collinear or coincident, or rSq is less than the squared circumradius of triangle abc Generated from method MR::InSphereTester<int>::reset. Parameter _this can not be null. It is a single object. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter c can not be null. It is a single object.