Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Implement
AbstractPath
and related API changes to support multiple path types #3535Implement
AbstractPath
and related API changes to support multiple path types #3535Changes from 6 commits
34daa7a
3d5c2ee
e0f19be
81d1aee
b4f11fd
b70b2fa
5e98a45
4f81105
016d8bd
bb4b8be
5a74515
ce3b0c4
c383f64
e57c1f6
e53ea0b
c3ac610
df76b0a
f64e3cd
f6e7208
2940c77
25ed001
e9e0008
507e4e1
83577ea
83959bb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Careful, avoid changing the API in such a way that isn't doesn't match a 4.4 --> 4.5 transition. OpenSim users are acclimatized to version bumps mostly only changing something quite trivial (e.g. the caller must now provide a
State
to this or that method).Not saying don't do it, but if there's any mechanism for avoiding it I'd strongly recommend doing that rather than having to eat the time overhead of supporting people complaining about their scripts being broken.
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.
Per your suggestions, I'm opting to revert API changes since supporting
getGeometryPath
andupdGeometryPath
is straight-forward anyway. But I agree, in the end, I'd prefer minimal API changes for those reasons.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.
Changes behavior/intent
The function is
DeGrooteFregly2016Muscle::replaceMuscles
. Apart from that function,DeGrooteFregly2016Muscle
doesn't appear to rely on "point-based paths" directly, so it should work with function-based paths also? The refactor effectively breaksDeGrootFregly2016Muscle
if it is given a non-point-based path because it makes no attempt to handle theelse
part ofif (auto* pGeometryPath = dynamic_cast<GeometryPath*>(&path))
If that's the case, I'd recommend writing a generic
CopyPath
/CopyMuscle
functions that can be used in cases where muscles want to copy this information around.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.
Same as below, I've added an
else
branch to catch unsupported path types. As we add new path types, we can add newelseif
branches to included supported path types.The generic functions for copying muscle information could be implemented and should probably live somewhere else (@aymanhab has suggested this before). I think that could be addressed in a separate PR.
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.
I'd tackle copying centrally in this PR rather than leaving an
else
as a future exercise: there's a high chance it'll be forgotten and undetected until a user runs into it at runtime (e.g. by usingDeGrooteFregly2016Muscle
with a non-GeometryPath
)Plus, if copy assignment of paths is something that's in downstream code (e.g. as it is here) then, architecturally speaking, it makes sense that copying is tackled centrally and code is ported accordingly.