MeshLib C Docs
Loading...
Searching...
No Matches
MRPolyline2Intersect.h File Reference
#include <MRCMisc/exports.h>
#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_EdgePoint MR_EdgePoint
 
typedef struct MR_IntersectionPrecomputes2_double MR_IntersectionPrecomputes2_double
 
typedef struct MR_IntersectionPrecomputes2_float MR_IntersectionPrecomputes2_float
 
typedef struct MR_Line2d MR_Line2d
 
typedef struct MR_Line2f MR_Line2f
 
typedef struct MR_Polyline2 MR_Polyline2
 
typedef struct MR_Vector2f MR_Vector2f
 
typedef struct MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_double_double_ref MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_double_double_ref
 
typedef struct MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_float_float_ref MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_float_float_ref
 
typedef struct MR_std_optional_MR_PolylineIntersectionResult2 MR_std_optional_MR_PolylineIntersectionResult2
 
typedef struct MR_PolylineIntersectionResult2 MR_PolylineIntersectionResult2
 Generated from class MR::PolylineIntersectionResult2.
 

Functions

MRC_API bool MR_isPointInsidePolyline (const MR_Polyline2 *polyline, const MR_Vector2f *point)
 detect if given point is inside polyline, by counting ray intersections
 
MRC_API const MR_EdgePointMR_PolylineIntersectionResult2_Get_edgePoint (const MR_PolylineIntersectionResult2 *_this)
 
MRC_API void MR_PolylineIntersectionResult2_Set_edgePoint (MR_PolylineIntersectionResult2 *_this, const MR_EdgePoint *value)
 
MRC_API MR_EdgePointMR_PolylineIntersectionResult2_GetMutable_edgePoint (MR_PolylineIntersectionResult2 *_this)
 
MRC_API const float * MR_PolylineIntersectionResult2_Get_distanceAlongLine (const MR_PolylineIntersectionResult2 *_this)
 
MRC_API void MR_PolylineIntersectionResult2_Set_distanceAlongLine (MR_PolylineIntersectionResult2 *_this, float value)
 
MRC_API float * MR_PolylineIntersectionResult2_GetMutable_distanceAlongLine (MR_PolylineIntersectionResult2 *_this)
 
MRC_API MR_PolylineIntersectionResult2MR_PolylineIntersectionResult2_DefaultConstruct (void)
 
MRC_API MR_PolylineIntersectionResult2MR_PolylineIntersectionResult2_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_PolylineIntersectionResult2MR_PolylineIntersectionResult2_ConstructFrom (const MR_EdgePoint *edgePoint, float distanceAlongLine)
 
