Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sdf::Model::CanonicalLinkAndRelativeName public #426

Merged
merged 2 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ but with improved human-readability..
+ Errors ResolveChildLink(std::string&) const
+ Errors ResolveParentLink(std::string&) const

1. **sdf/Model.hh**:
+ std::pair<const Link *, std::string> CanonicalLinkAndRelativeName() const;

### Modifications

1. **sdf/Model.hh**: the following methods now accept nested names relative to
Expand Down
19 changes: 7 additions & 12 deletions include/sdf/Model.hh
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ namespace sdf
/// \param[in] _name Name of the placement frame.
public: void SetPlacementFrameName(const std::string &_name);

/// \brief Get the model's canonical link and the nested name of the link
/// relative to the current model, delimited by "::".
/// \return An immutable pointer to the canonical link and the nested
/// name of the link relative to the current model.
public: std::pair<const Link *, std::string> CanonicalLinkAndRelativeName()
const;

/// \brief Give the scoped PoseRelativeToGraph to be used for resolving
/// poses. This is private and is intended to be called by Root::Load or
/// World::SetPoseRelativeToGraph if this is a standalone model and
Expand All @@ -330,24 +337,12 @@ namespace sdf
private: void SetFrameAttachedToGraph(
sdf::ScopedGraph<FrameAttachedToGraph> _graph);

/// \brief Get the model's canonical link and the nested name of the link
/// relative to the current model, delimited by "::".
/// \return An immutable pointer to the canonical link and the nested
/// name of the link relative to the current model.
private: std::pair<const Link *, std::string> CanonicalLinkAndRelativeName()
const;

/// \brief Allow Root::Load, World::SetPoseRelativeToGraph, or
/// World::SetFrameAttachedToGraph to call SetPoseRelativeToGraph and
/// SetFrameAttachedToGraph
friend class Root;
friend class World;

/// \brief Allow helper function in FrameSemantics.cc to call
/// CanonicalLinkAndRelativeName.
friend std::pair<const Link *, std::string>
modelCanonicalLinkAndRelativeName(const Model *);

/// \brief Private data pointer.
private: ModelPrivate *dataPtr = nullptr;
};
Expand Down