Skip to content

Commit f8e3509

Browse files
committed
add missing SurfaceMesh register w/ permutation functions for
compatibility
1 parent 71a1e64 commit f8e3509

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

include/polyscope/surface_mesh.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,12 @@ template <class V, class F>
423423
SurfaceMesh* registerSurfaceMesh(std::string name, const V& vertexPositions, const F& faceIndices);
424424
template <class V, class F>
425425
SurfaceMesh* registerSurfaceMesh2D(std::string name, const V& vertexPositions, const F& faceIndices);
426+
427+
// register functions that also set perms
428+
// these are kept mainly for backward compatability, prefer setting perms after registering
429+
template <class V, class F, class P>
430+
SurfaceMesh* registerSurfaceMesh(std::string name, const V& vertexPositions, const F& faceIndices,
431+
const std::array<std::pair<P, size_t>, 3>& perms);
426432
template <class V, class F, class P>
427433
SurfaceMesh* registerSurfaceMesh(std::string name, const V& vertexPositions, const F& faceIndices,
428434
const std::array<std::pair<P, size_t>, 5>& perms);

include/polyscope/surface_mesh.ipp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ SurfaceMesh* registerSurfaceMesh2D(std::string name, const V& vertexPositions, c
4040
return registerSurfaceMesh(name, positions3D, faceIndices);
4141
}
4242

43+
template <class V, class F, class P>
44+
SurfaceMesh* registerSurfaceMesh(std::string name, const V& vertexPositions, const F& faceIndices,
45+
const std::array<std::pair<P, size_t>, 3>& perms) {
46+
SurfaceMesh* mesh = registerSurfaceMesh(name, vertexPositions, faceIndices);
47+
if (mesh) {
48+
mesh->setAllPermutations(perms);
49+
}
50+
return mesh;
51+
}
52+
53+
template <class V, class F, class P>
54+
SurfaceMesh* registerSurfaceMesh(std::string name, const V& vertexPositions, const F& faceIndices,
55+
const std::array<std::pair<P, size_t>, 5>& perms) {
56+
SurfaceMesh* mesh = registerSurfaceMesh(name, vertexPositions, faceIndices);
57+
if (mesh) {
58+
mesh->setAllPermutations(perms);
59+
}
60+
return mesh;
61+
}
62+
4363
template <class V>
4464
void SurfaceMesh::updateVertexPositions(const V& newPositions) {
4565
validateSize(newPositions, vertexDataSize, "newPositions");

0 commit comments

Comments
 (0)