Skip to content

Use strongly typed 'enum' instead of 'int' for properties in PCLVisualizer code #1692

Open

Description

@aecins

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.

Activity

  1. added this to the pcl-1.9.0 milestone on Aug 25, 2016
  2. StephenNneji commented on Jan 7, 2018

    @StephenNneji
    Contributor

    I could take this issue if its still relevant considering its been dormant since 2016.

  3. SergioRAgostinho commented on Jan 9, 2018

    @SergioRAgostinho
    Member

    That would be great I would say. Just self assign yourself to this issue to help us keep track of things.

  4. StephenNneji commented on Jan 9, 2018

    @StephenNneji
    Contributor

    @SergioRAgostinho I don't have write access so I cannot assign this to myself

  5. SergioRAgostinho commented on Jan 9, 2018

    @SergioRAgostinho
    Member

    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.

  6. removed this from the pcl-1.9.0 milestone on Jan 26, 2018
  7. stale commented on May 19, 2020

    @stale

    Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

  8. theoniko commented on Jan 7, 2022

    @theoniko
    Contributor

    Hello,
    Could i work on this one? Is just using enum class instead of using ints in function singatures?

  9. mvieth commented on Jan 8, 2022

    @mvieth
    Member

    Hello, Could i work on this one?

    Sure, that would be great

    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

  10. theoniko commented on Nov 11, 2022

    @theoniko
    Contributor

    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.

  11. mvieth commented on Nov 12, 2022

    @mvieth
    Member

    Feel free to create a pull request with your proposed changes, then we can discuss them in detail 👍

  12. theoniko commented on Dec 3, 2022

    @theoniko
    Contributor

    Feel free to create a pull request with your proposed changes, then we can discuss them in detail 👍

    I created an initial PR. Please feel free to add your suggestions.

  13. theoniko commented on Dec 22, 2022

    @theoniko
    Contributor

    @mvieth: Could you please have a look to PR 5526?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: lowRough estimate of time needed to fix/implement/solvegood first issueSkills/areas of expertise needed to tackle the issuekind: todoType of issuemodule: visualization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions