From 16aaf4cda5fd97da12a7f1da8b0a5168fac2e289 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 11 Oct 2016 13:57:03 +0000 Subject: Problem of merge with tangentialcomplex branch. Redo in an integration branch git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_integration@1701 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fa029e8e90b3e203ea675f02098ec6fe95596f9f --- .../gudhi_patches/CGAL/Triangulation_full_cell.h | 148 +++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h (limited to 'src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h') diff --git a/src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h b/src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h new file mode 100644 index 00000000..a0c5246f --- /dev/null +++ b/src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h @@ -0,0 +1,148 @@ +// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Samuel Hornus + +#ifndef CGAL_TRIANGULATION_SIMPLEX_H +#define CGAL_TRIANGULATION_SIMPLEX_H + +#include +#include +#include +#include + +namespace CGAL { + +struct No_full_cell_data {}; + +template< class TriangulationTraits, typename Data_ = No_full_cell_data, class TDSFullCell = Default > +class Triangulation_full_cell : public Default::Get >::type +{ + // The default type for TDSFullCell is Triangulation_ds_full_cell<> : + typedef typename Default::Get >::type + Base; + typedef Triangulation_full_cell Self; +public: + typedef Data_ Data; + typedef typename Base::Vertex_handle Vertex_handle; + typedef typename Base::Vertex_const_handle Vertex_const_handle; + typedef typename Base::Vertex_handle_const_iterator Vertex_handle_const_iterator; + typedef typename Base::Full_cell_const_handle Full_cell_const_handle; + typedef typename TriangulationTraits::Point_d Point; + typedef typename TriangulationTraits::Point_d Point_d; + +private: // DATA MEMBERS + Data data_; + +public: + + using Base::vertices_begin; + using Base::vertices_end; + + template< class TDS2 > + struct Rebind_TDS + { + typedef typename Base::template Rebind_TDS::Other TDSFullCell2; + typedef Triangulation_full_cell Other; + }; + + Triangulation_full_cell(const int d) + : Base(d), data_() {} + + Triangulation_full_cell(const Self & s) + : Base(s), data_(s.data_) {} + + const Data & data() const + { + return data_; + } + + Data & data() + { + return data_; + } + + struct Point_from_vertex_handle + { + typedef Vertex_handle argument_type; + typedef Point result_type; + result_type & operator()(argument_type & x) const + { + return x->point(); + } + const result_type & operator()(const argument_type & x) const + { + return x->point(); + } + }; + +protected: + + typedef CGAL::Iterator_project< + Vertex_handle_const_iterator, + internal::Triangulation::Point_from_vertex_handle + > Point_const_iterator; + + Point_const_iterator points_begin() const + { return Point_const_iterator(Base::vertices_begin()); } + Point_const_iterator points_end() const + { return Point_const_iterator(Base::vertices_end()); } +}; + +// FUNCTIONS THAT ARE NOT MEMBER FUNCTIONS: + +inline +std::istream & +operator>>(std::istream & is, No_full_cell_data &) +{ + return is; +} + +inline +std::ostream & +operator<<(std::ostream & os, const No_full_cell_data &) +{ + return os; +} + +template < typename TDS, typename Data, typename SSP > +std::ostream & +operator<<(std::ostream & O, const Triangulation_full_cell & s) +{ + /*if( is_ascii(O) ) + { + // os << '\n'; + } + else {}*/ + O << s.data(); + return O; +} + +template < typename TDS, typename Data, typename SSP > +std::istream & +operator>>(std::istream & I, Triangulation_full_cell & s) +{ + /*if( is_ascii(I) ) + {} + else {}*/ + I >> s.data(); + return I; +} + +} //namespace CGAL + +#endif // CGAL_TRIANGULATION_SIMPLEX_H -- cgit v1.2.3