MeshLib C# Docs
Loading...
Searching...
No Matches
MR.PolylineTopology Class Reference

topology of one or several polylines (how line segments are connected in lines) common for 2D and 3D polylines Generated from class MR.PolylineTopology. This is the non-const half of the class. More...

Inheritance diagram for MR.PolylineTopology:

Public Member Functions

unsafe PolylineTopology ()
 Constructs an empty (default-constructed) instance.
unsafe PolylineTopology (MR._ByValue_PolylineTopology _other)
 Generated from constructor MR.PolylineTopology.PolylineTopology.
 PolylineTopology (Const_PolylineTopology _other)
 Generated from constructor MR.PolylineTopology.PolylineTopology.
 PolylineTopology (PolylineTopology _other)
 Generated from constructor MR.PolylineTopology.PolylineTopology.
unsafe MR.PolylineTopology assign (MR._ByValue_PolylineTopology _other)
 Generated from method MR::PolylineTopology::operator=.
unsafe void buildOpenLines (MR.Std.Const_Vector_MRVertId comp2firstVert)
 build topology of comp2firstVert.size()-1 not-closed polylines each pair (a,b) of indices in
unsafe MR.EdgeId makeEdge ()
 creates an edge not associated with any vertex Generated from method MR.PolylineTopology.makeEdge.
unsafe MR.EdgeId makeEdge (MR.VertId a, MR.VertId b, MR._InOpt_EdgeId e=default)
 makes an edge connecting vertices a and b
unsafe int makeEdges (MR.Const_Edges edges)
 for every given edge[ue] calls makeEdge( edge[ue][0], edge[ue][1], ue ), making new edges so that edges.size() <= undirectedEdgeSize() at the end
unsafe void edgeReserve (ulong newCapacity)
 sets the capacity of half-edges vector Generated from method MR.PolylineTopology.edgeReserve.
unsafe void deleteEdge (MR.UndirectedEdgeId ue)
 given edge becomes lone after the call, so it is un-spliced from connected edges, and if it was not connected at origin or destination, then that vertex is deleted as well Generated from method MR.PolylineTopology.deleteEdge.
unsafe void deleteEdges (MR.Const_UndirectedEdgeBitSet es)
 calls deleteEdge for every set bit Generated from method MR.PolylineTopology.deleteEdges.
unsafe void splice (MR.EdgeId a, MR.EdgeId b)
 given two half edges do either of two:
1) if a and b were from distinct rings, puts them in one ring;
2) if a and b were from the same ring, puts them in separate rings;
unsafe void setOrg (MR.EdgeId a, MR.VertId v)
 sets new origin to the full origin ring including this edge
unsafe MR.VertId addVertId ()
 creates new vert-id not associated with any edge yet Generated from method MR.PolylineTopology.addVertId.
unsafe void vertResize (ulong newSize)
 explicitly increases the size of vertices vector Generated from method MR.PolylineTopology.vertResize.
unsafe void vertResizeWithReserve (ulong newSize)
 explicitly increases the size of vertices vector, doubling the current capacity if it was not enough Generated from method MR.PolylineTopology.vertResizeWithReserve.
unsafe void vertReserve (ulong newCapacity)
 sets the capacity of vertices vector Generated from method MR.PolylineTopology.vertReserve.
unsafe MR.EdgeId splitEdge (MR.EdgeId e)
 split given edge on two parts: dest(returned-edge) = org(e) - newly created vertex, org(returned-edge) = org(e-before-split), dest(e) = dest(e-before-split) Generated from method MR.PolylineTopology.splitEdge.
unsafe MR.EdgeId makePolyline (MR.VertId? vs, ulong num)
 adds polyline in this topology passing progressively via vertices *[vs, vs+num); if vs[0] == vs[num-1] then a closed polyline is created; return the edge from first to second vertex Generated from method MR.PolylineTopology.makePolyline.
unsafe void addPart (MR.Const_PolylineTopology from, MR.VertMap? outVmap=null, MR.WholeEdgeMap? outEmap=null)
 appends polyline topology (from) in addition to the current topology: creates new edges, verts;
unsafe void addPartByMask (MR.Const_PolylineTopology from, MR.Const_UndirectedEdgeBitSet mask, MR.VertMap? outVmap=null, MR.EdgeMap? outEmap=null)
 appends polyline topology (from) in addition to the current topology: creates new edges, verts; Generated from method MR.PolylineTopology.addPartByMask.
unsafe void pack (MR.VertMap? outVmap=null, MR.WholeEdgeMap? outEmap=null)
 tightly packs all arrays eliminating lone edges and invalid vertices
unsafe bool read (MR.Std.Istream s)
 loads this from binary stream Generated from method MR.PolylineTopology.read.
