fix: Add explicit casts

This commit is contained in:
Tibo De Peuter 2024-11-12 18:54:39 +01:00
parent 3d600174b3
commit 2c6f46bc78
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
3 changed files with 5 additions and 5 deletions

View file

@ -165,8 +165,8 @@ void subdivide_quad_mesh_catmull_clark(
/* Check if the edge has been computed before */
if (EAP.find(Eigen::RowVector2i(v1, v2)) == EAP.end()) {
SV.row(V.rows() + F.rows() + EAP.size()) = compute_edge_average_point(V, F, FC, Eigen::RowVector2i(v1, v2));
EAP[Eigen::RowVector2i(v1, v2)] = V.rows() + F.rows() + EAP.size();
SV.row(static_cast<int>(V.rows() + F.rows() + EAP.size())) = compute_edge_average_point(V, F, FC, Eigen::RowVector2i(v1, v2));
EAP[Eigen::RowVector2i(v1, v2)] = static_cast<int>(V.rows() + F.rows() + EAP.size());
}
}
}
@ -179,7 +179,7 @@ void subdivide_quad_mesh_catmull_clark(
/* Compute the faces */
for (int i = 0; i < F.rows(); i++) { /* For each face */
int face_centroid = V.rows() + i;
const int face_centroid = static_cast<int>(V.rows() + i);
int edge_average_points[4] = {
EAP.at(Eigen::RowVector2i(std::min(F(i, 0), F(i, 1)), std::max(F(i, 0), F(i, 1)))),
EAP.at(Eigen::RowVector2i(std::min(F(i, 1), F(i, 2)), std::max(F(i, 1), F(i, 2)))),

View file

@ -13,7 +13,7 @@ void per_corner_normals(
Eigen::VectorXi count = Eigen::VectorXi::Zero(F.rows()*3);
std::vector<std::vector<int>> VF;
vertex_triangle_adjacency(F, V.rows(), VF);
vertex_triangle_adjacency(F, static_cast<int>(V.rows()), VF);
double cos_threshold = std::cos(corner_threshold * M_PI / 180.0);

View file

@ -11,7 +11,7 @@ void per_vertex_normals(
Eigen::VectorXi count = Eigen::VectorXi::Zero(V.rows());
std::vector<std::vector<int>> VF;
vertex_triangle_adjacency(F, V.rows(), VF);
vertex_triangle_adjacency(F, static_cast<int>(V.rows()), VF);
/* Calculate the product of the area and the normal of each face neighboring each vertex. */
for (int i = 0; i < V.rows(); i++) {