Qt Virtual Chart Table (QVCT)
COverlayPoint.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_COVERLAYPOINT_HPP
20 #define QVCT_COVERLAYPOINT_HPP
21 
22 // QT
23 #include <QDataStream>
24 #include <QPainter>
25 #include <QPointF>
26 #include <QTreeWidgetItem>
27 
28 // QVCT
29 #include "data/CDataPosition.hpp"
30 #include "data/CDataTime.hpp"
33 class CChart;
35 class CDataTimeValidity;
36 
37 
39 
46 {
47 
48  //------------------------------------------------------------------------------
49  // CONSTANTS / STATIC
50  //------------------------------------------------------------------------------
51 
52 public:
54 
55 public:
57 
63  static int getPositionBox( const QTreeWidgetItem* _pqTreeWidgetItem,
64  CDataPosition* _poDataPositionLower, CDataPosition* _poDataPositionUpper,
65  int _iIndexMin = 0, int _iIndexMax = -1 );
66 
67 
68  //------------------------------------------------------------------------------
69  // CONSTRUCTORS / DESTRUCTOR
70  //------------------------------------------------------------------------------
71 
72 protected:
73  COverlayPoint( const QString& _rqsName );
74  COverlayPoint( const QString& _rqsName, const CDataPosition& _roDataPosition );
75  virtual ~COverlayPoint() {};
76 
77 
78  //------------------------------------------------------------------------------
79  // METHODS: COverlayObject (override/implement)
80  //------------------------------------------------------------------------------
81 
82 public:
83  virtual void serialize( QDataStream& _rqDataStream ) const;
84  virtual void unserialize( QDataStream& _rqDataStream );
85 
86 
87  //------------------------------------------------------------------------------
88  // METHODS
89  //------------------------------------------------------------------------------
90 
91  // OTHER
92 public:
94  virtual void drawText( const CChart* _poChart, QPainter* _pqPainter, const QString& _rqsText, const QPointF& _rqPointFScrPosition, bool _bItalic = false );
96  virtual void drawLine( const CChart* _poChart, QPainter* _pqPainter, const COverlayPoint* _poOverlayPoint );
98  virtual void drawMarker( const CChart* _poChart, QPainter* _pqPainter, const CDataPositionValidity* _poDataPositionValidity = 0, bool _bSelected = false );
100  virtual void drawSymbol( const CChart* _poChart, QPainter* _pqPainter, const QString& _rqsSymbol );
102  virtual void drawTag( const CChart* _poChart, QPainter* _pqPainter, ETagPosition _eTagPosition = TAG_AUTO,
103  const CDataTimeValidity* _poDataTimeValidity = 0, const CDataPositionValidity* _poDataPositionValidity = 0 );
105  virtual bool matchScrPosition( const CChart* _poChart, const QPointF& _rqPointFScrPosition ) const;
106 
107 };
108 
109 #endif // QVCT_COVERLAYPOINT_HPP
[UI] Chart (view)
Definition: CChart.hpp:44
Position data validity.
(Geographical) Position data [long,lat,elev]
Time data validity.
Time data.
Definition: CDataTime.hpp:36
Generic overlay item.
Generic overlay point.
virtual bool matchScrPosition(const CChart *_poChart, const QPointF &_rqPointFScrPosition) const
Returns whether this point matches the given screen position.
static int getPositionBox(const QTreeWidgetItem *_pqTreeWidgetItem, CDataPosition *_poDataPositionLower, CDataPosition *_poDataPositionUpper, int _iIndexMin=0, int _iIndexMax=-1)
Returns the minimal geographical positions box containing the points in the given overlay/container.
virtual void drawSymbol(const CChart *_poChart, QPainter *_pqPainter, const QString &_rqsSymbol)
Draws the symbol (user-defined)
virtual void drawText(const CChart *_poChart, QPainter *_pqPainter, const QString &_rqsText, const QPointF &_rqPointFScrPosition, bool _bItalic=false)
Draws the given text, at the given screen position.
virtual void drawTag(const CChart *_poChart, QPainter *_pqPainter, ETagPosition _eTagPosition=TAG_AUTO, const CDataTimeValidity *_poDataTimeValidity=0, const CDataPositionValidity *_poDataPositionValidity=0)
Draws the tag (name)
virtual void drawMarker(const CChart *_poChart, QPainter *_pqPainter, const CDataPositionValidity *_poDataPositionValidity=0, bool _bSelected=false)
Draws the point (marker)
virtual void unserialize(QDataStream &_rqDataStream)
Unserializes (restore) this object's data from binary format.
virtual void serialize(QDataStream &_rqDataStream) const
Serializes (store) this object's data to binary format.
virtual ~COverlayPoint()
COverlayPoint(const QString &_rqsName)
virtual void drawLine(const CChart *_poChart, QPainter *_pqPainter, const COverlayPoint *_poOverlayPoint)
Draws a line (between this and the other specified point), including distance/bearing data.
Generic overlay visibility.