11#ifndef EASY3D_ALGO_DELAUNAY_2D_H
12#define EASY3D_ALGO_DELAUNAY_2D_H
14#include <easy3d/algo/delaunay.h>
52 set_vertices(
static_cast<unsigned int>(vertices.size()), vertices[0]);
128 triangulateio *triangle_out_;
129 triangulateio *triangle_in_;
void set_vertices(const std::vector< vec2 > &vertices)
Sets the vertices from an array of 2D points.
Definition delaunay_2d.h:51
int tri_adjacent(unsigned int t, unsigned int le) const
Returns the index of the triangle adjacent to the le-th edge of the t-th triangle.
Definition delaunay_2d.h:123
unsigned int nb_triangles() const
Returns the number of triangles.
Definition delaunay_2d.h:105
const vec2 & vertex(unsigned int i) const
Returns the coordinates of the vertex with index i.
Definition delaunay_2d.h:78
int tri_vertex(unsigned int t, unsigned int lv) const
Returns the index of the lv-th vertex in the t-th triangle.
Definition delaunay_2d.h:113
const int * tri_to_tri() const
Returns the pointer to the triangle-to-triangle mapping.
Definition delaunay_2d.h:92
unsigned int nearest_vertex(const vec2 &p) const
Finds the index of the nearest vertex to a given 2D point.
Definition delaunay_2d.h:69
void set_vertices(unsigned int nb_vertices, const float *pts) override
Sets the vertices from an array of floating point numbers, in which each consecutive number pair deno...
Definition delaunay_2d.cpp:62
int vertex_tri(int v) const
Returns the index of a triangle containing the vertex v.
Definition delaunay_2d.h:99
unsigned int nearest_vertex(const float *p) const override
Finds the index of the nearest vertex to a given point.
Definition delaunay_2d.h:60
Delaunay2()
Default constructor.
Definition delaunay_2d.cpp:47
~Delaunay2() override
Destructor.
Definition delaunay_2d.cpp:55
const int * tri_to_v() const
Returns the pointer to the triangle-to-vertex mapping.
Definition delaunay_2d.h:86
const int * cell_to_cell() const
Returns a pointer to the cell-to-cell mapping.
Definition delaunay.h:98
unsigned int nb_cells() const
Returns the number of cells.
Definition delaunay.h:86
int vertex_cell(unsigned int v) const
Returns the index of a cell containing the vertex v.
Definition delaunay.h:136
int cell_adjacent(unsigned int c, unsigned int lf) const
Returns the index of the cell adjacent to the lf-th face of the c-th cell.
Definition delaunay.h:125
virtual unsigned int nearest_vertex(const float *p) const
Finds the index of the nearest vertex to a given point.
Definition delaunay.cpp:74
unsigned int nb_vertices() const
Returns the number of vertices.
Definition delaunay.h:80
const float * vertex_ptr(unsigned int i) const
Returns a pointer to the vertex of index i.
Definition delaunay.h:71
int cell_vertex(unsigned int c, unsigned int lv) const
Returns the index of the lv-th vertex in the c-th cell.
Definition delaunay.h:113
const int * cell_to_v() const
Returns a pointer to the cell-to-vertex mapping.
Definition delaunay.h:92
Delaunay(unsigned int dimension)
Constructor.
Definition delaunay.cpp:34
T * data()
Returns the memory address of the vector.
Definition vec.h:82
Definition collider.cpp:182
Vec< 2, float > vec2
A 2D point/vector of float type.
Definition types.h:42