18 #ifndef QVCT_CCHARTTABLE_HPP
19 #define QVCT_CCHARTTABLE_HPP
22 #include <QDomElement>
23 #include <QGestureEvent>
25 #include <QMouseEvent>
26 #include <QWheelEvent>
30 #include <QXmlStreamWriter>
143 virtual void clear();
144 virtual bool eventFilter( QObject* _pqObject, QEvent* _pqEvent );
212 void stepScrPosition(
bool _bHorizontal,
bool _bIncrease,
bool _bBigStep =
true );
220 void setScale(
double _fdScale,
bool _bSkipCurrent =
false,
bool _bUpdateControl =
true );
222 void stepScale(
bool _bIncrease,
bool _bBigStep =
true );
234 void setZoom(
double _fdZoom,
bool _bSkipCurrent =
false,
bool _bUpdateControl =
true );
288 void load(
const QString& _rqsFilename );
290 void save(
const QString& _rqsFilename )
const;
292 int parseQVCT(
const QDomElement& _rqDomElement );
294 void dumpQVCT( QXmlStreamWriter & _rqXmlStreamWriter )
const;
311 double toZoom(
double _fdScale,
const CChart* _poChart = 0 );
313 double toScale(
double _fdZoom,
const CChart* _poChart = 0 );
[UI] Chart control user-interface
[UI] Virtual "chart table" (view)
double fdGestureZoomReference
Reference zoom for pinch gesture.
int parseQVCT(const QDomElement &_rqDomElement)
Retrieves this object's content from the given QVCT source (file)
double fdGestureTimeLast
Keep track of when a gesture event last occured.
virtual bool eventFilter(QObject *_pqObject, QEvent *_pqEvent)
void slotLoad()
[UI:Slot] Slot to load a full project's content from file
int iDpi
Resolution, in Dots-per-Inch (DPI)
void slotSave()
[UI:Slot] Slot to save the full project's content to file
void setOverlayPointMove(COverlayPoint *_poOverlayPoint)
Sets the overlay point to be moved (and lock all other actions while it is ongoing)
double toZoom(double _fdScale, const CChart *_poChart=0)
Converts the given scale factor to zoom factor (for the current position and - by default - the curre...
bool extendPointerPath(const CDataPosition &_roGeoPosition)
Extends the pointer path; returns true if is was actually extended, false otherwise.
void enablePointerTarget(bool _bEnable)
Enables/disables pointer target.
double fdScaleReference
Reference scale factor (shared by all "locked" maps)
QPointF qPointFMouse
Mouse position (saved dragging purposes)
COverlayObject * poOverlayObjectSelected
Currently selected overlay object.
void setProjectModified()
Sets the status of the project to modified (data have changed and need saving)
bool handlerKeyEvent(QKeyEvent *_pqKeyEvent)
Key events handler.
void showElevation(bool _bShow)
Display elevation data (instead of raster data) of the currently selected chart (if any)
void setPositionHome()
Sets the reference chart (geographical) position to the current chart's center position.
void slotVesselPointDestroyed(QObject *_pqObject)
[APP:Slot] Slot to handle vessel point destruction
void setVesselPointSynchronize(CVesselPoint *_poVesselPoint)
Sets the vessel point used to synchronize the chart reference (geographical) position.
bool bProjectModified
Flag to track project changes (and trigger user confirmation before discarding unsaved data)
double toScale(double _fdZoom, const CChart *_poChart=0)
Converts the given zoom factor to scale factor (for the current position and - by default - the curre...
bool handlerMouseEvent(QMouseEvent *_pqMouseEvent)
Mouse events handler.
void slotChangeTab(int _iTabIndex)
[UI:Slot] Slot to handle active tab change
bool isProjectModified() const
Returns whether the project has been modified (data have changed since last saved)
CVesselPoint * getVesselPointSynchronize() const
Returns the vessel defined to synchronize the chart reference (geographical) position.
void setZoom(double _fdZoom, bool _bSkipCurrent=false, bool _bUpdateControl=true)
Sets the reference zoom factor.
void lockScale(bool _bLock)
Sets the scale lock/unlock status.
void constructLayout()
Constructs the layout of the user-interface.
CChartTable(QWidget *_pqParent=0)
CVesselPoint * poVesselPointSynchronize
Vessel point to synchronize to.
void setScale(double _fdScale, bool _bSkipCurrent=false, bool _bUpdateControl=true)
Sets the reference scale factor.
void slotPointerTarget(bool _bEnable)
[UI:Slot] Slot to enable/disable pointer target
bool bIgnoreUpdate
Flag that disables position, scale and pointer updates.
bool bMousePressed
Mouse-pressed status.
void lockPosition(bool _bLock)
Sets the position lock/unlock status.
void setScaleFit()
Sets the reference scale factor to match the current chart's "fit" scale (entire chart visible)
void synchronizeVesselPoint()
Synchronize the reference chart (geographical) position with the designed vessel.
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 cor...
virtual QSize sizeHint() const
void slotLoadChart()
[UI:Slot] Slot to load a new chart
void stepScale(bool _bIncrease, bool _bBigStep=true)
Discretely increases/decreases the reference scale factor.
CDataPosition oGeoPositionReference
Reference chart (geographical) position (shared by all "locked" maps)
bool bMouseDrag
Mouse-drag status.
COverlayPoint * poOverlayPointMove
Overlay point being moved (non-0 only when a move is being performed)
void stepScrPosition(bool _bHorizontal, bool _bIncrease, bool _bBigStep=true)
Discretely move the reference chart (geographical) position.
bool bPointerPathSingle
Pointer single-segment path status.
void dumpQVCT(QXmlStreamWriter &_rqXmlStreamWriter) const
Stores this object's content to the given QVCT destination (file)
bool bPointerPath
Pointer path status.
COverlayObject * getOverlayObjectSelected() const
Returns the currently selected overlay object.
bool handlerGestureEvent(QGestureEvent *_pqGestureEvent)
Gesture events handler.
CChart * useChart()
Returns the currently displayed chart.
void updateChart()
Update the (current) chart content (on screen)
bool setPointerTarget(const CDataPosition &_roGeoPosition)
Sets the pointer target's position; returns true if is was actually set, false otherwise.
void slotCloseTab()
[UI:Slot] Slot to close the current tab
void slotScaleFit()
[UI:Slot] Slot to trigger scaling to "fit" scale
void showGeoPosition(const CDataPosition &_roGeoPosition)
Shows the given (geographical) position on chart.
void slotPointerPathSingle(bool _bEnable)
[UI:Slot] Slot to enable/disable single measurement (pointer path)
CDataPosition getGeoPosition() const
Returns the reference chart (geographical) position.
double getScale() const
Returns the reference scale factor.
void slotPointerPath(bool _bEnable)
[UI:Slot] Slot to enable/disable ongoing measurements (pointer path)
void load(const QString &_rqsFilename)
Load a full project's content from the given file.
void slotAddElevation()
[UI:Slot] Slot to add elevation data to the currently displayed chart
void enablePointerPathSingle(bool _bEnable)
Enables/disables single measurement (pointer path)
void slotScaleActual()
[UI:Slot] Slot to trigger scaling to "actual" scale
void dragScrPosition(const QPointF &_rqPointFScrPositionOffset)
Moves the reference chart (geographical) position according to the given screen offset.
bool handlerWheelEvent(QWheelEvent *_pqWheelEvent)
Wheel events handler.
bool bPointerTarget
Pointer target status.
CChart * loadChart(const QString &_rqsFilename)
Load the given chart from file.
void setScaleActual()
Sets the reference scale factor to match the current chart's "actual" scale (1:1 zoom)
void setGeoPosition(const CDataPosition &_roGeoPosition, bool _bSkipCurrent=false)
Sets the reference chart (geographical) position.
void slotPrintChart()
[UI:Slot] Slot to print the currently displayed chart
bool hasElevation()
Returns whether the currently selected chart has been associated elevation data (if any)
void setOverlayObjectSelected(COverlayObject *_poOverlayObject)
Sets the currently selected overlay object.
bool addElevation(const QString &_rqsFilename)
Add elevation data to the currently displayed chart (if any)
COverlayPoint * getOverlayPointMove() const
Returns the overlay point currently being moved (0 if none)
void enablePointerPath(bool _bEnable)
Enables/disables ongoing measurements (pointer path)
void save(const QString &_rqsFilename) const
Save the full project's content to the given file.
void resetVesselPointSynchronize()
Resets (clears) the vessel point used to synchronize the chart reference (geographical) position.
(Geographical) Position data [long,lat,elev]
[UI] Vessel overlay point (item) / vessel