visit icon indicating copy to clipboard operation
visit copied to clipboard

Text annotation objects might need to behave more like legend annotation objects

Open markcmiller86 opened this issue 3 years ago • 1 comments

Describe the bug

  1. Create 3 different databases from arbitrary but distinctly different subsets of the waveXXXX.silo files.
  2. Put up PC plot of pressure from waveA.silo and Mesh plot from waveB.silo
  3. Draw plots
  4. Add text annotation for $time and confirm it displays time of first database of first plot in plot list
  5. Change order of plots in plot list and watch value for $time annotation change

Somehow, the text annotation object is getting what it knows about the database only from the first entry in the plot list. I think the solution is for it to track which plot its associated with in the plot list. Looking here...

https://github.com/visit-dav/visit/blob/9d76188e4f5f9169709e9c0cf274209dbeca13e2/src/avt/VisWindow/Colleagues/avtAnnotationWithTextColleague.C#L76

Its obviously only using plot list entry 0. But, what plot...the plot's index at the time the annotation object was created? The plot's type...the plot`s database/variable name. The latter might be best so it could find which entry to query in the plot list to update its value.

markcmiller86 avatar Aug 26 '22 22:08 markcmiller86

I think what we need is a printable form way of identifying plots. Currently, plots are identified by and large within a VisIt session as an index into a list of plots. But, because plots are added and deleted and can even be re-ordered in the plot list, an index into the list is an unreliable way to identify a plot.

We could compute a hash of all relevant stuff that goes into a plot...the database, variable name, plot attributes, attributes of any operators applied, etc. Whenever anything about the plot changes, that hash would change...does that mean the plot itself is a different thing than it was before the change?

From the point of view of identifying the C++ object within a VisIt session, such an approach is overkill and leads to far too many instances where the identifer changes for the same C++ object instance. OTOH, in such an approach the same plot created in two different instances of VisIt would have the same id and maybe that is a good thing?

Could we just use the C++ plot object's pointer as its id? That certainly would not work across session saves and restores?

markcmiller86 avatar Aug 27 '22 23:08 markcmiller86