MeshLib C Docs
Loading...
Searching...
No Matches
MRPolyline.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRBox.h>
4#include <MRCMesh/MRId.h>
5#include <MRCMesh/MRVector2.h>
6#include <MRCMesh/MRVector3.h>
7#include <MRCMisc/common.h>
8#include <MRCMisc/exports.h>
9
10#include <stdbool.h>
11#include <stddef.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17typedef struct MR_AABBTreePolyline2 MR_AABBTreePolyline2; // Defined in `#include <MRCMesh/MRAABBTreePolyline.h>`.
18typedef struct MR_AABBTreePolyline3 MR_AABBTreePolyline3; // Defined in `#include <MRCMesh/MRAABBTreePolyline.h>`.
19typedef struct MR_AffineXf2f MR_AffineXf2f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
20typedef struct MR_AffineXf3f MR_AffineXf3f; // Defined in `#include <MRCMesh/MRAffineXf.h>`.
21typedef struct MR_EdgeMap MR_EdgeMap; // Defined in `#include <MRCMesh/MRVector.h>`.
22typedef struct MR_EdgePoint MR_EdgePoint; // Defined in `#include <MRCMesh/MREdgePoint.h>`.
23typedef struct MR_LineSegm2f MR_LineSegm2f; // Defined in `#include <MRCMesh/MRLineSegm.h>`.
24typedef struct MR_LineSegm3f MR_LineSegm3f; // Defined in `#include <MRCMesh/MRLineSegm.h>`.
25typedef struct MR_Mesh MR_Mesh; // Defined in `#include <MRCMesh/MRMesh.h>`.
26typedef struct MR_MeshTriPoint MR_MeshTriPoint; // Defined in `#include <MRCMesh/MRMeshTriPoint.h>`.
27typedef struct MR_Plane3f MR_Plane3f; // Defined in `#include <MRCMesh/MRPlane3.h>`.
28typedef struct MR_PolylineTopology MR_PolylineTopology; // Defined in `#include <MRCMesh/MRPolylineTopology.h>`.
29typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
30typedef struct MR_VertCoords MR_VertCoords; // Defined in `#include <MRCMesh/MRVector.h>`.
31typedef struct MR_VertCoords2 MR_VertCoords2; // Defined in `#include <MRCMesh/MRVector.h>`.
32typedef struct MR_VertMap MR_VertMap; // Defined in `#include <MRCMesh/MRVector.h>`.
33typedef struct MR_WholeEdgeMap MR_WholeEdgeMap; // Defined in `#include <MRCMesh/MRVector.h>`.
34typedef struct MR_std_vector_MR_EdgeId MR_std_vector_MR_EdgeId; // Defined in `#include <MRCMisc/std_vector_MR_EdgeId.h>`.
35typedef struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint; // Defined in `#include <MRCMisc/std_vector_MR_EdgePoint.h>`.
36typedef struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f; // Defined in `#include <MRCMisc/std_vector_MR_Vector2f.h>`.
37typedef struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_MR_Vector3f.h>`.
38typedef struct MR_std_vector_MR_VertId MR_std_vector_MR_VertId; // Defined in `#include <MRCMisc/std_vector_MR_VertId.h>`.
39typedef struct MR_std_vector_std_vector_MR_Vector2f MR_std_vector_std_vector_MR_Vector2f; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_Vector2f.h>`.
40typedef struct MR_std_vector_std_vector_MR_Vector3f MR_std_vector_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_Vector3f.h>`.
41typedef struct MR_std_vector_std_vector_MR_VertId MR_std_vector_std_vector_MR_VertId; // Defined in `#include <MRCMisc/std_vector_std_vector_MR_VertId.h>`.
42
43
48
53
58
64
69
74
80
85
89
94
98
102
107
114
121
131
134
137
144
151
158
167
176
184
189
194
199
205
210
215
221
227
234
239
244
250
255
260
266
271
276
283
284// computes average position of all valid polyline vertices
288
294
303
304// same, but split given edge on two equal parts
308
313
322
330
338
348
353
358
364
369
374
380
385
389
394
398
402
407
414
421
431
434
437
444
451
458
467
476
484
489
494
499
505
510
515
521
527
534
539
544
550
555
560
566
571
576
583
584// computes average position of all valid polyline vertices
588
594
603
604// same, but split given edge on two equal parts
608
613
622
630
638
648
653
659
660#ifdef __cplusplus
661} // extern "C"
662#endif
struct MR_std_vector_std_vector_MR_Vector2f MR_std_vector_std_vector_MR_Vector2f
Definition MR2DContoursTriangulation.h:21
struct MR_std_vector_std_vector_MR_VertId MR_std_vector_std_vector_MR_VertId
Definition MR2DContoursTriangulation.h:22
struct MR_AABBTreePolyline2 MR_AABBTreePolyline2
Definition MRAABBTreeBase.h:20
struct MR_AABBTreePolyline3 MR_AABBTreePolyline3
Definition MRAABBTreeBase.h:21
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:28
struct MR_VertCoords MR_VertCoords
Definition MRAABBTreePoints.h:21
struct MR_Polyline3 MR_Polyline3
Definition MRAABBTreePolyline.h:21
struct MR_Polyline2 MR_Polyline2
Definition MRAABBTreePolyline.h:20
struct MR_MeshTriPoint MR_MeshTriPoint
Definition MRAggregateFlow.h:13
struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint
Definition MRAlignContoursToMesh.h:22
struct MR_Plane3f MR_Plane3f
Definition MRBestFit.h:22
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:25
struct MR_VertMap MR_VertMap
Definition MRBitSet.h:40
struct MR_EdgeMap MR_EdgeMap
Definition MRBitSet.h:24
struct MR_WholeEdgeMap MR_WholeEdgeMap
Definition MRBooleanOperation.h:21
struct MR_std_vector_std_vector_MR_Vector3f MR_std_vector_std_vector_MR_Vector3f
Definition MRContour.h:17
struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f
Definition MRContour.h:11
struct MR_std_vector_MR_EdgeId MR_std_vector_MR_EdgeId
Definition MRContoursStitch.h:11
struct MR_Mesh MR_Mesh
Definition MRCtm.h:16
struct MR_VertCoords2 MR_VertCoords2
Definition MRCtm.h:23
struct MR_std_vector_MR_VertId MR_std_vector_MR_VertId
Definition MREdgePaths.h:29
struct MR_PolylineTopology MR_PolylineTopology
Definition MREdgePoint.h:15
struct MR_EdgePoint MR_EdgePoint
Definition MREdgePoint.h:22
struct MR_LineSegm3f MR_LineSegm3f
Definition MRFeatures.h:18
struct MR_LineSegm2f MR_LineSegm2f
Definition MRIntersection.h:9
MRC_API MR_EdgePoint * MR_Polyline2_toEdgePoint_1(const MR_Polyline2 *_this, MR_VertId v)
MRC_API const MR_Polyline3 * MR_Polyline3_OffsetPtr(const MR_Polyline3 *ptr, ptrdiff_t i)
MRC_API const MR_Polyline2 * MR_Polyline2_OffsetPtr(const MR_Polyline2 *ptr, ptrdiff_t i)
MRC_API MR_Box3f MR_Polyline3_getBoundingBox(const MR_Polyline3 *_this)
MRC_API MR_EdgeId MR_Polyline2_addFromGeneralSurfacePath(MR_Polyline2 *_this, const MR_Mesh *mesh, const MR_MeshTriPoint *start, const MR_std_vector_MR_EdgePoint *path, const MR_MeshTriPoint *end)
MRC_API MR_EdgePoint * MR_Polyline3_toEdgePoint_1(const MR_Polyline3 *_this, MR_VertId v)
MRC_API MR_Box2f MR_Polyline2_computeBoundingBox(const MR_Polyline2 *_this, const MR_AffineXf2f *toWorld)
MRC_API MR_Box3f MR_Polyline3_computeBoundingBox(const MR_Polyline3 *_this, const MR_AffineXf3f *toWorld)
MRC_API MR_EdgeId MR_Polyline2_splitEdge_1(MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_Vector3f MR_Polyline2_loopDirArea(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline3_addFromPoints_2(MR_Polyline3 *_this, const MR_Vector3f *vs, MR_uint64_t num)
MRC_API MR_Polyline2 * MR_Polyline2_OffsetMutablePtr(MR_Polyline2 *ptr, ptrdiff_t i)
MRC_API MR_Polyline2 * MR_Polyline2_Construct_2(const MR_std_vector_MR_VertId *comp2firstVert, MR_PassBy ps_pass_by, MR_VertCoords2 *ps)
MRC_API void MR_Polyline3_DestroyArray(const MR_Polyline3 *_this)
Destroys a heap-allocated array of MR_Polyline3. Does nothing if the pointer is null.
MRC_API void MR_Polyline2_transform(MR_Polyline2 *_this, const MR_AffineXf2f *xf)
MRC_API void MR_Polyline3_Set_topology(MR_Polyline3 *_this, MR_PassBy value_pass_by, MR_PolylineTopology *value)
MRC_API MR_EdgeId MR_Polyline3_addFromGeneralSurfacePath(MR_Polyline3 *_this, const MR_Mesh *mesh, const MR_MeshTriPoint *start, const MR_std_vector_MR_EdgePoint *path, const MR_MeshTriPoint *end)
MRC_API MR_std_vector_std_vector_MR_Vector2f * MR_Polyline2_contours(const MR_Polyline2 *_this, MR_std_vector_std_vector_MR_VertId *vertMap)
MRC_API const MR_AABBTreePolyline2 * MR_Polyline2_getAABBTreeNotCreate(const MR_Polyline2 *_this)
MRC_API MR_Polyline2 * MR_Polyline2_ConstructFromAnother(MR_PassBy _other_pass_by, MR_Polyline2 *_other)
MRC_API void MR_Polyline3_mirror(MR_Polyline3 *_this, const MR_Plane3f *plane)
MRC_API MR_Vector2f MR_Polyline2_orgPnt(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline3_splitEdge_1(MR_Polyline3 *_this, MR_EdgeId e)
MRC_API float MR_Polyline2_totalLength(const MR_Polyline2 *_this)
MRC_API void MR_Polyline3_transform(MR_Polyline3 *_this, const MR_AffineXf3f *xf)
MRC_API void MR_Polyline3_pack(MR_Polyline3 *_this, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API MR_Vector3f MR_Polyline3_edgePoint_1(const MR_Polyline3 *_this, const MR_EdgePoint *ep)
MRC_API MR_Polyline2 * MR_Polyline2_DefaultConstructArray(size_t num_elems)
MRC_API MR_Polyline3 * MR_Polyline3_DefaultConstructArray(size_t num_elems)
MRC_API MR_Polyline3 * MR_Polyline3_Construct_1_std_vector_MR_Vector3f(const MR_std_vector_MR_Vector3f *contour)
MRC_API void MR_Polyline2_DestroyArray(const MR_Polyline2 *_this)
Destroys a heap-allocated array of MR_Polyline2. Does nothing if the pointer is null.
MRC_API MR_EdgeId MR_Polyline3_addFromSurfacePath(MR_Polyline3 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgePoint *path)
MRC_API MR_Vector2f MR_Polyline2_edgePoint_1(const MR_Polyline2 *_this, const MR_EdgePoint *ep)
MRC_API MR_LineSegm2f * MR_Polyline2_edgeSegment(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API void MR_Polyline2_addPart(MR_Polyline2 *_this, const MR_Polyline2 *from, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API void MR_Polyline2_pack(MR_Polyline2 *_this, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API MR_Polyline2 * MR_Polyline2_Construct_1_std_vector_std_vector_MR_Vector2f(const MR_std_vector_std_vector_MR_Vector2f *contours)
MRC_API MR_Vector3f MR_Polyline3_edgePoint_2(const MR_Polyline3 *_this, MR_EdgeId e, float f)
MRC_API MR_EdgeId MR_Polyline2_addFromPoints_3(MR_Polyline2 *_this, const MR_Vector2f *vs, MR_uint64_t num, bool closed)
MRC_API const MR_VertCoords2 * MR_Polyline2_Get_points(const MR_Polyline2 *_this)
MRC_API MR_EdgePoint * MR_Polyline3_toEdgePoint_2(const MR_Polyline3 *_this, MR_EdgeId e, const MR_Vector3f *p)
MRC_API MR_Vector3f MR_Polyline3_loopDirArea(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Vector2f MR_Polyline2_edgeVector(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline2_splitEdge_2(MR_Polyline2 *_this, MR_EdgeId e, const MR_Vector2f *newVertPos)
MRC_API void MR_Polyline3_Destroy(const MR_Polyline3 *_this)
Destroys a heap-allocated instance of MR_Polyline3. Does nothing if the pointer is null.
MRC_API MR_Vector2f MR_Polyline2_edgeCenter(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API float MR_Polyline3_totalLength(const MR_Polyline3 *_this)
MRC_API float MR_Polyline2_averageEdgeLength(const MR_Polyline2 *_this)
MRC_API MR_Polyline2 * MR_Polyline2_Construct_1_std_vector_MR_Vector2f(const MR_std_vector_MR_Vector2f *contour)
MRC_API void MR_Polyline2_addPartByMask(MR_Polyline2 *_this, const MR_Polyline2 *from, const MR_UndirectedEdgeBitSet *mask, MR_VertMap *outVmap, MR_EdgeMap *outEmap)
MRC_API MR_std_vector_std_vector_MR_Vector3f * MR_Polyline3_contours(const MR_Polyline3 *_this, MR_std_vector_std_vector_MR_VertId *vertMap)
MRC_API const MR_AABBTreePolyline2 * MR_Polyline2_getAABBTree(const MR_Polyline2 *_this)
MRC_API MR_VertCoords2 * MR_Polyline2_GetMutable_points(MR_Polyline2 *_this)
MRC_API const MR_PolylineTopology * MR_Polyline2_Get_topology(const MR_Polyline2 *_this)
MRC_API float MR_Polyline3_averageEdgeLength(const MR_Polyline3 *_this)
MRC_API MR_Polyline3 * MR_Polyline3_DefaultConstruct(void)
MRC_API void MR_Polyline2_Destroy(const MR_Polyline2 *_this)
Destroys a heap-allocated instance of MR_Polyline2. Does nothing if the pointer is null.
MRC_API MR_Polyline3 * MR_Polyline3_Construct_1_std_vector_std_vector_MR_Vector3f(const MR_std_vector_std_vector_MR_Vector3f *contours)
MRC_API void MR_Polyline2_Set_topology(MR_Polyline2 *_this, MR_PassBy value_pass_by, MR_PolylineTopology *value)
MRC_API MR_Vector3f MR_Polyline3_findCenterFromPoints(const MR_Polyline3 *_this)
MRC_API MR_EdgeId MR_Polyline3_splitEdge_2(MR_Polyline3 *_this, MR_EdgeId e, const MR_Vector3f *newVertPos)
MRC_API const MR_VertCoords * MR_Polyline3_Get_points(const MR_Polyline3 *_this)
MRC_API MR_EdgeId MR_Polyline3_addFromEdgePath(MR_Polyline3 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgeId *path)
MRC_API void MR_Polyline3_Set_points(MR_Polyline3 *_this, MR_PassBy value_pass_by, MR_VertCoords *value)
MRC_API float MR_Polyline2_edgeLengthSq(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API float MR_Polyline2_edgeLength(const MR_Polyline2 *_this, MR_EdgeId e)
MRC_API void MR_Polyline2_invalidateCaches(MR_Polyline2 *_this)
MRC_API void MR_Polyline3_invalidateCaches(MR_Polyline3 *_this)
MRC_API MR_VertCoords * MR_Polyline3_GetMutable_points(MR_Polyline3 *_this)
MRC_API MR_PolylineTopology * MR_Polyline2_GetMutable_topology(MR_Polyline2 *_this)
MRC_API MR_uint64_t MR_Polyline3_heapBytes(const MR_Polyline3 *_this)
MRC_API MR_Polyline3 * MR_Polyline3_OffsetMutablePtr(MR_Polyline3 *ptr, ptrdiff_t i)
MRC_API MR_PolylineTopology * MR_Polyline3_GetMutable_topology(MR_Polyline3 *_this)
MRC_API MR_uint64_t MR_Polyline2_heapBytes(const MR_Polyline2 *_this)
MRC_API MR_Vector3f MR_Polyline3_edgeCenter(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Polyline3 * MR_Polyline3_AssignFromAnother(MR_Polyline3 *_this, MR_PassBy _other_pass_by, MR_Polyline3 *_other)
MRC_API MR_EdgeId MR_Polyline2_addFromPoints_2(MR_Polyline2 *_this, const MR_Vector2f *vs, MR_uint64_t num)
MRC_API MR_Polyline2 * MR_Polyline2_DefaultConstruct(void)
MRC_API float MR_Polyline3_edgeLength(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Polyline3 * MR_Polyline3_ConstructFromAnother(MR_PassBy _other_pass_by, MR_Polyline3 *_other)
MRC_API MR_Vector2f MR_Polyline2_edgePoint_2(const MR_Polyline2 *_this, MR_EdgeId e, float f)
MRC_API MR_Polyline2 * MR_Polyline2_AssignFromAnother(MR_Polyline2 *_this, MR_PassBy _other_pass_by, MR_Polyline2 *_other)
MRC_API MR_LineSegm3f * MR_Polyline3_edgeSegment(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Vector2f MR_Polyline2_findCenterFromPoints(const MR_Polyline2 *_this)
MRC_API MR_Vector3f MR_Polyline3_orgPnt(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_Vector3f MR_Polyline3_edgeVector(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API MR_EdgeId MR_Polyline3_addFromPoints_3(MR_Polyline3 *_this, const MR_Vector3f *vs, MR_uint64_t num, bool closed)
MRC_API float MR_Polyline3_edgeLengthSq(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API void MR_Polyline2_Set_points(MR_Polyline2 *_this, MR_PassBy value_pass_by, MR_VertCoords2 *value)
MRC_API const MR_AABBTreePolyline3 * MR_Polyline3_getAABBTreeNotCreate(const MR_Polyline3 *_this)
MRC_API const MR_PolylineTopology * MR_Polyline3_Get_topology(const MR_Polyline3 *_this)
MRC_API MR_Box2f MR_Polyline2_getBoundingBox(const MR_Polyline2 *_this)
MRC_API const MR_AABBTreePolyline3 * MR_Polyline3_getAABBTree(const MR_Polyline3 *_this)
MRC_API MR_EdgePoint * MR_Polyline2_toEdgePoint_2(const MR_Polyline2 *_this, MR_EdgeId e, const MR_Vector2f *p)
MRC_API void MR_Polyline3_addPart(MR_Polyline3 *_this, const MR_Polyline3 *from, MR_VertMap *outVmap, MR_WholeEdgeMap *outEmap)
MRC_API MR_EdgeId MR_Polyline2_addFromEdgePath(MR_Polyline2 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgeId *path)
MRC_API MR_EdgeId MR_Polyline2_addFromSurfacePath(MR_Polyline2 *_this, const MR_Mesh *mesh, const MR_std_vector_MR_EdgePoint *path)
MRC_API MR_Vector3f MR_Polyline3_destPnt(const MR_Polyline3 *_this, MR_EdgeId e)
MRC_API void MR_Polyline3_addPartByMask(MR_Polyline3 *_this, const MR_Polyline3 *from, const MR_UndirectedEdgeBitSet *mask, MR_VertMap *outVmap, MR_EdgeMap *outEmap)
MRC_API MR_Polyline3 * MR_Polyline3_Construct_2(const MR_std_vector_MR_VertId *comp2firstVert, MR_PassBy ps_pass_by, MR_VertCoords *ps)
MRC_API MR_Vector2f MR_Polyline2_destPnt(const MR_Polyline2 *_this, MR_EdgeId e)
MR_PassBy
Definition common.h:23
uint64_t MR_uint64_t
Definition common.h:18
#define MRC_API
Definition exports.h:11
Definition MRAffineXf.h:23
Definition MRAffineXf.h:39
Definition MRBox.h:78
Definition MRBox.h:110
Definition MRId.h:153
Definition MRVector2.h:45
Definition MRVector3.h:52
Definition MRId.h:55