49 VertMap * outVmap =
nullptr, WholeEdgeMap * outEmap =
nullptr );
53 VertMap* outVmap =
nullptr, EdgeMap* outEmap =
nullptr );
155 template <
class Q = V>
156 [[nodiscard]]
typename std::enable_if_t< std::is_same_v<Q, Vector3f> >
mirror(
const Plane3f& plane )
160 p += 2.0f * ( plane.project( p ) - p );
177 for (
size_t i = 0; i < points.size(); i++ )
int VertId
Definition MRDotNet/MRMeshFwd.h:51
List< VertId > VertMap
Definition MRDotNet/MRMeshFwd.h:84
int EdgeId
Definition MRDotNet/MRMeshFwd.h:52
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
bounding volume hierarchy for line segments
Definition MRAABBTreePolyline.h:30
Definition MRPolylineTopology.h:15
VertId org(EdgeId he) const
returns origin vertex of half-edge
Definition MRPolylineTopology.h:66
VertId dest(EdgeId he) const
returns destination vertex of half-edge
Definition MRPolylineTopology.h:68
Definition MRUniqueThreadSafeOwner.h:20
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
void reserve(size_t capacity)
Definition MRMesh/MRVector.h:58
void push_back(const T &t)
Definition MRMesh/MRVector.h:109
auto end(const BitSet &)
Definition MRMesh/MRBitSet.h:265
Definition MRCameraOrientationPlugin.h:7
std::vector< MeshEdgePoint > SurfacePath
Definition MRMesh/MRMeshFwd.h:340
Contours2< float > Contours2f
Definition MRMesh/MRMeshFwd.h:282
std::vector< EdgeId > EdgePath
Definition MRMesh/MRMeshFwd.h:98
Contours3< float > Contours3f
Definition MRMesh/MRMeshFwd.h:284
std::vector< Contour< V > > Contours
Definition MRMesh/MRMeshFwd.h:278
Definition MRMesh/MRAffineXf.h:14
Box given by its min- and max- corners.
Definition MRMesh/MRBox.h:23
encodes a point on an edge of mesh or of polyline
Definition MREdgePoint.h:11
SegmPointf a
a in [0,1], a=0 => point is in org( e ), a=1 => point is in dest( e )
Definition MREdgePoint.h:13
EdgeId e
Definition MREdgePoint.h:12
Definition MRLineSegm.h:11
Definition MRMesh/MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRPolyline.h:18
V edgePoint(const EdgePoint &ep) const
computes coordinates of point given as edge and relative position on it
Definition MRPolyline.h:69
MRMESH_API EdgePoint toEdgePoint(EdgeId e, const V &p) const
converts edge and point's coordinates into edge-point representation
V edgePoint(EdgeId e, float f) const
returns a point on the edge: origin point for f=0 and destination point for f=1
Definition MRPolyline.h:66
MRMESH_API EdgeId splitEdge(EdgeId e, const V &newVertPos)
MRMESH_API EdgeId addFromEdgePath(const Mesh &mesh, const EdgePath &path)
V destPnt(EdgeId e) const
returns coordinates of the edge destination
Definition MRPolyline.h:63
MRMESH_API float totalLength() const
returns total length of the polyline
float edgeLength(EdgeId e) const
returns Euclidean length of the edge
Definition MRPolyline.h:87
void invalidateCaches()
Invalidates caches (e.g. aabb-tree) after a change in polyline.
Definition MRPolyline.h:124
const AABBTreePolyline< V > * getAABBTreeNotCreate() const
returns cached aabb-tree for this polyline, but does not create it if it did not exist
Definition MRPolyline.h:99
MRMESH_API void addPartByMask(const Polyline< V > &from, const UndirectedEdgeBitSet &mask, VertMap *outVmap=nullptr, EdgeMap *outEmap=nullptr)
appends polyline (from) in addition to this polyline: creates new edges, verts and points
MRMESH_API Box< V > getBoundingBox() const
returns the minimal bounding box containing all valid vertices (implemented via getAABBTree())
V orgPnt(EdgeId e) const
returns coordinates of the edge origin
Definition MRPolyline.h:60
Polyline< U > toPolyline() const
convert Polyline3 to Polyline2 or vice versa
Definition MRPolyline.h:172
MRMESH_API Polyline(const Contours3f &contours)
creates polyline from 3D contours, 2D polyline will lose z-component
MRMESH_API void addPart(const Polyline< V > &from, VertMap *outVmap=nullptr, WholeEdgeMap *outEmap=nullptr)
MRMESH_API V findCenterFromPoints() const
MRMESH_API void transform(const AffineXf< V > &xf)
applies given transformation to all valid polyline vertices
MRMESH_API void pack(VertMap *outVmap=nullptr, WholeEdgeMap *outEmap=nullptr)
Vector< V, VertId > points
Definition MRPolyline.h:21
MRMESH_API Contours< V > contours(std::vector< std::vector< VertId > > *vertMap=nullptr) const
PolylineTopology topology
Definition MRPolyline.h:20
EdgeId addFromSurfacePath(const Mesh &mesh, const SurfacePath &path)
Definition MRPolyline.h:146
MRMESH_API Polyline(const std::vector< VertId > &comp2firstVert, Vector< V, VertId > ps)
MRMESH_API EdgeId addFromPoints(const V *vs, size_t num, bool closed)
float edgeLengthSq(EdgeId e) const
returns squared Euclidean length of the edge (faster to compute than length)
Definition MRPolyline.h:90
MRMESH_API Contours2f contours2(std::vector< std::vector< VertId > > *vertMap=nullptr) const
V edgeVector(EdgeId e) const
returns vector equal to edge destination point minus edge origin point
Definition MRPolyline.h:75
V edgeCenter(EdgeId e) const
returns edge's centroid
Definition MRPolyline.h:72
MRMESH_API EdgeId addFromPoints(const V *vs, size_t num)
MRMESH_API size_t heapBytes() const
returns the amount of memory this object occupies on heap
EdgePoint toEdgePoint(VertId v) const
converts vertex into edge-point representation
Definition MRPolyline.h:81
MRMESH_API const AABBTreePolyline< V > & getAABBTree() const
returns cached aabb-tree for this polyline, creating it if it did not exist in a thread-safe manner
LineSegm< V > edgeSegment(EdgeId e) const
returns line segment of given edge
Definition MRPolyline.h:78
std::enable_if_t< std::is_same_v< Q, Vector3f > > mirror(const Plane3f &plane)
reflects the polyline from a given plane. Enabled only for Polyline3f
Definition MRPolyline.h:156
EdgeId splitEdge(EdgeId e)
Definition MRPolyline.h:121
MRMESH_API Box< V > computeBoundingBox(const AffineXf< V > *toWorld=nullptr) const
MRMESH_API EdgeId addFromGeneralSurfacePath(const Mesh &mesh, const MeshTriPoint &start, const SurfacePath &path, const MeshTriPoint &end)
MRMESH_API Polyline(const Contours2f &contours)
creates polyline from 2D contours, 3D polyline will get zero z-component