Skip to content

Commit

Permalink
addressing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Oct 21, 2024
1 parent 985bb2d commit f837cb9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
34 changes: 19 additions & 15 deletions include/manifold/manifold.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,37 +332,41 @@ class Manifold {
* @{
*/
#ifdef MANIFOLD_DEBUG
inline std::ostream& operator<<(std::ostream& stream,
const Manifold::Error& error) {
inline std::string ToString(const Manifold::Error& error) {
switch (error) {
case Manifold::Error::NoError:
return stream << "No Error";
return "No Error";
case Manifold::Error::NonFiniteVertex:
return stream << "Non Finite Vertex";
return "Non Finite Vertex";
case Manifold::Error::NotManifold:
return stream << "Not Manifold";
return "Not Manifold";
case Manifold::Error::VertexOutOfBounds:
return stream << "Vertex Out Of Bounds";
return "Vertex Out Of Bounds";
case Manifold::Error::PropertiesWrongLength:
return stream << "Properties Wrong Length";
return "Properties Wrong Length";
case Manifold::Error::MissingPositionProperties:
return stream << "Missing Position Properties";
return "Missing Position Properties";
case Manifold::Error::MergeVectorsDifferentLengths:
return stream << "Merge Vectors Different Lengths";
return "Merge Vectors Different Lengths";
case Manifold::Error::MergeIndexOutOfBounds:
return stream << "Merge Index Out Of Bounds";
return "Merge Index Out Of Bounds";
case Manifold::Error::TransformWrongLength:
return stream << "Transform Wrong Length";
return "Transform Wrong Length";
case Manifold::Error::RunIndexWrongLength:
return stream << "Run Index Wrong Length";
return "Run Index Wrong Length";
case Manifold::Error::FaceIDWrongLength:
return stream << "Face ID Wrong Length";
return "Face ID Wrong Length";
case Manifold::Error::InvalidConstruction:
return stream << "Invalid Construction";
return "Invalid Construction";
default:
return stream << "Unkown Error";
return "Unkown Error";
};
}

inline std::ostream& operator<<(std::ostream& stream,
const Manifold::Error& error) {
return stream << ToString(error);
}
#endif
/** @} */
} // namespace manifold
2 changes: 1 addition & 1 deletion src/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ Manifold::Impl Manifold::Impl::Transform(const mat3x4& transform_) const {
result.status_ = status_;
return result;
}
if (!all(isfinite(transform_))) {
if (!all(la::isfinite(transform_))) {
result.MarkFailure(Error::NonFiniteVertex);
return result;
}
Expand Down

0 comments on commit f837cb9

Please sign in to comment.