|
wiRedPanda
Logic Circuit Simulator
|
Owns the waveform table's zoom state and the math that maps it to view metrics. More...
#include <DolphinZoom.h>
Public Member Functions | |
| void | apply () const |
| Applies the current zoom to the view's row/column section sizes and font. | |
| bool | canZoomIn () const |
| True if Zoom In is still possible (below the max level). | |
| bool | canZoomOut () const |
| True if Zoom Out is still possible (above the baseline). | |
| DolphinZoom (QTableView *view) | |
| Constructs the zoom controller for view (not owned; must outlive this). | |
| double | fitScale () const |
| Current uniform Fit Screen scale. | |
| void | fitScreen () |
| void | reset () |
| Resets both axes to the baseline (level 0, scale 1.0) and re-applies. | |
| void | zoomIn () |
| Increases the discrete column-zoom one step (capped) and re-applies. | |
| int | zoomLevel () const |
| Current discrete column-zoom level. | |
| void | zoomOut () |
| Decreases the discrete column-zoom one step (floored at the baseline) and re-applies. | |
Owns the waveform table's zoom state and the math that maps it to view metrics.
Two independent axes: a discrete column-zoom level (Zoom In/Out/Reset) that widens columns only — a horizontal "time stretch" — and a uniform Fit Screen scale that scales columns, rows, and font together. Holds a non-owning pointer to the table view and resizes its Fixed-mode header sections + font on apply(). The controller keeps the UI glue (sentry breadcrumbs, guarded slots, action enable-state, the wheel event filter).
Definition at line 22 of file DolphinZoom.h.
|
explicit |
Constructs the zoom controller for view (not owned; must outlive this).
Definition at line 24 of file DolphinZoom.cpp.
| void DolphinZoom::apply | ( | ) | const |
Applies the current zoom to the view's row/column section sizes and font.
Definition at line 112 of file DolphinZoom.cpp.
References kDefaultColumnWidth, kDefaultRowHeight, and kZoomStep.
Referenced by fitScreen(), reset(), zoomIn(), and zoomOut().
| bool DolphinZoom::canZoomIn | ( | ) | const |
True if Zoom In is still possible (below the max level).
Definition at line 29 of file DolphinZoom.cpp.
References kMaxZoomLevel.
| bool DolphinZoom::canZoomOut | ( | ) | const |
True if Zoom Out is still possible (above the baseline).
Definition at line 34 of file DolphinZoom.cpp.
|
inline |
Current uniform Fit Screen scale.
Definition at line 43 of file DolphinZoom.h.
| void DolphinZoom::fitScreen | ( | ) |
Computes a uniform scale that fits the content in the viewport and re-applies. On degenerate geometry (empty/hidden table) it leaves the zoom untouched.
Definition at line 64 of file DolphinZoom.cpp.
References apply(), kDefaultColumnWidth, kDefaultRowHeight, kFitEpsilon, kFitIterations, kMaxFitScale, and kMinFitScale.
| void DolphinZoom::reset | ( | ) |
Resets both axes to the baseline (level 0, scale 1.0) and re-applies.
Definition at line 57 of file DolphinZoom.cpp.
References apply().
| void DolphinZoom::zoomIn | ( | ) |
Increases the discrete column-zoom one step (capped) and re-applies.
Definition at line 39 of file DolphinZoom.cpp.
References apply(), and kMaxZoomLevel.
|
inline |
Current discrete column-zoom level.
Definition at line 41 of file DolphinZoom.h.
| void DolphinZoom::zoomOut | ( | ) |
Decreases the discrete column-zoom one step (floored at the baseline) and re-applies.
Definition at line 48 of file DolphinZoom.cpp.
References apply().