Debug (nyf)

This commit is contained in:
Guillaume Damiand 2017-03-22 14:08:25 -04:00
parent f3a6a80382
commit a232565907
3 changed files with 19 additions and 9 deletions

View File

@ -443,7 +443,7 @@ halfedge(typename boost::graph_traits<CGAL_LCC_TYPE>::vertex_descriptor u,
darts_of_cell<0>(const_cast<CGAL_LCC_TYPE&>(g).template beta<2>(u->dart())).end();*/ darts_of_cell<0>(const_cast<CGAL_LCC_TYPE&>(g).template beta<2>(u->dart())).end();*/
it!=itend; ++it) it!=itend; ++it)
{ {
if (it->template attribute<0>()==v) if (g.template attribute<0>(g.template beta<2>(it))==v)
{ {
return std::make_pair(it, true); return std::make_pair(it, true);
// return std::make_pair(const_cast<CGAL_LCC_TYPE&>(g).template beta<2>(it), true); // return std::make_pair(const_cast<CGAL_LCC_TYPE&>(g).template beta<2>(it), true);
@ -502,7 +502,7 @@ CGAL_LCC_TEMPLATE_ARGS
bool is_valid(const CGAL_LCC_TYPE& cm, bool = false) bool is_valid(const CGAL_LCC_TYPE& cm, bool = false)
{ {
// cm.display_darts(std::cout,true); // cm.display_darts(std::cout,true);
return cm.is_valid(); // true to inverse the convention between darts and 0-attributes return cm.is_valid();
} }
CGAL_LCC_TEMPLATE_ARGS CGAL_LCC_TEMPLATE_ARGS
@ -534,6 +534,7 @@ void set_target(typename boost::graph_traits<CGAL_LCC_TYPE>::halfedge_descriptor
CGAL_LCC_TYPE& cm) CGAL_LCC_TYPE& cm)
{ {
cm.template restricted_set_dart_attribute<0>(cm.template beta<2>(h1), v); cm.template restricted_set_dart_attribute<0>(cm.template beta<2>(h1), v);
// cm.template restricted_set_dart_attribute<0>(h1, v); // cm.template restricted_set_dart_attribute<0>(h1, v);
// cm.template set_dart_attribute<0>(h1, v); // cm.template set_dart_attribute<0>(h1, v);
} }

View File

@ -16,7 +16,7 @@
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h> #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Linear_cell_complex.h> #include <CGAL/Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_incremental_builder.h> #include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/Linear_cell_complex_constructors.h> #include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h> #include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/boost/graph/properties_Linear_cell_complex.h> #include <CGAL/boost/graph/properties_Linear_cell_complex.h>
@ -146,7 +146,7 @@ bool read_a_mesh(LCC& lcc, const std::string& str) {
std::ifstream in(str.c_str()); std::ifstream in(str.c_str());
bool success = in.good(); bool success = in.good();
if(success) if(success)
CGAL::load_off(lcc, in); CGAL::load_off_v2(lcc, in);
return success; return success;
} }

View File

@ -68,7 +68,7 @@ namespace CGAL {
void add_vertex_to_facet(size_type i) void add_vertex_to_facet(size_type i)
{ {
// std::cout<<i<<" "<<std::flush; std::cout<<"add vertex "<<i<<" "<<std::flush;
CGAL_assertion( i<new_vertices ); CGAL_assertion( i<new_vertices );
if ( !begin_face ) if ( !begin_face )
@ -88,7 +88,11 @@ namespace CGAL {
if (first_dart==lcc.null_handle) if (first_dart==lcc.null_handle)
{ first_dart=cur; } { first_dart=cur; }
else else
{ lcc.basic_link_beta_1(prev_dart, cur); } {
lcc.basic_link_beta_1(prev_dart, cur);
std::cout<<"1-link "<<lcc.darts().index(prev_dart)<<" -> "<<
lcc.darts().index(cur)<<std::endl;
}
prev_dart = cur; prev_dart = cur;
} }
@ -104,13 +108,17 @@ namespace CGAL {
// End of the facet. Return the first dart of this facet. // End of the facet. Return the first dart of this facet.
Dart_handle end_facet() Dart_handle end_facet()
{ {
// std::cout<<" end facet."<<std::endl;
CGAL_assertion( first_dart!=lcc.null_handle && CGAL_assertion( first_dart!=lcc.null_handle &&
prev_dart!=lcc.null_handle ); prev_dart!=lcc.null_handle );
add_vertex_to_facet(first_vertex); add_vertex_to_facet(first_vertex);
lcc.basic_link_beta_1(prev_dart, first_dart); lcc.basic_link_beta_1(prev_dart, first_dart);
face_attrib=NULL; face_attrib=NULL;
std::cout<<"1-link "<<lcc.darts().index(prev_dart)<<" -> "<<
lcc.darts().index(first_dart)<<std::endl;
std::cout<<" end facet."<<std::endl;
return first_dart; return first_dart;
} }
@ -129,7 +137,8 @@ namespace CGAL {
// End of the surface. Return one dart of the created surface. // End of the surface. Return one dart of the created surface.
Dart_handle end_surface() Dart_handle end_surface()
{ {
unsigned int nb=0; /* TODO NOT NEEDED ?
unsigned int nb=0;
for (typename LCC::Dart_range::iterator it=lcc.darts().begin(), for (typename LCC::Dart_range::iterator it=lcc.darts().begin(),
itend=lcc.darts().end(); it!=itend; ++it) itend=lcc.darts().end(); it!=itend; ++it)
@ -150,7 +159,7 @@ namespace CGAL {
lcc.template set_dart_of_attribute<0>(lcc.vertex_attribute(it), it); lcc.template set_dart_of_attribute<0>(lcc.vertex_attribute(it), it);
++nb; ++nb;
} }
} }*/
return first_dart; return first_dart;
} }