@@ -135,7 +135,7 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
|
||||
edgeData_.resize(n);
|
||||
next_cache_.resize(6*n);
|
||||
}
|
||||
next_cache_count_ = 0;
|
||||
int next_cache_count = 0;
|
||||
|
||||
// don't allow degenerated faces
|
||||
assert (n > 2);
|
||||
@@ -208,9 +208,9 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
|
||||
assert(inner_next.is_valid());
|
||||
|
||||
// relink
|
||||
next_cache_[next_cache_count_++] = std::make_pair(boundary_prev, patch_start);
|
||||
next_cache_[next_cache_count_++] = std::make_pair(patch_end, boundary_next);
|
||||
next_cache_[next_cache_count_++] = std::make_pair(inner_prev, inner_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(boundary_prev, patch_start);
|
||||
next_cache_[next_cache_count++] = std::make_pair(patch_end, boundary_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(inner_prev, inner_next);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,14 +252,14 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
|
||||
case 1: // prev is new, next is old
|
||||
boundary_prev = prev_halfedge_handle(inner_next);
|
||||
assert(boundary_prev.is_valid());
|
||||
next_cache_[next_cache_count_++] = std::make_pair(boundary_prev, outer_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(boundary_prev, outer_next);
|
||||
set_halfedge_handle(vh, outer_next);
|
||||
break;
|
||||
|
||||
case 2: // next is new, prev is old
|
||||
boundary_next = next_halfedge_handle(inner_prev);
|
||||
assert(boundary_next.is_valid());
|
||||
next_cache_[next_cache_count_++] = std::make_pair(outer_prev, boundary_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(outer_prev, boundary_next);
|
||||
set_halfedge_handle(vh, boundary_next);
|
||||
break;
|
||||
|
||||
@@ -267,7 +267,7 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
|
||||
if (!halfedge_handle(vh).is_valid())
|
||||
{
|
||||
set_halfedge_handle(vh, outer_next);
|
||||
next_cache_[next_cache_count_++] = std::make_pair(outer_prev, outer_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(outer_prev, outer_next);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -275,14 +275,14 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
|
||||
boundary_prev = prev_halfedge_handle(boundary_next);
|
||||
assert(boundary_prev.is_valid());
|
||||
assert(boundary_next.is_valid());
|
||||
next_cache_[next_cache_count_++] = std::make_pair(boundary_prev, outer_next);
|
||||
next_cache_[next_cache_count_++] = std::make_pair(outer_prev, boundary_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(boundary_prev, outer_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(outer_prev, boundary_next);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// set inner link
|
||||
next_cache_[next_cache_count_++] = std::make_pair(inner_prev, inner_next);
|
||||
next_cache_[next_cache_count++] = std::make_pair(inner_prev, inner_next);
|
||||
}
|
||||
else edgeData_[ii].needs_adjust = (halfedge_handle(vh) == inner_next);
|
||||
|
||||
@@ -292,7 +292,7 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
|
||||
}
|
||||
|
||||
// process next halfedge cache
|
||||
for (i = 0; i < next_cache_count_; ++i)
|
||||
for (i = 0; i < next_cache_count; ++i)
|
||||
set_next_halfedge_handle(next_cache_[i].first, next_cache_[i].second);
|
||||
|
||||
|
||||
|
||||
@@ -1185,66 +1185,66 @@ public:
|
||||
class CirculatorRange {
|
||||
public:
|
||||
CirculatorRange(
|
||||
CONTAINER_TYPE &container,
|
||||
const CONTAINER_TYPE &container,
|
||||
CENTER_ENTITY_TYPE center) :
|
||||
container_(container), center_(center) {}
|
||||
ITER_TYPE begin() { return (container_.*begin_fn)(center_); }
|
||||
ITER_TYPE end() { return (container_.*end_fn)(center_); }
|
||||
|
||||
private:
|
||||
CONTAINER_TYPE &container_;
|
||||
const CONTAINER_TYPE &container_;
|
||||
CENTER_ENTITY_TYPE center_;
|
||||
};
|
||||
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstVertexVertexCWIter,
|
||||
VertexHandle,
|
||||
&PolyConnectivity::cvv_cwbegin,
|
||||
&PolyConnectivity::cvv_cwend> ConstVertexVertexRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstVertexIHalfedgeIter,
|
||||
VertexHandle,
|
||||
&PolyConnectivity::cvih_begin,
|
||||
&PolyConnectivity::cvih_end> ConstVertexIHalfedgeRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstVertexOHalfedgeIter, VertexHandle,
|
||||
&PolyConnectivity::cvoh_begin,
|
||||
&PolyConnectivity::cvoh_end> ConstVertexOHalfedgeRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstVertexEdgeIter,
|
||||
VertexHandle,
|
||||
&PolyConnectivity::cve_begin,
|
||||
&PolyConnectivity::cve_end> ConstVertexEdgeRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstVertexFaceIter,
|
||||
VertexHandle,
|
||||
&PolyConnectivity::cvf_begin,
|
||||
&PolyConnectivity::cvf_end> ConstVertexFaceRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstFaceVertexIter,
|
||||
FaceHandle,
|
||||
&PolyConnectivity::cfv_begin,
|
||||
&PolyConnectivity::cfv_end> ConstFaceVertexRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstFaceHalfedgeIter,
|
||||
FaceHandle,
|
||||
&PolyConnectivity::cfh_begin,
|
||||
&PolyConnectivity::cfh_end> ConstFaceHalfedgeRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstFaceEdgeIter,
|
||||
FaceHandle,
|
||||
&PolyConnectivity::cfe_begin,
|
||||
&PolyConnectivity::cfe_end> ConstFaceEdgeRange;
|
||||
typedef CirculatorRange<
|
||||
const PolyConnectivity,
|
||||
PolyConnectivity,
|
||||
ConstFaceFaceIter,
|
||||
FaceHandle,
|
||||
&PolyConnectivity::cff_begin,
|
||||
@@ -1577,7 +1577,6 @@ private: // Working storage for add_face()
|
||||
};
|
||||
std::vector<AddFaceEdgeInfo> edgeData_; //
|
||||
std::vector<std::pair<HalfedgeHandle, HalfedgeHandle> > next_cache_; // cache for set_next_halfedge and vertex' set_halfedge
|
||||
uint next_cache_count_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user