template class geode::TriangulatedSurfaceModifier

Overview

#include <triangulated_surface_modifier.h>

template <index_t dimension>
class TriangulatedSurfaceModifier: public geode::VertexSetModifier
{
public:
    // construction

    TriangulatedSurfaceModifier(
        const SurfaceMesh<dimension>& surface,
        TriangulatedSurfaceBuilder<dimension>& builder
        );

    TriangulatedSurfaceModifier(TriangulatedSurfaceModifier&& other);

    // methods

    bool is_triangle_active(index_t triangle_id) const;
    bool is_edge_active(index_t edge_id) const;
    bool is_edge_active(const PolygonEdge& edge) const;

    SplitTriangleInfo split_triangle(
        index_t triangle_id,
        const Point<dimension>& point
        );

    SplitPolygonEdgeInfo split_edge(
        const PolygonEdge& edge,
        const Point<dimension>& point
        );

    CollapsePolygonEdgeInfo collapse_edge(
        const PolygonEdge& edge,
        const Point<dimension>& point
        );

    CollapseEdgeInfo collapse_edge(index_t edge_id, const Point<dimension>& point);
    void swap_edge(const PolygonEdge& edge);
    std::vector<index_t> clean_triangles();
    std::vector<index_t> clean_vertices();
    std::vector<index_t> clean_edges();
    std::tuple<std::vector<index_t>, std::vector<index_t>, std::vector<index_t>> clean();

    static bool is_collapse_edge_valid(
        const TriangulatedSurface<dimension>& surface,
        const PolygonEdge& edge,
        const Point<dimension>& point
        );

    static bool is_collapse_edge_valid(
        const TriangulatedSurface<dimension>& surface,
        index_t edge_id,
        const Point<dimension>& point
        );
};

// direct descendants

template <index_t dimension>
class TriangulatedSurfaceEpsilonModifier;

Inherited Members

public:
    // methods

    index_t updated_vertex(index_t vertex_id) const;

Detailed Documentation

Methods

SplitTriangleInfo split_triangle(
    index_t triangle_id,
    const Point<dimension>& point
    )

Split a triangle into three new triangles.

Parameters:

triangle_id

Index of the triangle to split.

point

Coordinates of the split point. @warn Given triangle is set as inactive but not deleted.

SplitPolygonEdgeInfo split_edge(
    const PolygonEdge& edge,
    const Point<dimension>& point
    )

Split an edge into two new edges. The triangles incident to this edge are also split into two new triangles.

Parameters:

edge

Index of the PolygonEdge to split.

point

Coordinates of the split point. @warn Split triangles are set as inactive but not deleted.

CollapsePolygonEdgeInfo collapse_edge(
    const PolygonEdge& edge,
    const Point<dimension>& point
    )

Collapse an edge. The triangles incident to this edge are set as inactive but not deleted.

Parameters:

edge

Index of the PolygonEdge to collapse.

point

Coordinates of the collapse point.

CollapseEdgeInfo collapse_edge(index_t edge_id, const Point<dimension>& point)

Collapse an edge. The triangles incident to this edge are set as inactive but not deleted.

Parameters:

edge_id

Unique index of the edge to collapse.

point

Coordinates of the collapse point.

void swap_edge(const PolygonEdge& edge)

Swap an edge.

Parameters:

edge

The edge to swap.

std::vector<index_t> clean_triangles()

Clean up the mesh removing inactive triangles

Returns:

old2new mappings for triangles

std::vector<index_t> clean_vertices()

Clean up the mesh removing isolated vertices This method should be called after clean_triangles()

Returns:

old2new mappings for vertices

std::vector<index_t> clean_edges()

Clean up the mesh removing edges This method should be called after clean_triangles()

Returns:

old2new mappings for edges

std::tuple<std::vector<index_t>, std::vector<index_t>, std::vector<index_t>> clean()

Clean up the mesh removing inactive triangles, isolated vertices and edges.

Returns:

old2new mappings for triangles, vertices and edges.

static bool is_collapse_edge_valid(
    const TriangulatedSurface<dimension>& surface,
    const PolygonEdge& edge,
    const Point<dimension>& point
    )

Check if an edge collapse will keep the mesh valid, meaning no triangle area flip its sign. The collapse is not applied.

Parameters:

edge

Index of the PolygonEdge to collapse.

point

Coordinates of the collapse point.

Returns:

true if collapse will keep mesh valid.

static bool is_collapse_edge_valid(
    const TriangulatedSurface<dimension>& surface,
    index_t edge_id,
    const Point<dimension>& point
    )

Check if an edge collapse will keep the mesh valid, meaning no triangle area flip its sign. The collapse is not applied.

Parameters:

edge_id

Unique index of the edge to collapse.

point

Coordinates of the collapse point.

Returns:

true if collapse will keep mesh valid.