Skip to content

Commit

Permalink
Used DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE macro.
Browse files Browse the repository at this point in the history
Instead of using if statements explicitly, used DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE
to dispatch to RemoveDuplicateVerticesWorker function appropriately.

On branch sganjugu/remdup2
Your branch is up to date with 'origin/sganjugu/remdup2'.
Changes to be committed:
modified:   ../cpp/open3d/t/geometry/TriangleMesh.cpp
  • Loading branch information
shashigk committed Feb 4, 2024
1 parent db3f353 commit b98ace5
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions cpp/open3d/t/geometry/TriangleMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1383,19 +1383,10 @@ TriangleMesh &TriangleMesh::RemoveDuplicateVertices() {
return *this;
}

if (core::Float32 == vertices.GetDtype()) {
if (core::Int32 == triangle_dtype) {
return RemoveDuplicateVerticesWorker<float, int>(*this);
} else {
return RemoveDuplicateVerticesWorker<float, int64_t>(*this);
}
} else {
if (core::Int32 == triangle_dtype) {
return RemoveDuplicateVerticesWorker<double, int>(*this);
} else {
return RemoveDuplicateVerticesWorker<double, int64_t>(*this);
}
}
DISPATCH_FLOAT_INT_DTYPE_TO_TEMPLATE(
vertices.GetDtype(), triangle_dtype,
[&]() { RemoveDuplicateVerticesWorker<scalar_t, int_t>(*this); });
return *this;
}

} // namespace geometry
Expand Down

0 comments on commit b98ace5

Please sign in to comment.