Qt Virtual Chart Table (QVCT)
|
[UI] Virtual "chart table" (view) More...
#include <charts/CChartTable.hpp>
Public Member Functions | |
CChartTable (QWidget *_pqParent=0) | |
virtual | ~CChartTable () |
virtual QSize | sizeHint () const |
void | setProjectModified () |
Sets the status of the project to modified (data have changed and need saving) More... | |
void | setGeoPosition (const CDataPosition &_roGeoPosition, bool _bSkipCurrent=false) |
Sets the reference chart (geographical) position. More... | |
void | showGeoPosition (const CDataPosition &_roGeoPosition) |
Shows the given (geographical) position on chart. More... | |
void | stepScrPosition (bool _bHorizontal, bool _bIncrease, bool _bBigStep=true) |
Discretely move the reference chart (geographical) position. More... | |
void | dragScrPosition (const QPointF &_rqPointFScrPositionOffset) |
Moves the reference chart (geographical) position according to the given screen offset. More... | |
void | setPositionHome () |
Sets the reference chart (geographical) position to the current chart's center position. More... | |
void | lockPosition (bool _bLock) |
Sets the position lock/unlock status. More... | |
void | setScale (double _fdScale, bool _bSkipCurrent=false, bool _bUpdateControl=true) |
Sets the reference scale factor. More... | |
void | stepScale (bool _bIncrease, bool _bBigStep=true) |
Discretely increases/decreases the reference scale factor. More... | |
void | setScaleActual () |
Sets the reference scale factor to match the current chart's "actual" scale (1:1 zoom) More... | |
void | setScaleFit () |
Sets the reference scale factor to match the current chart's "fit" scale (entire chart visible) More... | |
void | setScaleArea (const CDataPosition &_roGeoPosition1, const CDataPosition &_roGeoPosition2, double _fdScaleCorrection=1.0) |
Sets the reference scale factor to display the given (geographical) area (defined by its opposite corners) More... | |
void | lockScale (bool _bLock) |
Sets the scale lock/unlock status. More... | |
void | enablePointerTarget (bool _bEnable) |
Enables/disables pointer target. More... | |
bool | setPointerTarget (const CDataPosition &_roGeoPosition) |
Sets the pointer target's position; returns true if is was actually set, false otherwise. More... | |
void | enablePointerPath (bool _bEnable) |
Enables/disables ongoing measurements (pointer path) More... | |
void | enablePointerPathSingle (bool _bEnable) |
Enables/disables single measurement (pointer path) More... | |
bool | extendPointerPath (const CDataPosition &_roGeoPosition) |
Extends the pointer path; returns true if is was actually extended, false otherwise. More... | |
void | setOverlayObjectSelected (COverlayObject *_poOverlayObject) |
Sets the currently selected overlay object. More... | |
void | setOverlayPointMove (COverlayPoint *_poOverlayPoint) |
Sets the overlay point to be moved (and lock all other actions while it is ongoing) More... | |
void | setVesselPointSynchronize (CVesselPoint *_poVesselPoint) |
Sets the vessel point used to synchronize the chart reference (geographical) position. More... | |
void | resetVesselPointSynchronize () |
Resets (clears) the vessel point used to synchronize the chart reference (geographical) position. More... | |
bool | isProjectModified () const |
Returns whether the project has been modified (data have changed since last saved) More... | |
CDataPosition | getGeoPosition () const |
Returns the reference chart (geographical) position. More... | |
double | getScale () const |
Returns the reference scale factor. More... | |
COverlayObject * | getOverlayObjectSelected () const |
Returns the currently selected overlay object. More... | |
COverlayPoint * | getOverlayPointMove () const |
Returns the overlay point currently being moved (0 if none) More... | |
CVesselPoint * | getVesselPointSynchronize () const |
Returns the vessel defined to synchronize the chart reference (geographical) position. More... | |
CChart * | useChart () |
Returns the currently displayed chart. More... | |
void | synchronizeVesselPoint () |
Synchronize the reference chart (geographical) position with the designed vessel. More... | |
void | load (const QString &_rqsFilename) |
Load a full project's content from the given file. More... | |
void | save (const QString &_rqsFilename) const |
Save the full project's content to the given file. More... | |
int | 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... | |
CChart * | loadChart (const QString &_rqsFilename) |
Load the given chart from file. More... | |
void | updateChart () |
Update the (current) chart content (on screen) More... | |
bool | addElevation (const QString &_rqsFilename) |
Add elevation data to the currently displayed chart (if any) More... | |
bool | hasElevation () |
Returns whether the currently selected chart has been associated elevation data (if any) More... | |
void | showElevation (bool _bShow) |
Display elevation data (instead of raster data) of the currently selected chart (if any) More... | |
Private Slots | |
void | slotLoad () |
[UI:Slot] Slot to load a full project's content from file More... | |
void | slotSave () |
[UI:Slot] Slot to save the full project's content to file More... | |
void | slotLoadChart () |
[UI:Slot] Slot to load a new chart More... | |
void | slotPrintChart () |
[UI:Slot] Slot to print the currently displayed chart More... | |
void | slotAddElevation () |
[UI:Slot] Slot to add elevation data to the currently displayed chart More... | |
void | slotChangeTab (int _iTabIndex) |
[UI:Slot] Slot to handle active tab change More... | |
void | slotCloseTab () |
[UI:Slot] Slot to close the current tab More... | |
void | slotCloseTab (int _iTabIndex) |
[UI:Slot] Slot to close the requested tab More... | |
void | slotScaleActual () |
[UI:Slot] Slot to trigger scaling to "actual" scale More... | |
void | slotScaleFit () |
[UI:Slot] Slot to trigger scaling to "fit" scale More... | |
void | slotPointerTarget (bool _bEnable) |
[UI:Slot] Slot to enable/disable pointer target More... | |
void | slotPointerPath (bool _bEnable) |
[UI:Slot] Slot to enable/disable ongoing measurements (pointer path) More... | |
void | slotPointerPathSingle (bool _bEnable) |
[UI:Slot] Slot to enable/disable single measurement (pointer path) More... | |
void | slotVesselPointDestroyed (QObject *_pqObject) |
[APP:Slot] Slot to handle vessel point destruction More... | |
Private Member Functions | |
void | constructLayout () |
Constructs the layout of the user-interface. More... | |
virtual void | clear () |
virtual bool | eventFilter (QObject *_pqObject, QEvent *_pqEvent) |
bool | handlerKeyEvent (QKeyEvent *_pqKeyEvent) |
Key events handler. More... | |
bool | handlerMouseEvent (QMouseEvent *_pqMouseEvent) |
Mouse events handler. More... | |
bool | handlerWheelEvent (QWheelEvent *_pqWheelEvent) |
Wheel events handler. More... | |
bool | handlerGestureEvent (QGestureEvent *_pqGestureEvent) |
Gesture events handler. More... | |
void | setZoom (double _fdZoom, bool _bSkipCurrent=false, bool _bUpdateControl=true) |
Sets the reference zoom factor. More... | |
double | toZoom (double _fdScale, const CChart *_poChart=0) |
Converts the given scale factor to zoom factor (for the current position and - by default - the currently displayed chart) More... | |
double | toScale (double _fdZoom, const CChart *_poChart=0) |
Converts the given zoom factor to scale factor (for the current position and - by default - the currently displayed chart) More... | |
Private Attributes | |
bool | bProjectModified |
Flag to track project changes (and trigger user confirmation before discarding unsaved data) More... | |
CDataPosition | oGeoPositionReference |
Reference chart (geographical) position (shared by all "locked" maps) More... | |
double | fdScaleReference |
Reference scale factor (shared by all "locked" maps) More... | |
int | iDpi |
Resolution, in Dots-per-Inch (DPI) More... | |
bool | bIgnoreUpdate |
Flag that disables position, scale and pointer updates. More... | |
QPointF | qPointFMouse |
Mouse position (saved dragging purposes) More... | |
bool | bMousePressed |
Mouse-pressed status. More... | |
bool | bMouseDrag |
Mouse-drag status. More... | |
double | fdGestureTimeLast |
Keep track of when a gesture event last occured. More... | |
double | fdGestureZoomReference |
Reference zoom for pinch gesture. More... | |
bool | bPointerTarget |
Pointer target status. More... | |
bool | bPointerPath |
Pointer path status. More... | |
bool | bPointerPathSingle |
Pointer single-segment path status. More... | |
COverlayObject * | poOverlayObjectSelected |
Currently selected overlay object. More... | |
COverlayPoint * | poOverlayPointMove |
Overlay point being moved (non-0 only when a move is being performed) More... | |
CVesselPoint * | poVesselPointSynchronize |
Vessel point to synchronize to. More... | |
Friends | |
class | CChartControl |
[UI] Virtual "chart table" (view)
This class acts as the virtual "chart table" of the navigator environment, allowing to load several maps (each in a different tab).
All loaded maps shall share the same current position, in geographical coordinates corresponding to the center of the map.
Zooming shall be performed according to a logarithmic scaling factor: 1 [pixel] <-> pow( 10, scale ) [meter] which is more natural for chart handling and which can (optionally) be shared by all loaded maps.
Definition at line 54 of file CChartTable.hpp.
CChartTable::CChartTable | ( | QWidget * | _pqParent = 0 | ) |
Definition at line 57 of file CChartTable.cpp.
|
inlinevirtual |
Definition at line 123 of file CChartTable.hpp.
|
private |
Constructs the layout of the user-interface.
Definition at line 81 of file CChartTable.cpp.
|
virtual |
Definition at line 97 of file CChartTable.cpp.
|
privatevirtual |
Definition at line 889 of file CChartTable.cpp.
|
privatevirtual |
Definition at line 107 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to load a full project's content from file
Definition at line 148 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to save the full project's content to file
Definition at line 163 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to load a new chart
Definition at line 174 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to print the currently displayed chart
Definition at line 191 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to add elevation data to the currently displayed chart
Definition at line 227 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to handle active tab change
Definition at line 245 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to close the current tab
Definition at line 265 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to close the requested tab
Definition at line 272 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to trigger scaling to "actual" scale
Definition at line 288 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to trigger scaling to "fit" scale
Definition at line 295 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to enable/disable pointer target
Definition at line 302 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to enable/disable ongoing measurements (pointer path)
Definition at line 310 of file CChartTable.cpp.
|
privateslot |
[UI:Slot] Slot to enable/disable single measurement (pointer path)
Definition at line 321 of file CChartTable.cpp.
|
privateslot |
[APP:Slot] Slot to handle vessel point destruction
Definition at line 332 of file CChartTable.cpp.
|
private |
|
private |
|
private |
|
private |
|
inline |
Sets the status of the project to modified (data have changed and need saving)
Definition at line 203 of file CChartTable.hpp.
void CChartTable::setGeoPosition | ( | const CDataPosition & | _roGeoPosition, |
bool | _bSkipCurrent = false |
||
) |
Sets the reference chart (geographical) position.
Definition at line 608 of file CChartTable.cpp.
void CChartTable::showGeoPosition | ( | const CDataPosition & | _roGeoPosition | ) |
Shows the given (geographical) position on chart.
NOTE: if the position is not visible, it becomes the new reference chart (geographical) position, otherwise, the latter is left unchanged.
Definition at line 628 of file CChartTable.cpp.
void CChartTable::stepScrPosition | ( | bool | _bHorizontal, |
bool | _bIncrease, | ||
bool | _bBigStep = true |
||
) |
Discretely move the reference chart (geographical) position.
Definition at line 636 of file CChartTable.cpp.
void CChartTable::dragScrPosition | ( | const QPointF & | _rqPointFScrPositionOffset | ) |
Moves the reference chart (geographical) position according to the given screen offset.
Definition at line 645 of file CChartTable.cpp.
void CChartTable::setPositionHome | ( | ) |
Sets the reference chart (geographical) position to the current chart's center position.
Definition at line 660 of file CChartTable.cpp.
void CChartTable::lockPosition | ( | bool | _bLock | ) |
Sets the position lock/unlock status.
Definition at line 667 of file CChartTable.cpp.
void CChartTable::setScale | ( | double | _fdScale, |
bool | _bSkipCurrent = false , |
||
bool | _bUpdateControl = true |
||
) |
Sets the reference scale factor.
Definition at line 675 of file CChartTable.cpp.
void CChartTable::stepScale | ( | bool | _bIncrease, |
bool | _bBigStep = true |
||
) |
Discretely increases/decreases the reference scale factor.
Definition at line 698 of file CChartTable.cpp.
void CChartTable::setScaleActual | ( | ) |
Sets the reference scale factor to match the current chart's "actual" scale (1:1 zoom)
Definition at line 704 of file CChartTable.cpp.
void CChartTable::setScaleFit | ( | ) |
Sets the reference scale factor to match the current chart's "fit" scale (entire chart visible)
Definition at line 711 of file CChartTable.cpp.
void CChartTable::setScaleArea | ( | const CDataPosition & | _roGeoPosition1, |
const CDataPosition & | _roGeoPosition2, | ||
double | _fdScaleCorrection = 1.0 |
||
) |
Sets the reference scale factor to display the given (geographical) area (defined by its opposite corners)
Definition at line 719 of file CChartTable.cpp.
void CChartTable::lockScale | ( | bool | _bLock | ) |
Sets the scale lock/unlock status.
Definition at line 727 of file CChartTable.cpp.
|
private |
Sets the reference zoom factor.
Definition at line 735 of file CChartTable.cpp.
void CChartTable::enablePointerTarget | ( | bool | _bEnable | ) |
Enables/disables pointer target.
Definition at line 759 of file CChartTable.cpp.
bool CChartTable::setPointerTarget | ( | const CDataPosition & | _roGeoPosition | ) |
Sets the pointer target's position; returns true if is was actually set, false otherwise.
NOTE: The pointer target's position will be set only if: 1. is was previously enabled; 2. it has not yet been set.
Definition at line 769 of file CChartTable.cpp.
void CChartTable::enablePointerPath | ( | bool | _bEnable | ) |
Enables/disables ongoing measurements (pointer path)
Definition at line 784 of file CChartTable.cpp.
void CChartTable::enablePointerPathSingle | ( | bool | _bEnable | ) |
Enables/disables single measurement (pointer path)
Definition at line 803 of file CChartTable.cpp.
bool CChartTable::extendPointerPath | ( | const CDataPosition & | _roGeoPosition | ) |
Extends the pointer path; returns true if is was actually extended, false otherwise.
NOTE: The pointer path will be extended only if is was previously enabled.
Definition at line 817 of file CChartTable.cpp.
void CChartTable::setOverlayObjectSelected | ( | COverlayObject * | _poOverlayObject | ) |
Sets the currently selected overlay object.
Definition at line 841 of file CChartTable.cpp.
void CChartTable::setOverlayPointMove | ( | COverlayPoint * | _poOverlayPoint | ) |
Sets the overlay point to be moved (and lock all other actions while it is ongoing)
Definition at line 855 of file CChartTable.cpp.
void CChartTable::setVesselPointSynchronize | ( | CVesselPoint * | _poVesselPoint | ) |
Sets the vessel point used to synchronize the chart reference (geographical) position.
Definition at line 861 of file CChartTable.cpp.
void CChartTable::resetVesselPointSynchronize | ( | ) |
Resets (clears) the vessel point used to synchronize the chart reference (geographical) position.
Definition at line 868 of file CChartTable.cpp.
|
inline |
Returns whether the project has been modified (data have changed since last saved)
Definition at line 263 of file CChartTable.hpp.
|
inline |
Returns the reference chart (geographical) position.
Definition at line 265 of file CChartTable.hpp.
|
inline |
Returns the reference scale factor.
Definition at line 267 of file CChartTable.hpp.
|
inline |
Returns the currently selected overlay object.
Definition at line 269 of file CChartTable.hpp.
|
inline |
Returns the overlay point currently being moved (0 if none)
Definition at line 271 of file CChartTable.hpp.
|
inline |
Returns the vessel defined to synchronize the chart reference (geographical) position.
Definition at line 273 of file CChartTable.hpp.
|
inline |
Returns the currently displayed chart.
Definition at line 278 of file CChartTable.hpp.
void CChartTable::synchronizeVesselPoint | ( | ) |
Synchronize the reference chart (geographical) position with the designed vessel.
Definition at line 878 of file CChartTable.cpp.
void CChartTable::load | ( | const QString & | _rqsFilename | ) |
Load a full project's content from the given file.
Definition at line 899 of file CChartTable.cpp.
void CChartTable::save | ( | const QString & | _rqsFilename | ) | const |
Save the full project's content to the given file.
Definition at line 964 of file CChartTable.cpp.
int CChartTable::parseQVCT | ( | const QDomElement & | _rqDomElement | ) |
Retrieves this object's content from the given QVCT source (file)
Definition at line 1008 of file CChartTable.cpp.
void CChartTable::dumpQVCT | ( | QXmlStreamWriter & | _rqXmlStreamWriter | ) | const |
Stores this object's content to the given QVCT destination (file)
Definition at line 1039 of file CChartTable.cpp.
CChart * CChartTable::loadChart | ( | const QString & | _rqsFilename | ) |
Load the given chart from file.
Definition at line 1058 of file CChartTable.cpp.
void CChartTable::updateChart | ( | ) |
Update the (current) chart content (on screen)
NOTE: This results in the scheduling of a QWidget::paintEvent() by Qt. No guarantees can thus be given about when the actual CChart::draw() will occur.
Definition at line 1088 of file CChartTable.cpp.
bool CChartTable::addElevation | ( | const QString & | _rqsFilename | ) |
Add elevation data to the currently displayed chart (if any)
Definition at line 1094 of file CChartTable.cpp.
bool CChartTable::hasElevation | ( | ) |
Returns whether the currently selected chart has been associated elevation data (if any)
Definition at line 1103 of file CChartTable.cpp.
void CChartTable::showElevation | ( | bool | _bShow | ) |
Display elevation data (instead of raster data) of the currently selected chart (if any)
Definition at line 1109 of file CChartTable.cpp.
|
private |
Converts the given scale factor to zoom factor (for the current position and - by default - the currently displayed chart)
Definition at line 1116 of file CChartTable.cpp.
|
private |
Converts the given zoom factor to scale factor (for the current position and - by default - the currently displayed chart)
Definition at line 1135 of file CChartTable.cpp.
|
friend |
Definition at line 57 of file CChartTable.hpp.
|
private |
Flag to track project changes (and trigger user confirmation before discarding unsaved data)
Definition at line 65 of file CChartTable.hpp.
|
private |
Reference chart (geographical) position (shared by all "locked" maps)
Definition at line 69 of file CChartTable.hpp.
|
private |
Reference scale factor (shared by all "locked" maps)
Definition at line 73 of file CChartTable.hpp.
|
private |
Resolution, in Dots-per-Inch (DPI)
Definition at line 76 of file CChartTable.hpp.
|
private |
Flag that disables position, scale and pointer updates.
Definition at line 80 of file CChartTable.hpp.
|
private |
Mouse position (saved dragging purposes)
Definition at line 83 of file CChartTable.hpp.
|
private |
Mouse-pressed status.
Definition at line 85 of file CChartTable.hpp.
|
private |
Mouse-drag status.
Definition at line 87 of file CChartTable.hpp.
|
private |
Keep track of when a gesture event last occured.
Definition at line 90 of file CChartTable.hpp.
|
private |
Reference zoom for pinch gesture.
Definition at line 92 of file CChartTable.hpp.
|
private |
|
private |
|
private |
Pointer single-segment path status.
Definition at line 102 of file CChartTable.hpp.
|
private |
Currently selected overlay object.
Definition at line 106 of file CChartTable.hpp.
|
private |
Overlay point being moved (non-0 only when a move is being performed)
Definition at line 110 of file CChartTable.hpp.
|
private |
Vessel point to synchronize to.
Definition at line 114 of file CChartTable.hpp.