fix formatting

This commit is contained in:
Sébastien Loriot 2016-10-21 12:04:59 +02:00 committed by Mael Rouxel-Labbé
parent 82ff73da86
commit eab6b6b68a
1 changed files with 137 additions and 147 deletions

View File

@ -28,8 +28,8 @@
namespace CGAL { namespace CGAL {
template <typename HD> template <typename HD>
struct Seam_mesh_halfedge_descriptor { struct Seam_mesh_halfedge_descriptor {
typedef HD TM_halfedge_descriptor; typedef HD TM_halfedge_descriptor;
@ -80,7 +80,7 @@ namespace CGAL {
os << hd.tmhd << ((hd.seam)?" on seam":""); os << hd.tmhd << ((hd.seam)?" on seam":"");
return os; return os;
} }
}; };
@ -113,7 +113,7 @@ private:
public: public:
/// @cond CGAL_DOCUMENT_INTERNALS /// @cond CGAL_DOCUMENT_INTERNALS
typedef typename boost::graph_traits<TM>::face_descriptor face_descriptor; typedef typename boost::graph_traits<TM>::face_descriptor face_descriptor;
const TM& mesh()const const TM& mesh()const
{ {
@ -125,7 +125,7 @@ typedef typename boost::graph_traits<TM>::face_descriptor face_descriptor;
/** A vertex /** A vertex
* *
**/ **/
struct vertex_descriptor{ struct vertex_descriptor {
vertex_descriptor() vertex_descriptor()
{} {}
@ -221,25 +221,25 @@ typedef typename boost::graph_traits<TM>::face_descriptor face_descriptor;
{ {
//std::cerr << "increment\n"; //std::cerr << "increment\n";
if(hd == end) return; if(hd == end) return;
do{ do {
++hd; ++hd;
//std::cerr << *hd << " ++" << std::endl; //std::cerr << *hd << " ++" << std::endl;
if(hd == end) return; if(hd == end) return;
TM_vertex_descriptor tvd = target(*hd,mesh_->mesh()); TM_vertex_descriptor tvd = target(*hd,mesh_->mesh());
//std::cerr << "tvd = " << tvd << std::endl; //std::cerr << "tvd = " << tvd << std::endl;
if( (! mesh_->has_on_seam(tvd))&& (halfedge(tvd,mesh_->mesh()) == *hd)){ if( (! mesh_->has_on_seam(tvd))&& (halfedge(tvd,mesh_->mesh()) == *hd)) {
//std::cerr <<"return as not on seam and reverse incidence\n"; //std::cerr <<"return as not on seam and reverse incidence\n";
return; return;
} }
if(mesh_->has_on_seam(edge(*hd,mesh_->mesh()))){ if(mesh_->has_on_seam(edge(*hd,mesh_->mesh()))) {
//std::cerr <<"return as edge on seam\n"; //std::cerr <<"return as edge on seam\n";
return; return;
} }
if(mesh_->has_on_seam(tvd) && is_border(opposite(*hd,mesh_->mesh()),mesh_->mesh())){ if(mesh_->has_on_seam(tvd) && is_border(opposite(*hd,mesh_->mesh()),mesh_->mesh())) {
//std::cerr <<"return as edge on border and target on seam\n"; //std::cerr <<"return as edge on border and target on seam\n";
return; return;
} }
}while(true); } while(true);
} }
bool equal(const vertex_iterator& other) const bool equal(const vertex_iterator& other) const
@ -247,7 +247,9 @@ typedef typename boost::graph_traits<TM>::face_descriptor face_descriptor;
return (this->mesh_ == other.mesh_) && (this->hd == other.hd); return (this->mesh_ == other.mesh_) && (this->hd == other.hd);
} }
vertex_descriptor dereference() const { return vertex_descriptor(*hd); } vertex_descriptor dereference() const {
return vertex_descriptor(*hd);
}
TM_halfedge_iterator hd, end; TM_halfedge_iterator hd, end;
@ -334,18 +336,18 @@ public:
*this, *this,
std::back_inserter(faces)); std::back_inserter(faces));
BOOST_FOREACH(face_descriptor fd, faces){ BOOST_FOREACH(face_descriptor fd, faces) {
BOOST_FOREACH(TM_halfedge_descriptor tmhd , halfedges_around_face(halfedge(fd,tm),tm)){ BOOST_FOREACH(TM_halfedge_descriptor tmhd , halfedges_around_face(halfedge(fd,tm),tm)) {
halfedge_descriptor hd(tmhd); halfedge_descriptor hd(tmhd);
vertex_descriptor vd = target(hd,mesh); vertex_descriptor vd = target(hd,mesh);
put(vipm,vd,-1); put(vipm,vd,-1);
} }
} }
BOOST_FOREACH(face_descriptor fd, faces){ BOOST_FOREACH(face_descriptor fd, faces) {
BOOST_FOREACH(TM_halfedge_descriptor tmhd , halfedges_around_face(halfedge(fd,tm),tm)){ BOOST_FOREACH(TM_halfedge_descriptor tmhd , halfedges_around_face(halfedge(fd,tm),tm)) {
halfedge_descriptor hd(tmhd); halfedge_descriptor hd(tmhd);
vertex_descriptor vd = target(hd,mesh); vertex_descriptor vd = target(hd,mesh);
if(get(vipm,vd) == -1){ if(get(vipm,vd) == -1) {
put(vipm,vd,index); put(vipm,vd,index);
++index; ++index;
} }
@ -361,69 +363,57 @@ public:
return index; return index;
} }
halfedge_descriptor m_next(const halfedge_descriptor& hd) const halfedge_descriptor m_next(const halfedge_descriptor& hd) const
{ {
if((! hd.seam)&& (! is_border(hd.tmhd,tm))){ if((! hd.seam)&& (! is_border(hd.tmhd,tm))) {
return halfedge_descriptor(next(hd.tmhd, tm)); return halfedge_descriptor(next(hd.tmhd, tm));
} }
Halfedge_around_target_circulator<TM> hatc(hd.tmhd,tm); Halfedge_around_target_circulator<TM> hatc(hd.tmhd,tm);
do { do {
--hatc; --hatc;
}while((! has_on_seam(*hatc))&&(! is_border(opposite(*hatc,tm),tm))); } while((! has_on_seam(*hatc))&&(! is_border(opposite(*hatc,tm),tm)));
return halfedge_descriptor(opposite(*hatc,tm), ! is_border(opposite(*hatc,tm),tm)); return halfedge_descriptor(opposite(*hatc,tm), ! is_border(opposite(*hatc,tm),tm));
} }
halfedge_descriptor m_prev(const halfedge_descriptor& hd) const halfedge_descriptor m_prev(const halfedge_descriptor& hd) const
{ {
if((! hd.seam)&& (! is_border(hd.tmhd,tm))){ if((! hd.seam)&& (! is_border(hd.tmhd,tm))) {
return halfedge_descriptor(prev(hd.tmhd, tm)); return halfedge_descriptor(prev(hd.tmhd, tm));
} }
Halfedge_around_source_circulator<TM> hatc(hd.tmhd,tm); Halfedge_around_source_circulator<TM> hatc(hd.tmhd,tm);
do { do {
++hatc; ++hatc;
}while((! has_on_seam(*hatc))&&(! is_border(opposite(*hatc,tm),tm))); } while((! has_on_seam(*hatc))&&(! is_border(opposite(*hatc,tm),tm)));
return halfedge_descriptor(opposite(*hatc,tm), ! is_border(opposite(*hatc,tm),tm)); return halfedge_descriptor(opposite(*hatc,tm), ! is_border(opposite(*hatc,tm),tm));
} }
halfedge_descriptor m_opposite(const halfedge_descriptor& hd) const halfedge_descriptor m_opposite(const halfedge_descriptor& hd) const
{ {
if(! hd.seam){ if(! hd.seam) {
return halfedge_descriptor(opposite(hd.tmhd,tm), has_on_seam(hd)); return halfedge_descriptor(opposite(hd.tmhd,tm), has_on_seam(hd));
} }
return halfedge_descriptor(opposite(hd.tmhd,tm)); return halfedge_descriptor(opposite(hd.tmhd,tm));
} }
vertex_descriptor m_target(halfedge_descriptor hd) const vertex_descriptor m_target(halfedge_descriptor hd) const
{ {
TM_halfedge_descriptor tmhd(hd); TM_halfedge_descriptor tmhd(hd);
if(! has_on_seam(target(tmhd,tm))){ if(! has_on_seam(target(tmhd,tm))) {
tmhd = halfedge(target(tmhd,tm),tm); tmhd = halfedge(target(tmhd,tm),tm);
return vertex_descriptor(halfedge_descriptor(tmhd)); return vertex_descriptor(halfedge_descriptor(tmhd));
} }
if(hd.seam){ if(hd.seam) {
return m_target(halfedge_descriptor(prev(opposite(tmhd,tm),tm))); return m_target(halfedge_descriptor(prev(opposite(tmhd,tm),tm)));
} }
while((! has_on_seam(tmhd)) && (! is_border(opposite(tmhd,tm),tm))){ while((! has_on_seam(tmhd)) && (! is_border(opposite(tmhd,tm),tm))) {
tmhd = prev(opposite(tmhd,tm),tm); tmhd = prev(opposite(tmhd,tm),tm);
} }
return vertex_descriptor(halfedge_descriptor(tmhd)); return vertex_descriptor(halfedge_descriptor(tmhd));
}
/*
vertex_descriptor m_target(const halfedge_descriptor& hd) const
{
return m_target(hd.tmhd);
} }
*/
vertex_descriptor m_source(const halfedge_descriptor& hd) const vertex_descriptor m_source(const halfedge_descriptor& hd) const
{ {