Qt Virtual Chart Table (QVCT)
CChart Class Reference

[UI] Chart (view) More...

#include <charts/CChart.hpp>

Inheritance diagram for CChart:

Public Member Functions

 CChart (const QString &_rqsFileName, QWidget *_pqParent=0)
 
virtual ~CChart ()
 
void addElevation (const QString &_rqsFileName)
 Add elevation model data to chart. More...
 
void setDrawArea (QRectF _qRectFDrawArea)
 Sets the viewport draw area. More...
 
void resetDrawArea ()
 Resets the viewport draw area (to the widget's area) More...
 
void setGeoPosition (const CDataPosition &_roGeoPosition)
 Sets the current (center) position (geographical coordinates) of the chart. More...
 
void lockPosition (bool _bLock)
 Sets the position lock status. More...
 
void setZoom (double _fdZoom)
 Sets the current zoom factor. More...
 
void lockZoom (bool _bLock)
 Sets the zoom lock status. More...
 
void showElevation (bool _bShow)
 Sets the elevation model show status. More...
 
QVCT::EStatus getStatus () const
 Returns the internal status of the object. More...
 
QString getFileName () const
 Returns the underlying chart (GDAL dataset) file name. More...
 
QRectF getDrawArea () const
 Returns the viewport draw area. More...
 
CDataPosition getGeoPositionCenter () const
 Returns the center position (geographical coordinates) of the chart. More...
 
CDataPosition getGeoPosition () const
 Returns the current (center) position (geographical coordinates) of the chart. More...
 
QPointF getDrawPositionCenter () const
 Returns the viewport draw area's center position. More...
 
QPointF getDatPosition () const
 Returns the current (center) position (dataset coordinates) of the chart. More...
 
bool isPositionLocked () const
 Returns the position lock status. More...
 
double getZoom () const
 Returns the current zoom factor. More...
 
double getZoomActual () const
 Returns the zoom factor corresponding to a 1:1 dataset/screen pixels ratio. More...
 
double getZoomFit () const
 Returns the zoom factor allowing to view the entire chart. More...
 
double getZoomArea (const CDataPosition &_roGeoPosition1, const CDataPosition &_roGeoPosition2) const
 Returns the zoom factor allowing to view the given geographical area (defined by its opposite corners) More...
 
bool isZoomLocked () const
 Returns the zoom lock status. More...
 
bool hasElevation () const
 Returns whether this chart has been associated elevation model data. More...
 
bool isElevationShowed () const
 Returns the elevation model show status. More...
 
double getResolution () const
 Returns the resolution of the chart at its current position, in meters per pixel [m/px]. More...
 
CDataPosition toGeoPosition (const QPointF &_rqPointFDrawPosition) const
 Converts the given chart draw position to geographical position. More...
 
QPointF toDrawPosition (const CDataPosition &_roGeoPosition) const
 Converts the given (geographical) position [long,lat,elev] to chart draw point [px]. More...
 
void move (const QPointF &_rqPointFDrawPositionOffset)
 Move the current (center) chart position by specified offset (in the draw area) More...
 
void print (QPrinter *_pqPrinter)
 Prints the chart. More...
 
void parseQVCT (const QDomElement &_rqDomElement)
 Retrieves this object's content from the given QVCT source (file) More...
 
void dumpQVCT (QXmlStreamWriter &_rqXmlStreamWriter) const
 Stores this object's content to the given QVCT destination (file) More...
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *_pqPaintEvent)
 
void draw ()
 Draws the chart (on screen) More...
 

Private Attributes

CChartGDALRasterpoChartGDALRaster
 GDAL chart (dataset) More...
 
CChartGDALElevationpoChartGDALElevation
 GDAL data elevation model (dataset) More...
 
QRectF qRectFDrawArea
 Viewport draw area. More...
 
QPointF qPointFDatPosition
 Current (center) position in the GDAL dataset. More...
 
bool bPositionLock
 Position lock status. More...
 
double fdZoom
 Current zoom factor. More...
 
bool bZoomLock
 Zoom lock status. More...
 
