Skip to content

Resolve "Contour with annotated color"

To fix #15810 (closed), we use the following approach:

  1. vtkPVContourFilter, when Compute Scalars is checked, fixes the generated scalars array to have values exactly matching the requested contour values (without the numerical error introduced by interpolation).
  2. Compute Scalars is now checked by default and made an advanced property, since users will only need to change it they really really don't want to compute scalars (which is really not that expensive computationally, just has memory overhead).
  3. The code to add annotation values and labels uses full double/float precision for double/float values. This makes sure the categorical colors when requested are setup for accurate values. This causes the default labels annotated floating point numbers to be too verbose. Hence, making it use the same settings as Real Number Display Precision, used by pqDoubleLineEdit etc.

Steps for testing

  • Open disk_out_ref.ex2, load all variables Apply.
  • Contour, hit image to delete all Isosurfaces and add an arbitrary range of values using the image button, say 10. Apply
  • The contours will be colored by the default transfer function which is not categorical. Go to the Color Map Editor and simply check Interpret Values as Categories.

image

Edited by Utkarsh Ayachit

Merge request reports