A widget that draws a scale bar with subdivision lines for spatial reference.
More...
#include <QmitkScalarBar.h>
A widget that draws a scale bar with subdivision lines for spatial reference.
The scalar bar can be oriented either vertically or horizontally. It automatically adapts its number of subdivisions and size based on the parent widget dimensions and the given scale factor (mm-per-pixel). The bar is drawn using a configurable QPen.
- See also
- QmitkScalarBarOverlay
Definition at line 32 of file QmitkScalarBar.h.
◆ alignment
Orientation of the scalar bar.
| Enumerator |
|---|
| vertical | Vertical orientation (default)
|
| horizontal | Horizontal orientation.
|
Definition at line 39 of file QmitkScalarBar.h.
◆ QmitkScalarBar()
| QmitkScalarBar::QmitkScalarBar |
( |
QWidget * |
parent = nullptr | ) |
|
Constructor.
- Parameters
-
| [in] | parent | Optional parent widget. |
◆ ~QmitkScalarBar()
| QmitkScalarBar::~QmitkScalarBar |
( |
| ) |
|
|
override |
◆ CleanUpLines()
| void QmitkScalarBar::CleanUpLines |
( |
| ) |
|
|
protected |
◆ GetNumberOfSubdivisions()
| unsigned int QmitkScalarBar::GetNumberOfSubdivisions |
( |
| ) |
|
Returns the current number of subdivision tick marks.
- Returns
- The number of subdivisions.
◆ paintEvent()
| void QmitkScalarBar::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotected |
◆ SetAlignment()
| virtual void QmitkScalarBar::SetAlignment |
( |
alignment |
align | ) |
|
|
virtual |
Sets the orientation of the scalar bar.
- Parameters
-
| [in] | align | The desired alignment (vertical or horizontal). |
◆ SetNumberOfSubdivisions()
| void QmitkScalarBar::SetNumberOfSubdivisions |
( |
unsigned int |
subs | ) |
|
Sets the number of subdivision tick marks.
- Parameters
-
| [in] | subs | The number of subdivisions. |
◆ SetPen()
| void QmitkScalarBar::SetPen |
( |
const QPen & |
pen | ) |
|
Sets the pen used to draw the scalar bar lines.
- Parameters
-
| [in] | pen | The QPen to use for rendering. |
◆ SetScaleFactor()
| virtual void QmitkScalarBar::SetScaleFactor |
( |
double |
scale | ) |
|
|
virtual |
Sets the scale factor (mm per pixel) and resizes the bar accordingly.
The method dynamically adjusts the number of subdivisions and the widget size to fit within a reasonable proportion of the parent widget.
- Parameters
-
| [in] | scale | The scale factor in mm per pixel. |
◆ SetupGeometry()
| void QmitkScalarBar::SetupGeometry |
( |
alignment |
align | ) |
|
|
protected |
◆ m_Alignment
◆ m_MainLine
| QLine* QmitkScalarBar::m_MainLine |
|
protected |
◆ m_NumberOfSubDivisions
| unsigned int QmitkScalarBar::m_NumberOfSubDivisions |
|
protected |
◆ m_Pen
| QPen QmitkScalarBar::m_Pen |
|
protected |
◆ m_ScaleFactor
| double QmitkScalarBar::m_ScaleFactor |
|
protected |
◆ m_SubDivisionLines
| std::vector<QLine *> QmitkScalarBar::m_SubDivisionLines |
|
protected |
The documentation for this class was generated from the following file: