You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use strongly typed 'enum' instead of 'int' for properties in PCLVisualizer code #1692
Right now functions like setPointCloudRenderingProperties use an int to represent the property to be modified. This means that there is no way of knowing which properties are accepted by the function. A solution is to use strongly typed enum instead of int for properties. The issue was brought up in #1668.
You're right. In this case the only way of assigning a non member of the organization to the issue is if that person is the one responsible for opening the issue. In this case, we can't do much else.
Is just using enum class instead of using ints in function singatures?
On a quick look, I saw that there are already enums defined here, but each function only accepts some of those values. So maybe it makes sense to specify in the documentation of each function, which properties are accepted? Feel free to propose something, or maybe @larshg has an idea
I thought adding an assert or [[deprecated("reason")]] for property but it is already handled with corresponding pcl::console::print_error. I think updating the documentation of setPointCloudRenderingProperties and maybe turning RenderingProperties to enum class are enough.
Also, viewport is never used in any setPointCloudRenderingProperties and the setters in my eyes shall return [[noreturn]] bool or void.
Activity
StephenNneji commentedon Jan 7, 2018
I could take this issue if its still relevant considering its been dormant since 2016.
SergioRAgostinho commentedon Jan 9, 2018
That would be great I would say. Just self assign yourself to this issue to help us keep track of things.
StephenNneji commentedon Jan 9, 2018
@SergioRAgostinho I don't have write access so I cannot assign this to myself
SergioRAgostinho commentedon Jan 9, 2018
You're right. In this case the only way of assigning a non member of the organization to the issue is if that person is the one responsible for opening the issue. In this case, we can't do much else.
stale commentedon May 19, 2020
Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.
theoniko commentedon Jan 7, 2022
Hello,
Could i work on this one? Is just using enum class instead of using ints in function singatures?
mvieth commentedon Jan 8, 2022
Sure, that would be great
On a quick look, I saw that there are already enums defined here, but each function only accepts some of those values. So maybe it makes sense to specify in the documentation of each function, which properties are accepted? Feel free to propose something, or maybe @larshg has an idea
theoniko commentedon Nov 11, 2022
I thought adding an assert or [[deprecated("reason")]] for property but it is already handled with corresponding pcl::console::print_error. I think updating the documentation of setPointCloudRenderingProperties and maybe turning RenderingProperties to enum class are enough.
Also, viewport is never used in any setPointCloudRenderingProperties and the setters in my eyes shall return [[noreturn]] bool or void.
mvieth commentedon Nov 12, 2022
Feel free to create a pull request with your proposed changes, then we can discuss them in detail 👍
theoniko commentedon Dec 3, 2022
I created an initial PR. Please feel free to add your suggestions.
theoniko commentedon Dec 22, 2022
@mvieth: Could you please have a look to PR 5526?