Gudhi  1.1.0
 All Classes Functions Typedefs Friends Groups Pages
Skeleton_blocker_geometric_complex.h
1  /* This file is part of the Gudhi Library. The Gudhi library
2  * (Geometric Understanding in Higher Dimensions) is a generic C++
3  * library for computational topology.
4  *
5  * Author(s): David Salinas
6  *
7  * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 #ifndef SKELETON_BLOCKER_GEOMETRIC_COMPLEX_H_
23 #define SKELETON_BLOCKER_GEOMETRIC_COMPLEX_H_
24 
25 
26 #include "gudhi/Utils.h"
27 #include "gudhi/Skeleton_blocker_simplifiable_complex.h"
28 #include "gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h"
29 
30 
31 
32 namespace Gudhi{
33 
34 namespace skbl {
35 
41 template<typename SkeletonBlockerGeometricDS>
43 {
44 public:
45  typedef typename SkeletonBlockerGeometricDS::GT GT;
46 
48 
51  typedef typename SimplifiableSkeletonblocker::Edge_handle Edge_handle;
53 
54 
56 
57  typedef typename SkeletonBlockerGeometricDS::Point Point;
58 
59 
65  (*this)[ad].point() = point;
66  return ad;
67  }
68 
69 
73  const Point& point(Vertex_handle v) const{
74  assert(this->contains_vertex(v));
75  return (*this)[v].point();
76  }
77 
81  Point& point(Vertex_handle v) {
82  assert(this->contains_vertex(v));
83  return (*this)[v].point();
84  }
85 
86  const Point& point(Root_vertex_handle global_v) const{
87  Vertex_handle local_v ( (*this)[global_v]) ;
88  assert(this->contains_vertex(local_v));
89  return (*this)[local_v].point();
90  }
91 
92  Point& point(Root_vertex_handle global_v) {
93  Vertex_handle local_v ( (*this)[global_v]) ;
94  assert(this->contains_vertex(local_v));
95  return (*this)[local_v].point();
96  }
97 
98 
99  typedef Skeleton_blocker_link_complex<Skeleton_blocker_geometric_complex> Geometric_link;
100 
104  Geometric_link link(const Simplex_handle& simplex) const{
105  Geometric_link link(*this,simplex);
106  //we now add the point info
107  add_points_to_link(link);
108  return link;
109  }
110 
115  Geometric_link link(*this,edge);
116  //we now add the point info
117  add_points_to_link(link);
118  return link;
119  }
120 private:
121  void add_points_to_link(Geometric_link& link) const{
122  for(Vertex_handle v : link.vertex_range()){
123  Root_vertex_handle v_root(link.get_id(v));
124  link.point(v) = (*this).point(v_root);
125  }
126  }
127 };
128 
129 }
130 
131 } // namespace GUDHI
132 
133 #endif /* SKELETON_BLOCKER_GEOMETRIC_COMPLEX_H_ */
Class that allows simplification operation on a simplicial complex represented by a skeleton/blockers...
Definition: Skeleton_blocker_simplifiable_complex.h:38
Vertex_handle add_vertex(const Point &point)
Add a vertex to the complex with its associated point.
Definition: Skeleton_blocker_geometric_complex.h:63
Geometric_link link(const Simplex_handle &simplex) const
Definition: Skeleton_blocker_geometric_complex.h:104
boost::graph_traits< Graph >::edge_descriptor Edge_handle
Handle to an edge of the complex.
Definition: Skeleton_blocker_complex.h:139
Class that represents a geometric complex that can be simplified. The class allows access to points o...
Definition: Skeleton_blocker_geometric_complex.h:42
GeometryTrait::Point Point
Definition: SkeletonBlockerGeometricDS.h:36
const Point & point(Vertex_handle v) const
Returns the Point associated to the vertex v.
Definition: Skeleton_blocker_geometric_complex.h:73
Point & point(Vertex_handle v)
Returns the Point associated to the vertex v.
Definition: Skeleton_blocker_geometric_complex.h:81
Vertex_handle add_vertex()
Adds a vertex to the simplicial complex and returns its Vertex_handle.
Definition: Skeleton_blocker_complex.h:443
Abstract simplex used in Skeleton blockers data-structure.
Definition: Skeleton_blocker_simplex.h:48
Definition: SkeletonBlockerDS.h:60
The type of vertices that are stored the boost graph. A Vertex must be Default Constructible and Equa...
Definition: SkeletonBlockerDS.h:72
GeometryTrait GT
Definition: SkeletonBlockerGeometricDS.h:31
Root_vertex_handle and Vertex_handle are similar to global and local vertex descriptor used in boost ...
Definition: SkeletonBlockerDS.h:50
Geometric_link link(Edge_handle edge) const
Definition: Skeleton_blocker_geometric_complex.h:114