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

Array Curve container #1678

Open
heinezen opened this issue Aug 25, 2024 · 0 comments
Open

Array Curve container #1678

heinezen opened this issue Aug 25, 2024 · 0 comments
Labels
area: util Utilitis and data structures lang: c++ Done in C++ code nice new thing ☺ A new feature that was not there before

Comments

@heinezen
Copy link
Member

We should add a curve::Array type to our curve container classes to record changes to a fixed size sequence over time. In comparison to #1677 we can probably optimize a lot more since the size doesn't change over time (i.e. no inserts or erasures).

The new array type should implement these methods:

Read

Method Description
get(t, i) Get value of index i at time t
get(t) Get vector at time t
size() Get size of the array
frame(t, i) Get the previous keyframe (time and value) of index i before or at t
next_frame(t, i) Get the next keyframe (time and value) of index i after t

There should also be an iterator type to iterate over the array at time t.

Modify

Method Description
set_insert(t, i, value) Insert a new keyframe value at time t at index i
set_last(t, i, value) Insert a new keyframe value at time t; delete all keyframes after time t at index i
set_replace(t, i, value) Insert a new keyframe value at time t at index i; remove all other keyframes with time t at index i

Copy

Method Description
sync(Curve, t) Replace all keyframes from self after time t with keyframes from source Curve after time t
@heinezen heinezen added nice new thing ☺ A new feature that was not there before lang: c++ Done in C++ code area: util Utilitis and data structures labels Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: util Utilitis and data structures lang: c++ Done in C++ code nice new thing ☺ A new feature that was not there before
Projects
None yet
Development

No branches or pull requests

1 participant