unsafe void flip ()
 changes the orientation of all edges: every edge e is replaced with e.sym() Generated from method MR.PolylineTopology.flip.
unsafe void computeValidsFromEdges ()
 computes numValidVerts_ and validVerts_ from edgePerVertex_ Generated from method MR.PolylineTopology.computeValidsFromEdges.
Public Member Functions inherited from MR.Const_PolylineTopology
virtual void Dispose ()
unsafe Const_PolylineTopology ()
 Constructs an empty (default-constructed) instance.
unsafe Const_PolylineTopology (MR._ByValue_PolylineTopology _other)
 Generated from constructor MR.PolylineTopology.PolylineTopology.
 Const_PolylineTopology (Const_PolylineTopology _other)
 Generated from constructor MR.PolylineTopology.PolylineTopology.
 Const_PolylineTopology (PolylineTopology _other)
 Generated from constructor MR.PolylineTopology.PolylineTopology.
unsafe bool isLoneEdge (MR.EdgeId a)
 checks whether the edge is disconnected from all other edges and disassociated from all vertices (as if after makeEdge) Generated from method MR.PolylineTopology.isLoneEdge.
unsafe MR.UndirectedEdgeId lastNotLoneUndirectedEdge ()
 returns last not lone undirected edge id, or invalid id if no such edge exists Generated from method MR.PolylineTopology.lastNotLoneUndirectedEdge.
unsafe MR.EdgeId lastNotLoneEdge ()
 returns last not lone edge id, or invalid id if no such edge exists Generated from method MR.PolylineTopology.lastNotLoneEdge.
unsafe ulong edgeSize ()
 returns the number of half-edge records including lone ones Generated from method MR.PolylineTopology.edgeSize.
unsafe ulong edgeCapacity ()
 returns the number of allocated edge records Generated from method MR.PolylineTopology.edgeCapacity.
unsafe ulong undirectedEdgeSize ()
 returns the number of undirected edges (pairs of half-edges) including lone ones Generated from method MR.PolylineTopology.undirectedEdgeSize.
unsafe ulong undirectedEdgeCapacity ()
 returns the number of allocated undirected edges (pairs of half-edges) Generated from method MR.PolylineTopology.undirectedEdgeCapacity.
unsafe ulong computeNotLoneUndirectedEdges ()
 computes the number of not-lone (valid) undirected edges Generated from method MR.PolylineTopology.computeNotLoneUndirectedEdges.
unsafe bool hasEdge (MR.EdgeId e)
 returns true if given edge is within valid range and not-lone Generated from method MR.PolylineTopology.hasEdge.
unsafe ulong heapBytes ()
 returns the amount of memory this object occupies on heap Generated from method MR.PolylineTopology.heapBytes.
unsafe MR.EdgeId next (MR.EdgeId he)
 next (counter clock wise) half-edge in the origin ring Generated from method MR.PolylineTopology.next.
unsafe MR.VertId org (MR.EdgeId he)
 returns origin vertex of half-edge Generated from method MR.PolylineTopology.org.
unsafe MR.VertId dest (MR.EdgeId he)
 returns destination vertex of half-edge Generated from method MR.PolylineTopology.dest.
unsafe MR.Const_Vector_MREdgeId_MRVertId edgePerVertex ()
 for all valid vertices this vector contains an edge with the origin there Generated from method MR.PolylineTopology.edgePerVertex.
unsafe MR.Vector_MRVertId_MREdgeId getOrgs ()
 for all edges this vector contains its origin Generated from method MR.PolylineTopology.getOrgs.
unsafe MR.EdgeId edgeWithOrg (MR.VertId a)
 returns valid edge if given vertex is present in the mesh Generated from method MR.PolylineTopology.edgeWithOrg.
unsafe bool hasVert (MR.VertId a)
 returns true if given vertex is present in the mesh Generated from method MR.PolylineTopology.hasVert.
unsafe int getVertDegree (MR.VertId a)
 returns 0 if given vertex does not exist, 1 if it has one incident edge, and 2 if it has two incident edges Generated from method MR.PolylineTopology.getVertDegree.
unsafe int numValidVerts ()
 returns the number of valid vertices Generated from method MR.PolylineTopology.numValidVerts.
unsafe MR.VertId lastValidVert ()
 returns last valid vertex id, or invalid id if no single valid vertex exists Generated from method MR.PolylineTopology.lastValidVert.
unsafe ulong vertSize ()
 returns the number of vertex records including invalid ones Generated from method MR.PolylineTopology.vertSize.
unsafe ulong vertCapacity ()
 returns the number of allocated vert records Generated from method MR.PolylineTopology.vertCapacity.
unsafe MR.Const_VertBitSet getValidVerts ()
 returns cached set of all valid vertices Generated from method MR.PolylineTopology.getValidVerts.
