SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::sectionview::SectionPreviewWidget Class Reference

#include <sectionpreviewwidget.h>

Inheritance diagram for openswmmvis::sectionview::SectionPreviewWidget:
Collaboration diagram for openswmmvis::sectionview::SectionPreviewWidget:

Signals

void viewportChanged (const DiagramViewport &viewport)
 

Public Member Functions

 SectionPreviewWidget (QWidget *parent=nullptr)
 
void setModel (SectionDiagramModel model)
 
const SectionDiagramModelmodel () const noexcept
 
void setPlaceholderText (const QString &text)
 
QImage renderToImage (const QSize &size) const
 
const DiagramViewportviewport () const noexcept
 
void setViewport (const DiagramViewport &viewport)
 
void zoomToExtents ()
 
void zoomBy (double factor, const QPointF &anchorPx)
 
double achievedVerticalExaggeration () const noexcept
 
QRectF lastFitRect () const noexcept
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 
void wheelEvent (QWheelEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 

Constructor & Destructor Documentation

◆ SectionPreviewWidget()

openswmmvis::sectionview::SectionPreviewWidget::SectionPreviewWidget ( QWidget *  parent = nullptr)
explicit

Member Function Documentation

◆ achievedVerticalExaggeration()

double openswmmvis::sectionview::SectionPreviewWidget::achievedVerticalExaggeration ( ) const
inlinenoexcept

V:H ratio used by the last paint — 1.0 for a true-scale or uniform-scale drawing. Reflects the automatic choice as well as an explicit one, so callers (and tests) never have to infer it from pixels. Valid only after something has been painted.

◆ lastFitRect()

QRectF openswmmvis::sectionview::SectionPreviewWidget::lastFitRect ( ) const
inlinenoexcept

Pixel rect the model bounds were fitted into by the last paint, before zoom/pan. Exposed for tests and for any host that needs to relate widget coordinates back to the drawing.

◆ model()

const SectionDiagramModel & openswmmvis::sectionview::SectionPreviewWidget::model ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ mouseDoubleClickEvent()

void openswmmvis::sectionview::SectionPreviewWidget::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mouseMoveEvent()

void openswmmvis::sectionview::SectionPreviewWidget::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mousePressEvent()

void openswmmvis::sectionview::SectionPreviewWidget::mousePressEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mouseReleaseEvent()

void openswmmvis::sectionview::SectionPreviewWidget::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

◆ paintEvent()

void openswmmvis::sectionview::SectionPreviewWidget::paintEvent ( QPaintEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ renderToImage()

QImage openswmmvis::sectionview::SectionPreviewWidget::renderToImage ( const QSize &  size) const

Render the current model into an image — used by tests (offscreen) and by any future "copy diagram" action. Honours the current view.

Here is the call graph for this function:

◆ setModel()

void openswmmvis::sectionview::SectionPreviewWidget::setModel ( SectionDiagramModel  model)

Replace the drawing and repaint. Passing a default-constructed model clears the widget to its empty state.

Does NOT reset zoom/pan — see the note in the implementation. Call zoomToExtents() when the SUBJECT changes, not when its values do.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPlaceholderText()

void openswmmvis::sectionview::SectionPreviewWidget::setPlaceholderText ( const QString &  text)

Message shown when the model has nothing to draw and carries no emptyText of its own.

◆ setViewport()

void openswmmvis::sectionview::SectionPreviewWidget::setViewport ( const DiagramViewport viewport)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ viewport()

const DiagramViewport & openswmmvis::sectionview::SectionPreviewWidget::viewport ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ viewportChanged

void openswmmvis::sectionview::SectionPreviewWidget::viewportChanged ( const DiagramViewport viewport)
signal

Emitted whenever zoom or pan changes, so a host can mirror the state (e.g. a zoom-percentage readout).

Here is the caller graph for this function:

◆ wheelEvent()

void openswmmvis::sectionview::SectionPreviewWidget::wheelEvent ( QWheelEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ zoomBy()

void openswmmvis::sectionview::SectionPreviewWidget::zoomBy ( double  factor,
const QPointF &  anchorPx 
)

Multiply the current zoom by factor, keeping the model point under anchorPx (widget coordinates) stationary.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zoomToExtents()

void openswmmvis::sectionview::SectionPreviewWidget::zoomToExtents ( )

Reset to the automatic fit. Invoked by middle double-click, and by hosts when the displayed object (not merely its values) changes.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: