Blender V5.3
blender::meshintersect::CDTArrangement< T > Struct Template Reference

Public Member Functions

 CDTArrangement ()=default
 ~CDTArrangement ()
void reserve (int verts_num, int edges_num, int faces_num)
CDTVert< T > * add_vert (const VecBase< T, 2 > &pt)
CDTEdge< T > * add_edge (CDTVert< T > *v1, CDTVert< T > *v2, CDTFace< T > *fleft, CDTFace< T > *fright)
CDTFace< T > * add_face ()
CDTEdge< T > * add_vert_to_symedge_edge (CDTVert< T > *v, SymEdge< T > *se)
CDTEdge< T > * add_diagonal (SymEdge< T > *s1, SymEdge< T > *s2)
CDTEdge< T > * connect_separate_parts (SymEdge< T > *se1, SymEdge< T > *se2)
CDTEdge< T > * split_edge (SymEdge< T > *se, T lambda, Map< CDTEdge< T > *, int > *edge_winding_map, Map< CDTEdge< T > *, int > *polygon_boundary_count_map)
void delete_edge (SymEdge< T > *se)
CDTVert< T > * get_vert_resolve_merge (int i)

Public Attributes

Vector< CDTVert< T > * > verts
Vector< CDTEdge< T > * > edges
Vector< CDTFace< T > * > faces
CDTFace< T > * outer_face {nullptr}

Detailed Description

template<typename T>
struct blender::meshintersect::CDTArrangement< T >

Definition at line 247 of file delaunay_2d.cc.

Constructor & Destructor Documentation

◆ CDTArrangement()

◆ ~CDTArrangement()

Member Function Documentation

◆ add_diagonal()

template<typename T>
CDTEdge< T > * blender::meshintersect::CDTArrangement< T >::add_diagonal ( SymEdge< T > * s1,
SymEdge< T > * s2 )

Assuming s1 and s2 are both SymEdge's in a face with > 3 sides and one is not the next of the other, Add an edge from s1->v to s2->v, splitting the face in two. The original face will be the one that s1 has as left face, and a new face will be added and made s2 and its next-cycle's left face.

Assume s1 and s2 are both #SymEdges in a face with > 3 sides, and one is not the next of the other. Add an edge from s1->v to s2->v, splitting the face in two. The original face will continue to be associated with the sub-face that has s1, and a new face will be made for s2's new face. Return the new diagonal's CDTEdge pointer.

Definition at line 1066 of file delaunay_2d.cc.

References add_edge(), add_face(), blender::meshintersect::add_list_to_input_ids(), blender::meshintersect::SymEdge< T >::face, blender::meshintersect::CDTFace< T >::input_ids, blender::meshintersect::SymEdge< T >::next, blender::meshintersect::prev(), blender::meshintersect::SymEdge< T >::rot, blender::meshintersect::sym(), blender::meshintersect::CDTEdge< T >::symedges, and blender::meshintersect::SymEdge< T >::vert.

Referenced by CDTArrangement(), blender::meshintersect::dc_tri(), and blender::meshintersect::re_delaunay_triangulate().

◆ add_edge()

template<typename T>
CDTEdge< T > * blender::meshintersect::CDTArrangement< T >::add_edge ( CDTVert< T > * v1,
CDTVert< T > * v2,
CDTFace< T > * fleft,
CDTFace< T > * fright )

Add an edge from v1 to v2. The edge will have a left face and a right face, specified by fleft and fright. The edge will not be connected to anything yet. If the vertices do not yet have a SymEdge pointer, their pointer is set to the SymEdge in this new edge.

Definition at line 904 of file delaunay_2d.cc.

References blender::meshintersect::CDTEdge< T >::CDTEdge(), blender::e, blender::meshintersect::SymEdge< T >::edge, edges, blender::meshintersect::SymEdge< T >::face, blender::meshintersect::SymEdge< T >::next, blender::meshintersect::SymEdge< T >::rot, blender::meshintersect::CDTVert< T >::symedge, blender::v2, and blender::meshintersect::SymEdge< T >::vert.

Referenced by add_diagonal(), add_vert_to_symedge_edge(), CDTArrangement(), connect_separate_parts(), blender::meshintersect::dc_tri(), and split_edge().

◆ add_face()

template<typename T>
CDTFace< T > * blender::meshintersect::CDTArrangement< T >::add_face ( )

Add a new face. It is disconnected until an add_edge makes it the left or right face of an edge.

Definition at line 928 of file delaunay_2d.cc.

References blender::meshintersect::CDTFace< T >::CDTFace(), and faces.

Referenced by add_diagonal(), and CDTArrangement().

◆ add_vert()

template<typename T>
CDTVert< T > * blender::meshintersect::CDTArrangement< T >::add_vert ( const VecBase< T, 2 > & pt)

Add a new vertex to the arrangement, with the given 2D coordinate. It will not be connected to anything yet.

Definition at line 895 of file delaunay_2d.cc.

References blender::meshintersect::CDTVert< T >::CDTVert(), blender::v, and verts.

