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_face.h | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 src/common/include/gudhi_patches/CGAL/Triangulation_face.h (limited to 'src/common/include/gudhi_patches/CGAL/Triangulation_face.h') diff --git a/src/common/include/gudhi_patches/CGAL/Triangulation_face.h b/src/common/include/gudhi_patches/CGAL/Triangulation_face.h new file mode 100644 index 00000000..bc9c1781 --- /dev/null +++ b/src/common/include/gudhi_patches/CGAL/Triangulation_face.h @@ -0,0 +1,111 @@ +// 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_FACE_H +#define CGAL_TRIANGULATION_FACE_H + +#include +#include + +namespace CGAL { + +template< typename TDS > +class Triangulation_face +{ + typedef typename internal::Dimen_plus_one::type Dimen_plus; +public: + typedef TDS Triangulation_data_structure; + typedef typename TDS::Full_cell_handle Full_cell_handle; /* Concept */ + typedef typename TDS::Vertex_handle Vertex_handle; /* Concept */ + typedef internal::S_or_D_array Indices; + +protected: + Full_cell_handle full_cell_; + Indices indices_; + +public: + explicit Triangulation_face(Full_cell_handle s) /* Concept */ + : full_cell_(s), indices_(s->maximal_dimension()+2) + { + CGAL_assertion( Full_cell_handle() != s ); + clear(); + } + + explicit Triangulation_face(const int maximal_dim) /* Concept */ + : full_cell_(), indices_(maximal_dim+2) + { + clear(); + } + + Triangulation_face(const Triangulation_face & f) /* Concept */ + : full_cell_(f.full_cell_), indices_(f.indices_) + {} + + int face_dimension() const /* Concept */ + { + int i(0); + while( -1 != indices_[i] ) ++i; + return (i-1); + } + + Full_cell_handle full_cell() const /* Concept */ + { + return full_cell_; + } + + int index(const int i) const /* Concept */ + { + CGAL_precondition( (0 <= i) && (i <= face_dimension()) ); + return indices_[i]; + } + + Vertex_handle vertex(const int i) const /* Concept */ + { + int j = index(i); + if( j == -1 ) + return Vertex_handle(); + return full_cell()->vertex(j); + } + +// - - - - - - - - - - - - - - - - - - UPDATE FUNCTIONS + + void clear() /* Concept */ + { + const std::size_t d = indices_.size(); + for(std::size_t i = 0; i < d; ++i ) + indices_[i] = -1; + } + + void set_full_cell(Full_cell_handle s) /* Concept */ + { + CGAL_precondition( Full_cell_handle() != s ); + full_cell_ = s; + } + + void set_index(const int i, const int idx) /* Concept */ + { + CGAL_precondition( (0 <= i) && ((size_t)i+1 < indices_.size()) ); + CGAL_precondition( (0 <= idx) && ((size_t)idx < indices_.size()) ); + indices_[i] = idx; + } +}; + +} //namespace CGAL + +#endif // CGAL_TRIANGULATION_FACE_H -- cgit v1.2.3