This commit is contained in:
Andreas Fabri 2016-01-06 08:29:40 +01:00
parent 206420c77b
commit 220be3d365
5 changed files with 1 additions and 58 deletions

View File

@ -344,7 +344,7 @@ Specifically, this example constructs a Theta graph first and then calculates
the shortest paths on this graph by calling the Dijkstra's algorithm from BGL.
It mainly consists of the following steps:
1. Define `Exact_predicates_inexact_constructions_kernel_with_root_of` as the kernel type
1. Define `Exact_predicates_inexact_constructions_kernel` as the kernel type
to construct the graph inexactly.
2. Define a structure named `Edge_property` for storing the Euclidean length of each edge,
which is needed by the Dijkstra's algorithm.

View File

@ -1,54 +0,0 @@
/** @file compute_cones.cpp
* An example application that computes the cone boundaries given the number of cones
* and the initial direction.
*
* Authors: Weisheng Si and Quincy Tse, University of Western Sydney
*/
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <vector>
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_root_of.h>
#include <CGAL/Compute_cone_boundaries_2.h>
// select the kernel type
typedef CGAL::Exact_predicates_exact_constructions_kernel_with_root_of Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Direction_2 Direction_2;
int main(int argc, char ** argv) {
if (argc < 2) {
std::cout << "Usage: " << argv[0] << " <no. of cones> [<direction-x> <direction-y>]" << std::endl;
return 1;
}
unsigned long k = atol(argv[1]);
if (k<2) {
std::cout << "The number of cones should be larger than 1!" << std::endl;
return 1;
}
Direction_2 initial_direction;
if (argc == 2)
initial_direction = Direction_2(1, 0); // default initial_direction
else if (argc == 4)
initial_direction = Direction_2(atof(argv[2]), atof(argv[3]));
else {
std::cout << "Usage: " << argv[0] << " <no. of cones> [<direction-x> <direction-y>]" << std::endl;
return 1;
}
// construct the functor
CGAL::Compute_cone_boundaries_2<Kernel> cones;
// create the vector rays to store the results
std::vector<Direction_2> rays(k);
// compute the cone boundaries and store them in rays
cones(k, initial_direction, rays.begin());
// display the computed rays, starting from the initial direction, ccw order
for (int i=0; i<k; i++)
std::cout << "Ray " << i << ": " << rays[i] << std::endl;
return 0;
}

View File

@ -1 +0,0 @@
6 data/n20.cin

View File

@ -1 +0,0 @@
4 data/n9.cin