summaryrefslogtreecommitdiff
path: root/src/Alpha_complex/example/traits_test.cpp
blob: 4402ecf32ec6c7c8a9ca1609fa2397bc2f3b907f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <gudhi/Alpha_complex_3d.h>

#include <iostream>
#include <string>
#include <vector>
#include <limits>  // for numeric limits

void usage(int nbArgs, char * const progName) {
  std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n";
  std::cerr << "Usage: " << progName << " [alpha_square_max_value]\n";
  std::cerr << "       i.e.: " << progName << " 60.0\n";
  exit(-1);  // ----- >>
}

int main(int argc, char **argv) {
  //if ((argc != 1) && (argc != 2)) usage(argc, (argv[0] - 1));

  using Alpha_shapes_3d = Gudhi::alpha_complex::Alpha_shapes_3d;
  std::vector<Alpha_shapes_3d::Point_3> points;
  points.push_back(Alpha_shapes_3d::Point_3(1., 2., 3.));
  points.push_back(Alpha_shapes_3d::Point_3(6., 5., 4.));

  Gudhi::alpha_complex::Alpha_complex_3d<Alpha_shapes_3d> alpha_complex(points);

  using Weighted_alpha_shapes_3d = Gudhi::alpha_complex::Weighted_alpha_shapes_3d;
  std::vector<Weighted_alpha_shapes_3d::Point_3> w_points;
  w_points.push_back(Alpha_shapes_3d::Point_3(1., 2., 3.));
  w_points.push_back(Alpha_shapes_3d::Point_3(6., 5., 4.));

  std::vector<double> weights = {1., 2.};

  Gudhi::alpha_complex::Alpha_complex_3d<Weighted_alpha_shapes_3d> weighted_alpha_complex(points, weights);

  using Periodic_alpha_shapes_3d = Gudhi::alpha_complex::Periodic_alpha_shapes_3d;
  std::vector<Periodic_alpha_shapes_3d::Point_3> p_points;
  p_points.push_back(Alpha_shapes_3d::Point_3(1., 2., 3.));
  p_points.push_back(Alpha_shapes_3d::Point_3(6., 5., 4.));

  Gudhi::alpha_complex::Alpha_complex_3d<Periodic_alpha_shapes_3d> periodic_alpha_complex(points,
                                                                                          0., 0., 0.,
                                                                                          1., 1., 1.);

  return 0;
}