Skip to content

Commit

Permalink
order all one rings at once
Browse files Browse the repository at this point in the history
  • Loading branch information
mlivesu committed Dec 12, 2023
1 parent a9a9b9f commit a15064b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions include/cinolib/meshes/abstract_polygonmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,25 @@ bool AbstractPolygonMesh<M,V,E,P>::edge_is_CCW(const uint eid, const uint pid) c

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

template<class M, class V, class E, class P>
CINO_INLINE
void AbstractPolygonMesh<M,V,E,P>::vert_order_all_one_rings()
{
for(uint vid=0; vid<this->num_verts(); ++vid)
{
std::vector<uint> v_link;
std::vector<uint> f_star;
std::vector<uint> e_star;
std::vector<uint> e_link;
this->vert_ordered_one_ring(vid,v_link,f_star,e_star,e_link);
this->adj_v2v(vid) = v_link;
this->adj_v2e(vid) = e_star;
this->adj_v2p(vid) = f_star;
}
}

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

template<class M, class V, class E, class P>
CINO_INLINE
void AbstractPolygonMesh<M,V,E,P>::vert_ordered_one_ring(const uint vid,
Expand Down
1 change: 1 addition & 0 deletions include/cinolib/meshes/abstract_polygonmesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class AbstractPolygonMesh : public AbstractMesh<M,V,E,P>
std::vector<uint> vert_ordered_polys_star (const uint vid) const;
std::vector<uint> vert_ordered_edges_star (const uint vid) const;
std::vector<uint> vert_ordered_edges_link (const uint vid) const;
void vert_order_all_one_rings();
void vert_ordered_one_ring (const uint vid,
std::vector<uint> & v_link, // sorted list of adjacent vertices
std::vector<uint> & f_star, // sorted list of adjacent triangles
Expand Down

0 comments on commit a15064b

Please sign in to comment.