MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRMeshFwd.h
Go to the documentation of this file.
1#pragma once
2
3#include "config.h"
4
6
7// Not-zero _ITERATOR_DEBUG_LEVEL in Microsoft STL greatly reduces the performance of STL containers.
8//
9// Pre-build binaries from MeshLib distribution are prepared with _ITERATOR_DEBUG_LEVEL=0,
10// and if you build MeshLib by yourself then _ITERATOR_DEBUG_LEVEL=0 is also selected see
11// 1) vcpkg/triplets/x64-windows-meshlib.cmake and
12// 2) MeshLib/source/common.props
13// Please note that all other modules (.exe, .dll, .lib) with MS STL calls in your application also need
14// to define exactly the same value of _ITERATOR_DEBUG_LEVEL to be operational after linking.
15//
16// If you deliberately would like to work with not zero _ITERATOR_DEBUG_LEVEL, then please define
17// additionally MR_ITERATOR_DEBUG_LEVEL with the same value to indicate that it is done intentionally
18// (and you are ok with up to 100x slowdown).
19//
20#if defined _MSC_VER
21 #if !defined _ITERATOR_DEBUG_LEVEL
22 #define _ITERATOR_DEBUG_LEVEL 0
23 #endif
24 #if !defined MR_ITERATOR_DEBUG_LEVEL
25 #define MR_ITERATOR_DEBUG_LEVEL 0
26 #endif
27 #if _ITERATOR_DEBUG_LEVEL != MR_ITERATOR_DEBUG_LEVEL
28 #error _ITERATOR_DEBUG_LEVEL is inconsistent with MeshLib
29 #endif
30#endif
31
32#include <array>
33#include <vector>
34#include <string>
35#include <parallel_hashmap/phmap_fwd_decl.h>
36#include <functional>
37
38#ifdef _WIN32
39# ifdef MRMESH_EXPORT
40# define MRMESH_API __declspec(dllexport)
41# else
42# define MRMESH_API __declspec(dllimport)
43# endif
44# define MRMESH_CLASS
45#else
46# define MRMESH_API __attribute__((visibility("default")))
47// to fix undefined reference to `typeinfo/vtable`
48// Also it's important to use this on any type for which `typeid` is used in multiple shared libraries, and then passed across library boundaries.
49// Otherwise on Mac the resulting typeids will incorrectly compare not equal.
50# define MRMESH_CLASS __attribute__((visibility("default")))
51#endif
52
53namespace MR
54{
55
56struct NoInit {};
57inline constexpr NoInit noInit;
58template <typename T> struct MRMESH_CLASS NoDefInit;
59
72
73MR_CANONICAL_TYPEDEFS( (template <typename T> class MRMESH_CLASS), Id,
74 ( EdgeId, Id<EdgeTag> )
75 ( UndirectedEdgeId, Id<UndirectedEdgeTag> )
76 ( FaceId, Id<FaceTag> )
77 ( VertId, Id<VertTag> )
78 ( PixelId, Id<PixelTag> )
79 ( VoxelId, Id<VoxelTag> )
80 ( RegionId, Id<RegionTag> )
81 ( NodeId, Id<NodeTag> )
82 ( ObjId, Id<ObjTag> )
83 ( TextureId, Id<TextureTag> )
84 ( GraphVertId, Id<GraphVertTag> )
85 ( GraphEdgeId, Id<GraphEdgeTag> )
86)
87
88template <typename T, typename I = size_t> class MRMESH_CLASS Buffer;
89struct PackMapping;
90
91class ViewportId;
92class ViewportMask;
93
97
98using EdgePath = std::vector<EdgeId>;
99using EdgeLoop = std::vector<EdgeId>;
100using EdgeLoops = std::vector<EdgeLoop>;
101
103
104MR_CANONICAL_TYPEDEFS( (template <typename T> class MRMESH_CLASS), TaggedBitSet,
105 ( FaceBitSet, TaggedBitSet<FaceTag> )
106 ( VertBitSet, TaggedBitSet<VertTag> )
107 ( EdgeBitSet, TaggedBitSet<EdgeTag> )
108 ( UndirectedEdgeBitSet, TaggedBitSet<UndirectedEdgeTag> )
109 ( PixelBitSet, TaggedBitSet<PixelTag> )
110 ( VoxelBitSet, TaggedBitSet<VoxelTag> )
111 ( RegionBitSet, TaggedBitSet<RegionTag> )
112 ( NodeBitSet, TaggedBitSet<NodeTag> )
113 ( ObjBitSet, TaggedBitSet<ObjTag> )
114 ( TextureBitSet, TaggedBitSet<TextureTag> )
115 ( GraphVertBitSet, TaggedBitSet<GraphVertTag> )
116 ( GraphEdgeBitSet, TaggedBitSet<GraphEdgeTag> )
117)
118
119MR_CANONICAL_TYPEDEFS( (template <typename T> class MRMESH_CLASS), SetBitIteratorT,
121 ( FaceSetBitIterator, SetBitIteratorT<FaceBitSet> )
122 ( VertSetBitIterator, SetBitIteratorT<VertBitSet> )
123 ( EdgeSetBitIterator, SetBitIteratorT<EdgeBitSet> )
124 ( UndirectedEdgeSetBitIterator, SetBitIteratorT<UndirectedEdgeBitSet> )
125)
126
127struct Color;
128
129MR_CANONICAL_TYPEDEFS( (template <typename T> struct), MRMESH_CLASS Vector2,
130 ( Vector2b, Vector2<bool> )
131 ( Vector2i, Vector2<int> )
132 ( Vector2ll, Vector2<long long> )
133 ( Vector2f, Vector2<float> )
134 ( Vector2d, Vector2<double> )
135)
136
137MR_CANONICAL_TYPEDEFS( (template <typename T> struct), MRMESH_CLASS Vector3,
138 ( Vector3b, Vector3<bool> )
139 ( Vector3i, Vector3<int> )
140 ( Vector3ll, Vector3<long long> )
141 ( Vector3f, Vector3<float> )
142 ( Vector3d, Vector3<double> )
143)
144
145MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Vector4,
146 ( Vector4b, Vector4<bool> )
147 ( Vector4i, Vector4<int> )
148 ( Vector4ll, Vector4<long long> )
149 ( Vector4f, Vector4<float> )
150 ( Vector4d, Vector4<double> )
151)
152
153MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Matrix2,
154 ( Matrix2b, Matrix2<bool> )
155 ( Matrix2i, Matrix2<int> )
156 ( Matrix2ll, Matrix2<long long> )
157 ( Matrix2f, Matrix2<float> )
158 ( Matrix2d, Matrix2<double> )
159)
160
161MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Matrix3,
162 ( Matrix3b, Matrix3<bool> )
163 ( Matrix3i, Matrix3<int> )
164 ( Matrix3ll, Matrix3<long long> )
165 ( Matrix3f, Matrix3<float> )
166 ( Matrix3d, Matrix3<double> )
167)
168
169MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Matrix4,
170 ( Matrix4b, Matrix4<bool> )
171 ( Matrix4i, Matrix4<int> )
172 ( Matrix4ll, Matrix4<long long> )
173 ( Matrix4f, Matrix4<float> )
174 ( Matrix4d, Matrix4<double> )
175)
176
177MR_CANONICAL_TYPEDEFS( (template <typename T> struct), SymMatrix2,
178 ( SymMatrix2b, SymMatrix2<bool> )
179 ( SymMatrix2i, SymMatrix2<int> )
180 ( SymMatrix2ll, SymMatrix2<long long> )
181 ( SymMatrix2f, SymMatrix2<float> )
182 ( SymMatrix2d, SymMatrix2<double> )
183)
184
185MR_CANONICAL_TYPEDEFS( (template <typename T> struct), SymMatrix3,
187 ( SymMatrix3i, SymMatrix3<int> )
188 ( SymMatrix3ll, SymMatrix3<long long> )
189 ( SymMatrix3f, SymMatrix3<float> )
190 ( SymMatrix3d, SymMatrix3<double> )
191)
192
193MR_CANONICAL_TYPEDEFS( (template <typename T> struct), SymMatrix4,
194 ( SymMatrix4b, SymMatrix4<bool> )
195 ( SymMatrix4i, SymMatrix4<int> )
196 ( SymMatrix4ll, SymMatrix4<long long> )
197 ( SymMatrix4f, SymMatrix4<float> )
198 ( SymMatrix4d, SymMatrix4<double> )
199)
200
201MR_CANONICAL_TYPEDEFS( (template <typename V> struct), AffineXf,
203 ( AffineXf2d, AffineXf<Vector2<double>> )
204 ( AffineXf3f, AffineXf<Vector3<float>> )
205 ( AffineXf3d, AffineXf<Vector3<double>> )
206)
207template <typename T> using AffineXf2 = AffineXf<Vector2<T>>;
208template <typename T> using AffineXf3 = AffineXf<Vector3<T>>;
209
210MR_CANONICAL_TYPEDEFS( (template <typename T> struct), RigidXf3,
211 ( RigidXf3f, RigidXf3<float> )
212 ( RigidXf3d, RigidXf3<double> )
213)
214
215MR_CANONICAL_TYPEDEFS( (template <typename T> struct), RigidScaleXf3,
217 ( RigidScaleXf3d, RigidScaleXf3<double> )
218)
219
222
223MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Sphere,
224 ( Sphere2f, Sphere<Vector2<float>> )
225 ( Sphere2d, Sphere<Vector2<double>> )
226 ( Sphere3f, Sphere<Vector3<float>> )
227 ( Sphere3d, Sphere<Vector3<double>> )
228)
229template <typename T> using Sphere2 = Sphere<Vector2<T>>;
230template <typename T> using Sphere3 = Sphere<Vector3<T>>;
231
232MR_CANONICAL_TYPEDEFS( (template <typename V> struct), Line,
233 ( Line2f, Line<Vector2<float>> )
234 ( Line2d, Line<Vector2<double>> )
235 ( Line3f, Line<Vector3<float>> )
236 ( Line3d, Line<Vector3<double>> )
237)
238template <typename T> using Line2 = Line<Vector2<T>>;
239template <typename T> using Line3 = Line<Vector3<T>>;
240
241MR_CANONICAL_TYPEDEFS( (template <typename V> struct), LineSegm,
242 ( LineSegm2f, LineSegm<Vector2<float>> )
243 ( LineSegm2d, LineSegm<Vector2<double>> )
244 ( LineSegm3f, LineSegm<Vector3<float>> )
245 ( LineSegm3d, LineSegm<Vector3<double>> )
246)
247template <typename T> using LineSegm2 = LineSegm<Vector2<T>>;
248template <typename T> using LineSegm3 = LineSegm<Vector3<T>>;
249
250MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Parabola,
251 ( Parabolaf, Parabola<float> )
252 ( Parabolad, Parabola<double> )
253)
254
255MR_CANONICAL_TYPEDEFS( (template <typename T> class), BestFitParabola,
257 ( BestFitParabolad, BestFitParabola<double> )
258)
259
260MR_CANONICAL_TYPEDEFS( (template <typename T> class), Cylinder3,
262 ( Cylinder3d, Cylinder3<double> )
263)
264
265MR_CANONICAL_TYPEDEFS( (template <typename T> class), Cone3,
266 ( Cone3f, Cone3<float> )
267 ( Cone3d, Cone3<double> )
268)
269
270// No canonical typedefs here, because those ultimately boil to `std::vector`, which isn't under our control.
271template <typename V> using Contour = std::vector<V>;
272template <typename T> using Contour2 = Contour<Vector2<T>>;
273template <typename T> using Contour3 = Contour<Vector3<T>>;
274using Contour2d = Contour2<double>;
275using Contour2f = Contour2<float>;
276using Contour3d = Contour3<double>;
277using Contour3f = Contour3<float>;
278
279template <typename V> using Contours = std::vector<Contour<V>>;
280template <typename T> using Contours2 = Contours<Vector2<T>>;
281template <typename T> using Contours3 = Contours<Vector3<T>>;
282using Contours2d = Contours2<double>;
283using Contours2f = Contours2<float>;
284using Contours3d = Contours3<double>;
285using Contours3f = Contours3<float>;
286
287template <typename T> using Contour3 = Contour<Vector3<T>>;
288using Contour3d = Contour3<double>;
289using Contours3d = std::vector<Contour3d>;
290using Contour3f = Contour3<float>;
291using Contours3f = std::vector<Contour3f>;
292
293MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Plane3,
294 ( Plane3f, Plane3<float> )
295 ( Plane3d, Plane3<double> )
296)
297
298MR_CANONICAL_TYPEDEFS( (template <typename V> struct MRMESH_CLASS), Box,
299 ( Box1i, Box<int> )
300 ( Box1ll, Box<long long> )
301 ( Box1f, Box<float> )
302 ( Box1d, Box<double> )
303 ( Box2i, Box<Vector2<int>> )
304 ( Box2ll, Box<Vector2<long long>> )
305 ( Box2f, Box<Vector2<float>> )
306 ( Box2d, Box<Vector2<double>> )
307 ( Box3i, Box<Vector3<int>> )
308 ( Box3ll, Box<Vector3<long long>> )
309 ( Box3f, Box<Vector3<float>> )
310 ( Box3d, Box<Vector3<double>> )
311)
312template <typename T> using MinMax = Box<T>;
313using MinMaxf = MinMax<float>;
314using MinMaxd = MinMax<double>;
315
316template <typename T> using Box1 = Box<T>;
317template <typename T> using Box2 = Box<Vector2<T>>;
318template <typename T> using Box3 = Box<Vector3<T>>;
319
320MR_CANONICAL_TYPEDEFS( (template <typename V> struct), QuadraticForm,
321 ( QuadraticForm2f, QuadraticForm<Vector2<float>> )
322 ( QuadraticForm2d, QuadraticForm<Vector2<double>> )
323 ( QuadraticForm3f, QuadraticForm<Vector3<float>> )
324 ( QuadraticForm3d, QuadraticForm<Vector3<double>> )
325)
326template <typename T> using QuadraticForm2 = QuadraticForm<Vector2<T>>;
327template <typename T> using QuadraticForm3 = QuadraticForm<Vector3<T>>;
328
329MR_CANONICAL_TYPEDEFS( (template <typename T> struct), Quaternion,
330 ( Quaternionf, Quaternion<float> )
331 ( Quaterniond, Quaternion<double> )
332)
333
334// No canonical typedefs because `std::array` is not under our control.
335template <typename T> using Triangle3 = std::array<Vector3<T>, 3>;
336using Triangle3i = Triangle3<int>;
337using Triangle3f = Triangle3<float>;
338using Triangle3d = Triangle3<double>;
339
340class PointAccumulator;
341
342MR_CANONICAL_TYPEDEFS( (template <typename T> struct), SegmPoint,
343 ( SegmPointf, SegmPoint<float> )
344 ( SegmPointd, SegmPoint<double> )
345)
346
347struct EdgePoint;
348struct EdgeSegment;
350using SurfacePath = std::vector<MeshEdgePoint>;
351using SurfacePaths = std::vector<SurfacePath>;
356struct EdgePointPair;
357class Laplacian;
358
359using VertPair = std::pair<VertId, VertId>;
360using FacePair = std::pair<FaceId, FaceId>;
361using EdgePair = std::pair<EdgeId, EdgeId>;
362using UndirectedEdgePair = std::pair<UndirectedEdgeId, UndirectedEdgeId>;
363
364MR_CANONICAL_TYPEDEFS( (template <typename T> struct), TriPoint,
365 ( TriPointf, TriPoint<float> )
366 ( TriPointd, TriPoint<double> )
367)
368
369struct PointOnFace;
370struct PointOnObject;
371struct MeshTriPoint;
374template <typename T> struct IntersectionPrecomputes;
375
376template <typename I> struct IteratorRange;
377
380using UVCoord = Vector2f;
381
383using ThreeVertIds = std::array<VertId, 3>;
384
386
387MR_CANONICAL_TYPEDEFS( (template <typename T, typename I> class MRMESH_CLASS), Vector,
389 ( Triangulation, Vector<ThreeVertIds, FaceId> )
390
391 ( Dipoles, Vector<Dipole, NodeId> )
392
393 ( FaceMap, Vector<FaceId, FaceId> )
394 ( VertMap, Vector<VertId, VertId> )
395 ( EdgeMap, Vector<EdgeId, EdgeId> )
396 ( UndirectedEdgeMap, Vector<UndirectedEdgeId, UndirectedEdgeId> )
397 ( ObjMap, Vector<ObjId, ObjId> )
398
400 ( WholeEdgeMap, Vector<EdgeId, UndirectedEdgeId> )
401 ( UndirectedEdge2RegionMap, Vector<RegionId, UndirectedEdgeId> )
402 ( Face2RegionMap, Vector<RegionId, FaceId> )
403 ( Vert2RegionMap, Vector<RegionId, VertId> )
404
405 ( VertCoords, Vector<Vector3f, VertId> )
406 ( VertNormals, Vector<Vector3f, VertId> )
407 ( VertUVCoords, Vector<UVCoord, VertId> )
408 ( FaceNormals, Vector<Vector3f, FaceId> )
409
410 ( TexturePerFace, Vector<TextureId, FaceId> )
411 ( VertColors, Vector<Color, VertId> )
412 ( FaceColors, Vector<Color, FaceId> )
413 ( EdgeColors, Vector<Color, EdgeId> )
414 ( UndirectedEdgeColors, Vector<Color, UndirectedEdgeId> )
415
416 ( VertScalars, Vector<float, VertId> )
417 ( FaceScalars, Vector<float, FaceId> )
418 ( EdgeScalars, Vector<float, EdgeId> )
419 ( UndirectedEdgeScalars, Vector<float, UndirectedEdgeId> )
420)
421
422using VertPredicate = std::function<bool( VertId )>;
423using FacePredicate = std::function<bool( FaceId )>;
424using EdgePredicate = std::function<bool( EdgeId )>;
425using UndirectedEdgePredicate = std::function<bool( UndirectedEdgeId )>;
426
427using PreCollapseCallback = std::function<bool( EdgeId edgeToCollapse, const Vector3f& newEdgeOrgPos )>;
428using OnEdgeSplit = std::function<void( EdgeId e1, EdgeId e )>;
429
430template <typename T>
431[[nodiscard]] inline bool contains( const std::function<bool( Id<T> )> & pred, Id<T> id )
432{
433 return id.valid() && ( !pred || pred( id ) );
434}
435
436using VertMetric = std::function<float( VertId )>;
437using FaceMetric = std::function<float( FaceId )>;
438using EdgeMetric = std::function<float( EdgeId )>;
439using UndirectedEdgeMetric = std::function<float( UndirectedEdgeId )>;
440
441MR_CANONICAL_TYPEDEFS( (template <typename T, typename I> struct MRMESH_CLASS), BMap,
442 ( FaceBMap, BMap<FaceId, FaceId> )
443 ( VertBMap, BMap<VertId, VertId> )
444 ( EdgeBMap, BMap<EdgeId, EdgeId> )
445 ( UndirectedEdgeBMap, BMap<UndirectedEdgeId, UndirectedEdgeId> )
446 ( WholeEdgeBMap, BMap<EdgeId, UndirectedEdgeId> )
447)
448
449template <typename T, typename Hash = phmap::priv::hash_default_hash<T>, typename Eq = phmap::priv::hash_default_eq<T>>
450using HashSet = phmap::flat_hash_set<T, Hash, Eq>;
451template <typename T, typename Hash = phmap::priv::hash_default_hash<T>, typename Eq = phmap::priv::hash_default_eq<T>>
452using ParallelHashSet = phmap::parallel_flat_hash_set<T, Hash, Eq>;
453
454// No canonical typedefs because `phmap::...` is not under our control.
455using FaceHashSet = HashSet<FaceId>;
456using VertHashSet = HashSet<VertId>;
457using EdgeHashSet = HashSet<EdgeId>;
458
459template <typename K, typename V, typename Hash = phmap::priv::hash_default_hash<K>, typename Eq = phmap::priv::hash_default_eq<K>>
460using HashMap = phmap::flat_hash_map<K, V, Hash, Eq>;
461template <typename K, typename V, typename Hash = phmap::priv::hash_default_hash<K>, typename Eq = phmap::priv::hash_default_eq<K>>
462using ParallelHashMap = phmap::parallel_flat_hash_map<K, V, Hash, Eq>;
463
464using FaceHashMap = HashMap<FaceId, FaceId>;
465using VertHashMap = HashMap<VertId, VertId>;
466using EdgeHashMap = HashMap<EdgeId, EdgeId>;
467using UndirectedEdgeHashMap = HashMap<UndirectedEdgeId, UndirectedEdgeId>;
469using WholeEdgeHashMap = HashMap<UndirectedEdgeId, EdgeId>;
470
471template <typename I> class UnionFind;
472template <typename T, typename I, typename P> class Heap;
473
483struct MeshOrPointsXf;
484struct MeshTexture;
485struct GridSettings;
486struct TriMesh;
487
488MR_CANONICAL_TYPEDEFS( ( template <typename T> struct ), MRMESH_CLASS MeshRegion,
489 ( MeshPart, MeshRegion<FaceTag> )
490 ( MeshVertPart, MeshRegion<VertTag> )
491)
492
493template<typename T> class UniqueThreadSafeOwner;
494
495class PolylineTopology;
496
497MR_CANONICAL_TYPEDEFS( (template<typename V> struct), Polyline,
498 ( Polyline2, Polyline<Vector2f> )
499 ( Polyline3, Polyline<Vector3f> )
500)
501
504 ( AABBTreePolyline3, AABBTreePolyline<Vector3f> )
505)
506
507template<typename T> struct IntersectionPrecomputes;
508template<typename T> struct IntersectionPrecomputes2;
509
510MR_CANONICAL_TYPEDEFS( (template<typename V> struct [[nodiscard]]), PolylineProjectionResult,
511 ( PolylineProjectionResult2, PolylineProjectionResult<Vector2f> )
512 ( PolylineProjectionResult3, PolylineProjectionResult<Vector3f> )
513)
514
515MR_CANONICAL_TYPEDEFS( (template<typename V> struct [[nodiscard]]), PolylineProjectionWithOffsetResult,
517 ( PolylineProjectionWithOffsetResult3, PolylineProjectionWithOffsetResult<Vector3f> )
518)
519
520class DistanceMap;
521
522using GcodeSource = std::vector<std::string>;
523
524class Object;
525class SceneRootObject;
526class VisualObject;
527class ObjectMeshHolder;
528class ObjectMesh;
530class ObjectPoints;
532class ObjectLines;
534class ObjectLabel;
535class ObjectGcode;
536class PointObject;
537class LineObject;
538class CircleObject;
539class PlaneObject;
540class SphereObject;
541class CylinderObject;
542class ConeObject;
543
544struct Image;
546
547class HistoryAction;
554class ChangeMeshAction;
557class ChangeXfAction;
559class SwapRootAction;
560
561MR_CANONICAL_TYPEDEFS( (template <typename Tag> class MRMESH_CLASS), ColorMapAggregator,
562 ( VertColorMapAggregator, ColorMapAggregator<VertTag> )
563 ( UndirEdgeColorMapAggregator, ColorMapAggregator<UndirectedEdgeTag> )
564 ( FaceColorMapAggregator, ColorMapAggregator<FaceTag> )
565)
566
567template<typename T>
568class FewSmallest;
569
570class Graph;
571class WatershedGraph;
572
576typedef std::function<bool( float )> ProgressCallback;
577
578enum class FilterType : char
579{
580 Linear,
582};
583
584enum class WrapType : char
585{
586 Repeat,
587 Mirror,
588 Clamp
589};
590
592enum class Reorder : char
593{
594 None,
596 AABBTree
597};
598
599template <typename T>
600constexpr inline T sqr( T x ) noexcept { return x * x; }
601
602template <typename T>
603constexpr inline int sgn( T x ) noexcept { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
604
605template<typename...>
606inline constexpr bool dependent_false = false;
607
608template<class... Ts>
609struct overloaded : Ts... { using Ts::operator()...; };
610
611// explicit deduction guide (not needed as of C++20, but still needed in Clang)
612template<class... Ts>
613overloaded(Ts...) -> overloaded<Ts...>;
614
617
618namespace MeshBuilder
619{
620
621struct BuildSettings;
622struct Triangle;
623struct VertDuplication;
624
625} //namespace MeshBuilder
626
627} //namespace MR
628
629#ifdef __cpp_lib_unreachable
630# define MR_UNREACHABLE std::unreachable();
631# define MR_UNREACHABLE_NO_RETURN std::unreachable();
632#else
633# ifdef __GNUC__
634# define MR_UNREACHABLE __builtin_unreachable();
635# define MR_UNREACHABLE_NO_RETURN __builtin_unreachable();
636# else
637# define MR_UNREACHABLE { assert( false ); return {}; }
638# define MR_UNREACHABLE_NO_RETURN assert( false );
639# endif
640#endif
#define MR_CANONICAL_TYPEDEFS(type_, name_, aliases_)
Definition MRCanonicalTypedefs.h:23
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
Contour
Definition MRObjectLabel.h:16
Definition MRAABBTreeObjects.h:19
bounding volume hierarchy for point cloud structure
Definition MRAABBTreePoints.h:16
bounding volume hierarchy for line segments
Definition MRAABBTreePolyline.h:30
Definition MRAABBTree.h:16
Definition MRVisualObject.h:67
accumulates a number of (x,y) points to find the best-least-squares parabola approximating them
Definition MRBestFitParabola.h:12
container of bits
Definition MRMesh/MRBitSet.h:27
std::vector<V>-like container that is 1) resized without initialization of its elements,...
Definition MRBuffer.h:54
Undo action for ObjectMesh mesh change.
Definition MRChangeMeshAction.h:16
Undo action for ObjectMesh creases.
Definition MRChangeSelectionAction.h:122
Undo action for ObjectMesh edge selection.
Definition MRChangeSelectionAction.h:68
Undo action for ObjectMesh face selection.
Definition MRChangeSelectionAction.h:14
Undo action for ObjectMesh points only (not topology) change.
Definition MRChangeMeshAction.h:190
Undo action for ObjectMesh topology only (not points) change.
Definition MRChangeMeshAction.h:251
Definition MRChangeObjectAction.h:14
Undo action for ObjectPoints point selection.
Definition MRChangeSelectionAction.h:165
Definition MRChangeSceneAction.h:13
Definition MRChangeXfAction.h:13
Definition MRCircleObject.h:17
Class for aggregate several color map in one Color maps are aggregated according order.
Definition MRColorMapAggregator.h:17
Definition MRCombinedHistoryAction.h:12
Definition MRCone3.h:11
Definition MRConeObject.h:19
Definition MRCylinder3.h:12
Definition MRCylinderObject.h:18
Definition MRDistanceMap.h:24
the class stores some number of smallest elements from a larger number of candidates
Definition MRFewSmallest.h:14
mathematical graph consisting from vertices and undirected edges
Definition MRGraph.h:14
stores map from element id in[0, size) to T;
Definition MRMesh/MRMeshFwd.h:472
Definition MRHistoryAction.h:12
Abstract class for fast approximate computation of generalized winding number for a mesh (using its A...
Definition MRFastWindingNumber.h:12
Abstract class, computes the closest point on mesh to each of given points. Pure virtual functions mu...
Definition MRPointsToMeshProjector.h:12
Definition MRMesh/MRId.h:13
Definition MRLaplacian.h:32
Definition MRLineObject.h:12
Definition MRMesh/MRMeshOrPoints.h:17
Definition MRMesh/MRMeshTopology.h:18
Definition MRObjectDistanceMap.h:13
Definition MRObjectGcode.h:14
Definition MRObjectLabel.h:25
Definition MRObjectLinesHolder.h:19
Definition MRObjectLines.h:11
Definition MRObjectMeshHolder.h:30
Definition MRObjectMesh.h:11
Definition MRObjectPointsHolder.h:18
Definition MRObjectPoints.h:11
named object in the data model
Definition MRObject.h:60
Definition MRPlaneObject.h:12
Class to accumulate points and make best line / plane approximation.
Definition MRBestFit.h:19
Definition MRPointObject.h:13
Definition MRPointToPlaneAligningTransform.h:20
Definition MRPointToPointAligningTransform.h:16
Definition MRPolylineTopology.h:15
Object that is parent of all scene.
Definition MRSceneRoot.h:11
iterator to enumerate all indices with set bits in BitSet class or its derivatives
Definition MRMesh/MRBitSet.h:234
Definition MRSphereObject.h:15
Definition MRSwapRootAction.h:13
container of bits representing specific indices (faces, verts or edges)
Definition MRMesh/MRBitSet.h:127
Simple union find data structure.
Definition MRUnionFind.h:16
Definition MRUniqueThreadSafeOwner.h:20
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
Definition MRViewportId.h:16
stores mask of viewport unique identifiers
Definition MRViewportId.h:38
Visual Object.
Definition MRVisualObject.h:131
graphs representing rain basins on the mesh
Definition MRWatershedGraph.h:12
bool contains(const TaggedBitSet< T > *bitset, Id< T > id)
Definition MRMesh/MRBitSet.h:220
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
@ None
special value not to limit path in one slice
Definition MRVoxelPath.h:33
Definition MRCameraOrientationPlugin.h:8
std::function< float(VertId)> VertMetric
Definition MRMesh/MRMeshFwd.h:436
phmap::parallel_flat_hash_map< K, V, Hash, Eq > ParallelHashMap
Definition MRMesh/MRMeshFwd.h:462
std::vector< EdgeId > EdgeLoop
Definition MRMesh/MRMeshFwd.h:99
std::vector< std::string > GcodeSource
Definition MRMesh/MRMeshFwd.h:522
WrapType
Definition MRMesh/MRMeshFwd.h:585
std::vector< SurfacePath > SurfacePaths
Definition MRMesh/MRMeshFwd.h:351
std::vector< EdgeLoop > EdgeLoops
Definition MRMesh/MRMeshFwd.h:100
class MRMESH_CLASS UndirectedEdgeTag
Definition MRMesh/MRMeshFwd.h:61
constexpr T sqr(T x) noexcept
Definition MRMesh/MRMeshFwd.h:600
Cylinder3f
Definition MRMesh/MRMeshFwd.h:261
AABBTreePolyline2
Definition MRMesh/MRMeshFwd.h:503
Contour3< double > Contour3d
Definition MRMesh/MRMeshFwd.h:276
class MRMESH_CLASS ObjTag
Definition MRMesh/MRMeshFwd.h:68
Eq
Definition MRMesh/MRMeshFwd.h:449
std::function< bool(FaceId)> FacePredicate
Definition MRMesh/MRMeshFwd.h:423
MinMax< float > MinMaxf
Definition MRMesh/MRMeshFwd.h:313
Contour2< double > Contour2d
Definition MRMesh/MRMeshFwd.h:274
class MRMESH_CLASS NodeTag
Definition MRMesh/MRMeshFwd.h:67
HashSet< VertId > VertHashSet
Definition MRMesh/MRMeshFwd.h:456
std::function< bool(EdgeId)> EdgePredicate
Definition MRMesh/MRMeshFwd.h:424
Hash
Definition MRMesh/MRMeshFwd.h:449
Contour2< float > Contour2f
Definition MRMesh/MRMeshFwd.h:275
Contours2< double > Contours2d
Definition MRMesh/MRMeshFwd.h:282
std::function< bool(UndirectedEdgeId)> UndirectedEdgePredicate
Definition MRMesh/MRMeshFwd.h:425
SurfacePaths PlaneSections
Definition MRMesh/MRMeshFwd.h:355
HashMap< VertId, VertId > VertHashMap
Definition MRMesh/MRMeshFwd.h:465
class MRMESH_CLASS VoxelTag
Definition MRMesh/MRMeshFwd.h:65
FilterType
Definition MRMesh/MRMeshFwd.h:579
SurfacePath IsoLine
Definition MRMesh/MRMeshFwd.h:352
Vector2f UVCoord
Definition MRMesh/MRMeshFwd.h:380
Triangle3< int > Triangle3i
Definition MRMesh/MRMeshFwd.h:336
MRMESH_CLASS Vector3b
Definition MRMesh/MRMeshFwd.h:138
std::vector< MeshEdgePoint > SurfacePath
Definition MRMesh/MRMeshFwd.h:350
HashMap< UndirectedEdgeId, EdgeId > WholeEdgeHashMap
mapping of whole edges: map[e]->f, map[e.sym()]->f.sym(), where only map[e] for even edges is stored
Definition MRMesh/MRMeshFwd.h:469
class MRMESH_CLASS FaceTag
Definition MRMesh/MRMeshFwd.h:62
class MRMESH_CLASS TextureTag
Definition MRMesh/MRMeshFwd.h:69
class MRMESH_CLASS PixelTag
Definition MRMesh/MRMeshFwd.h:64
Contours< Vector2< T > > Contours2
Definition MRMesh/MRMeshFwd.h:280
MRMESH_CLASS Vector3< double > Matrix2< double > Matrix4< double > SymMatrix3< double > AffineXf2f
Definition MRMesh/MRMeshFwd.h:202
SetBitIterator
Definition MRMesh/MRMeshFwd.h:120
overloaded(Ts...) -> overloaded< Ts... >
MRMESH_CLASS Vector3< double > Matrix2< double > Matrix4b
Definition MRMesh/MRMeshFwd.h:170
constexpr int sgn(T x) noexcept
Definition MRMesh/MRMeshFwd.h:603
Contours2< float > Contours2f
Definition MRMesh/MRMeshFwd.h:283
RigidScaleXf3f
Definition MRMesh/MRMeshFwd.h:216
std::function< float(EdgeId)> EdgeMetric
Definition MRMesh/MRMeshFwd.h:438
MinMax< double > MinMaxd
Definition MRMesh/MRMeshFwd.h:314
std::function< bool(EdgeId edgeToCollapse, const Vector3f &newEdgeOrgPos)> PreCollapseCallback
Definition MRMesh/MRMeshFwd.h:427
Contour< Vector2< T > > Contour2
Definition MRMesh/MRMeshFwd.h:272
SurfacePath PlaneSection
Definition MRMesh/MRMeshFwd.h:354
HashMap< FaceId, FaceId > FaceHashMap
Definition MRMesh/MRMeshFwd.h:464
std::function< float(FaceId)> FaceMetric
Definition MRMesh/MRMeshFwd.h:437
Triangle3< double > Triangle3d
Definition MRMesh/MRMeshFwd.h:338
Box1i
Definition MRMesh/MRMeshFwd.h:299
Contour< Vector3< T > > Contour3
Definition MRMesh/MRMeshFwd.h:273
HashSet< FaceId > FaceHashSet
Definition MRMesh/MRMeshFwd.h:455
std::vector< EdgeId > EdgePath
Definition MRMesh/MRMeshFwd.h:98
std::array< VertId, 3 > ThreeVertIds
three vertex ids describing a triangle topology
Definition MRMesh/MRMeshFwd.h:383
class MRMESH_CLASS VertTag
Definition MRMesh/MRMeshFwd.h:63
std::pair< FaceId, FaceId > FacePair
Definition MRMesh/MRMeshFwd.h:360
constexpr NoInit noInit
Definition MRMesh/MRMeshFwd.h:57
HashSet< EdgeId > EdgeHashSet
Definition MRMesh/MRMeshFwd.h:457
std::pair< UndirectedEdgeId, UndirectedEdgeId > UndirectedEdgePair
Definition MRMesh/MRMeshFwd.h:362
Cone3f
Definition MRMesh/MRMeshFwd.h:266
BestFitParabolaf
Definition MRMesh/MRMeshFwd.h:256
I
Definition MRMesh/MRMeshFwd.h:88
std::pair< EdgeId, EdgeId > EdgePair
Definition MRMesh/MRMeshFwd.h:361
std::function< void(EdgeId e1, EdgeId e)> OnEdgeSplit
Definition MRMesh/MRMeshFwd.h:428
std::function< float(UndirectedEdgeId)> UndirectedEdgeMetric
Definition MRMesh/MRMeshFwd.h:439
constexpr bool dependent_false
Definition MRMesh/MRMeshFwd.h:606
Triangle3< float > Triangle3f
Definition MRMesh/MRMeshFwd.h:337
SurfacePaths IsoLines
Definition MRMesh/MRMeshFwd.h:353
class MRMESH_CLASS EdgeTag
Definition MRMesh/MRMeshFwd.h:60
Contours3< float > Contours3f
Definition MRMesh/MRMeshFwd.h:285
std::vector< Contour< V > > Contours
Definition MRMesh/MRMeshFwd.h:279
Polyline2ProjectionWithOffsetResult
Definition MRMesh/MRMeshFwd.h:516
HashMap< EdgeId, EdgeId > EdgeHashMap
Definition MRMesh/MRMeshFwd.h:466
phmap::parallel_flat_hash_set< T, Hash, Eq > ParallelHashSet
Definition MRMesh/MRMeshFwd.h:452
MRMESH_CLASS Vector3< double > Matrix2b
Definition MRMesh/MRMeshFwd.h:154
std::pair< VertId, VertId > VertPair
Definition MRMesh/MRMeshFwd.h:359
Contour3< float > Contour3f
Definition MRMesh/MRMeshFwd.h:277
HashMap< UndirectedEdgeId, UndirectedEdgeId > UndirectedEdgeHashMap
Definition MRMesh/MRMeshFwd.h:467
Contours< Vector3< T > > Contours3
Definition MRMesh/MRMeshFwd.h:281
Contours3< double > Contours3d
Definition MRMesh/MRMeshFwd.h:284
class MRMESH_CLASS RegionTag
Definition MRMesh/MRMeshFwd.h:66
MRMESH_CLASS Vector3< double > Matrix2< double > Matrix4< double > SymMatrix3b
Definition MRMesh/MRMeshFwd.h:186
class MRMESH_CLASS GraphVertTag
Definition MRMesh/MRMeshFwd.h:70
phmap::flat_hash_map< K, V, Hash, Eq > HashMap
Definition MRMesh/MRMeshFwd.h:460
class MRMESH_CLASS GraphEdgeTag
Definition MRMesh/MRMeshFwd.h:71
Reorder
determines how points to be ordered
Definition MRMesh/MRMeshFwd.h:593
@ Lexicographically
the order is determined by lexicographical sorting by coordinates (optimal for uniform sampling)
Definition MRMesh/MRAffineXf.h:14
triangulations for all points, with easy access by VertId
Definition MRLocalTriangulations.h:48
flat map: I -> T
Definition MRBuffer.h:143
Box given by its min- and max- corners.
Definition MRMesh/MRBox.h:25
Definition MRCloudPartMapping.h:10
Definition MRColor.h:9
Definition MRDipole.h:11
two edge-points (e.g. representing collision point of two edges)
Definition MREdgePoint.h:50
encodes a point on an edge of mesh or of polyline
Definition MREdgePoint.h:11
Represents a segment on one edge.
Definition MREdgePoint.h:61
settings defining regular grid, where each quadrangular cell is split on two triangles in one of two ...
Definition MRGridSettings.h:11
Definition MRImage.h:15
Definition MRMesh/MRMeshFwd.h:508
Definition MRMesh/MRMeshFwd.h:374
Definition MRMesh/MRMeshFwd.h:376
Definition MRLineSegm.h:11
Definition MRLine.h:12
Definition MRMatrix2.h:13
Definition MRMesh/MRMatrix3.h:13
Definition MRMatrix4.h:14
Definition MRMeshIntersect.h:17
an object and its transformation to global space with other objects
Definition MRMesh/MRMeshOrPoints.h:97
Definition MRMesh/MRMeshProject.h:18
Definition MRMesh/MRMeshPart.h:12
Definition MRMeshTexture.h:13
Definition MRMesh/MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRNoDefInit.h:11
Definition MRMesh/MRMeshFwd.h:56
Definition MRBuffer.h:151
Represents quadratic function f(x) = a*x*x + b*x + c.
Definition MRParabola.h:11
Definition MRPartMapping.h:10
Definition MRPlane3.h:12
Definition MRMesh/MRPointCloud.h:16
Definition MRMesh/MRPointOnFace.h:11
Definition MRPointOnObject.h:16
Definition MRPolylineProject.h:15
Definition MRPolylineProject.h:53
Definition MRPolyline.h:18
Definition MRQuadraticForm.h:13
Definition MRQuaternion.h:13
Definition MRRigidScaleXf3.h:12
Definition MRRigidXf3.h:13
encodes a point inside a line segment using relative distance in [0,1]
Definition MRSegmPoint.h:14
describes a number of local triangulations of some points (e.g. assigned to a thread)
Definition MRLocalTriangulations.h:40
Definition MRSphere.h:9
Definition MRSymMatrix2.h:14
Definition MRSymMatrix3.h:15
Definition MRSymMatrix4.h:13
Definition MRTriMesh.h:13
encodes a point inside a triangle using barycentric coordinates
Definition MRMesh/MRTriPoint.h:14
Definition MRUnorientedTriangle.h:13
Definition MRVector2.h:18
Definition MRMesh/MRVector3.h:19
Definition MRVector4.h:13
Definition MRMesh/MRMeshFwd.h:609