ENH: Adding itk::PolyLineCell#3393
Conversation
8e0e992 to
dba2abb
Compare
aeb86d2 to
f71e4e1
Compare
jhlegarreta
left a comment
There was a problem hiding this comment.
Thanks for having added a test. I added a few comments (I apologize if these were planned to be added later as the PR is still a draft).
PolyLineCell can take variable number of points. Depending on the number of points present in LINE cell in the vtk file we decide if LINE cell (num of points = 2) or POLYLINE cell (num of points > 2) needs to be created.
Test if both LINE cell and POLYLINE cell can be read and written from ascii and binary vtk files and can come together in a single vtk file.
| /** | ||
| * Standard CellInterface: | ||
| */ | ||
| template <typename TCellInterface> |
There was a problem hiding this comment.
@PranjalSahu as metioned in commit a837b20, methods need to be documented in header files. Probably this is a side effect of other CellInterface-templated classes being documented in the wrong place as well.
Also, virtually all child methods seem to have the exact same documentation (have checked only a few methods), so if I'm not mistaken, if a overridden method is not documented, the parent class documentation is used for the child class. The latter should be verified, but if it is the case (should be the case for e.g. PrintSelf methods, although there are some extraneous cases #3401), and if the reimplementation does not require any custom documentation, then all method documentation should be removed. That would ease maintenance as well.
You may want to check and fix this. Thanks.
There was a problem hiding this comment.
ok I will move them to header files.
|
While trying to have a look at why the const end iterator is not covered by tests: I saw that the empty cell point tests may not be working correctly, and I got a segfault for the I am not sure whether having a random (or max trait for some type) is the intended behavior when there are no cells for the iterator to iterate on.
Does this deserve an issue? |
|
Polyline cell can have a variable number of points. So we can't have a max trait like other cells that have a fixed number of points (ex. Vertex, Line). And I checked the test logs for the windows test and it looks fine to me. But yes this could be an issue as in the code we have |
|
In the default constructor, I will use 2 points instead of empty, because at least 2 points should be present in a PolyLine Cell. |
I am fine testing with 0 points: in fact. as it happens to be an interesting case to test I'd keep it unless I'm missing something. The thing is that the rest of the In fact, if you happen to have a Win 10, MSVC 2019 machine at hand, it would be interesting to try to reproduce the segfault. Also, as you see, the output you print for the rest of the |
|
Yes that is because other cells have a minimum number of points so that vector is never empty. I have to check why it passes the tests in CI and in my machine. Constructor for VertexCell where NumberOfPoints is constant. |
Then the iterators (at least) in |
|
@jhlegarreta Please check PR #3409 |
Looks good. Thanks for doing this 💯 ! |
|
@PranjalSahu If the list of point ids can be cleared (have not checked), there should probably exist an Minor comment concerning the PR:
|
This PR adds itk::PolyLineCell.
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.