I am writing a Qt application to enable generation of signal files using a GUI. The GUI has a canvas that allows a user to draw a new signal. Id like a signal to be defined as a set of contiguous line segments where each segment can be shifted up or down to shift the signal up or down.
I am trying to figure out the best data structure to represent the signal that will allow dynamic change in number of line segments while keeping total signal length the same, i.e. a user can choose the granularity at which she can change the signal. This would mean there needs to be a dynamic data structure that can add/remove and more importantly split and merge line segments.
Need some pointers at what type of data structure might be best.
thanks