Commit 6ded333f authored by Martin Heistermann's avatar Martin Heistermann

Optimize Tetmesh Cell-Vertex iterator

parent dc2e4c4d
Pipeline #12185 failed with stage
in 5 minutes and 13 seconds
......@@ -64,27 +64,24 @@ BaseIter(_mesh, _ref_h, _max_laps) {
HalfEdgeHandle curHE = *_mesh->halfface(curHF).halfedges().begin();
assert(curHE.is_valid());
vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
vertices_[0] = _mesh->halfedge(curHE).to_vertex();
curHE = _mesh->next_halfedge_in_halfface(curHE, curHF);
vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
vertices_[1] = _mesh->halfedge(curHE).to_vertex();
curHE = _mesh->next_halfedge_in_halfface(curHE, curHF);
vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
vertices_[2] = _mesh->halfedge(curHE).to_vertex();
curHF = _mesh->adjacent_halfface_in_cell(curHF, curHE);
curHE = _mesh->opposite_halfedge_handle(curHE);
curHE = _mesh->next_halfedge_in_halfface(curHE, curHF);
vertices_.push_back(_mesh->halfedge(curHE).to_vertex());
vertices_[3] = _mesh->halfedge(curHE).to_vertex();
cur_index_ = 0;
BaseIter::valid(vertices_.size() > 0);
if(BaseIter::valid()) {
BaseIter::cur_handle(vertices_[cur_index_]);
}
BaseIter::cur_handle(vertices_[cur_index_]);
}
......
#pragma once
/*===========================================================================*\
* *
* OpenVolumeMesh *
......@@ -32,20 +33,11 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#ifndef TETRAHEDRALMESHITERATORS_HH
#define TETRAHEDRALMESHITERATORS_HH
#include "../Core/Iterators.hh"
#include "OpenVolumeMesh/Config/Export.hh"
#include <array>
namespace OpenVolumeMesh {
class TetrahedralMeshTopologyKernel;
......@@ -109,10 +101,8 @@ public:
TetVertexIter& operator--();
private:
std::vector<VertexHandle> vertices_;
std::array<VertexHandle, 4> vertices_;
size_t cur_index_;
};
} // Namespace OpenVolumeMesh
#endif /* TETRAHEDRALMESHITERATORS_HH */
#pragma once
/*===========================================================================*\
* *
* OpenVolumeMesh *
......@@ -32,16 +33,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Date$ *
* $LastChangedBy$ *
* *
\*===========================================================================*/
#ifndef TETRAHEDRALMESHTOPOLOGYKERNEL_HH
#define TETRAHEDRALMESHTOPOLOGYKERNEL_HH
#ifndef NDEBUG
#include <iostream>
......@@ -133,4 +124,3 @@ private:
} // Namespace OpenVolumeMesh
#endif /* TETRAHEDRALMESHTOPOLOGYKERNEL_HH */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment