Hi Michel, I think that there's a bit of an abstraction layer missing.
As code speaks, first thing we did was update the documentation for the code so it speaks more clearly.
Next up, I think you should look at the ITmfStatesystem interface, it is interfacing with queries, the backend is interfacing to the state system history front end.
>From a user perspective, this is the important API
<code>
Management:
getSSID()
getStartTime()
getCurrentEndTime()
isCancelled()
waitUntilBuilt()
waitUntilBuilt(long)
dispose()
Stuff to set up a query:
getNbAttributes()
getQuarkAbsolute(String...)
optQuarkAbsolute(String...)
getQuarkRelative(int, String...)
optQuarkRelative(int, String...)
getSubAttributes(int, boolean)
getSubAttributes(int, boolean, String)
getQuarks(String...)
getQuarks(int, String...)
getAttributeName(int)
getFullAttributePath(int)
getFullAttributePathArray(int)
getParentAttributeQuark(int)
Actual heavy lifting
queryOngoingState(int)
queryOngoing(int)
getOngoingStartTime(int)
queryFullState(long)
querySingleState(long, int)
query2D(Collection<Integer>, Collection<Long>)
query2D(Collection<Integer>, long, long)
The backend has the history tree. It is written in a bit more of a c-like way (passing arrays to be filled)
doQuery is a 1-1 map with query full state.
doQuery(List<ITmfStateInterval>, long)
doSingularQuery is a single quark single time query
doSingularQuery(long, int)
query2d will make a 2d grid
query2D(IntegerRangeCondition, TimeRangeCondition)
query2D(IntegerRangeCondition, TimeRangeCondition, boolean)
Our views typically use either 2d queries when possible (more efficient as no node is traversed twice) or single state queries for stuff like tooltips.
Please note, even if the 2d query is "theoretically" faster than a full stabbing state query (queryFullState), in tests, the full state query is sometimes faster. That is why you will see it here and there.
Sampling is done with:
resolution = (end-start) / width (a floored long)
Then we use StateSystemUtils.getTimes() which loops incrementing t += resolution.
So, if resolution is a bit shorted due to the floor, you'll get a little bit too many samples, so you could get two in the same pixel. And each sample can be anywhere in the pixel range.
Now we are also working on making a fixed raster pattern which should sidestep that problem and make the state aliasing pop be a problem of the past.