summaryrefslogtreecommitdiff
path: root/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
diff options
context:
space:
mode:
authorsalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-01-26 12:45:45 +0000
committersalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-01-26 12:45:45 +0000
commit6b5cb7d8b2dc3c065eafc7a475be55319722ef09 (patch)
tree86d0af4329b33462f1ac3f9c8587a2335ef906c7 /src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
parentf47e9cba9ce535d1c71a71056858a6ee1503b3ab (diff)
skbl some cleaning
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@420 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 8dab1684f8a9b0987de5ed19863b8173cc71f2f4
Diffstat (limited to 'src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h')
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h173
1 files changed, 93 insertions, 80 deletions
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
index e2918901..095ebbdc 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
@@ -37,86 +37,99 @@ namespace skbl {
*/
template<typename SkeletonBlockerGeometricDS>
class Skeleton_blocker_geometric_complex :
- public Skeleton_blocker_simplifiable_complex<SkeletonBlockerGeometricDS> {
- public:
- typedef typename SkeletonBlockerGeometricDS::GT GT;
-
- typedef Skeleton_blocker_simplifiable_complex<SkeletonBlockerGeometricDS> SimplifiableSkeletonblocker;
-
- typedef typename SimplifiableSkeletonblocker::Vertex_handle Vertex_handle;
- typedef typename SimplifiableSkeletonblocker::Root_vertex_handle Root_vertex_handle;
- typedef typename SimplifiableSkeletonblocker::Edge_handle Edge_handle;
- typedef typename SimplifiableSkeletonblocker::Simplex_handle Simplex_handle;
-
- typedef typename SimplifiableSkeletonblocker::Graph_vertex Graph_vertex;
-
- typedef typename SkeletonBlockerGeometricDS::Point Point;
-
- /**
- * @brief Add a vertex to the complex with its associated point.
- */
- Vertex_handle add_vertex(const Point& point) {
- Vertex_handle ad = SimplifiableSkeletonblocker::add_vertex();
- (*this)[ad].point() = point;
- return ad;
- }
-
- /**
- * @brief Returns the Point associated to the vertex v.
- */
- const Point& point(Vertex_handle v) const {
- assert(this->contains_vertex(v));
- return (*this)[v].point();
- }
-
- /**
- * @brief Returns the Point associated to the vertex v.
- */
- Point& point(Vertex_handle v) {
- assert(this->contains_vertex(v));
- return (*this)[v].point();
- }
-
- const Point& point(Root_vertex_handle global_v) const {
- Vertex_handle local_v((*this)[global_v]);
- assert(this->contains_vertex(local_v));
- return (*this)[local_v].point();
- }
-
- Point& point(Root_vertex_handle global_v) {
- Vertex_handle local_v((*this)[global_v]);
- assert(this->contains_vertex(local_v));
- return (*this)[local_v].point();
- }
-
- typedef Skeleton_blocker_link_complex<Skeleton_blocker_geometric_complex> Geometric_link;
-
- /**
- * Constructs the link of 'simplex' with points coordinates.
- */
- Geometric_link link(const Simplex_handle& simplex) const {
- Geometric_link link(*this, simplex);
- // we now add the point info
- add_points_to_link(link);
- return link;
- }
-
- /**
- * Constructs the link of 'simplex' with points coordinates.
- */
- Geometric_link link(Edge_handle edge) const {
- Geometric_link link(*this, edge);
- // we now add the point info
- add_points_to_link(link);
- return link;
- }
- private:
- void add_points_to_link(Geometric_link& link) const {
- for (Vertex_handle v : link.vertex_range()) {
- Root_vertex_handle v_root(link.get_id(v));
- link.point(v) = (*this).point(v_root);
- }
- }
+ public Skeleton_blocker_simplifiable_complex<SkeletonBlockerGeometricDS> {
+ public:
+ typedef typename SkeletonBlockerGeometricDS::GT GT;
+
+ typedef Skeleton_blocker_simplifiable_complex<SkeletonBlockerGeometricDS> SimplifiableSkeletonblocker;
+
+ typedef typename SimplifiableSkeletonblocker::Vertex_handle Vertex_handle;
+ typedef typename SimplifiableSkeletonblocker::Root_vertex_handle Root_vertex_handle;
+ typedef typename SimplifiableSkeletonblocker::Edge_handle Edge_handle;
+ typedef typename SimplifiableSkeletonblocker::Simplex_handle Simplex_handle;
+
+ typedef typename SimplifiableSkeletonblocker::Graph_vertex Graph_vertex;
+
+ typedef typename SkeletonBlockerGeometricDS::Point Point;
+
+ /**
+ * @brief Add a vertex to the complex with its associated point.
+ */
+ Vertex_handle add_vertex(const Point& point) {
+ Vertex_handle ad = SimplifiableSkeletonblocker::add_vertex();
+ (*this)[ad].point() = point;
+ return ad;
+ }
+
+ /**
+ * @brief Returns the Point associated to the vertex v.
+ */
+ const Point& point(Vertex_handle v) const {
+ assert(this->contains_vertex(v));
+ return (*this)[v].point();
+ }
+
+ /**
+ * @brief Returns the Point associated to the vertex v.
+ */
+ Point& point(Vertex_handle v) {
+ assert(this->contains_vertex(v));
+ return (*this)[v].point();
+ }
+
+ const Point& point(Root_vertex_handle global_v) const {
+ Vertex_handle local_v((*this)[global_v]);
+ assert(this->contains_vertex(local_v));
+ return (*this)[local_v].point();
+ }
+
+ Point& point(Root_vertex_handle global_v) {
+ Vertex_handle local_v((*this)[global_v]);
+ assert(this->contains_vertex(local_v));
+ return (*this)[local_v].point();
+ }
+
+ typedef Skeleton_blocker_link_complex<Skeleton_blocker_geometric_complex> Geometric_link;
+
+
+ /**
+ * Constructs the link of 'simplex' with points coordinates.
+ */
+ Geometric_link link(Vertex_handle v) const {
+ Geometric_link link(*this, Simplex_handle(v));
+ // we now add the point info
+ add_points_to_link(link);
+ return link;
+ }
+
+
+ /**
+ * Constructs the link of 'simplex' with points coordinates.
+ */
+ Geometric_link link(const Simplex_handle& simplex) const {
+ Geometric_link link(*this, simplex);
+ // we now add the point info
+ add_points_to_link(link);
+ return link;
+ }
+
+ /**
+ * Constructs the link of 'simplex' with points coordinates.
+ */
+ Geometric_link link(Edge_handle edge) const {
+ Geometric_link link(*this, edge);
+ // we now add the point info
+ add_points_to_link(link);
+ return link;
+ }
+
+ private:
+ void add_points_to_link(Geometric_link& link) const {
+ for (Vertex_handle v : link.vertex_range()) {
+ Root_vertex_handle v_root(link.get_id(v));
+ link.point(v) = (*this).point(v_root);
+ }
+ }
};
} // namespace skbl