unsafe MR.Const_VertBitSet getVertIds (MR.Const_VertBitSet? region)
 if region pointer is not null then converts it in reference, otherwise returns all valid vertices in the mesh Generated from method MR.PolylineTopology.getVertIds.
unsafe MR.EdgeId findEdge (MR.VertId o, MR.VertId d)
 finds and returns edge from o to d in the mesh; returns invalid edge otherwise Generated from method MR.PolylineTopology.findEdge.
unsafe MR.VertBitSet getPathVertices (MR.Std.Const_Vector_MREdgeId path)
 returns all vertices incident to path edges Generated from method MR.PolylineTopology.getPathVertices.
unsafe void write (MR.Std.Ostream s)
 saves this in binary stream Generated from method MR.PolylineTopology.write.
unsafe bool isConsistentlyOriented ()
 returns true if for each edge e: e == e.next() || e.odd() == next( e ).sym().odd() Generated from method MR.PolylineTopology.isConsistentlyOriented.
unsafe bool checkValidity ()
 verifies that all internal data structures are valid Generated from method MR.PolylineTopology.checkValidity.
unsafe bool isClosed ()
 returns true if the polyline does not have any holes Generated from method MR.PolylineTopology.isClosed.
bool Equals (MR.Const_PolylineTopology? b)
override bool Equals (object? other)

Additional Inherited Members

Static Public Member Functions inherited from MR.Const_PolylineTopology
static unsafe bool operator== (MR.Const_PolylineTopology _this, MR.Const_PolylineTopology b)
 comparison via edges (all other members are considered as not important caches) Generated from method MR::PolylineTopology::operator==.
static unsafe bool operator!= (MR.Const_PolylineTopology _this, MR.Const_PolylineTopology b)
Protected Member Functions inherited from MR.Const_PolylineTopology
virtual unsafe void Dispose (bool disposing)

Detailed Description

topology of one or several polylines (how line segments are connected in lines) common for 2D and 3D polylines Generated from class MR.PolylineTopology. This is the non-const half of the class.

Constructor & Destructor Documentation

◆ PolylineTopology() [1/4]

unsafe MR.PolylineTopology.PolylineTopology ( )
inline

Constructs an empty (default-constructed) instance.

◆ PolylineTopology() [2/4]

unsafe MR.PolylineTopology.PolylineTopology ( MR._ByValue_PolylineTopology _other)
inline

Generated from constructor MR.PolylineTopology.PolylineTopology.

◆ PolylineTopology() [3/4]

MR.PolylineTopology.PolylineTopology ( Const_PolylineTopology _other)
inline

Generated from constructor MR.PolylineTopology.PolylineTopology.

◆ PolylineTopology() [4/4]

MR.PolylineTopology.PolylineTopology ( PolylineTopology _other)
inline

Generated from constructor MR.PolylineTopology.PolylineTopology.

Member Function Documentation

◆ addPart()

unsafe void MR.PolylineTopology.addPart ( MR.Const_PolylineTopology from,
MR.VertMap? outVmap = null,
MR.WholeEdgeMap? outEmap = null )
inline

appends polyline topology (from) in addition to the current topology: creates new edges, verts;

Parameters
outVmap,outEmap(optionally) returns mappings: from.id -> this.id Generated from method MR.PolylineTopology.addPart.

◆ addPartByMask()

unsafe void MR.PolylineTopology.addPartByMask ( MR.Const_PolylineTopology from,
MR.Const_UndirectedEdgeBitSet mask,
MR.VertMap? outVmap = null,
MR.EdgeMap? outEmap = null )
inline

appends polyline topology (from) in addition to the current topology: creates new edges, verts; Generated from method MR.PolylineTopology.addPartByMask.

◆ addVertId()

unsafe MR.VertId MR.PolylineTopology.addVertId ( )
inline

creates new vert-id not associated with any edge yet Generated from method MR.PolylineTopology.addVertId.

◆ assign()

unsafe MR.PolylineTopology MR.PolylineTopology.assign ( MR._ByValue_PolylineTopology _other)
inline

Generated from method MR::PolylineTopology::operator=.

◆ buildOpenLines()

unsafe void MR.PolylineTopology.buildOpenLines ( MR.Std.Const_Vector_MRVertId comp2firstVert)
inline

build topology of comp2firstVert.size()-1 not-closed polylines each pair (a,b) of indices in

Parameters
comp2firstVertdefines vertex range of a polyline [a,b) Generated from method MR.PolylineTopology.buildOpenLines.

◆ computeValidsFromEdges()

unsafe void MR.PolylineTopology.computeValidsFromEdges ( )
inline

computes numValidVerts_ and validVerts_ from edgePerVertex_ Generated from method MR.PolylineTopology.computeValidsFromEdges.

◆ deleteEdge()