bool bShowElevation
 Elevation model show status. More...
 

Detailed Description

[UI] Chart (view)

This class wraps a CChartGDAL object and allows it to be manipulated and displayed in the "virtual" chart table.

Author
Cedric Dufour http://cedric.dufour.name

Definition at line 43 of file CChart.hpp.

Constructor & Destructor Documentation

◆ CChart()

CChart::CChart ( const QString &  _rqsFileName,
QWidget *  _pqParent = 0 
)

Definition at line 44 of file CChart.cpp.

◆ ~CChart()

CChart::~CChart ( )
virtual

Definition at line 63 of file CChart.cpp.

Member Function Documentation

◆ addElevation()

void CChart::addElevation ( const QString &  _rqsFileName)

Add elevation model data to chart.

Definition at line 69 of file CChart.cpp.

◆ paintEvent()

void CChart::paintEvent ( QPaintEvent *  _pqPaintEvent)
protectedvirtual

Definition at line 84 of file CChart.cpp.

◆ setDrawArea()

void CChart::setDrawArea ( QRectF  _qRectFDrawArea)
inline

Sets the viewport draw area.

Definition at line 105 of file CChart.hpp.

◆ resetDrawArea()

void CChart::resetDrawArea ( )

Resets the viewport draw area (to the widget's area)

Definition at line 100 of file CChart.cpp.

◆ setGeoPosition()

void CChart::setGeoPosition ( const CDataPosition _roGeoPosition)

Sets the current (center) position (geographical coordinates) of the chart.

Definition at line 105 of file CChart.cpp.

◆ lockPosition()

void CChart::lockPosition ( bool  _bLock)
inline

Sets the position lock status.

Definition at line 111 of file CChart.hpp.

◆ setZoom()

void CChart::setZoom ( double  _fdZoom)
inline

Sets the current zoom factor.

Definition at line 113 of file CChart.hpp.

◆ lockZoom()

void CChart::lockZoom ( bool  _bLock)
inline

Sets the zoom lock status.

Definition at line 115 of file CChart.hpp.

◆ showElevation()

void CChart::showElevation ( bool  _bShow)

Sets the elevation model show status.

Definition at line 110 of file CChart.cpp.

◆ getStatus()

QVCT::EStatus CChart::getStatus ( ) const

Returns the internal status of the object.

NOTE: Anything but QVCT::OK means the object is not usable.

Definition at line 128 of file CChart.cpp.

◆ getFileName()

QString CChart::getFileName ( ) const

Returns the underlying chart (GDAL dataset) file name.

Definition at line 133 of file CChart.cpp.

◆ getDrawArea()

QRectF CChart::getDrawArea ( ) const
inline

Returns the viewport draw area.

Definition at line 127 of file CChart.hpp.

◆ getGeoPositionCenter()

CDataPosition CChart::getGeoPositionCenter ( ) const

Returns the center position (geographical coordinates) of the chart.

Definition at line 138 of file CChart.cpp.

◆ getGeoPosition()

CDataPosition CChart::getGeoPosition ( ) const

Returns the current (center) position (geographical coordinates) of the chart.

Definition at line 143 of file CChart.cpp.

◆ getDrawPositionCenter()

QPointF CChart::getDrawPositionCenter ( ) const

Returns the viewport draw area's center position.

Definition at line 148 of file CChart.cpp.

◆ getDatPosition()

QPointF CChart::getDatPosition ( ) const
inline

Returns the current (center) position (dataset coordinates) of the chart.

Definition at line 135 of file CChart.hpp.

◆ isPositionLocked()

bool CChart::isPositionLocked ( ) const
inline

Returns the position lock status.

Definition at line 137 of file CChart.hpp.

◆ getZoom()

double CChart::getZoom ( ) const
inline

Returns the current zoom factor.

Definition at line 139 of file CChart.hpp.

◆ getZoomActual()

double CChart::getZoomActual ( ) const
inline

Returns the zoom factor corresponding to a 1:1 dataset/screen pixels ratio.

Definition at line 141 of file CChart.hpp.

◆ getZoomFit()

double CChart::getZoomFit ( ) const

Returns the zoom factor allowing to view the entire chart.

Definition at line 153 of file CChart.cpp.

◆ getZoomArea()

double CChart::getZoomArea ( const CDataPosition _roGeoPosition1,
const CDataPosition _roGeoPosition2 
) const

Returns the zoom factor allowing to view the given geographical area (defined by its opposite corners)

Definition at line 161 of file CChart.cpp.

◆ isZoomLocked()

bool CChart::isZoomLocked ( ) const
inline

Returns the zoom lock status.

Definition at line 147 of file CChart.hpp.

◆ hasElevation()

bool CChart::hasElevation ( ) const
inline

Returns whether this chart has been associated elevation model data.

Definition at line 149 of file CChart.hpp.

◆ isElevationShowed()

bool CChart::isElevationShowed ( ) const
inline

Returns the elevation model show status.

Definition at line 151 of file CChart.hpp.

◆ getResolution()

double CChart::getResolution ( ) const

Returns the resolution of the chart at its current position, in meters per pixel [m/px].

Definition at line 176 of file CChart.cpp.

◆ toGeoPosition()

CDataPosition CChart::toGeoPosition ( const QPointF &  _rqPointFDrawPosition) const

Converts the given chart draw position to geographical position.

Definition at line 185 of file CChart.cpp.

◆ toDrawPosition()

QPointF CChart::toDrawPosition ( const CDataPosition _roGeoPosition) const

Converts the given (geographical) position [long,lat,elev] to chart draw point [px].

Definition at line 192 of file CChart.cpp.

◆ move()

void CChart::move ( const QPointF &  _rqPointFDrawPositionOffset)

Move the current (center) chart position by specified offset (in the draw area)

Definition at line 198 of file CChart.cpp.

◆ draw()

void CChart::draw ( )
protected

Draws the chart (on screen)

Definition at line 203 of file CChart.cpp.

◆ print()

void CChart::print ( QPrinter *  _pqPrinter)

Prints the chart.

Definition at line 253 of file CChart.cpp.

◆ parseQVCT()

void CChart::parseQVCT ( const QDomElement &  _rqDomElement)

Retrieves this object's content from the given QVCT source (file)

Definition at line 283 of file CChart.cpp.

◆ dumpQVCT()

void CChart::dumpQVCT ( QXmlStreamWriter &  _rqXmlStreamWriter) const

Stores this object's content to the given QVCT destination (file)

Definition at line 309 of file CChart.cpp.

Member Data Documentation

◆ poChartGDALRaster

CChartGDALRaster* CChart::poChartGDALRaster
private

GDAL chart (dataset)

Definition at line 53 of file CChart.hpp.

◆ poChartGDALElevation

CChartGDALElevation* CChart::poChartGDALElevation
private

GDAL data elevation model (dataset)

See also
addElevation(), hasElevation()

Definition at line 56 of file CChart.hpp.

◆ qRectFDrawArea

QRectF CChart::qRectFDrawArea
private

Viewport draw area.

See also
setDrawArea(), resetDrawArea(), getDrawArea()

Definition at line 59 of file CChart.hpp.

◆ qPointFDatPosition

QPointF CChart::qPointFDatPosition
private

Current (center) position in the GDAL dataset.

See also
setGeoPosition(), getGeoPosition(), getDatPosition()

Definition at line 62 of file CChart.hpp.

◆ bPositionLock

bool CChart::bPositionLock
private

Position lock status.

See also
lockPosition(), isPositionLocked()

Definition at line 65 of file CChart.hpp.

◆ fdZoom

double CChart::fdZoom
private

Current zoom factor.

See also
setZoom(), getZoom()

Definition at line 68 of file CChart.hpp.

◆ bZoomLock

bool CChart::bZoomLock
private

Zoom lock status.

See also
lockZoom(), isZoomLocked()

Definition at line 71 of file CChart.hpp.

◆ bShowElevation

bool CChart::bShowElevation
private

Elevation model show status.

See also
showElevation(), isElevationShowed()

Definition at line 74 of file CChart.hpp.


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