OGS
|
A 2D bar visualisation of a borehole stratigraphy.
A 2D bar visualisation of a borehole stratigraphy as a QGraphicsItem.
Definition at line 29 of file StratBar.h.
#include <StratBar.h>
Public Member Functions | |
StratBar (GeoLib::StationBorehole *station, std::map< std::string, DataHolderLib::Color > *stratColors=nullptr, QGraphicsItem *parent=nullptr) | |
Constructor. | |
~StratBar () override=default | |
QRectF | boundingRect () const override |
Returns the bounding rectangle of the bar. | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
Paints the bar. | |
Private Member Functions | |
double | logHeight (double h) const |
Calculates the height for a soil layer by "log(d+1)*100". | |
double | totalLogHeight () const |
Calculates the total height of the bar by calculating and adding the log-height for all layers in the borehole. | |
Private Attributes | |
GeoLib::StationBorehole * | _station |
std::map< std::string, DataHolderLib::Color > | _stratColors |
Static Private Attributes | |
static const int | BARWIDTH = 50 |
The default width of the bar. | |
|
explicit |
Constructor.
station | The borehole whose stratigraphy will be visualised. |
stratColors | A color map. |
parent | The parent QGraphicsItem. |
Definition at line 19 of file StratBar.cpp.
References _stratColors.
|
overridedefault |
|
override |
Returns the bounding rectangle of the bar.
Definition at line 30 of file StratBar.cpp.
References BARWIDTH, and totalLogHeight().
Referenced by StratScene::StratScene().
|
inlineprivate |
Calculates the height for a soil layer by "log(d+1)*100".
h | The original thickness of the soil layer. |
Definition at line 57 of file StratBar.h.
Referenced by paint().
|
override |
Paints the bar.
Definition at line 35 of file StratBar.cpp.
References _station, _stratColors, BARWIDTH, DataHolderLib::getColor(), GeoLib::StationBorehole::getProfile(), GeoLib::StationBorehole::getSoilNames(), and logHeight().
|
private |
Calculates the total height of the bar by calculating and adding the log-height for all layers in the borehole.
Definition at line 81 of file StratBar.cpp.
References _station, and GeoLib::StationBorehole::getProfile().
Referenced by boundingRect().
|
private |
Definition at line 65 of file StratBar.h.
Referenced by paint(), and totalLogHeight().
|
private |
Definition at line 66 of file StratBar.h.
Referenced by StratBar(), and paint().
|
staticprivate |
The default width of the bar.
Definition at line 63 of file StratBar.h.
Referenced by boundingRect(), and paint().