summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker/concept
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2014-12-05 13:32:54 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2014-12-05 13:32:54 +0000
commit425b462d361286822ee0ed7b5fe00881ba312ea3 (patch)
treee8f641a8604418882b916573cf32c87b78d33472 /src/Skeleton_blocker/concept
parent952b77f3b1e2415602d5d9ffc2fb7ff45cc3edc4 (diff)
Moved into trunk
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@341 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Diffstat (limited to 'src/Skeleton_blocker/concept')
-rw-r--r--src/Skeleton_blocker/concept/SkeletonBlockerDS.h127
-rw-r--r--src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h65
2 files changed, 192 insertions, 0 deletions
diff --git a/src/Skeleton_blocker/concept/SkeletonBlockerDS.h b/src/Skeleton_blocker/concept/SkeletonBlockerDS.h
new file mode 100644
index 00000000..1fa9dc06
--- /dev/null
+++ b/src/Skeleton_blocker/concept/SkeletonBlockerDS.h
@@ -0,0 +1,127 @@
+/*
+ * SkeletonBlockerDS.h
+ *
+ * Created on: Feb 20, 2014
+ * Author: David Salinas
+ * Copyright 2013 INRIA. All rights reserved
+ */
+
+#ifndef GUDHI_SKELETONBLOCKERDS_H_
+#define GUDHI_SKELETONBLOCKERDS_H_
+
+
+namespace Gudhi {
+
+namespace skbl {
+
+
+
+/** \brief Concept that must be passed to
+ * the template class Skeleton_blockers_complex
+ *
+ */
+struct SkeletonBlockerDS
+{
+ /**
+ * @todo faire un default value pour les vertex_handle
+ */
+
+ /**
+ * @brief index that allows to find the vertex in the boost graph
+ */
+ typedef int boost_vertex_handle;
+
+
+ /**
+ * @brief Root_vertex_handle and Vertex_handle are similar to global and local vertex descriptor
+ * used in <a href="http://www.boost.org/doc/libs/1_38_0/libs/graph/doc/subgraph.html">boost subgraphs</a>
+ * and allow to localize a vertex of a subcomplex on its parent root complex.
+ *
+ * In gross, vertices are stored in a vector
+ * and the Root_vertex_handle and Vertex_handle store indices of a vertex in this vector.
+ *
+ * For the root simplicial complex, the Root_vertex_handle and Vertex_handle of a vertex
+ * are the same.
+ *
+ *
+ * For a subcomplex L of a simplicial complex K, the local descriptor, ie the Vertex_handle, of a
+ * vertex v (that belongs to L) is its position in the vector of vertices
+ * of the subcomplex L whereas its Root_vertex_handle (global descriptor) is the position of v in the vector of the
+ * vertices of the root simplicial complex K.
+ */
+ struct Root_vertex_handle{
+
+ boost_vertex_handle vertex;
+
+ friend ostream& operator << (ostream& o, const Root_vertex_handle & v);
+ };
+
+ /**
+ * A Vertex_handle must be Default Constructible, Assignable and Equality Comparable.
+ */
+ struct Vertex_handle{
+ boost_vertex_handle vertex;
+
+ friend ostream& operator << (ostream& o, const Vertex_handle & v);
+ };
+
+
+ /**
+ * \brief The type of vertices that are stored the boost graph.
+ * A Vertex must be Default Constructible and Equality Comparable.
+ *
+ */
+ struct Graph_vertex{
+ /** \brief Used to deactivate a vertex for example when contracting an edge.
+ * It allows in some cases to remove the vertex at low cost.
+ */
+ void deactivate();
+
+ /** \brief Used to activate a vertex.
+ */
+ void activate();
+
+ /** \brief Tells if the vertex is active.
+ */
+ bool is_active() const;
+
+ void set_id(Root_vertex_handle i);
+ Root_vertex_handle get_id() const;
+ virtual string to_string() const ;
+ friend ostream& operator << (ostream& o, const Graph_vertex & v);
+ };
+
+
+ /**
+ * \brief The type of edges that are stored the boost graph.
+ * An Edge must be Default Constructible and Equality Comparable.
+ */
+ struct Graph_edge{
+ /**
+ * @brief Allows to modify vertices of the edge.
+ */
+ void setId(Root_vertex_handle a,Root_vertex_handle b);
+
+ /**
+ * @brief Returns the first vertex of the edge.
+ */
+ Root_vertex_handle first() const ;
+
+ /**
+ * @brief Returns the second vertex of the edge.
+ */
+ Root_vertex_handle second() const ;
+
+ friend ostream& operator << (ostream& o, const Simple_edge & v);
+ };
+
+
+};
+
+
+
+} // namespace skbl
+} // namespace GUDHI
+
+
+#endif /* GUDHI_SKELETONBLOCKERDS_H_ */
diff --git a/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h
new file mode 100644
index 00000000..23edaaef
--- /dev/null
+++ b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h
@@ -0,0 +1,65 @@
+/*
+ * SkeletonBlockerGeometricDS.h
+ *
+ * Created on: Feb 20, 2014
+ * Author: David Salinas
+ * Copyright 2013 INRIA. All rights reserved
+ */
+
+#ifndef GUDHI_SKELETONBLOCKERGEOMETRICDS_H_
+#define GUDHI_SKELETONBLOCKERGEOMETRICDS_H_
+
+/** \brief Concept that must be passed to
+ * the template class Skeleton_blocker_geometric_complex
+ *
+ */
+template<typename GeometryTrait>
+struct SkeletonBlockerGeometricDS : public SkeletonBlockerDS
+{
+
+ /**
+ * Geometry information.
+ */
+ typedef GeometryTrait GT ;
+
+ /**
+ * Type of point (should be the same as GT::Point).
+ */
+ typedef typename GeometryTrait::Point Point;
+
+ /**
+ * @brief Vertex that stores a point.
+ */
+ class Graph_vertex : public SkeletonBlockerDS::Graph_vertex{
+ public:
+ /**
+ * @brief Access to the point.
+ */
+ Point& point(){ return point_; }
+ /**
+ * @brief Access to the point.
+ */
+ const Point& point() const { return point_; }
+ };
+
+ /**
+ * @brief Edge that allows to access to an index.
+ * The indices of the edges are used to store heap information
+ * in the edge contraction algorithm.
+ */
+ class Graph_Edge : public SkeletonBlockerDS::Graph_edge{
+ public:
+ /**
+ * @brief Access to the index.
+ */
+ int& index();
+ /**
+ * @brief Access to the index.
+ */
+ int index();
+ };
+};
+
+
+
+#endif /* GUDHI_SKELETONBLOCKERGEOMETRICDS_H_ */