summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-09-16 12:39:00 +0200
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-09-16 12:39:00 +0200
commitcb68f3e4c8ce7724ccb693e5c67dd9928d12d84b (patch)
treec3343bc8ea6b48c3e6727085b4558f71b706ab2c
parentd6f68d20e975e0cd530cd15ca5f7f782550e6af4 (diff)
Some documentation about weighted dD Alpha complex. Make examples 3d/dD consistents
-rw-r--r--src/Alpha_complex/doc/Intro_alpha_complex.h35
-rw-r--r--src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp4
-rw-r--r--src/Alpha_complex/example/Weighted_alpha_complex_from_points.cpp16
-rw-r--r--src/Alpha_complex/example/weightedalpha3dfrompoints_for_doc.txt4
4 files changed, 45 insertions, 14 deletions
diff --git a/src/Alpha_complex/doc/Intro_alpha_complex.h b/src/Alpha_complex/doc/Intro_alpha_complex.h
index 60da7169..f14adee6 100644
--- a/src/Alpha_complex/doc/Intro_alpha_complex.h
+++ b/src/Alpha_complex/doc/Intro_alpha_complex.h
@@ -22,6 +22,17 @@ namespace alpha_complex {
*
* @{
*
+<div class="toc">
+Table of Contents
+<ul>
+<li class="level1"><a href="#definition">Definition</a></li>
+<li class="level1"><a href="#pointsexample">Example from points</a></li>
+<li class="level1"><a href="#createcomplexalgorithm">Create complex algorithm</a></li>
+<li class="level1"><a href="#offexample">Example from OFF file</a></li>
+<li class="level1"><a href="#weighted3dexample">3d specific version</a></li>
+</ul>
+</div>
+
* \section definition Definition
*
* Alpha_complex is a <a target="_blank" href="https://en.wikipedia.org/wiki/Simplicial_complex">simplicial complex</a>
@@ -146,6 +157,28 @@ namespace alpha_complex {
* `SimplicialComplexForAlpha::prune_above_filtration()`).
* In the following example, the value is given by the user as argument of the program.
*
+ * \section weightedversion Weighted specific version
+ * <b>Requires:</b> \ref eigen &ge; 3.1.0 and \ref cgal &ge; 5.1.0.
+ * For performances reasons, it is advised to use \ref eigen &ge; 3.5.8 and \ref cgal &ge; 5.2.0
+ * A weighted version for Alpha complex is available (cf. Alpha_complex).
+ *
+ * This example builds the CGAL weighted alpha shapes from a small molecule, and initializes the alpha complex with
+ * it. This example is taken from <a href="https://doc.cgal.org/latest/Alpha_shapes_3/index.html#title13">CGAL 3d
+ * weighted alpha shapes</a>.
+ *
+ * Then, it is asked to display information about the alpha complex.
+ *
+ * \include Alpha_complex/Weighted_alpha_complex_from_points.cpp
+ *
+ * When launching:
+ *
+ * \code $> ./Weighted_alpha_complex_example_from_points
+ * \endcode
+ *
+ * the program output is:
+ *
+ * \include Alpha_complex/weightedalpha3dfrompoints_for_doc.txt
+ *
*
* \section offexample Example from OFF file
*
@@ -166,7 +199,7 @@ namespace alpha_complex {
* \include Alpha_complex/alphaoffreader_for_doc_32.txt
*
*
- * \section weighted3dexample 3d specific example
+ * \section weighted3dexample 3d specific version
*
* A specific module for Alpha complex is available in 3d (cf. Alpha_complex_3d) and allows to construct standard,
* weighted, periodic or weighted and periodic versions of alpha complexes. Alpha values computation can be
diff --git a/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp b/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp
index c044194e..74f0cf30 100644
--- a/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp
+++ b/src/Alpha_complex/example/Weighted_alpha_complex_3d_from_points.cpp
@@ -34,10 +34,10 @@ int main(int argc, char **argv) {
// ----------------------------------------------------------------------------
// Display information about the alpha complex
// ----------------------------------------------------------------------------
- std::clog << "Alpha complex is of dimension " << simplex.dimension() << " - " << simplex.num_simplices()
+ std::clog << "Weighted alpha complex is of dimension " << simplex.dimension() << " - " << simplex.num_simplices()
<< " simplices - " << simplex.num_vertices() << " vertices." << std::endl;
- std::clog << "Iterator on alpha complex simplices in the filtration order, with [filtration value]:" << std::endl;
+ std::clog << "Iterator on weighted alpha complex simplices in the filtration order, with [filtration value]:" << std::endl;
for (auto f_simplex : simplex.filtration_simplex_range()) {
std::clog << " ( ";
for (auto vertex : simplex.simplex_vertex_range(f_simplex)) {
diff --git a/src/Alpha_complex/example/Weighted_alpha_complex_from_points.cpp b/src/Alpha_complex/example/Weighted_alpha_complex_from_points.cpp
index 19a04282..d49d3e93 100644
--- a/src/Alpha_complex/example/Weighted_alpha_complex_from_points.cpp
+++ b/src/Alpha_complex/example/Weighted_alpha_complex_from_points.cpp
@@ -8,23 +8,21 @@
#include <vector>
// Explicit dimension 2 Epeck_d kernel
-using Kernel = CGAL::Epeck_d< CGAL::Dimension_tag<2> >;
+using Kernel = CGAL::Epeck_d< CGAL::Dimension_tag<3> >;
using Bare_point = Kernel::Point_d;
using Weighted_point = Kernel::Weighted_point_d;
using Vector_of_points = std::vector<Weighted_point>;
int main() {
// ----------------------------------------------------------------------------
- // Init of a list of points
+ // Init of a list of points and weights from a small molecule
// ----------------------------------------------------------------------------
Vector_of_points points;
- points.push_back(Weighted_point(Bare_point(1.0, 1.0) , 1.));
- points.push_back(Weighted_point(Bare_point(7.0, 0.0) , 1.));
- points.push_back(Weighted_point(Bare_point(4.0, 6.0) , 1.));
- points.push_back(Weighted_point(Bare_point(9.0, 6.0) , 1.));
- points.push_back(Weighted_point(Bare_point(0.0, 14.0), 1.));
- points.push_back(Weighted_point(Bare_point(2.0, 19.0), 1.));
- points.push_back(Weighted_point(Bare_point(9.0, 17.0), 1.));
+ points.push_back(Weighted_point(Bare_point(1, -1, -1), 4.));
+ points.push_back(Weighted_point(Bare_point(-1, 1, -1), 4.));
+ points.push_back(Weighted_point(Bare_point(-1, -1, 1), 4.));
+ points.push_back(Weighted_point(Bare_point(1, 1, 1), 4.));
+ points.push_back(Weighted_point(Bare_point(2, 2, 2), 1.));
// ----------------------------------------------------------------------------
// Init of an alpha complex from the list of points
diff --git a/src/Alpha_complex/example/weightedalpha3dfrompoints_for_doc.txt b/src/Alpha_complex/example/weightedalpha3dfrompoints_for_doc.txt
index 7a09998d..f0695f1a 100644
--- a/src/Alpha_complex/example/weightedalpha3dfrompoints_for_doc.txt
+++ b/src/Alpha_complex/example/weightedalpha3dfrompoints_for_doc.txt
@@ -1,5 +1,5 @@
-Alpha complex is of dimension 3 - 29 simplices - 5 vertices.
-Iterator on alpha complex simplices in the filtration order, with [filtration value]:
+Weighted alpha complex is of dimension 3 - 29 simplices - 5 vertices.
+Iterator on weighted alpha complex simplices in the filtration order, with [filtration value]:
( 0 ) -> [-4]
( 1 ) -> [-4]
( 2 ) -> [-4]