Geogram
Version 1.9.1
A programming library of geometric algorithms
|
Internal representation of polygons for GenericVoronoiDiagram. More...
#include <geogram/voronoi/generic_RVD_polygon.h>
Public Member Functions | |
index_t | nb_vertices () const |
Gets the number of vertices. | |
const Vertex & | vertex (index_t i) const |
Gets a vertex by index. More... | |
Vertex & | vertex (index_t i) |
Gets a vertex by index. More... | |
index_t | next_vertex (index_t i) const |
Gets the index of the successor of a Vertex. More... | |
index_t | prev_vertex (index_t i) const |
Gets the index of the predecessor of a Vertex. More... | |
Vertex * | add_vertex (const Vertex &v) |
Adds a Vertex to this Polygon. More... | |
void | clear () |
Clears this Polygon. | |
void | resize (index_t sz) |
Resizes this Polygon. More... | |
void | initialize_from_mesh_facet (const Mesh *mesh, index_t f, bool symbolic, const GEO::Attribute< double > &vertex_weight) |
Assigns a mesh facet to this Polygon. More... | |
template<index_t DIM> | |
void | clip_by_plane (Polygon &target, PointAllocator &target_intersections, const Mesh *mesh, const Delaunay *delaunay, index_t i, index_t j, bool exact, bool symbolic) |
Clips a polygon with a plane. More... | |
void | copy (const Polygon &rhs) |
Overwrites this Polygon with the contents of another polygon. More... | |
void | swap (Polygon &rhs) |
Swaps the contents of this Polygon and another polygon. More... | |
Protected Member Functions | |
template<index_t DIM> | |
void | clip_by_plane_fast (Polygon &target, PointAllocator &target_intersections, const Delaunay *delaunay, index_t i, index_t j, bool symbolic) const |
Clips a Polygon with a plane (fast inexact version). More... | |
template<index_t DIM> | |
void | clip_by_plane_exact (Polygon &target, PointAllocator &target_intersections, const Mesh *mesh, const Delaunay *delaunay, index_t i, index_t j) |
Clips a Polygon with a plane (exact version). More... | |
Static Protected Member Functions | |
static Sign | side_exact (const Mesh *mesh, const Delaunay *delaunay, const Vertex &q, const double *pi, const double *pj, coord_index_t dim) |
Returns the position of a point relative to a bisector (exact version). More... | |
Internal representation of polygons for GenericVoronoiDiagram.
Stores both geometrical and symbolic representations.
Definition at line 64 of file generic_RVD_polygon.h.
Adds a Vertex to this Polygon.
[in] | v | the vertex to be added. It is copied. |
Definition at line 125 of file generic_RVD_polygon.h.
|
inline |
Clips a polygon with a plane.
Computes the intersection between this Polygon and the half-space determined by the positive side of the bisector of segment [i,j] (on the same side as vertex i).
[out] | target | where to store the intersection |
[out] | target_intersections | where to allocate the generated vertices |
[in] | mesh | the input mesh, used by the symbolic information |
[in] | delaunay | the Delaunay triangulation |
[in] | i | index of one extremity of bisector in delaunay |
[in] | j | index of the other extremity of the bisector in delaunay |
[in] | exact | if true, exact predicates are used. Implies symbolic. |
[in] | symbolic | if true, symbolic representation of vertices is computed |
Definition at line 181 of file generic_RVD_polygon.h.
|
inlineprotected |
Clips a Polygon with a plane (exact version).
Computes the intersection between this Polygon and the half-space determined by the positive side of the bisector of segment [i,j] (the side of i). This version uses symbolically perturbed exact predicates.
[out] | target | where to store the intersection |
[out] | target_intersections | where to allocate the generated vertices |
[in] | mesh | the input mesh (used by exact predicates) |
[in] | delaunay | the Delaunay triangulation |
[in] | i | index of one extremity of bisector in delaunay |
[in] | j | index of the other extremity of the bisector in delaunay |
Definition at line 385 of file generic_RVD_polygon.h.
|
inlineprotected |
Clips a Polygon with a plane (fast inexact version).
Computes the intersection between this Polygon and the half-space determined by the positive side of the bisector of segment [i,j] (the side of i). This version uses a "fused" predicates-constructions strategy (and reuses the computations from the predicates to accelerate the constructions).
[out] | target | where to store the intersection |
[out] | target_intersections | where to allocate the generated vertices |
[in] | delaunay | the Delaunay triangulation |
[in] | i | index of one extremity of bisector in delaunay |
[in] | j | index of the other extremity of the bisector in delaunay |
[in] | symbolic | if true, symbolic representation of vertices is computed |
Definition at line 242 of file generic_RVD_polygon.h.
|
inline |
Overwrites this Polygon with the contents of another polygon.
[in] | rhs | a const reference to the polygon to be copied. |
Definition at line 203 of file generic_RVD_polygon.h.
void GEOGen::Polygon::initialize_from_mesh_facet | ( | const Mesh * | mesh, |
index_t | f, | ||
bool | symbolic, | ||
const GEO::Attribute< double > & | vertex_weight | ||
) |
Assigns a mesh facet to this Polygon.
The facet from the initial mesh is converted into the internal geometric/symbolic representation.
[in] | mesh | the mesh from which the facet is copied |
[in] | f | the index of the facet in mesh |
[in] | symbolic | if true, symbolic information is copied |
[in] | vertex_weight | a reference to a vertex attribute that stores weights. If not bound, then 1.0 is used for the weights. |
|
inline |
Gets the index of the successor of a Vertex.
i
i
< nb_vertices() Definition at line 102 of file generic_RVD_polygon.h.
|
inline |
Gets the index of the predecessor of a Vertex.
i
ii
< nb_vertices() Definition at line 115 of file generic_RVD_polygon.h.
|
inline |
Resizes this Polygon.
[in] | sz | new size |
Definition at line 141 of file generic_RVD_polygon.h.
|
staticprotected |
Returns the position of a point relative to a bisector (exact version).
Position of q relative to the bisector Pi(i,j). The symbolic representation of q is used. Symbolic perturbation is applied to degenerate configurations, therefore ZERO is never returned.
[in] | mesh | the input mesh |
[in] | delaunay | the Delaunay triangulation |
[in] | q | query point |
[in] | pi | one extremity of the bisector |
[in] | pj | the other extremity of the bisector |
[in] | dim | dimension of the points |
|
inline |
Swaps the contents of this Polygon and another polygon.
[in,out] | rhs | a reference to the Polygon to be swapped with this one. |
Definition at line 212 of file generic_RVD_polygon.h.
|
inline |
Gets a vertex by index.
i
i
< nb_vertices() Definition at line 91 of file generic_RVD_polygon.h.
|
inline |
Gets a vertex by index.
i
i
< nb_vertices() Definition at line 80 of file generic_RVD_polygon.h.