Fixed initializer API

This commit is contained in:
Efi Fogel 2016-01-03 01:01:26 +02:00
parent 87309bafcd
commit fb09c4ac65
1 changed files with 10 additions and 57 deletions

View File

@ -197,9 +197,6 @@ private:
/*! The number of facest */
size_type m_num_facets;
/*! The type of the facets. */
size_type m_num_vertices_per_facet;
/*! The index of the marked vertex */
size_type m_marked_vertex_index;
@ -216,13 +213,11 @@ private:
size_type num_points,
const CoordIndexIter& indices_begin,
const CoordIndexIter& indices_end,
size_type num_facets,
size_type num_vertices_per_facet = 0) :
size_type num_facets) :
m_points_begin(points_begin), m_points_end(points_end),
m_num_points(num_points),
m_indices_begin(indices_begin), m_indices_end(indices_end),
m_num_facets(num_facets),
m_num_vertices_per_facet(num_vertices_per_facet),
m_marked_vertex_index(0),
m_marked_edge_index(0),
m_marked_facet_index(0)
@ -257,51 +252,12 @@ private:
// Add the facets:
counter = 0;
switch (m_num_vertices_per_facet) {
case 0: // '0' indicates variant number of vertices per facet
{
CoordIndexIter ii = m_indices_begin;
while (ii != m_indices_end) {
Polyhedron_facet_handle fh = B.begin_facet();
if (counter == m_marked_facet_index) fh->set_marked(true);
int index = *ii++;
while (index != -1) {
B.add_vertex_to_facet(index);
index = *ii++;
}
B.end_facet();
++counter;
}
}
break;
case 3:
// Unfold for to improve preformance:
for (CoordIndexIter ii = m_indices_begin; ii != m_indices_end;
ii += m_num_vertices_per_facet)
{
Polyhedron_facet_handle fh = B.begin_facet();
if (counter == m_marked_facet_index) fh->set_marked(true);
B.add_vertex_to_facet(*ii);
B.add_vertex_to_facet(*(ii+1));
B.add_vertex_to_facet(*(ii+2));
B.end_facet();
++counter;
}
break;
default:
for (CoordIndexIter ii = m_indices_begin; ii != m_indices_end;
ii += m_num_vertices_per_facet)
{
Polyhedron_facet_handle fh = B.begin_facet();
if (counter == m_marked_facet_index) fh->set_marked(true);
for (size_type i = 0; i < m_num_vertices_per_facet; ++i)
B.add_vertex_to_facet(*(ii + i));
B.end_facet();
++counter;
}
break;
for (auto it = m_indices_begin; it != m_indices_end; ++it) {
Polyhedron_facet_handle fh = B.begin_facet();
if (counter == m_marked_facet_index) fh->set_marked(true);
for (auto index: *it) B.add_vertex_to_facet(index);
B.end_facet();
++counter;
}
B.end_surface();
}
@ -360,13 +316,12 @@ private:
size_type num_points,
const CoordIndexIter indices_begin,
const CoordIndexIter indices_end,
size_type num_facets,
size_type num_vertices_per_facet = 0)
size_type num_facets)
{
/*! The builder */
Build_surface<PointIterator, CoordIndexIter>
surface(points_begin, points_end, num_points,
indices_begin, indices_end, num_facets, num_vertices_per_facet);
indices_begin, indices_end, num_facets);
surface.set_marked_vertex_index(m_marked_vertex_index);
surface.set_marked_edge_index(m_marked_edge_index);
surface.set_marked_facet_index(m_marked_facet_index);
@ -598,15 +553,13 @@ public:
const CoordIndexIter indices_begin,
const CoordIndexIter indices_end,
size_type num_facets,
size_type num_vertices_per_facet = 0,
Visitor* visitor = NULL)
{
m_visitor = visitor;
Polyhedron polyhedron;
update_polyhedron(polyhedron, points_begin, points_end, num_points,
indices_begin, indices_end, num_facets,
num_vertices_per_facet);
indices_begin, indices_end, num_facets);
#if 0
std::copy(polyhedron.points_begin(), polyhedron.points_end(),