summaryrefslogtreecommitdiff
path: root/src/common/include/gudhi/Off_reader.h
diff options
context:
space:
mode:
authorsalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2014-12-12 09:14:20 +0000
committersalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2014-12-12 09:14:20 +0000
commitd5f559170c6674cf5534a9818d4a3a8a1e598165 (patch)
tree2ec3933eb935f9f1f7657fefd7e35ad6f6a7ffc4 /src/common/include/gudhi/Off_reader.h
parent425b462d361286822ee0ed7b5fe00881ba312ea3 (diff)
modif off reader +skbl geometry
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@349 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Diffstat (limited to 'src/common/include/gudhi/Off_reader.h')
-rw-r--r--src/common/include/gudhi/Off_reader.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/common/include/gudhi/Off_reader.h b/src/common/include/gudhi/Off_reader.h
index a9c64f97..1c99a90a 100644
--- a/src/common/include/gudhi/Off_reader.h
+++ b/src/common/include/gudhi/Off_reader.h
@@ -1,8 +1,8 @@
/*
* Off_reader.h
* Created on: Nov 28, 2014
- * This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
* library for computational topology.
*
* Author(s): David Salinas
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
@@ -113,18 +113,26 @@ private:
bool is_off_file = (line.find("OFF") != std::string::npos);
bool is_noff_file = (line.find("nOFF") != std::string::npos);
- if(!is_off_file && !is_noff_file) return false;
+ if(!is_off_file && !is_noff_file) {
+ std::cerr << line<<std::endl;
+ std::cerr << "missing off header\n";
+ return false;
+ }
if(!goto_next_uncomment_line(line)) return false;
std::istringstream iss(line);
if(is_off_file){
off_info_.dim = 3;
- if(!(iss >> off_info_.num_vertices >> off_info_.num_faces >> off_info_.num_edges))
+ if(!(iss >> off_info_.num_vertices >> off_info_.num_faces >> off_info_.num_edges)){
+ std::cerr << "incorrect number of vertices/faces/edges\n";
return false;
+ }
}
else
- if(!(iss >> off_info_.dim >> off_info_.num_vertices >> off_info_.num_faces >> off_info_.num_edges))
+ if(!(iss >> off_info_.dim >> off_info_.num_vertices >> off_info_.num_faces >> off_info_.num_edges)){
+ std::cerr << "incorrect number of vertices/faces/edges\n";
return false;
+ }
off_visitor.init(off_info_.dim,off_info_.num_vertices,off_info_.num_faces,off_info_.num_edges);
return true;
@@ -134,7 +142,7 @@ private:
uncomment_line.clear();
do
std::getline(stream_, uncomment_line);
- while(uncomment_line[0] == '%');
+ while(uncomment_line[0] == '%');// || uncomment_line.empty());
return (uncomment_line.size()>0 && uncomment_line[0] != '%');
}