Qt Virtual Chart Table (QVCT)
CPointerOverlay.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 #ifndef QVCT_CPOINTEROVERLAY_HPP
20 #define QVCT_CPOINTEROVERLAY_HPP
21 
22 // QT
23 #include <QPainter>
24 #include <QPointF>
25 #include <QWidget>
26 
27 // QVCT
29 class CChart;
30 class CDataPosition;
31 class CPointerContainer;
32 class CPointerPoint;
33 
34 
36 
41 {
42 
43 
44  //------------------------------------------------------------------------------
45  // CONSTRUCTORS / DESTRUCTOR
46  //------------------------------------------------------------------------------
47 
48 public:
50  virtual ~CPointerOverlay();
51 
52 
53  //------------------------------------------------------------------------------
54  // METHODS: COverlay (implement/override)
55  //------------------------------------------------------------------------------
56 
57 public:
58  virtual void drawContent( const CChart* _poChart, QPainter* _pqPainter ) const;
59  virtual void showDetail( const QTreeWidgetItem* _pqTreeWidgetItem ) const;
60  virtual void setPosition( const QTreeWidgetItem* _pqTreeWidgetItem ) const;
61  virtual COverlayPoint* matchScrPosition( const CChart* _poChart, const QPointF& _rqPointFScrPosition ) const { return 0; };
62 
63 
64  //------------------------------------------------------------------------------
65  // METHODS
66  //------------------------------------------------------------------------------
67 
68  // GETTERS
69 public:
71  bool hasPath() const;
73  int getPathSegments() const;
74 
75  // USERS
76 public:
81 
82  // OTHER
83 public:
85  void importSettings();
87  void setPosition( const CChart* _poChart, const QPointF& _rqPointFScrPosition, bool _bTarget = false );
89  void setPosition( const CDataPosition& _roDataPosition, bool _bTarget = false );
91  void clearPosition( bool _bTarget = false );
93  void setPath( const CChart* _poChart, const QPointF& _rqPointFScrPosition );
95  void setPath( const CDataPosition& _roDataPosition );
97  double getPathLengthRL();
99  double getPathLengthGC();
101  void clearPath();
102 
103 };
104 
105 #endif // QVCT_CPOINTEROVERLAY_HPP
[UI] Chart (view)
Definition: CChart.hpp:44
(Geographical) Position data [long,lat,elev]
Generic overlay base (non-widget)
Generic overlay point.
[UI] Pointer overlay
void setPath(const CChart *_poChart, const QPointF &_rqPointFScrPosition)
Adds the given screen position to the pointer path.
virtual COverlayPoint * matchScrPosition(const CChart *_poChart, const QPointF &_rqPointFScrPosition) const
Returns the overlay's point that (first) matches the given screen position (0 if none is found)
double getPathLengthRL()
Returns the pointer path (rhumb-line) length along its segments.
virtual void setPosition(const QTreeWidgetItem *_pqTreeWidgetItem) const
Centers the chart on the given overlay object's position.
bool hasPath() const
Returns whether a pointer path has been defined.
int getPathSegments() const
Returns the quantity of segments along the pointer path (0 if no path is defined)
double getPathLengthGC()
Returns the equivalent (great-circle) length between the first and last position of the pointer path.
void importSettings()
Imports settings from the application's global settings.
CPointerPoint * usePointerTarget()
Returns the pointer point corresponding to the target.
virtual void drawContent(const CChart *_poChart, QPainter *_pqPainter) const
Draws this overlay's content.
void clearPath()
Clears the pointer path.
virtual ~CPointerOverlay()
void clearPosition(bool _bTarget=false)
Clears the mouse pointer or target.
virtual void showDetail(const QTreeWidgetItem *_pqTreeWidgetItem) const
Displays the given overlay object's details (in the appropriate widget/view)
CPointerPoint * usePointerPoint()
Returns the pointer point corresponding to the mouse pointer.
[UI] Pointer overlay point (item)