MRC_API const MR_PolylineIntersectionResult2MR_PolylineIntersectionResult2_OffsetPtr (const MR_PolylineIntersectionResult2 *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.
 
MRC_API MR_PolylineIntersectionResult2MR_PolylineIntersectionResult2_OffsetMutablePtr (MR_PolylineIntersectionResult2 *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.
 
MRC_API MR_PolylineIntersectionResult2MR_PolylineIntersectionResult2_ConstructFromAnother (const MR_PolylineIntersectionResult2 *_other)
 
MRC_API void MR_PolylineIntersectionResult2_Destroy (const MR_PolylineIntersectionResult2 *_this)
 Destroys a heap-allocated instance of MR_PolylineIntersectionResult2. Does nothing if the pointer is null.
 
MRC_API void MR_PolylineIntersectionResult2_DestroyArray (const MR_PolylineIntersectionResult2 *_this)
 Destroys a heap-allocated array of MR_PolylineIntersectionResult2. Does nothing if the pointer is null.
 
MRC_API MR_PolylineIntersectionResult2MR_PolylineIntersectionResult2_AssignFromAnother (MR_PolylineIntersectionResult2 *_this, const MR_PolylineIntersectionResult2 *_other)
 
MRC_API MR_std_optional_MR_PolylineIntersectionResult2MR_rayPolylineIntersect_MR_Line2f (const MR_Polyline2 *polyline, const MR_Line2f *line, const float *rayStart, const float *rayEnd, const MR_IntersectionPrecomputes2_float *prec, const bool *closestIntersect)
 
MRC_API MR_std_optional_MR_PolylineIntersectionResult2MR_rayPolylineIntersect_MR_Line2d (const MR_Polyline2 *polyline, const MR_Line2d *line, const double *rayStart, const double *rayEnd, const MR_IntersectionPrecomputes2_double *prec, const bool *closestIntersect)
 
MRC_API void MR_rayPolylineIntersectAll_MR_Line2f (const MR_Polyline2 *polyline, const MR_Line2f *line, const MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_float_float_ref *callback, const float *rayStart, const float *rayEnd, const MR_IntersectionPrecomputes2_float *prec)
 
MRC_API void MR_rayPolylineIntersectAll_MR_Line2d (const MR_Polyline2 *polyline, const MR_Line2d *line, const MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_double_double_ref *callback, const double *rayStart, const double *rayEnd, const MR_IntersectionPrecomputes2_double *prec)
 

Typedef Documentation

◆ MR_EdgePoint

typedef struct MR_EdgePoint MR_EdgePoint

◆ MR_IntersectionPrecomputes2_double

◆ MR_IntersectionPrecomputes2_float

◆ MR_Line2d

typedef struct MR_Line2d MR_Line2d

◆ MR_Line2f

typedef struct MR_Line2f MR_Line2f

◆ MR_Polyline2

typedef struct MR_Polyline2 MR_Polyline2

◆ MR_PolylineIntersectionResult2

◆ MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_double_double_ref

◆ MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_float_float_ref

◆ MR_std_optional_MR_PolylineIntersectionResult2

◆ MR_Vector2f

typedef struct MR_Vector2f MR_Vector2f

Function Documentation

◆ MR_isPointInsidePolyline()

MRC_API bool MR_isPointInsidePolyline ( const MR_Polyline2 * polyline,
const MR_Vector2f * point )

detect if given point is inside polyline, by counting ray intersections

Parameters
polylineinput polyline
pointinput point Generated from function MR::isPointInsidePolyline. Parameter polyline can not be null. It is a single object. Parameter point can not be null. It is a single object.

◆ MR_PolylineIntersectionResult2_AssignFromAnother()

MRC_API MR_PolylineIntersectionResult2 * MR_PolylineIntersectionResult2_AssignFromAnother ( MR_PolylineIntersectionResult2 * _this,
const MR_PolylineIntersectionResult2 * _other )

Generated from a method of class MR::PolylineIntersectionResult2 named operator=. Parameter _this can not be null. It is a single object. Parameter _other can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_PolylineIntersectionResult2_ConstructFrom()

MRC_API MR_PolylineIntersectionResult2 * MR_PolylineIntersectionResult2_ConstructFrom ( const MR_EdgePoint * edgePoint,
float distanceAlongLine )

Constructs MR::PolylineIntersectionResult2 elementwise. Parameter edgePoint can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_PolylineIntersectionResult2_Destroy() to free it when you're done using it.

◆ MR_PolylineIntersectionResult2_ConstructFromAnother()

MRC_API MR_PolylineIntersectionResult2 * MR_PolylineIntersectionResult2_ConstructFromAnother ( const MR_PolylineIntersectionResult2 * _other)

Generated from a constructor of class MR::PolylineIntersectionResult2. Parameter _other can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_PolylineIntersectionResult2_Destroy() to free it when you're done using it.

◆ MR_PolylineIntersectionResult2_DefaultConstruct()

MRC_API MR_PolylineIntersectionResult2 * MR_PolylineIntersectionResult2_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_PolylineIntersectionResult2_Destroy() to free it when you're done using it.

◆ MR_PolylineIntersectionResult2_DefaultConstructArray()

MRC_API MR_PolylineIntersectionResult2 * MR_PolylineIntersectionResult2_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_PolylineIntersectionResult2_DestroyArray(). Use MR_PolylineIntersectionResult2_OffsetMutablePtr() and MR_PolylineIntersectionResult2_OffsetPtr() to access the array elements.

◆ MR_PolylineIntersectionResult2_Destroy()

MRC_API void MR_PolylineIntersectionResult2_Destroy ( const MR_PolylineIntersectionResult2 * _this)

Destroys a heap-allocated instance of MR_PolylineIntersectionResult2. Does nothing if the pointer is null.

◆ MR_PolylineIntersectionResult2_DestroyArray()

MRC_API void MR_PolylineIntersectionResult2_DestroyArray ( const MR_PolylineIntersectionResult2 * _this)

Destroys a heap-allocated array of MR_PolylineIntersectionResult2. Does nothing if the pointer is null.

◆ MR_PolylineIntersectionResult2_Get_distanceAlongLine()

MRC_API const float * MR_PolylineIntersectionResult2_Get_distanceAlongLine ( const MR_PolylineIntersectionResult2 * _this)

stores the distance from ray origin to the intersection point in direction units Returns a pointer to a member variable of class MR::PolylineIntersectionResult2 named distanceAlongLine. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_PolylineIntersectionResult2_Get_edgePoint()

MRC_API const MR_EdgePoint * MR_PolylineIntersectionResult2_Get_edgePoint ( const MR_PolylineIntersectionResult2 * _this)

intersection point in polyline Returns a pointer to a member variable of class MR::PolylineIntersectionResult2 named edgePoint. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_PolylineIntersectionResult2_GetMutable_distanceAlongLine()

MRC_API float * MR_PolylineIntersectionResult2_GetMutable_distanceAlongLine ( MR_PolylineIntersectionResult2 * _this)

stores the distance from ray origin to the intersection point in direction units Returns a mutable pointer to a member variable of class MR::PolylineIntersectionResult2 named distanceAlongLine. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_PolylineIntersectionResult2_GetMutable_edgePoint()

MRC_API MR_EdgePoint * MR_PolylineIntersectionResult2_GetMutable_edgePoint ( MR_PolylineIntersectionResult2 * _this)

intersection point in polyline Returns a mutable pointer to a member variable of class MR::PolylineIntersectionResult2 named edgePoint. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_PolylineIntersectionResult2_OffsetMutablePtr()

MRC_API MR_PolylineIntersectionResult2 * MR_PolylineIntersectionResult2_OffsetMutablePtr ( MR_PolylineIntersectionResult2 * 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.

◆ MR_PolylineIntersectionResult2_OffsetPtr()

MRC_API const MR_PolylineIntersectionResult2 * MR_PolylineIntersectionResult2_OffsetPtr ( const MR_PolylineIntersectionResult2 * 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.

◆ MR_PolylineIntersectionResult2_Set_distanceAlongLine()

MRC_API void MR_PolylineIntersectionResult2_Set_distanceAlongLine ( MR_PolylineIntersectionResult2 * _this,
float value )

stores the distance from ray origin to the intersection point in direction units Modifies a member variable of class MR::PolylineIntersectionResult2 named distanceAlongLine. Parameter _this can not be null. It is a single object.

◆ MR_PolylineIntersectionResult2_Set_edgePoint()

MRC_API void MR_PolylineIntersectionResult2_Set_edgePoint ( MR_PolylineIntersectionResult2 * _this,
const MR_EdgePoint * value )

intersection point in polyline Modifies a member variable of class MR::PolylineIntersectionResult2 named edgePoint. Parameter _this can not be null. It is a single object. Parameter value can not be null. It is a single object.

◆ MR_rayPolylineIntersect_MR_Line2d()

MRC_API MR_std_optional_MR_PolylineIntersectionResult2 * MR_rayPolylineIntersect_MR_Line2d ( const MR_Polyline2 * polyline,
const MR_Line2d * line,
const double * rayStart,
const double * rayEnd,
const MR_IntersectionPrecomputes2_double * prec,
const bool * closestIntersect )

Finds ray and polyline intersection in double-precision. rayStart and rayEnd define the interval on the ray to detect an intersection. prec can be specified to reuse some precomputations (e.g. for checking many parallel rays). Finds the closest to ray origin intersection (or any intersection for better performance if !closestIntersect). Generated from function MR::rayPolylineIntersect. Parameter polyline can not be null. It is a single object. Parameter line can not be null. It is a single object. Parameter rayStart has a default argument: 0, pass a null pointer to use it. Parameter rayEnd has a default argument: 1.7976931348623157E+308, pass a null pointer to use it. Parameter prec defaults to a null pointer in C++. Parameter closestIntersect has a default argument: true, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_MR_PolylineIntersectionResult2_Destroy() to free it when you're done using it.

◆ MR_rayPolylineIntersect_MR_Line2f()

MRC_API MR_std_optional_MR_PolylineIntersectionResult2 * MR_rayPolylineIntersect_MR_Line2f ( const MR_Polyline2 * polyline,
const MR_Line2f * line,
const float * rayStart,
const float * rayEnd,
const MR_IntersectionPrecomputes2_float * prec,
const bool * closestIntersect )

Finds ray and polyline intersection in float-precision. rayStart and rayEnd define the interval on the ray to detect an intersection. prec can be specified to reuse some precomputations (e.g. for checking many parallel rays). Finds the closest to ray origin intersection (or any intersection for better performance if !closestIntersect). Generated from function MR::rayPolylineIntersect. Parameter polyline can not be null. It is a single object. Parameter line can not be null. It is a single object. Parameter rayStart has a default argument: 0, pass a null pointer to use it. Parameter rayEnd has a default argument: 3.40282347E+38F, pass a null pointer to use it. Parameter prec defaults to a null pointer in C++. Parameter closestIntersect has a default argument: true, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_MR_PolylineIntersectionResult2_Destroy() to free it when you're done using it.

◆ MR_rayPolylineIntersectAll_MR_Line2d()

MRC_API void MR_rayPolylineIntersectAll_MR_Line2d ( const MR_Polyline2 * polyline,
const MR_Line2d * line,
const MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_double_double_ref * callback,
const double * rayStart,
const double * rayEnd,
const MR_IntersectionPrecomputes2_double * prec )

Intersects 2D ray and polyline in double-precision. Reports all intersections via given callback with the tendency to do it from ray start to ray end, but without guarantee of exact order. Generated from function MR::rayPolylineIntersectAll. Parameter polyline can not be null. It is a single object. Parameter line can not be null. It is a single object. Parameter callback can not be null. It is a single object. Parameter rayStart has a default argument: 0., pass a null pointer to use it. Parameter rayEnd has a default argument: 1.7976931348623157E+308, pass a null pointer to use it. Parameter prec defaults to a null pointer in C++.

◆ MR_rayPolylineIntersectAll_MR_Line2f()

MRC_API void MR_rayPolylineIntersectAll_MR_Line2f ( const MR_Polyline2 * polyline,
const MR_Line2f * line,
const MR_std_function_MR_Processing_from_const_MR_EdgePoint_ref_float_float_ref * callback,
const float * rayStart,
const float * rayEnd,
const MR_IntersectionPrecomputes2_float * prec )

Intersects 2D ray and polyline in single-precision. Reports all intersections via given callback with the tendency to do it from ray start to ray end, but without guarantee of exact order. Generated from function MR::rayPolylineIntersectAll. Parameter polyline can not be null. It is a single object. Parameter line can not be null. It is a single object. Parameter callback can not be null. It is a single object. Parameter rayStart has a default argument: 0.F, pass a null pointer to use it. Parameter rayEnd has a default argument: 3.40282347E+38F, pass a null pointer to use it. Parameter prec defaults to a null pointer in C++.