From 52bca1c4334e8abe965d616e1ef8a92280013a9b Mon Sep 17 00:00:00 2001 From: salinasd Date: Thu, 29 Jan 2015 09:09:18 +0000 Subject: test is manifold git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@437 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a515b3216d21c8a5736744842fdcf09644f5c7b1 --- src/GudhUI/model/Model.h | 59 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 5 deletions(-) (limited to 'src/GudhUI/model') diff --git a/src/GudhUI/model/Model.h b/src/GudhUI/model/Model.h index 39bbd9d8..6ac971d0 100644 --- a/src/GudhUI/model/Model.h +++ b/src/GudhUI/model/Model.h @@ -20,6 +20,7 @@ #include "utils/Edge_contractor.h" #include "utils/Persistence_compute.h" #include "utils/Critical_points.h" +#include "utils/Is_manifold.h" #include "gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h" #include "gudhi/Skeleton_blocker_geometric_complex.h" @@ -56,8 +57,9 @@ public: void maximal_face(std::vector vertices){ if (!load_only_points_){ - for (int i = 0; i read_wraper(complex_); + CGAL_geometric_flag_complex_wrapper read_wraper(complex_,false); Gudhi::read_off(name_file,read_wraper); } void off_points_open(const std::string& name_file){ UIDBGMSG("load off points",name_file); complex_.clear(); - CGAL_geometric_flag_complex_wrapper read_wraper(complex_); + CGAL_geometric_flag_complex_wrapper read_wraper(complex_,true); Gudhi::read_off(name_file,read_wraper); } void off_file_save(const std::string& name_file){ UIDBG("save off file"); + UIDBG("save off off_points_save"); + std::ofstream file(name_file); + if(file.is_open()){ + file<<"OFF\n"; + file< collapsor(complex_,complex_.num_edges()); + Edge_collapsor collapsor(complex_,num_collapses); } @@ -268,6 +301,17 @@ public: Critical_points critical_points(complex_,std::cout,max_distance); } + void show_is_manifold(){ + unsigned dim; + bool is_manifold; + Is_manifold test_manifold(complex_,dim,is_manifold); + + if(is_manifold) std::cout << "The complex is a "<=4 and may or may not be a manifold\n"; + } + private: void run_chomp(){ @@ -296,6 +340,11 @@ public: unsigned num_vertices() const{ return complex_.num_vertices(); } + + unsigned num_edges() const{ + return complex_.num_edges(); + } + }; #endif /* MODEL_H_ */ -- cgit v1.2.3