Improvement: Move CAD management to t8_cad_handle with cmesh ownership#2093
Improvement: Move CAD management to t8_cad_handle with cmesh ownership#2093LenaRadmer wants to merge 2 commits intomainfrom
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.
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.
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.
| * 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.
A static member function means something different than a static function
There was a problem hiding this comment.
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.
| 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.
| * 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.
| * 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.
| * 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.
| * 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.
| /** 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).