Skeleton_blocker_complex_visitor.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
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 
23 #ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_COMPLEX_VISITOR_H_
24 #define SKELETON_BLOCKER_SKELETON_BLOCKER_COMPLEX_VISITOR_H_
25 
26 #include <gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h>
27 
28 namespace Gudhi {
29 
30 namespace skeleton_blocker {
31 // TODO(DS): to be constified
32 
37 template<typename Vertex_handle>
39  public:
41 
42  virtual void on_add_vertex(Vertex_handle) = 0;
43  virtual void on_remove_vertex(Vertex_handle) = 0;
44 
45  virtual void on_add_edge_without_blockers(Vertex_handle a, Vertex_handle b) = 0;
46  virtual void on_remove_edge(Vertex_handle a, Vertex_handle b) = 0;
47 
52  virtual void on_changed_edge(Vertex_handle a, Vertex_handle b) = 0;
53 
62  virtual void on_swaped_edge(Vertex_handle a, Vertex_handle b,
63  Vertex_handle x) = 0;
64  virtual void on_add_blocker(
66  virtual void on_delete_blocker(
68 };
69 
75 template<typename Vertex_handle>
77 Vertex_handle> {
78  public:
79  void on_add_vertex(Vertex_handle) { }
80 
81  void on_remove_vertex(Vertex_handle) { }
82 
83  void on_add_edge_without_blockers(Vertex_handle a, Vertex_handle b) { }
84 
85  void on_remove_edge(Vertex_handle a, Vertex_handle b) { }
86 
87  void on_changed_edge(Vertex_handle a, Vertex_handle b) { }
88 
89  void on_swaped_edge(Vertex_handle a, Vertex_handle b, Vertex_handle x) { }
90 
91  void on_add_blocker(const Skeleton_blocker_simplex<Vertex_handle>&) { }
92 
93  void on_delete_blocker(const Skeleton_blocker_simplex<Vertex_handle>*) { }
94 };
95 
101 template<typename Vertex_handle>
103 Vertex_handle> {
104  public:
105  void on_add_vertex(Vertex_handle v) {
106  std::cerr << "on_add_vertex:" << v << std::endl;
107  }
108 
109  void on_remove_vertex(Vertex_handle v) {
110  std::cerr << "on_remove_vertex:" << v << std::endl;
111  }
112 
113  void on_add_edge_without_blockers(Vertex_handle a, Vertex_handle b) {
114  std::cerr << "on_add_edge_without_blockers:" << a << "," << b << std::endl;
115  }
116 
117  void on_remove_edge(Vertex_handle a, Vertex_handle b) {
118  std::cerr << "on_remove_edge:" << a << "," << b << std::endl;
119  }
120 
121  void on_changed_edge(Vertex_handle a, Vertex_handle b) {
122  std::cerr << "on_changed_edge:" << a << "," << b << std::endl;
123  }
124 
125  void on_swaped_edge(Vertex_handle a, Vertex_handle b, Vertex_handle x) {
126  std::cerr << "on_swaped_edge:" << a << "," << b << "," << x << std::endl;
127  }
128 
129  void on_add_blocker(const Skeleton_blocker_simplex<Vertex_handle>& b) {
130  std::cerr << "on_add_blocker:" << b << std::endl;
131  }
132 
133  void on_delete_blocker(const Skeleton_blocker_simplex<Vertex_handle>* b) {
134  std::cerr << "on_delete_blocker:" << b << std::endl;
135  }
136 };
137 
138 } // namespace skeleton_blocker
139 
140 namespace skbl = skeleton_blocker;
141 
142 } // namespace Gudhi
143 
144 #endif // SKELETON_BLOCKER_SKELETON_BLOCKER_COMPLEX_VISITOR_H_
A visitor that prints the visit information.
Definition: Skeleton_blocker_complex_visitor.h:102
Abstract simplex used in Skeleton blockers data-structure.
Definition: Skeleton_blocker_simplex.h:50
Definition: SimplicialComplexForAlpha.h:26
void on_swaped_edge(Vertex_handle a, Vertex_handle b, Vertex_handle x)
Called when performing an edge contraction when an edge bx is replaced by an edge ax (not already pre...
Definition: Skeleton_blocker_complex_visitor.h:125
void on_changed_edge(Vertex_handle a, Vertex_handle b)
Called when an edge changes, during the contraction of an edge.
Definition: Skeleton_blocker_complex_visitor.h:87
A dummy visitor of a simplicial complex that does nothing.
Definition: Skeleton_blocker_complex_visitor.h:76
virtual void on_swaped_edge(Vertex_handle a, Vertex_handle b, Vertex_handle x)=0
Called when performing an edge contraction when an edge bx is replaced by an edge ax (not already pre...
Interface for a visitor of a simplicial complex.
Definition: Skeleton_blocker_complex_visitor.h:38
virtual void on_changed_edge(Vertex_handle a, Vertex_handle b)=0
Called when an edge changes, during the contraction of an edge.
void on_changed_edge(Vertex_handle a, Vertex_handle b)
Called when an edge changes, during the contraction of an edge.
Definition: Skeleton_blocker_complex_visitor.h:121
void on_swaped_edge(Vertex_handle a, Vertex_handle b, Vertex_handle x)
Called when performing an edge contraction when an edge bx is replaced by an edge ax (not already pre...
Definition: Skeleton_blocker_complex_visitor.h:89
GUDHI  Version 2.2.0  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : GPL v3 Generated on Thu Jun 14 2018 15:00:54 for GUDHI by Doxygen 1.8.13