Skeleton_blocker_complex_visitor.h
1 /* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
2  * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
3  * Author(s): David Salinas
4  *
5  * Copyright (C) 2014 Inria
6  *
7  * Modification(s):
8  * - YYYY/MM Author: Description of the modification
9  */
10 
11 #ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_COMPLEX_VISITOR_H_
12 #define SKELETON_BLOCKER_SKELETON_BLOCKER_COMPLEX_VISITOR_H_
13 
14 #include <gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h>
15 
16 namespace Gudhi {
17 
18 namespace skeleton_blocker {
19 // TODO(DS): to be constified
20 
25 template<typename Vertex_handle>
27  public:
29 
30  virtual void on_add_vertex(Vertex_handle) = 0;
31  virtual void on_remove_vertex(Vertex_handle) = 0;
32 
33  virtual void on_add_edge_without_blockers(Vertex_handle a, Vertex_handle b) = 0;
34  virtual void on_remove_edge(Vertex_handle a, Vertex_handle b) = 0;
35 
40  virtual void on_changed_edge(Vertex_handle a, Vertex_handle b) = 0;
41 
50  virtual void on_swaped_edge(Vertex_handle a, Vertex_handle b,
51  Vertex_handle x) = 0;
52  virtual void on_add_blocker(
54  virtual void on_delete_blocker(
56 };
57 
63 template<typename Vertex_handle>
65 Vertex_handle> {
66  public:
67  void on_add_vertex(Vertex_handle) { }
68 
69  void on_remove_vertex(Vertex_handle) { }
70 
71  void on_add_edge_without_blockers(Vertex_handle a, Vertex_handle b) { }
72 
73  void on_remove_edge(Vertex_handle a, Vertex_handle b) { }
74 
76 
78 
79  void on_add_blocker(const Skeleton_blocker_simplex<Vertex_handle>&) { }
80 
81  void on_delete_blocker(const Skeleton_blocker_simplex<Vertex_handle>*) { }
82 };
83 
89 template<typename Vertex_handle>
91 Vertex_handle> {
92  public:
93  void on_add_vertex(Vertex_handle v) {
94  std::cerr << "on_add_vertex:" << v << std::endl;
95  }
96 
97  void on_remove_vertex(Vertex_handle v) {
98  std::cerr << "on_remove_vertex:" << v << std::endl;
99  }
100 
101  void on_add_edge_without_blockers(Vertex_handle a, Vertex_handle b) {
102  std::cerr << "on_add_edge_without_blockers:" << a << "," << b << std::endl;
103  }
104 
105  void on_remove_edge(Vertex_handle a, Vertex_handle b) {
106  std::cerr << "on_remove_edge:" << a << "," << b << std::endl;
107  }
108 
110  std::cerr << "on_changed_edge:" << a << "," << b << std::endl;
111  }
112 
114  std::cerr << "on_swaped_edge:" << a << "," << b << "," << x << std::endl;
115  }
116 
117  void on_add_blocker(const Skeleton_blocker_simplex<Vertex_handle>& b) {
118  std::cerr << "on_add_blocker:" << b << std::endl;
119  }
120 
121  void on_delete_blocker(const Skeleton_blocker_simplex<Vertex_handle>* b) {
122  std::cerr << "on_delete_blocker:" << b << std::endl;
123  }
124 };
125 
126 } // namespace skeleton_blocker
127 
128 namespace skbl = skeleton_blocker;
129 
130 } // namespace Gudhi
131 
132 #endif // SKELETON_BLOCKER_SKELETON_BLOCKER_COMPLEX_VISITOR_H_
A visitor that prints the visit information.
Definition: Skeleton_blocker_complex_visitor.h:90
Abstract simplex used in Skeleton blockers data-structure.
Definition: Skeleton_blocker_simplex.h:38
Definition: SimplicialComplexForAlpha.h:14
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:113
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:75
A dummy visitor of a simplicial complex that does nothing.
Definition: Skeleton_blocker_complex_visitor.h:64
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:26
Handle type for the vertices of a cell complex.
Definition: VertexHandle.h:15
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:109
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:77
GUDHI  Version 3.3.0  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : MIT Generated on Tue Aug 11 2020 11:09:13 for GUDHI by Doxygen 1.8.13