Initial refactor - compiles but needs fixing etc.#2
Merged
joris997 merged 2 commits intojoris997:interpolationfrom Apr 16, 2021
adamkewley:ak_interpolation
Merged
Initial refactor - compiles but needs fixing etc.#2joris997 merged 2 commits intojoris997:interpolationfrom adamkewley:ak_interpolation
joris997 merged 2 commits intojoris997:interpolationfrom
adamkewley:ak_interpolation
Conversation
Author
|
The latest refactor:
Outstanding work (laundry list - will be discussed separately):
|
Owner
|
I'll merge and fix/test things during the weekend. Then if anything breaks we can go back to the pre-merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a work-in-progress PR - it does not currently work.
Changes up to now:
GeometryPathmeans hereGeometryPathmethods such that related members are together (e.g.1, e.g.2)PointBasedPathhereFunctionBasedPathhereFunctionBasedPathhereInterpolateinto thecppfile forFunctionBasedPathand hiddenFunctionBasedPath's implementation behind an opaqueOpenSim::FunctionBasedPath::Implstructthat no other compilation units can see (header, impl)getLengthandgetLengtheningSpeeduse the underlyingCacheVariableinfrastructure hereprintContentuse anostreamrather than anofstream, so that it can be used to also print to (e.g.) memory. Also refactored the implementation to usechardelimibers, which the compiler can more easily optimize around than strings. See hereid, anintthat implicitly names+finds the associated data file, intodata_path, which explicitly holds a path to the data file. This is so that data files can later be moved to other locations, shared between models, etc. Change hereFunctionBasedPathconstructors that take anidor aPointBasedPathto construct an instance ofFunctionBasedPath. Understanding the intention (of passing anint) is unclear from the type signature alone. Those constructors are now factory functions called:FunctionBasedPath::fromPointBasedPathi.e., create aFunctionBasedPathfrom an existingPointBasedPath(here)FunctionBasedPath::fromDataFilei.e. create aFunctionBasedPathfrom an existing data file (here)stoabstractions. See change herefromPointBasedPathimplementation hereFunctionBasedPathModelToolhereFunctionBasedPathModelToolto take two args, so the user can specify an output name hereOutstanding issues:
FunctionBasedPathin the implementation doesn't seem to have a way of loading data files whereid != 0. Probably wouldn't be able to load an arbitraryosimcontainingFunctionBasedPaths and expect it to workCoordinate*s intoInterpolate, butInterpolateseems to rely on it being non-empty at runtime (there are asserts, but these would be disabled in release builds)GeometryPathclass still contains a lot of point-centric methodssetLengthdo not seem to make sense in eitherFunctionBasedPathorPointBasedPath- should probably be private. Same forsetLengtheningSpeedWe'll meet tomorrow about some of these