Qt Virtual Chart Table (QVCT)
CLandmarkContainer.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_CLANDMARKCONTAINER_HPP
20 #define QVCT_CLANDMARKCONTAINER_HPP
21 
22 // QT
23 #include <QDomElement> // QtXml module
24 #include <QPainter>
25 #include <QPointF>
26 #include <QXmlStreamWriter>
27 
28 // QVCT
29 #include "data/CDataPosition.hpp"
32 class CChart;
33 class CLandmarkOverlay;
34 class CLandmarkPoint;
35 
36 
38 
43 {
44 
45  //------------------------------------------------------------------------------
46  // CONSTRUCTORS / DESTRUCTOR
47  //------------------------------------------------------------------------------
48 
49 public:
50  CLandmarkContainer( const QString& _rqsName );
51  virtual ~CLandmarkContainer();
52 
53 
54  //------------------------------------------------------------------------------
55  // METHODS: COverlayObject (implement/override)
56  //------------------------------------------------------------------------------
57 
58 public:
59  virtual void unserialize( QDataStream& _rqDataStream );
60 
61 public:
62  virtual COverlay* useOverlay() { return (COverlay*)QTreeWidgetItem::parent(); };
63 
64 public:
65  virtual void draw( const CChart* _poChart, QPainter* _pqPainter );
66  virtual void showDetail();
67  virtual void showEdit();
68 
69 
70  //------------------------------------------------------------------------------
71  // METHODS: COverlayContainer (implement/override)
72  //------------------------------------------------------------------------------
73 
74 public:
75  virtual COverlayPoint* matchScrPosition( const CChart* _poChart, const QPointF& _rqPointFScrPosition ) const;
76 
77 
78  //------------------------------------------------------------------------------
79  // METHODS: COverlayVisibility (override)
80  //------------------------------------------------------------------------------
81 
82 public:
83  virtual void toggleVisibility();
84 
85 
86  //------------------------------------------------------------------------------
87  // METHODS
88  //------------------------------------------------------------------------------
89 
90  // OTHER
91 public:
93  CLandmarkPoint* addPoint( const QString& _rqsName, const CDataPosition& _roDataPosition = CDataPosition::UNDEFINED );
94 
95 public:
97  int parseQVCT( const QDomElement& _rqDomElement );
99  int parseGPX( const QDomElement& _rqDomElement );
101  void dumpQVCT( QXmlStreamWriter & _rqXmlStreamWriter, bool bOnlySelected = false ) const;
103  void dumpGPX( QXmlStreamWriter & _rqXmlStreamWriter, bool bOnlySelected = false ) const;
105  int deleteSelection();
106 
107 protected:
109 
110 };
111 
112 #endif // QVCT_CLANDMARKCONTAINER_HPP
[UI] Chart (view)
Definition: CChart.hpp:44
(Geographical) Position data [long,lat,elev]
static const CDataPosition UNDEFINED
Specific value for an undefined position.
[UI] Landmark overlay container
CLandmarkContainer(const QString &_rqsName)
virtual void toggleVisibility()
int deleteSelection()
Deletes selected items within this container.
virtual COverlayPoint * matchScrPosition(const CChart *_poChart, const QPointF &_rqPointFScrPosition) const
Returns the overlay container's point that (first) matches the given screen position (0 if none is fo...
int parseQVCT(const QDomElement &_rqDomElement)
Retrieves this object's content from the given QVCT source (file)
virtual void draw(const CChart *_poChart, QPainter *_pqPainter)
Draws this object (itself or its content)
void dumpQVCT(QXmlStreamWriter &_rqXmlStreamWriter, bool bOnlySelected=false) const
Stores this object's content to the given QVCT destination (file)
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
virtual void showEdit()
Displays this object's edit widget/view.
void dumpGPX(QXmlStreamWriter &_rqXmlStreamWriter, bool bOnlySelected=false) const
Stores this object's content to the given GPX destination (file)
virtual void unserialize(QDataStream &_rqDataStream)
Unserializes (restore) this object's data from binary format.
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
int parseGPX(const QDomElement &_rqDomElement)
Retrieves this object's content from the given GPX source (file)
CLandmarkPoint * addPoint(const QString &_rqsName, const CDataPosition &_roDataPosition=CDataPosition::UNDEFINED)
Add a new landmark (item/point) to this container.
[UI] Landmark overlay container
[UI] Landmark overlay point (item)
Generic overlay container.
Generic overlay point.
Generic overlay visibility.
virtual void toggleVisibility(bool _bIncludeCourse, bool _bIncludeRouting)
Toggle the visibility status.
Generic overlay.
Definition: COverlay.hpp:45