/usr/include/tulip/Delaunay.h is in libtulip-dev 3.1.2-2.3ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | //-*-c++-*-
/**
Authors: David Auber, Patrick Mary, Morgan Mathiaut
from the LaBRI Visualization Team
Email : auber@tulip-software.org
Last modification : 13/03/2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
#ifndef TLP_GEO_DELAUNAY_H
#define TLP_GEO_DELAUNAY_H
#include <vector>
#include <tulip/Coord.h>
#include <tulip/Node.h>
namespace tlp {
template<typename TYPE>
class MutableContainer;
/**
* \addtogroup basic
*/
/*@{*/
/**
* \brief functions for Delaunay Triangulations
*
* Used to triangulate a set of points in the plane
*
* \author : David Auber/Daniel Archambault : auber@tulip-software.org
*
* \version 0.0.1 02/06/2005
*/
/**
* Compute the delaunay triangulation and return the set of edges of the
* triangulation in the vector edges. Edges are defined using a pair of
* indexes into the original set
* of points.
*/
TLP_SCOPE void delaunayTriangulation (const std::vector<Coord> &points,
std::vector<std::pair<unsigned int, unsigned int> > &edges);
/**
* Compute the delaunay triangulation and return the set of triangles of the
* triangulation in the vector triangles. Triangles are defined using a
* triple indexes into the original
* set of points.
*/
void delaunayTriangulation (const std::vector<Coord> &points,
std::vector<tlp::Array<unsigned int, 3> > &triangles);
/**
* Compute the delaunay triangulation and return the set of edges in the
* vector edge and triangles of the triangulation in the vector triangles.
* Triangles are defined using a triple indexes into the original
* set of points.
*/
void delaunayTriangulation (const std::vector<Coord> &points,
std::vector<std::pair<unsigned int, unsigned int> > &edges,
std::vector< tlp::Array<unsigned int, 3> > &triangles);
class VoronoiDiagram {
public:
//A voronoi vertex.
typedef Coord Vertex;
//a edge with endpoints p1 and p2
class Edge {
public:
unsigned int p1;
unsigned int p2;
};
//a ray with endpoint p and vector v.
class Ray {
public:
unsigned int p;
Coord v;
};
//A counterclockwise cell with zero or two rays. Vertices
//are voronoi vertices
class Cell {
public:
std::vector<unsigned int> vertices;
std::vector<unsigned int> rays;
inline bool hasRays () { return !rays.empty(); }
};
//Stores listst of each of these types defining the voronoi diagram
std::vector<Vertex> vertices;
std::vector<Edge> edges;
std::vector<Ray> rays;
std::vector<Cell> cells;
};
/**
* Compute the voronoi diagram of a set of points. The set of input
* points are given in points. The resultant voronoi diagram is returned
* in voronoiDiagram. It automatically computes the set of all voronoi
* vertices, rays, and returns the set of cells in counterclockwise order.
* If a voronoi edge list is required set returnVoronoiEdgeList to true.
*/
void voronoiDiagram (const std::vector<Coord> &points,
VoronoiDiagram &voronoiDiagram,
bool returnVoronoiEdgeList = false);
/*@}*/
}
#endif
|