-
Notifications
You must be signed in to change notification settings - Fork 123
Parse category bitmask SDF element in Surface DOM #1630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,9 @@ | |||||||
| #ifndef SDF_SURFACE_HH_ | ||||||||
| #define SDF_SURFACE_HH_ | ||||||||
|
|
||||||||
| #include <cstdint> | ||||||||
| #include <optional> | ||||||||
|
|
||||||||
| #include <gz/math/Vector3.hh> | ||||||||
| #include <gz/utils/ImplPtr.hh> | ||||||||
| #include "sdf/Element.hh" | ||||||||
|
|
@@ -53,8 +56,17 @@ namespace sdf | |||||||
| public: uint16_t CollideBitmask() const; | ||||||||
|
|
||||||||
| /// \brief Set the collide bitmask parameter. | ||||||||
| /// \param[in] _bitmask Category bitmask to set | ||||||||
| public: void SetCollideBitmask(const uint16_t _bitmask); | ||||||||
|
|
||||||||
| /// \brief Get the category bitmask parameter. | ||||||||
| /// \return The category bitmask parameter. | ||||||||
| public: std::optional<uint16_t> CategoryBitmask() const; | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it make sense to return a
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after doing some reading online and asking AI, it seems that for simple primitive types like I do see some places in sdformat that returns sdformat/include/sdf/InterfaceElements.hh Line 102 in dcd3c2d
so I'm ok to match the style for consistency or clarity reasons.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CPP core guideline F.15 suggests preferring simple and conventional ways of passing information, and the example indicate returning by value rather than a so I think you can ignore my earlier suggestion and keep it as is I remember seeing lint warnings recommending more use of |
||||||||
|
|
||||||||
| /// \brief Set the category bitmask parameter. | ||||||||
| /// \param[in] _bitmask Category bitmask to set | ||||||||
| public: void SetCategoryBitmask(const uint16_t _bitmask); | ||||||||
|
|
||||||||
| /// \brief Private data pointer. | ||||||||
| GZ_UTILS_IMPL_PTR(dataPtr) | ||||||||
| }; | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.