-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Halfedge primitive type and refactored primitive type indexing #460
Conversation
I added a HalfEdge attribute. The most potentially problematic changes are code snippets where a correspondence between dimension and a PrimitiveType is assumed, and especially where iteration over dimensions are used. In particular, the attribute manager in |
: Mesh(dimension, dimension, get_primitive_type_from_id(dimension)) | ||
{} | ||
|
||
Mesh::Mesh(const long& dimension, const long& max_primitive_type_id, PrimitiveType hash_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the type of the hash explicit as well instead of inferring from dimension.
m_flag_handles.emplace_back( | ||
register_attribute<char>("flags", static_cast<PrimitiveType>(j), 1)); | ||
register_attribute<char>("flags", get_primitive_type_from_id(j), 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a function to explicitly convert from IDs to primitive types. We could just use static_cast
and initializers in the enumerator list (as was done before), but I think this more explicit conversion function is safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add one include and try to remove as many derprecations as you can
{ | ||
switch (t) { | ||
case PrimitiveType::Vertex: return 0; | ||
case PrimitiveType::Edge: return 1; | ||
case PrimitiveType::Face: return 2; | ||
case PrimitiveType::Tetrahedron: return 3; | ||
case PrimitiveType::HalfEdge: { | ||
throw std::runtime_error("halfedge is not a simplex"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure we include stdexcept
Codecov Report
@@ Coverage Diff @@
## main #460 +/- ##
==========================================
+ Coverage 82.02% 84.66% +2.63%
==========================================
Files 156 162 +6
Lines 4184 4557 +373
==========================================
+ Hits 3432 3858 +426
+ Misses 752 699 -53
Flags with carried forward coverage won't be shown. Click here to find out more.
|
No description provided.