unsafe void MR.PolylineTopology.deleteEdge ( MR.UndirectedEdgeId ue)
inline

given edge becomes lone after the call, so it is un-spliced from connected edges, and if it was not connected at origin or destination, then that vertex is deleted as well Generated from method MR.PolylineTopology.deleteEdge.

◆ deleteEdges()

unsafe void MR.PolylineTopology.deleteEdges ( MR.Const_UndirectedEdgeBitSet es)
inline

calls deleteEdge for every set bit Generated from method MR.PolylineTopology.deleteEdges.

◆ edgeReserve()

unsafe void MR.PolylineTopology.edgeReserve ( ulong newCapacity)
inline

sets the capacity of half-edges vector Generated from method MR.PolylineTopology.edgeReserve.

◆ flip()

unsafe void MR.PolylineTopology.flip ( )
inline

changes the orientation of all edges: every edge e is replaced with e.sym() Generated from method MR.PolylineTopology.flip.

◆ makeEdge() [1/2]

unsafe MR.EdgeId MR.PolylineTopology.makeEdge ( )
inline

creates an edge not associated with any vertex Generated from method MR.PolylineTopology.makeEdge.

◆ makeEdge() [2/2]

unsafe MR.EdgeId MR.PolylineTopology.makeEdge ( MR.VertId a,
MR.VertId b,
MR._InOpt_EdgeId e = default )
inline

makes an edge connecting vertices a and b

Parameters
eif valid then the function does not make new edge, but connects the vertices using given one (and returns it)

if 1) any of the vertices is invalid or not within the vertSize(), 2) or a==b, 3) or either a or b already has 2 incident edges, 4) given edge e is not lone or not within the edgeSize() then makeEdge(a,b) does nothing and returns invalid edge Generated from method MR.PolylineTopology.makeEdge. Parameter e defaults to {}.

◆ makeEdges()

unsafe int MR.PolylineTopology.makeEdges ( MR.Const_Edges edges)
inline

for every given edge[ue] calls makeEdge( edge[ue][0], edge[ue][1], ue ), making new edges so that edges.size() <= undirectedEdgeSize() at the end

Returns
the total number of edges created Generated from method MR.PolylineTopology.makeEdges.

◆ makePolyline()

unsafe MR.EdgeId MR.PolylineTopology.makePolyline ( MR.VertId? vs,
ulong num )
inline

adds polyline in this topology passing progressively via vertices *[vs, vs+num); if vs[0] == vs[num-1] then a closed polyline is created; return the edge from first to second vertex Generated from method MR.PolylineTopology.makePolyline.

◆ pack()

unsafe void MR.PolylineTopology.pack ( MR.VertMap? outVmap = null,
MR.WholeEdgeMap? outEmap = null )
inline

tightly packs all arrays eliminating lone edges and invalid vertices

Parameters
outVmap,outEmapif given returns mappings: old.id -> new.id; Generated from method MR.PolylineTopology.pack.

◆ read()

unsafe bool MR.PolylineTopology.read ( MR.Std.Istream s)
inline

loads this from binary stream Generated from method MR.PolylineTopology.read.

◆ setOrg()

unsafe void MR.PolylineTopology.setOrg ( MR.EdgeId a,
MR.VertId v )
inline

sets new origin to the full origin ring including this edge

edgePerVertex_ table is updated accordingly Generated from method MR.PolylineTopology.setOrg.

◆ splice()

unsafe void MR.PolylineTopology.splice ( MR.EdgeId a,
MR.EdgeId b )
inline

given two half edges do either of two:
1) if a and b were from distinct rings, puts them in one ring;
2) if a and b were from the same ring, puts them in separate rings;

the cut in rings in both cases is made after a and b Generated from method MR.PolylineTopology.splice.

◆ splitEdge()

unsafe MR.EdgeId MR.PolylineTopology.splitEdge ( MR.EdgeId e)
inline

split given edge on two parts: dest(returned-edge) = org(e) - newly created vertex, org(returned-edge) = org(e-before-split), dest(e) = dest(e-before-split) Generated from method MR.PolylineTopology.splitEdge.

◆ vertReserve()

unsafe void MR.PolylineTopology.vertReserve ( ulong newCapacity)
inline

sets the capacity of vertices vector Generated from method MR.PolylineTopology.vertReserve.

◆ vertResize()

unsafe void MR.PolylineTopology.vertResize ( ulong newSize)
inline

explicitly increases the size of vertices vector Generated from method MR.PolylineTopology.vertResize.

◆ vertResizeWithReserve()

unsafe void MR.PolylineTopology.vertResizeWithReserve ( ulong newSize)
inline

explicitly increases the size of vertices vector, doubling the current capacity if it was not enough Generated from method MR.PolylineTopology.vertResizeWithReserve.


The documentation for this class was generated from the following file: