Commit 60a52d65 authored by Jan Möbius's avatar Jan Möbius
Browse files

Refactored redundant code

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8465 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ade73d86
...@@ -145,11 +145,25 @@ void ...@@ -145,11 +145,25 @@ void
StripProcessorT<Mesh>:: StripProcessorT<Mesh>::
buildStrips() buildStrips()
{ {
// init faces to be un-processed and un-used
// deleted or hidden faces are marked processed
if (mesh_.has_face_status()) {
for (typename Mesh::FaceIter f_it=mesh_.faces_begin(); f_it != mesh_.faces_end(); ++f_it)
if (mesh_.status(f_it).hidden() || mesh_.status(f_it).deleted())
processed(f_it) = used(f_it) = true;
else
processed(f_it) = used(f_it) = false;
} else {
for (typename Mesh::FaceIter f_it=mesh_.faces_begin(); f_it != mesh_.faces_end() ; ++f_it)
processed(f_it) = used(f_it) = false;
}
if ( mesh_.is_trimesh() ) { if ( mesh_.is_trimesh() ) {
buildStripsTriMesh(); buildStripsTriMesh();
} else { } else {
buildStripsPolyMesh(); buildStripsPolyMesh();
} }
} }
template <class Mesh> template <class Mesh>
...@@ -168,19 +182,6 @@ buildStripsPolyMesh() { ...@@ -168,19 +182,6 @@ buildStripsPolyMesh() {
std::vector<FaceMap> faceMap; std::vector<FaceMap> faceMap;
faceMaps_.clear(); faceMaps_.clear();
// init faces to be un-processed and un-used
// deleted or hidden faces are marked processed
if (mesh_.has_face_status()) {
for (f_it=mesh_.faces_begin(); f_it!=f_end; ++f_it)
if (mesh_.status(f_it).hidden() || mesh_.status(f_it).deleted())
processed(f_it) = used(f_it) = true;
else
processed(f_it) = used(f_it) = false;
} else {
for (f_it=mesh_.faces_begin(); f_it!=f_end; ++f_it)
processed(f_it) = used(f_it) = false;
}
uint k = 0; uint k = 0;
for (f_it=mesh_.faces_begin(); true; ) { for (f_it=mesh_.faces_begin(); true; ) {
...@@ -246,21 +247,7 @@ buildStripsTriMesh() ...@@ -246,21 +247,7 @@ buildStripsTriMesh()
typename Mesh::FaceIter f_it, f_end=mesh_.faces_end(); typename Mesh::FaceIter f_it, f_end=mesh_.faces_end();
// init faces to be un-processed and un-used
// deleted or hidden faces are marked processed
if (mesh_.has_face_status())
{
for (f_it=mesh_.faces_begin(); f_it!=f_end; ++f_it)
if (mesh_.status(f_it).hidden() || mesh_.status(f_it).deleted())
processed(f_it) = used(f_it) = true;
else
processed(f_it) = used(f_it) = false;
}
else
{
for (f_it=mesh_.faces_begin(); f_it!=f_end; ++f_it)
processed(f_it) = used(f_it) = false;
}
for (f_it=mesh_.faces_begin(); true; ) for (f_it=mesh_.faces_begin(); true; )
{ {
......
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