-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix the triggering in PickPointsInteractor when there are linesets pr… #6499
Conversation
…esents Adds handling of LineSet that is similar to Mesh and PointCloud in SetPickableGeometry()
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
I could help review this PR |
Seems like Codacy caught an error (thanks!) |
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.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @EwingKang)
cpp/open3d/visualization/gui/PickPointsInteractor.cpp
line 166 at r1 (raw file):
auto tmesh = dynamic_cast<const t::geometry::TriangleMesh *>(pg.tgeometry); auto lineset = dynamic_cast<const geometry::LineSet *>(pg.geometry);
Can we implement polymorphism here rather than dynamically casting and checking for nullptr?
Hi @godwincharan , const geometry::Geometry3D* geometry = nullptr;
const t::geometry::Geometry* tgeometry = nullptr; So one would have to check which one is the valid pointer essentially. Another way to implement this is to add some sort of base function that returns interest points in their parent class. The third way is to make pickable objects inherit a new base class. This would require some careful design directly from the owner/maintainers IMHO. My original intent is to quickly fix this crashing issue for me, so I simply follow what has been done. But I would love to implement a more complete solution (at least for the newer |
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.
Thanks @EwingKang for the fix! Tested can pick points from line sets.
PS: Here's the last part of the output of make apply-style
for me:
...
Please correct license header *manually* in the following files (see util/check_style.py for the standard header):
/home/ssheorey/Documents/Open3D/Code/Open3D/examples/cpp/TImage.cpp
make[3]: *** [CMakeFiles/apply-style.dir/build.make:71: CMakeFiles/apply-style] Error 1
make[2]: *** [CMakeFiles/Makefile2:2053: CMakeFiles/apply-style.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:2060: CMakeFiles/apply-style.dir/rule] Error 2
make: *** [Makefile:709: apply-style] Error 2
I was able to fix it by updating the license header text. Is this the issue you ran into?
@godwincharan agree with your assessment that polymorphism may help to simplify this code. However, the refactoring will take some careful planning and effort as @EwingKang has noted. Please reach out to me if you would like to help. |
@ssheorey Thanks for merging the code. About the style checker, I just re-ran the checker with |
So I've test it again with a fresh Ubuntu 22.04 install. It turns out that the when installing the style checker dependencies following the instructions, the install defaults to ...
WARNING: The scripts clang-format, clang-format-diff.py and git-clang-format are installed in '/home/user/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Attempting uninstall: nbformat
Found existing installation: nbformat 5.9.2
Uninstalling nbformat-5.9.2:
Successfully uninstalled nbformat-5.9.2
WARNING: The script jupyter-trust is installed in '/home/user/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed clang-format-10.0.1.1 nbformat-5.7.0
... I just installed it to the system with sudo pip3 install clang-format==10.0.1.1 |
Adds handling of LineSet that is similar to Mesh and PointCloud in SetPickableGeometry()
Type
Motivation and Context
This change fixes #6498
Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code. (On U22.04, clang_format 10 is not available, the default install script didn't worked, I eyeballed the format instead)
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
GUI no-longer crashes when there's lineset object in the scene when switching to
Actions -> show settings -> Mouse control (drop down) -> Selection (tab).