-
Notifications
You must be signed in to change notification settings - Fork 1.5k
SMDS_3 - add c3t3.set_triangulation()
#8851
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
SMDS_3 - add c3t3.set_triangulation()
#8851
Conversation
Successfully tested in CGAL-6.1-Ic-136 |
@janetournois Mergeable? |
The function is not documented, so I would say no. |
This pull-request was previously marked with the label |
2c36c5f
to
d4a335f
Compare
that internally calls rescan_after_load_of_triangulation() it avoids calling it explicitly or documenting it, but fixes the issue of updating the internal metadata of C3t3 automatically
d4a335f
to
9c58f6c
Compare
c3t3.set_triangulation()
should not we remove the |
It is used quite a lot in Tetrahedral_remeshing (maybe also in Mesh_3) so I would be against that change. |
Co-authored-by: Laurent Rineau <[email protected]>
Successfully tested in CGAL-6.1-Ic-151 |
/// returns a reference to the triangulation | ||
/// \cgalAdvancedBegin | ||
/// This function should only be used by advanced users: it merely swaps the triangulation without | ||
/// rebuilding critical C3T3 information such as the number of simplexes in complex. | ||
/// On the other hand, this is performed by `set_triangulation()` | ||
/// \cgalAdvancedEnd | ||
Triangulation& triangulation() { return tr_; } |
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 do not understand:
it merely swaps the triangulation without...
The function just returns the reference to the non-const triangulation. It does not swap anything. What was the intent?
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 went too fast, it was meant in the context of using the reference to assign a different triangulation, i.e. something like, "If you use this reference to call the change the triangulation, [...]"
When loading a .mesh file to a
Triangulation_3
, and then aC3t3
, as done in this example leads to aC3t3
for whichnumber_of_facets()
andnumber_of_cells()
return 0, because the internal counters have not been updated byc3t3.triangulation() = tr
.It is not clear to the user why these numbers are 0, and the function
rescan_after_load_of_triangulation()
(which fixes the counters) is not documented.Summary of Changes
Add the use ofrescan_after_load_of_triangulation()
in an example.The other option would be to use it automatically in the functions that load a triangulation.@lrineau @MaelRL do you have an opinion?Todo : discuss the APIAdd and document a function
c3t3.set_triangulation(const Tr& tr)
that internally callsrescan_after_load_of_triangulation()
, and is easier to useRelease Management