scenepic 1.1.0
3D Visualization Made Easy
loop_subdivision_stencil.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#ifndef _SCENEPIC_LOOP_SUBDIV_STENCIL_H_
5#define _SCENEPIC_LOOP_SUBDIV_STENCIL_H_
6
7#include "matrix.h"
8#include "mesh_info.h"
9
10namespace scenepic
11{
21 {
22 public:
28 LoopSubdivisionStencil(TriangleBuffer triangles, SparseMatrix subdiv);
29
31 const ConstTriangleBufferRef triangles() const;
32
38 VertexBuffer apply(const ConstVertexBufferRef vertices) const;
39
41 std::size_t vertex_count() const;
42
44 std::size_t triangle_count() const;
45
57 const ConstTriangleBufferRef triangles,
58 int steps = 1,
59 bool project_to_limit = false);
60
61 private:
62 TriangleBuffer m_triangles;
63 SparseMatrix m_subdiv;
64 };
65} // namespace scenepic
66
67#endif
This class enables efficient Loop subdivision of triangle meshes.
Definition: loop_subdivision_stencil.h:21
static LoopSubdivisionStencil create(const ConstTriangleBufferRef triangles, int steps=1, bool project_to_limit=false)
Creates a new stencil by subdividing the provided triangles.
const ConstTriangleBufferRef triangles() const
Returns the triangles of the subdivided mesh.
LoopSubdivisionStencil(TriangleBuffer triangles, SparseMatrix subdiv)
Constructor.
std::size_t vertex_count() const
The number of vertices in the subdivided mesh.
std::size_t triangle_count() const
The number of triangles in the subdivided mesh.
VertexBuffer apply(const ConstVertexBufferRef vertices) const
Applies the stencil to a vertex buffer.
Definition: audio_track.h:14