35 #ifndef TOPOLOGYKERNEL_HH_ 36 #define TOPOLOGYKERNEL_HH_ 42 #include "BaseEntities.hh" 43 #include "OpenVolumeMeshHandle.hh" 44 #include "ResourceManager.hh" 45 #include "Iterators.hh" 58 assert(other !=
nullptr);
108 template <
class Circulator>
109 static Circulator make_end_circulator(
const Circulator& _circ)
111 Circulator end = _circ;
113 end.lap(_circ.max_laps());
125 std::pair<VertexVertexIter, VertexVertexIter> vertex_vertices(
const VertexHandle& _h,
int _max_laps = 1)
const {
127 return std::make_pair(begin, make_end_circulator(begin));
134 std::pair<VertexOHalfEdgeIter, VertexOHalfEdgeIter> outgoing_halfedges(
const VertexHandle& _h,
int _max_laps = 1)
const {
136 return std::make_pair(begin, make_end_circulator(begin));
143 std::pair<VertexIHalfEdgeIter, VertexIHalfEdgeIter> incoming_halfedges(
const VertexHandle& _h,
int _max_laps = 1)
const {
145 return std::make_pair(begin, make_end_circulator(begin));
152 std::pair<VertexEdgeIter, VertexEdgeIter> vertex_edges(
const VertexHandle& _h,
int _max_laps = 1)
const {
154 return std::make_pair(begin, make_end_circulator(begin));
161 std::pair<VertexHalfFaceIter, VertexHalfFaceIter> vertex_halffaces(
const VertexHandle& _h,
int _max_laps = 1)
const {
163 return std::make_pair(begin, make_end_circulator(begin));
170 std::pair<VertexFaceIter, VertexFaceIter> vertex_faces(
const VertexHandle& _h,
int _max_laps = 1)
const {
172 return std::make_pair(begin, make_end_circulator(begin));
179 std::pair<VertexCellIter, VertexCellIter> vertex_cells(
const VertexHandle& _h,
int _max_laps = 1)
const {
181 return std::make_pair(begin, make_end_circulator(begin));
188 std::pair<HalfEdgeHalfFaceIter, HalfEdgeHalfFaceIter> halfedge_halffaces(
const HalfEdgeHandle& _h,
int _max_laps = 1)
const {
190 return std::make_pair(begin, make_end_circulator(begin));
197 std::pair<HalfEdgeFaceIter, HalfEdgeFaceIter> halfedge_faces(
const HalfEdgeHandle& _h,
int _max_laps = 1)
const {
199 return std::make_pair(begin, make_end_circulator(begin));
206 std::pair<HalfEdgeCellIter, HalfEdgeCellIter> halfedge_cells(
const HalfEdgeHandle& _h,
int _max_laps = 1)
const {
208 return std::make_pair(begin, make_end_circulator(begin));
215 std::pair<EdgeHalfFaceIter, EdgeHalfFaceIter> edge_halffaces(
const EdgeHandle& _h,
int _max_laps = 1)
const {
217 return std::make_pair(begin, make_end_circulator(begin));
224 std::pair<EdgeFaceIter, EdgeFaceIter> edge_faces(
const EdgeHandle& _h,
int _max_laps = 1)
const {
226 return std::make_pair(begin, make_end_circulator(begin));
233 std::pair<EdgeCellIter, EdgeCellIter> edge_cells(
const EdgeHandle& _h,
int _max_laps = 1)
const {
235 return std::make_pair(begin, make_end_circulator(begin));
242 std::pair<HalfFaceHalfEdgeIter, HalfFaceHalfEdgeIter> halfface_halfedges(
const HalfFaceHandle& _h,
int _max_laps = 1)
const {
244 return std::make_pair(begin, make_end_circulator(begin));
251 std::pair<HalfFaceEdgeIter, HalfFaceEdgeIter> halfface_edges(
const HalfFaceHandle& _h,
int _max_laps = 1)
const {
253 return std::make_pair(begin, make_end_circulator(begin));
260 std::pair<FaceVertexIter, FaceVertexIter> face_vertices(
const FaceHandle& _h,
int _max_laps = 1)
const {
262 return std::make_pair(begin, make_end_circulator(begin));
269 std::pair<FaceHalfEdgeIter, FaceHalfEdgeIter> face_halfedges(
const FaceHandle& _h,
int _max_laps = 1)
const {
271 return std::make_pair(begin, make_end_circulator(begin));
278 std::pair<FaceEdgeIter, FaceEdgeIter> face_edges(
const FaceHandle& _h,
int _max_laps = 1)
const {
280 return std::make_pair(begin, make_end_circulator(begin));
287 std::pair<CellVertexIter, CellVertexIter> cell_vertices(
const CellHandle& _h,
int _max_laps = 1)
const {
289 return std::make_pair(begin, make_end_circulator(begin));
296 std::pair<CellHalfEdgeIter, CellHalfEdgeIter> cell_halfedges(
const CellHandle& _h,
int _max_laps = 1)
const {
298 return std::make_pair(begin, make_end_circulator(begin));
305 std::pair<CellEdgeIter, CellEdgeIter> cell_edges(
const CellHandle& _h,
int _max_laps = 1)
const {
307 return std::make_pair(begin, make_end_circulator(begin));
314 std::pair<CellHalfFaceIter, CellHalfFaceIter> cell_halffaces(
const CellHandle& _h,
int _max_laps = 1)
const {
316 return std::make_pair(begin, make_end_circulator(begin));
323 std::pair<CellFaceIter, CellFaceIter> cell_faces(
const CellHandle& _h,
int _max_laps = 1)
const {
325 return std::make_pair(begin, make_end_circulator(begin));
332 std::pair<CellCellIter, CellCellIter> cell_cells(
const CellHandle& _h,
int _max_laps = 1)
const {
334 return std::make_pair(begin, make_end_circulator(begin));
341 std::pair<HalfFaceVertexIter, HalfFaceVertexIter> halfface_vertices(
const HalfFaceHandle& _h,
int _max_laps = 1)
const {
343 return std::make_pair(begin, make_end_circulator(begin));
350 std::pair<BoundaryHalfFaceHalfFaceIter, BoundaryHalfFaceHalfFaceIter> boundary_halfface_halffaces(
const HalfFaceHandle& _h,
int _max_laps = 1)
const {
352 return std::make_pair(begin, make_end_circulator(begin));
395 std::pair<VertexIter, VertexIter> vertices()
const {
396 return std::make_pair(vertices_begin(), vertices_end());
411 std::pair<EdgeIter, EdgeIter> edges()
const {
412 return std::make_pair(edges_begin(), edges_end());
427 std::pair<HalfEdgeIter, HalfEdgeIter> halfedges()
const {
428 return std::make_pair(halfedges_begin(), halfedges_end());
443 std::pair<FaceIter, FaceIter> faces()
const {
444 return std::make_pair(faces_begin(), faces_end());
459 std::pair<HalfFaceIter, HalfFaceIter> halffaces()
const {
460 return std::make_pair(halffaces_begin(), halffaces_end());
475 std::pair<CellIter, CellIter> cells()
const {
476 return std::make_pair(cells_begin(), cells_end());
483 std::vector<VertexHandle> halfedge_vertices(
const HalfEdgeHandle& _h)
const {
484 std::vector<VertexHandle> res(2);
490 std::vector<VertexHandle> edge_vertices(
const EdgeHandle& _h)
const {
494 std::vector<HalfEdgeHandle> edge_halfedges(
const EdgeHandle& _h)
const {
495 std::vector<HalfEdgeHandle> res(2);
501 std::vector<HalfFaceHandle> face_halffaces(
const FaceHandle& _h)
const {
502 std::vector<HalfFaceHandle> res(2);
508 std::vector<CellHandle> face_cells(
const FaceHandle& _h)
const {
509 std::vector<CellHandle> res(2);
522 size_t n_edges()
const override {
return edges_.size(); }
524 size_t n_halfedges()
const override {
return edges_.size() * 2u; }
526 size_t n_faces()
const override {
return faces_.size(); }
528 size_t n_halffaces()
const override {
return faces_.size() * 2u; }
530 size_t n_cells()
const override {
return cells_.size(); }
552 if(g % 2 == 0)
return (g / 2);
562 size_t n_vertices_ = 0u;
581 virtual FaceHandle add_face(
const std::vector<HalfEdgeHandle>& _halfedges,
bool _topologyCheck =
false);
593 virtual CellHandle add_cell(
const std::vector<HalfFaceHandle>& _halffaces,
bool _topologyCheck =
false);
674 assert(has_vertex_bottom_up_incidences());
675 assert(_vh.is_valid() && _vh.
uidx() < outgoing_hes_per_vertex_.size());
677 return outgoing_hes_per_vertex_[_vh.idx()].size();
682 assert(has_edge_bottom_up_incidences());
683 assert(_eh.is_valid() && _eh.
uidx() < edges_.size());
691 assert(_fh.is_valid() && _fh.
uidx() < faces_.size());
693 return face(_fh).halfedges().size();
698 assert(_ch.is_valid() && _ch.
uidx() < cells_.size());
700 return cell(_ch).halffaces().size();
720 virtual bool is_deleted(
const VertexHandle& _h)
const {
return vertex_deleted_[_h.idx()]; }
721 virtual bool is_deleted(
const EdgeHandle& _h)
const {
return edge_deleted_[_h.idx()]; }
722 virtual bool is_deleted(
const HalfEdgeHandle& _h)
const {
return edge_deleted_[_h.idx()/2]; }
723 virtual bool is_deleted(
const FaceHandle& _h)
const {
return face_deleted_[_h.idx()]; }
724 virtual bool is_deleted(
const HalfFaceHandle& _h)
const {
return face_deleted_[_h.idx()/2]; }
725 virtual bool is_deleted(
const CellHandle& _h)
const {
return cell_deleted_[_h.idx()]; }
729 template <
class ContainerT>
730 void get_incident_edges(
const ContainerT& _vs, std::set<EdgeHandle>& _es)
const;
732 template <
class ContainerT>
733 void get_incident_faces(
const ContainerT& _es, std::set<FaceHandle>& _fs)
const;
735 template <
class ContainerT>
736 void get_incident_cells(
const ContainerT& _fs, std::set<CellHandle>& _cs)
const;
762 virtual void delete_multiple_vertices(
const std::vector<bool>& _tag);
764 virtual void delete_multiple_edges(
const std::vector<bool>& _tag);
766 virtual void delete_multiple_faces(
const std::vector<bool>& _tag);
768 virtual void delete_multiple_cells(
const std::vector<bool>& _tag);
772 explicit EdgeCorrector(
const std::vector<int>& _newIndices) :
773 newIndices_(_newIndices) {}
775 void operator()(Edge& _edge) {
776 _edge.set_from_vertex(
VertexHandle(newIndices_[_edge.from_vertex().idx()]));
777 _edge.set_to_vertex(
VertexHandle(newIndices_[_edge.to_vertex().idx()]));
780 const std::vector<int>& newIndices_;
785 explicit FaceCorrector(
const std::vector<int>& _newIndices) :
786 newIndices_(_newIndices) {}
788 void operator()(Face& _face) {
789 std::vector<HalfEdgeHandle> hes = _face.halfedges();
790 for(std::vector<HalfEdgeHandle>::iterator he_it = hes.begin(),
791 he_end = hes.end(); he_it != he_end; ++he_it) {
797 _face.set_halfedges(hes);
800 const std::vector<int>& newIndices_;
805 explicit CellCorrector(
const std::vector<int>& _newIndices) :
806 newIndices_(_newIndices) {}
808 void operator()(Cell& _cell) {
809 std::vector<HalfFaceHandle> hfs = _cell.halffaces();
810 for(std::vector<HalfFaceHandle>::iterator hf_it = hfs.begin(),
811 hf_end = hfs.end(); hf_it != hf_end; ++hf_it) {
817 _cell.set_halffaces(hfs);
820 const std::vector<int>& newIndices_;
838 virtual void clear(
bool _clearProps =
true) {
843 vertex_deleted_.clear();
844 edge_deleted_.clear();
845 face_deleted_.clear();
846 cell_deleted_.clear();
847 n_deleted_vertices_ = 0;
848 n_deleted_edges_ = 0;
849 n_deleted_faces_ = 0;
850 n_deleted_cells_ = 0;
851 outgoing_hes_per_vertex_.clear();
852 incident_hfs_per_he_.clear();
853 incident_cell_per_hf_.clear();
859 clear_vertex_props();
861 clear_halfedge_props();
863 clear_halfface_props();
882 void enable_bottom_up_incidences(
bool _enable =
true) {
884 enable_vertex_bottom_up_incidences(_enable);
885 enable_edge_bottom_up_incidences(_enable);
886 enable_face_bottom_up_incidences(_enable);
889 void enable_vertex_bottom_up_incidences(
bool _enable =
true) {
891 if(_enable && !v_bottom_up_) {
894 compute_vertex_bottom_up_incidences();
898 outgoing_hes_per_vertex_.clear();
901 v_bottom_up_ = _enable;
904 void enable_edge_bottom_up_incidences(
bool _enable =
true) {
906 if(_enable && !e_bottom_up_) {
909 compute_edge_bottom_up_incidences();
912 #if defined(__clang_major__) && (__clang_major__ >= 5) 913 for(
EdgeIter e_it = edges_begin(), e_end = edges_end();
914 e_it != e_end; ++e_it) {
915 reorder_incident_halffaces(*e_it);
918 std::for_each(edges_begin(), edges_end(),
919 fun::bind(&TopologyKernel::reorder_incident_halffaces,
this, fun::placeholders::_1));
925 incident_hfs_per_he_.clear();
928 e_bottom_up_ = _enable;
931 void enable_face_bottom_up_incidences(
bool _enable =
true) {
933 bool updateOrder =
false;
934 if(_enable && !f_bottom_up_) {
937 compute_face_bottom_up_incidences();
943 incident_cell_per_hf_.clear();
946 f_bottom_up_ = _enable;
950 #if defined(__clang_major__) && (__clang_major__ >= 5) 951 for(
EdgeIter e_it = edges_begin(), e_end = edges_end();
952 e_it != e_end; ++e_it) {
953 reorder_incident_halffaces(*e_it);
956 std::for_each(edges_begin(), edges_end(),
957 fun::bind(&TopologyKernel::reorder_incident_halffaces,
this, fun::placeholders::_1));
963 bool has_full_bottom_up_incidences()
const {
964 return (has_vertex_bottom_up_incidences() &&
965 has_edge_bottom_up_incidences() &&
966 has_face_bottom_up_incidences());
969 bool has_vertex_bottom_up_incidences()
const {
return v_bottom_up_; }
971 bool has_edge_bottom_up_incidences()
const {
return e_bottom_up_; }
973 bool has_face_bottom_up_incidences()
const {
return f_bottom_up_; }
976 void enable_deferred_deletion(
bool _enable =
true);
977 bool deferred_deletion_enabled()
const {
return deferred_deletion; }
980 void enable_fast_deletion(
bool _enable =
true) { fast_deletion = _enable; }
981 bool fast_deletion_enabled()
const {
return fast_deletion; }
986 void compute_vertex_bottom_up_incidences();
988 void compute_edge_bottom_up_incidences();
990 void compute_face_bottom_up_incidences();
992 void reorder_incident_halffaces(
const EdgeHandle& _eh);
995 std::vector<std::vector<HalfEdgeHandle> > outgoing_hes_per_vertex_;
998 std::vector<std::vector<HalfFaceHandle> > incident_hfs_per_he_;
1001 std::vector<CellHandle> incident_cell_per_hf_;
1004 bool v_bottom_up_ =
true;
1006 bool e_bottom_up_ =
true;
1008 bool f_bottom_up_ =
true;
1010 bool deferred_deletion =
true;
1012 bool fast_deletion =
true;
1033 assert(_halfFaceHandle.is_valid() && _halfFaceHandle.
uidx() < faces_.size() * 2u);
1034 assert(has_face_bottom_up_incidences());
1035 assert(_halfFaceHandle.
uidx() < incident_cell_per_hf_.size());
1036 return incident_cell_per_hf_[_halfFaceHandle.idx()] == InvalidCellHandle;
1039 bool is_boundary(
const FaceHandle& _faceHandle)
const {
1040 assert(_faceHandle.is_valid() && _faceHandle.
uidx() < faces_.size());
1041 assert(has_face_bottom_up_incidences());
1046 bool is_boundary(
const EdgeHandle& _edgeHandle)
const {
1047 assert(has_edge_bottom_up_incidences());
1048 assert(_edgeHandle.is_valid() && _edgeHandle.
uidx() < edges_.size());
1051 hehf_it.valid(); ++hehf_it) {
1052 if(is_boundary(face_handle(*hehf_it))) {
1060 assert(has_edge_bottom_up_incidences());
1061 assert(_halfedgeHandle.is_valid() && _halfedgeHandle.
uidx() < edges_.size() * 2u);
1064 hehf_it.valid(); ++hehf_it) {
1065 if(is_boundary(face_handle(*hehf_it))) {
1072 bool is_boundary(
const VertexHandle& _vertexHandle)
const {
1073 assert(has_vertex_bottom_up_incidences());
1074 assert(_vertexHandle.is_valid() && _vertexHandle.
uidx() <
n_vertices());
1077 if(is_boundary(*voh_it))
return true;
1082 bool is_boundary(
const CellHandle& _cellHandle)
const {
1083 assert(_cellHandle.is_valid() && (size_t)_cellHandle.idx() <
n_cells());
1085 for(
CellFaceIter cf_it = cf_iter(_cellHandle); cf_it.valid(); ++cf_it) {
1086 if(is_boundary(*cf_it))
return true;
1091 size_t n_vertices_in_cell(
const CellHandle& _ch)
const {
1092 assert(_ch.is_valid() && _ch.
uidx() < cells_.size());
1094 std::set<VertexHandle> vhs;
1095 std::vector<HalfFaceHandle> hfs =
cell(_ch).halffaces();
1096 for(std::vector<HalfFaceHandle>::const_iterator hf_it = hfs.begin();
1097 hf_it != hfs.end(); ++hf_it) {
1098 std::vector<HalfEdgeHandle> hes =
halfface(*hf_it).halfedges();
1099 for(std::vector<HalfEdgeHandle>::const_iterator he_it = hes.begin();
1100 he_it != hes.end(); ++he_it) {
1101 vhs.insert(
halfedge(*he_it).to_vertex());
1114 return Edge(_edge.to_vertex(), _edge.from_vertex());
1118 std::vector<HalfEdgeHandle> opp_halfedges;
1119 for(std::vector<HalfEdgeHandle>::const_iterator it = _face.halfedges().begin(); it
1120 != _face.halfedges().end(); ++it) {
1121 opp_halfedges.insert(opp_halfedges.begin(), opposite_halfedge_handle(*it));
1124 return Face(opp_halfedges);
1134 assert(_h.is_valid());
1135 assert(_subIdx < 2);
1143 assert(_h.is_valid());
1144 assert(_subIdx < 2);
1152 assert(_h.is_valid());
1159 assert(_h.is_valid());
1166 assert(_h.is_valid());
1170 if(_h.idx() % 2 == 0) {
1178 assert(_h.is_valid());
1182 if(_h.idx() % 2 == 0) {
1188 bool inline needs_garbage_collection()
const {
1189 return n_deleted_vertices_ > 0 || n_deleted_edges_ > 0 || n_deleted_faces_ > 0 || n_deleted_cells_ > 0;
1195 std::vector<Edge> edges_;
1198 std::vector<Face> faces_;
1201 std::vector<Cell> cells_;
1203 std::vector<bool> vertex_deleted_;
1204 std::vector<bool> edge_deleted_;
1205 std::vector<bool> face_deleted_;
1206 std::vector<bool> cell_deleted_;
1209 size_t n_deleted_vertices_ = 0;
1210 size_t n_deleted_edges_ = 0;
1211 size_t n_deleted_faces_ = 0;
1212 size_t n_deleted_cells_ = 0;
void resize_cprops(size_t _nc)
Change size of stored cell properties.
virtual VertexHandle add_vertex()
Add abstract vertex.
virtual void swap_vertex_indices(VertexHandle _h1, VertexHandle _h2)
Exchanges the indices of two vertices while keeping the mesh otherwise unaffected.
virtual FaceHandle add_face(const std::vector< HalfEdgeHandle > &_halfedges, bool _topologyCheck=false)
Add face via incident edges.
size_t n_edges() const override
Get number of edges in mesh.
size_t valence(const VertexHandle &_vh) const
Get valence of vertex (number of incident edges)
const Face & face(const FaceHandle &_faceHandle) const
Get face with handle _faceHandle.
virtual CellIter delete_cell(const CellHandle &_h)
Delete cell from mesh.
virtual void clear(bool _clearProps=true)
Clear whole mesh.
size_t n_logical_halffaces() const
Get number of undeleted halffaces in mesh.
size_t n_cells() const override
Get number of cells in mesh.
void resize_eprops(size_t _ne)
Change size of stored edge properties.
CellHandle incident_cell(const HalfFaceHandle &_halfFaceHandle) const
Get cell that is incident to the given halfface.
virtual void swap_edge_indices(EdgeHandle _h1, EdgeHandle _h2)
Exchanges the indices of two edges while keeping the mesh otherwise unaffected.
CellIter delete_cell_core(const CellHandle &_h)
Delete cell from mesh.
size_t n_logical_cells() const
Get number of undeleted cells in mesh.
FaceIter delete_face_core(const FaceHandle &_h)
Delete face from mesh.
size_t uidx() const
return unsigned idx - handle must be valid
virtual EdgeHandle add_edge(const VertexHandle &_fromVertex, const VertexHandle &_toHandle, bool _allowDuplicates=false)
Add edge.
virtual EdgeIter delete_edge(const EdgeHandle &_h)
Delete edge from mesh.
VertexHandle to_vertex_handle(const HalfEdgeHandle &_h) const
Get the vertex the halfedge points to.
size_t n_logical_vertices() const
Get number of undeleted vertices in mesh.
static EdgeHandle edge_handle(const HalfEdgeHandle &_h)
Handle conversion.
HalfFaceHandle adjacent_halfface_in_cell(const HalfFaceHandle &_halfFaceHandle, const HalfEdgeHandle &_halfEdgeHandle) const
Get halfface that is adjacent (w.r.t. a common halfedge) within the same cell.
EdgeIter delete_edge_core(const EdgeHandle &_h)
Delete edge from mesh.
size_t valence(const EdgeHandle &_eh) const
Get valence of edge (number of incident faces)
static HalfFaceHandle halfface_handle(const FaceHandle &_h, const unsigned char _subIdx)
Conversion function.
HalfEdgeHandle prev_halfedge_in_halfface(const HalfEdgeHandle &_heh, const HalfFaceHandle &_hfh) const
Get previous halfedge within a halfface.
size_t n_faces() const override
Get number of faces in mesh.
HalfEdgeHandle next_halfedge_in_halfface(const HalfEdgeHandle &_heh, const HalfFaceHandle &_hfh) const
Get next halfedge within a halfface.
size_t n_vertices() const override
Get number of vertices in mesh.
Face halfface(const HalfFaceHandle &_halfFaceHandle) const
Get face that corresponds to halfface with handle _halfFaceHandle.
size_t valence(const CellHandle &_ch) const
Get valence of cell (number of incident faces)
size_t valence(const FaceHandle &_fh) const
Get valence of face (number of incident edges)
void set_cell(const CellHandle &_ch, const std::vector< HalfFaceHandle > &_hfs)
Set the half-faces of a cell.
virtual VertexIter delete_vertex(const VertexHandle &_h)
Delete vertex from mesh.
virtual CellHandle add_cell(const std::vector< HalfFaceHandle > &_halffaces, bool _topologyCheck=false)
Add cell via incident halffaces.
void resize_fprops(size_t _nf)
Change size of stored face properties.
Edge opposite_halfedge(const HalfEdgeHandle &_halfEdgeHandle) const
Get opposite halfedge that corresponds to halfedge with handle _halfEdgeHandle.
bool bind(osg::GeometryPtr &_geo, Mesh &_mesh)
Edge halfedge(const HalfEdgeHandle &_halfEdgeHandle) const
Get edge that corresponds to halfedge with handle _halfEdgeHandle.
virtual FaceIter delete_face(const FaceHandle &_h)
Delete face from mesh.
VertexHandle from_vertex_handle(const HalfEdgeHandle &_h) const
Get the vertex the halfedge starts from.
virtual void swap_face_indices(FaceHandle _h1, FaceHandle _h2)
Exchanges the indices of two faces while keeping the mesh otherwise unaffected.
const Cell & cell(const CellHandle &_cellHandle) const
Get cell with handle _cellHandle.
virtual void collect_garbage()
Delete all entities that are marked as deleted.
size_t n_logical_faces() const
Get number of undeleted faces in mesh.
HalfFaceHandle halfface_extensive(const std::vector< VertexHandle > &_vs) const
VertexIter delete_vertex_core(const VertexHandle &_h)
Delete vertex from mesh.
virtual void swap_cell_indices(CellHandle _h1, CellHandle _h2)
Exchanges the indices of two cells while keeping the mesh otherwise unaffected.
CellIter delete_cell_range(const CellIter &_first, const CellIter &_last)
Delete range of cells.
size_t n_halffaces() const override
Get number of halffaces in mesh.
const Edge & edge(const EdgeHandle &_edgeHandle) const
Get edge with handle _edgeHandle.
Face opposite_halfface(const HalfFaceHandle &_halfFaceHandle) const
Get opposite halfface that corresponds to halfface with handle _halfFaceHandle.
size_t n_logical_edges() const
Get number of undeleted edges in mesh.
size_t n_logical_halfedges() const
Get number of undeleted halfedges in mesh.
void resize_vprops(size_t _nv)
Change size of stored vertex properties.
static HalfEdgeHandle halfedge_handle(const EdgeHandle &_h, const unsigned char _subIdx)
Conversion function.
size_t n_halfedges() const override
Get number of halfedges in mesh.
void set_face(const FaceHandle &_fh, const std::vector< HalfEdgeHandle > &_hes)
Set the half-edges of a face.
void set_edge(const EdgeHandle &_eh, const VertexHandle &_fromVertex, const VertexHandle &_toVertex)
Set the vertices of an edge.