Skip to content

Rework AxisActor2D Ticks positions

Nicolas Vuaille requested to merge nicolas.vuaille/vtk:AxisActor2DTicks into master

Rework the vtkAxisActor2D core algorithm. This class generates:

  • a polydata, containing one main line (the Axis) and smaller orthogonal lines (Ticks)
  • a list of displayed values (Labels) contained in Range, forwarded to TextActors/TextMappers

Labels are associated to Major Ticks. There can be intermediate, minor ticks between them.

This MR contains:

  • A refactor, to split the main algo into methods for each step of the work
    1. Adjust the given Range and NumberOfTicks depending on configuration (RulerMode, AdjustTicks)
    2. Build a list of Ticks value and position
    3. Generate polydata
    4. Update TextActors
    5. Update Title
  • Some improvements: there were different cases were labels were badly associated to ticks
    1. wrong number of displayed labels
    2. wrong number of computed labels
    3. displayed labels not matching actual ticks position (incorrect for RulerMode)
Edited by Nicolas Vuaille

Merge request reports