diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-08-18 12:45:13 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-08-18 12:45:13 +0000 |
commit | 2ca2d175f0b49ff267d9a99e5a4c0a5f03e0d30c (patch) | |
tree | 24f7df7a0116576d4ace896640111406efa5dcd5 /src/Alpha_complex/include | |
parent | 3d47e5f4f22e82f2af246ae7d67f19307d57a053 (diff) |
exception throw on get_point not found
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@740 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: fd2efc725a140f978d2624fe7879dc32f5566ab0
Diffstat (limited to 'src/Alpha_complex/include')
-rw-r--r-- | src/Alpha_complex/include/gudhi/Alpha_complex.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h index 71d34229..213436e0 100644 --- a/src/Alpha_complex/include/gudhi/Alpha_complex.h +++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h @@ -166,17 +166,14 @@ class Alpha_complex : public Simplex_tree<> { * * @param[in] vertex Vertex handle of the point to retrieve. * @return The founded point. + * @warning Exception std::out_of_range is thrown in case vertex is not in the map vertex_handle_to_iterator_. */ Point_d get_point(Vertex_handle vertex) { - Point_d point(dimension()); - try { - if (vertex_handle_to_iterator_[vertex] != nullptr) { - point = vertex_handle_to_iterator_[vertex]->point(); - } - } catch (...) { - std::cerr << "Alpha_complex - getPoint not found on vertex " << vertex << std::endl; + if (vertex_handle_to_iterator_[vertex] != nullptr) { + return vertex_handle_to_iterator_[vertex]->point(); + } else { + throw std::out_of_range("Vertex out of vector range"); } - return point; } private: |