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_PolylineTopology MR_PolylineTopology; // Defined in `#include <MRCMesh/MRPolylineTopology.h>`.
28typedef struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet; // Defined in `#include <MRCMesh/MRBitSet.h>`.
29typedef struct MR_VertCoords MR_VertCoords; // Defined in `#include <MRCMesh/MRVector.h>`.
30typedef struct MR_VertCoords2 MR_VertCoords2; // Defined in `#include <MRCMesh/MRVector.h>`.
31typedef struct MR_VertMap MR_VertMap; // Defined in `#include <MRCMesh/MRVector.h>`.
32typedef struct MR_WholeEdgeMap MR_WholeEdgeMap; // Defined in `#include <MRCMesh/MRVector.h>`.
33typedef struct MR_std_vector_MR_EdgeId MR_std_vector_MR_EdgeId; // Defined in `#include <MRCMisc/std_vector_MR_EdgeId.h>`.
34typedef struct MR_std_vector_MR_EdgePoint MR_std_vector_MR_EdgePoint; // Defined in `#include <MRCMisc/std_vector_MR_EdgePoint.h>`.
35typedef struct MR_std_vector_MR_Vector2f MR_std_vector_MR_Vector2f; // Defined in `#include <MRCMisc/std_vector_MR_Vector2f.h>`.
36typedef struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f; // Defined in `#include <MRCMisc/std_vector_MR_Vector3f.h>`.
37typedef struct MR_std_vector_MR_VertId MR_std_vector_MR_VertId; // Defined in `#include <MRCMisc/std_vector_MR_VertId.h>`.
38typedef 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>`.
39typedef 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>`.
40typedef 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>`.
41
42
46typedef struct MR_Polyline2 MR_Polyline2;
47
51typedef struct MR_Polyline3 MR_Polyline3;
52
58
64
70
76
82
88
92
97
101
105
110
117
124
134
137
140
147
153MRC_API MR_EdgeId MR_Polyline2_addFromPoints_3(MR_Polyline2 *_this, const MR_Vector2f *vs, size_t num, bool closed);
154
161
170
179
187
192
197
202
208
213
218
224
230
237
242
247
253
258
263
269
274
279
286
287// computes average position of all valid polyline vertices
291
297
306
307// same, but split given edge on two equal parts
311
316
325
333
341
351
356
362
368
374
380
386
392
396
401
405
409
414
421
428
438
441
444
451
457MRC_API MR_EdgeId MR_Polyline3_addFromPoints_3(MR_Polyline3 *_this, const MR_Vector3f *vs, size_t num, bool closed);
458
465
474
483
491
496
501
506
512
517
522
528
534
541
546
551
557
562
567
573
578
583
590
591// computes average position of all valid polyline vertices
595
601
610
611// same, but split given edge on two equal parts
615
620
629
637
645
655
660
661#ifdef __cplusplus
662} // extern "C"
663#endif
struct MR_std_vector_std_vector_MR_Vector2f MR_std_vector_std_vector_MR_Vector2f
Definition MR2DContoursTriangulation.h:22
struct MR_std_vector_std_vector_MR_VertId MR_std_vector_std_vector_MR_VertId
Definition MR2DContoursTriangulation.h:23
struct MR_UndirectedEdgeBitSet MR_UndirectedEdgeBitSet
Definition MRAABBTreeBase.h:24
struct MR_VertCoords MR_VertCoords
std::vector<T>-like container that requires specific indexing type,
Definition MRAABBTreePoints.h:21
struct MR_AABBTreePolyline2 MR_AABBTreePolyline2
Definition MRAABBTreePolyline.h:35
struct MR_Polyline3 MR_Polyline3
Definition MRAABBTreePolyline.h:21
struct MR_AABBTreePolyline3 MR_AABBTreePolyline3
Definition MRAABBTreePolyline.h:43
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:23
struct MR_std_vector_MR_Vector3f MR_std_vector_MR_Vector3f
Definition MRBestFit.h:25
struct MR_VertMap MR_VertMap
std::vector<T>-like container that requires specific indexing type,
Definition MRBitSet.h:40
struct MR_EdgeMap MR_EdgeMap
std::vector<T>-like container that requires specific indexing type,
Definition MRBitSet.h:24
struct MR_WholeEdgeMap MR_WholeEdgeMap
std::vector<T>-like container that requires specific indexing type,
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
std::vector<T>-like container that requires specific indexing type,
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_EdgeId MR_Polyline3_addFromPoints_2(MR_Polyline3 *_this, const MR_Vector3f *vs, size_t num)
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 size_t MR_Polyline2_heapBytes(const MR_Polyline2 *_this)
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 MR_EdgeId MR_Polyline3_addFromPoints_3(MR_Polyline3 *_this, const MR_Vector3f *vs, size_t num, bool closed)
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 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_EdgeId MR_Polyline2_addFromPoints_3(MR_Polyline2 *_this, const MR_Vector2f *vs, size_t num, bool closed)
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 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_EdgeId MR_Polyline2_addFromPoints_2(MR_Polyline2 *_this, const MR_Vector2f *vs, size_t num)
MRC_API MR_PolylineTopology * MR_Polyline2_GetMutable_topology(MR_Polyline2 *_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 size_t MR_Polyline3_heapBytes(const MR_Polyline3 *_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_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 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:13
#define MRC_API
Definition include/MRCMisc/exports.h:11
Definition MRAffineXf.h:23
Definition MRAffineXf.h:39
Definition MRBox.h:75
Definition MRBox.h:107
Definition MRId.h:146
Generated from class MR::Vector2f.
Definition MRVector2.h:36
Generated from class MR::Vector3f.
Definition MRVector3.h:47
Definition MRId.h:41