MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.PolylineTopology Class Reference

Public Member Functions

bool __eq__ (self, PolylineTopology b)
 
None __init__ (self)
 
bool __ne__ (self, PolylineTopology b)
 
None addPart (self, PolylineTopology from_, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
None addPartByMask (self, PolylineTopology from_, UndirectedEdgeBitSet mask, VertMap outVmap=None, EdgeMap outEmap=None)
 
VertId addVertId (self)
 
None buildOpenLines (self, std_vector_Id_VertTag comp2firstVert)
 
bool checkValidity (self)
 
int computeNotLoneUndirectedEdges (self)
 
None computeValidsFromEdges (self)
 
None deleteEdge (self, UndirectedEdgeId ue)
 
None deleteEdges (self, UndirectedEdgeBitSet es)
 
VertId dest (self, EdgeId he)
 
int edgeCapacity (self)
 
Vector_EdgeId_VertId edgePerVertex (self)
 
None edgeReserve (self, int newCapacity)
 
int edgeSize (self)
 
EdgeId edgeWithOrg (self, VertId a)
 
EdgeId findEdge (self, VertId o, VertId d)
 
None flip (self)
 
Vector_VertId_EdgeId getOrgs (self)
 
VertBitSet getPathVertices (self, std_vector_Id_EdgeTag path)
 
VertBitSet getValidVerts (self)
 
int getVertDegree (self, VertId a)
 
VertBitSet getVertIds (self, VertBitSet region)
 
bool hasEdge (self, EdgeId e)
 
bool hasVert (self, VertId a)
 
int heapBytes (self)
 
bool isClosed (self)
 
bool isConsistentlyOriented (self)
 
bool isLoneEdge (self, EdgeId a)
 
EdgeId lastNotLoneEdge (self)
 
UndirectedEdgeId lastNotLoneUndirectedEdge (self)
 
VertId lastValidVert (self)
 
EdgeId makeEdge (self)
 
EdgeId makeEdge (self, VertId a, VertId b, EdgeId e='{}')
 
int makeEdges (self, Edges edges)
 
EdgeId makePolyline (self, VertId vs, int num)
 
EdgeId next (self, EdgeId he)
 
int numValidVerts (self)
 
VertId org (self, EdgeId he)
 
None pack (self, VertMap outVmap=None, WholeEdgeMap outEmap=None)
 
bool read (self, typing.Any s)
 
None setOrg (self, EdgeId a, VertId v)
 
None splice (self, EdgeId a, EdgeId b)
 
EdgeId splitEdge (self, EdgeId e)
 
int undirectedEdgeCapacity (self)
 
int undirectedEdgeSize (self)
 
int vertCapacity (self)
 
None vertReserve (self, int newCapacity)
 
None vertResize (self, int newSize)
 
None vertResizeWithReserve (self, int newSize)
 
int vertSize (self)
 
None write (self, typing.Any s)
 

Static Public Member Functions

None __init__ (*args, **kwargs)
 
PolylineTopology operator (*args, **kwargs)
 
PolylineTopology operator (*args, **kwargs)
 

Detailed Description

Generated from:  MR::PolylineTopology

topology of one or several polylines (how line segments are connected in lines) common for 2D and 3D polylines

Constructor & Destructor Documentation

◆ __init__() [1/2]

None mrmeshpy.PolylineTopology.__init__ ( * args,
** kwargs )
static

◆ __init__() [2/2]

None mrmeshpy.PolylineTopology.__init__ ( self)

Member Function Documentation

◆ __eq__()

bool mrmeshpy.PolylineTopology.__eq__ ( self,
PolylineTopology b )
comparison via edges (all other members are considered as not important caches)

◆ __ne__()

bool mrmeshpy.PolylineTopology.__ne__ ( self,
PolylineTopology b )

◆ addPart()

None mrmeshpy.PolylineTopology.addPart ( self,
PolylineTopology from_,
VertMap outVmap = None,
WholeEdgeMap outEmap = None )
appends polyline topology (from) in addition to the current topology: creates new edges, verts;
\\param outVmap,outEmap (optionally) returns mappings: from.id -> this.id

◆ addPartByMask()

None mrmeshpy.PolylineTopology.addPartByMask ( self,
PolylineTopology from_,
UndirectedEdgeBitSet mask,
VertMap outVmap = None,
EdgeMap outEmap = None )
appends polyline topology (from) in addition to the current topology: creates new edges, verts;

◆ addVertId()

VertId mrmeshpy.PolylineTopology.addVertId ( self)
creates new vert-id not associated with any edge yet

◆ buildOpenLines()

None mrmeshpy.PolylineTopology.buildOpenLines ( self,
std_vector_Id_VertTag comp2firstVert )
build topology of comp2firstVert.size()-1 not-closed polylines
each pair (a,b) of indices in \\param comp2firstVert defines vertex range of a polyline [a,b)

◆ checkValidity()

bool mrmeshpy.PolylineTopology.checkValidity ( self)
verifies that all internal data structures are valid

◆ computeNotLoneUndirectedEdges()

int mrmeshpy.PolylineTopology.computeNotLoneUndirectedEdges ( self)
computes the number of not-lone (valid) undirected edges

◆ computeValidsFromEdges()

None mrmeshpy.PolylineTopology.computeValidsFromEdges ( self)
computes numValidVerts_ and validVerts_ from edgePerVertex_

◆ deleteEdge()

None mrmeshpy.PolylineTopology.deleteEdge ( self,
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

◆ deleteEdges()

None mrmeshpy.PolylineTopology.deleteEdges ( self,
UndirectedEdgeBitSet es )
calls deleteEdge for every set bit

◆ dest()

VertId mrmeshpy.PolylineTopology.dest ( self,
EdgeId he )
returns destination vertex of half-edge

◆ edgeCapacity()

int mrmeshpy.PolylineTopology.edgeCapacity ( self)
returns the number of allocated edge records

◆ edgePerVertex()

Vector_EdgeId_VertId mrmeshpy.PolylineTopology.edgePerVertex ( self)
for all valid vertices this vector contains an edge with the origin there

◆ edgeReserve()

None mrmeshpy.PolylineTopology.edgeReserve ( self,
int newCapacity )
sets the capacity of half-edges vector

◆ edgeSize()

int mrmeshpy.PolylineTopology.edgeSize ( self)
returns the number of half-edge records including lone ones

◆ edgeWithOrg()

EdgeId mrmeshpy.PolylineTopology.edgeWithOrg ( self,
VertId a )
returns valid edge if given vertex is present in the mesh

◆ findEdge()

EdgeId mrmeshpy.PolylineTopology.findEdge ( self,
VertId o,
VertId d )
finds and returns edge from o to d in the mesh; returns invalid edge otherwise

◆ flip()

None mrmeshpy.PolylineTopology.flip ( self)
changes the orientation of all edges: every edge e is replaced with e.sym()

◆ getOrgs()

Vector_VertId_EdgeId mrmeshpy.PolylineTopology.getOrgs ( self)
for all edges this vector contains its origin

◆ getPathVertices()

VertBitSet mrmeshpy.PolylineTopology.getPathVertices ( self,
std_vector_Id_EdgeTag path )
returns all vertices incident to path edges

◆ getValidVerts()

VertBitSet mrmeshpy.PolylineTopology.getValidVerts ( self)
returns cached set of all valid vertices

◆ getVertDegree()

int mrmeshpy.PolylineTopology.getVertDegree ( self,
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

◆ getVertIds()

VertBitSet mrmeshpy.PolylineTopology.getVertIds ( self,
VertBitSet region )
if region pointer is not null then converts it in reference, otherwise returns all valid vertices in the mesh

◆ hasEdge()

bool mrmeshpy.PolylineTopology.hasEdge ( self,
EdgeId e )
returns true if given edge is within valid range and not-lone

◆ hasVert()

bool mrmeshpy.PolylineTopology.hasVert ( self,
VertId a )
returns true if given vertex is present in the mesh

◆ heapBytes()

int mrmeshpy.PolylineTopology.heapBytes ( self)
returns the amount of memory this object occupies on heap

◆ isClosed()

bool mrmeshpy.PolylineTopology.isClosed ( self)
returns true if the polyline does not have any holes

◆ isConsistentlyOriented()

bool mrmeshpy.PolylineTopology.isConsistentlyOriented ( self)
returns true if for each edge e: e == e.next() || e.odd() == next( e ).sym().odd()

◆ isLoneEdge()

bool mrmeshpy.PolylineTopology.isLoneEdge ( self,
EdgeId a )
checks whether the edge is disconnected from all other edges and disassociated from all vertices (as if after makeEdge)

◆ lastNotLoneEdge()

EdgeId mrmeshpy.PolylineTopology.lastNotLoneEdge ( self)
returns last not lone edge id, or invalid id if no such edge exists

◆ lastNotLoneUndirectedEdge()

UndirectedEdgeId mrmeshpy.PolylineTopology.lastNotLoneUndirectedEdge ( self)
returns last not lone undirected edge id, or invalid id if no such edge exists

◆ lastValidVert()

VertId mrmeshpy.PolylineTopology.lastValidVert ( self)
returns last valid vertex id, or invalid id if no single valid vertex exists

◆ makeEdge() [1/2]

EdgeId mrmeshpy.PolylineTopology.makeEdge ( self)
creates an edge not associated with any vertex

◆ makeEdge() [2/2]

EdgeId mrmeshpy.PolylineTopology.makeEdge ( self,
VertId a,
VertId b,
EdgeId e = '{}' )
makes an edge connecting vertices a and b
\\param e if valid then the function does not make new edge, but connects the vertices using given one (and returns it)
\\details 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

◆ makeEdges()

int mrmeshpy.PolylineTopology.makeEdges ( self,
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
\\return the total number of edges created

◆ makePolyline()

EdgeId mrmeshpy.PolylineTopology.makePolyline ( self,
VertId vs,
int 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

◆ next()

EdgeId mrmeshpy.PolylineTopology.next ( self,
EdgeId he )
next (counter clock wise) half-edge in the origin ring

◆ numValidVerts()

int mrmeshpy.PolylineTopology.numValidVerts ( self)
returns the number of valid vertices

◆ operator() [1/2]

PolylineTopology mrmeshpy.PolylineTopology.operator ( * args,
** kwargs )
static

◆ operator() [2/2]

PolylineTopology mrmeshpy.PolylineTopology.operator ( * args,
** kwargs )
static

◆ org()

VertId mrmeshpy.PolylineTopology.org ( self,
EdgeId he )
returns origin vertex of half-edge

◆ pack()

None mrmeshpy.PolylineTopology.pack ( self,
VertMap outVmap = None,
WholeEdgeMap outEmap = None )
tightly packs all arrays eliminating lone edges and invalid vertices
\\param outVmap,outEmap if given returns mappings: old.id -> new.id;

◆ read()

bool mrmeshpy.PolylineTopology.read ( self,
typing.Any s )
loads this from binary stream

◆ setOrg()

None mrmeshpy.PolylineTopology.setOrg ( self,
EdgeId a,
VertId v )
sets new origin to the full origin ring including this edge
\\details edgePerVertex_ table is updated accordingly

◆ splice()

None mrmeshpy.PolylineTopology.splice ( self,
EdgeId a,
EdgeId b )
given two half edges do either of two: \\n
1) if a and b were from distinct rings, puts them in one ring; \\n
2) if a and b were from the same ring, puts them in separate rings;
\\details the cut in rings in both cases is made after a and b

◆ splitEdge()

EdgeId mrmeshpy.PolylineTopology.splitEdge ( self,
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)

◆ undirectedEdgeCapacity()

int mrmeshpy.PolylineTopology.undirectedEdgeCapacity ( self)
returns the number of allocated undirected edges (pairs of half-edges)

◆ undirectedEdgeSize()

int mrmeshpy.PolylineTopology.undirectedEdgeSize ( self)
returns the number of undirected edges (pairs of half-edges) including lone ones

◆ vertCapacity()

int mrmeshpy.PolylineTopology.vertCapacity ( self)
returns the number of allocated vert records

◆ vertReserve()

None mrmeshpy.PolylineTopology.vertReserve ( self,
int newCapacity )
sets the capacity of vertices vector

◆ vertResize()

None mrmeshpy.PolylineTopology.vertResize ( self,
int newSize )
explicitly increases the size of vertices vector

◆ vertResizeWithReserve()

None mrmeshpy.PolylineTopology.vertResizeWithReserve ( self,
int newSize )
explicitly increases the size of vertices vector, doubling the current capacity if it was not enough

◆ vertSize()

int mrmeshpy.PolylineTopology.vertSize ( self)
returns the number of vertex records including invalid ones

◆ write()

None mrmeshpy.PolylineTopology.write ( self,
typing.Any s )
saves this in binary stream

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