-
Notifications
You must be signed in to change notification settings - Fork 63
Improvement: Move CAD management to t8_cad_handle with cmesh ownership #2093
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| #include <t8.h> | ||
| #include <t8_cad/t8_cad.hxx> | ||
| #include <t8_cad_handle/t8_cad_handle.hxx> |
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.
The folder should still be called t8_cad. It is the t8code module about cad. t8_cad_handle is just one part of it
| { | ||
| /* Map the new cad shape. */ | ||
| t8_cad_handle::map_cad_shape (new_cad_shape); | ||
| } |
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.
There is probably a way to achieve the same thing with less functions. What we definitely need are:
constructor from file
constructor from shape
destructor
load from file
load from shape
| public: | ||
| /** | ||
| * Constructor of the cad shape. | ||
| * Constructor of the cad shape handler. |
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.
| * Constructor of the cad shape handler. | |
| * Constructor of the cad shape handle. |
| * \param [in] fileprefix Prefix of a .brep file from which to extract cad geometry. | ||
| * \return The loaded cad shape. | ||
| */ | ||
| static TopoDS_Shape |
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.
A static member function means something different than a static function
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.
what you probably want to use is private
| unref () | ||
| { | ||
| if (t8_refcount_unref (&rc)) { | ||
| t8_debugf ("Deleting the cad_handler.\n"); |
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.
| t8_debugf ("Deleting the cad_handler.\n"); | |
| t8_debugf ("Deleting the cad_handle.\n"); |
| } | ||
|
|
||
| /** | ||
| * Decrease the reference count of the cad handler. |
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.
| * Decrease the reference count of the cad handler. | |
| * Decrease the reference count of the cad handle. |
| is_surface_closed (int geometry_index, int parameter) const; | ||
|
|
||
| /** | ||
| * Increase the reference count of the cad handler. |
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.
| * Increase the reference count of the cad handler. | |
| * Increase the reference count of the cad handle. |
| t8_cad_handle (); | ||
|
|
||
| /** | ||
| * Destructor of the cad shape handler. |
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.
| * Destructor of the cad shape handler. | |
| * Destructor of the cad shape handle. |
|
|
||
| /** | ||
| * Decrease the reference count of the cad handler. | ||
| * If the reference count reaches zero, the cad handler is deleted. |
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.
| * If the reference count reaches zero, the cad handler is deleted. | |
| * If the reference count reaches zero, the cad handle is deleted. |
| cad_shape_vertex2edge_map; /**< Maps all TopoDS_Vertex of shape to all its connected TopoDS_Edge */ | ||
| TopTools_IndexedDataMapOfShapeListOfShape | ||
| cad_shape_edge2face_map; /**< Maps all TopoDS_Edge of shape to all its connected TopoDS_Face */ | ||
| /** The reference count of the cad handler. TODO: Replace by shared_ptr when cmesh becomes a class. */ |
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.
| /** The reference count of the cad handler. TODO: Replace by shared_ptr when cmesh becomes a class. */ | |
| /** The reference count of the cad handle. TODO: Replace by shared_ptr when cmesh becomes a class. */ |
Describe your changes here:
Changing t8_cad to t8_cad_handle for a more explicit CAD shape management. The cmesh now owns the CAD handle and uses a reference counter to manage it.
Also, the t8_geom prefix was removed for everything related to CAD shape management for cleanup. The mesh reader and geometry implementations were updated to support this new handle system.
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:,Bugfix:,Feature:,Improvement:orOther:.All these boxes must be checked by the REVIEWERS before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
script/find_all_source_files.scpto check the indentation of these files.License
doc/(or already has one).