Referenced by CDTArrangement(), and split_edge().

◆ add_vert_to_symedge_edge()

◆ connect_separate_parts()

template<typename T>
CDTEdge< T > * blender::meshintersect::CDTArrangement< T >::connect_separate_parts ( SymEdge< T > * se1,
SymEdge< T > * se2 )

Connect the verts of se1 and se2, assuming that currently those two SymEdge's are on the outer boundary (have face == outer_face) of two components that are isolated from each other.

Definition at line 1116 of file delaunay_2d.cc.

References add_edge(), blender::BLI_assert(), blender::e, blender::meshintersect::SymEdge< T >::face, blender::meshintersect::SymEdge< T >::next, blender::meshintersect::SymEdge< T >::rot, blender::meshintersect::sym(), and blender::meshintersect::SymEdge< T >::vert.

Referenced by CDTArrangement(), and blender::meshintersect::dc_tri().

◆ delete_edge()

template<typename T>
void blender::meshintersect::CDTArrangement< T >::delete_edge ( SymEdge< T > * se)

Delete an edge. The new combined face on either side of the deleted edge will be the one that was e's face. There will now be an unused face, which will be marked deleted, and an unused CDTEdge, marked by setting the next and rot pointers of its SymEdge's to nullptr.

Delete an edge from the structure. The new combined face on either side of the deleted edge will be the one that was e's face. There will be now an unused face, marked by setting its deleted flag, and an unused CDTEdge, marked by setting the next and rot pointers of its #SymEdges to nullptr.

       .  v2               .
      / \                 / \
     /f|j\               /   \
    /  |  \             /     \
       |
     A |  B                A
   \  e|   /           \       /
    \  | /              \     /
     \h|i/               \   /
       .  v1               .

Also handle variant cases where one or both ends are attached only to e.

Definition at line 1231 of file delaunay_2d.cc.

References blender::BLI_assert(), blender::meshintersect::CDTFace< T >::deleted, ELEM, blender::meshintersect::SymEdge< T >::face, blender::meshintersect::SymEdge< T >::next, outer_face, blender::meshintersect::prev(), blender::meshintersect::SymEdge< T >::rot, blender::meshintersect::sym(), blender::meshintersect::CDTVert< T >::symedge, blender::v2, and blender::meshintersect::SymEdge< T >::vert.

Referenced by CDTArrangement(), blender::meshintersect::dc_tri(), and blender::meshintersect::dissolve_symedge().

◆ get_vert_resolve_merge()

template<typename T>
CDTVert< T > * blender::meshintersect::CDTArrangement< T >::get_vert_resolve_merge ( int i)
inline

If the vertex with index i in the vert array has not been merge, return it. Else return the one that it has merged to.

Definition at line 328 of file delaunay_2d.cc.

References blender::v.

Referenced by blender::meshintersect::add_face_constraints().

◆ reserve()

template<typename T>
void blender::meshintersect::CDTArrangement< T >::reserve ( int verts_num,
int edges_num,
int faces_num )

Hint to how much space to reserve in the Vectors of the arrangement, based on these counts of input elements.

Definition at line 935 of file delaunay_2d.cc.

References edges, faces, and verts.

Referenced by CDTArrangement().

◆ split_edge()

template<typename T>
CDTEdge< T > * blender::meshintersect::CDTArrangement< T >::split_edge ( SymEdge< T > * se,
T lambda,
Map< CDTEdge< T > *, int > * edge_winding_map,
Map< CDTEdge< T > *, int > * polygon_boundary_count_map )

Split se at fraction lambda, and return the new CDTEdge that is the new second half. Copy the edge input_ids into the new one. If edge_winding_map is non-null, propagate winding to the new edge.

Split se at fraction lambda, and return the new CDTEdge that is the new second half. Copy the edge input_ids into the new one.

Parameters
edge_winding_mapOnly used for non-zero filling.
polygon_boundary_count_mapOnly used for even-odd hole detection.

Definition at line 1146 of file delaunay_2d.cc.

References add_edge(), blender::meshintersect::add_list_to_input_ids(), add_vert(), b, blender::BLI_assert(), blender::e, blender::meshintersect::SymEdge< T >::edge, edges, blender::meshintersect::SymEdge< T >::face, interpolate(), blender::meshintersect::SymEdge< T >::next, blender::meshintersect::prev(), blender::meshintersect::SymEdge< T >::rot, blender::meshintersect::sym(), T, blender::v, and blender::meshintersect::SymEdge< T >::vert.

Referenced by CDTArrangement().

Member Data Documentation

◆ edges

◆ faces

◆ outer_face

◆ verts

template<typename T>
Vector<CDTVert<T> *> blender::meshintersect::CDTArrangement< T >::verts

The verts. Some may be merged to others (see their merge_to_index).

Definition at line 253 of file delaunay_2d.cc.

Referenced by add_vert(), blender::meshintersect::cdt_draw(), blender::meshintersect::get_cdt_output(), blender::meshintersect::initial_triangulation(), reserve(), and ~CDTArrangement().


The documentation for this struct was generated from the following file: