Qt Virtual Chart Table (QVCT)
CPointerPoint.cpp
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 // QT
20 #include <QPainter>
21 
22 // QVCT
23 #include "QVCTRuntime.hpp"
24 #include "charts/CChart.hpp"
26 
27 
28 //------------------------------------------------------------------------------
29 // CONSTRUCTORS / DESTRUCTOR
30 //------------------------------------------------------------------------------
31 
32 CPointerPoint::CPointerPoint( const QString& _rqsName )
33  : COverlayPoint( _rqsName )
34 {}
35 
36 
37 //------------------------------------------------------------------------------
38 // METHODS: COverlayObject (implement/override)
39 //------------------------------------------------------------------------------
40 
41 void CPointerPoint::draw( const CChart* _poChart, QPainter* _pqPainter )
42 {
43  if( !bVisible
44  || this->CDataPosition::operator==( CDataPosition::UNDEFINED )
45  || !_poChart->getDrawArea().contains( _poChart->toDrawPosition( *this ).toPoint() ) ) return;
46  COverlayPoint::drawMarker( _poChart, _pqPainter );
47  COverlayPoint::drawTag( _poChart, _pqPainter );
48 }
49 
51 {
56 }
void setOverlayObjectSelected(COverlayObject *_poOverlayObject)
Sets the currently selected overlay object.
[UI] Chart (view)
Definition: CChart.hpp:44
QRectF getDrawArea() const
Returns the viewport draw area.
Definition: CChart.hpp:127
QPointF toDrawPosition(const CDataPosition &_roGeoPosition) const
Converts the given (geographical) position [long,lat,elev] to chart draw point [px].
Definition: CChart.cpp:192
static const CDataPosition UNDEFINED
Specific value for an undefined position.
void switchView(EView eView)
Displays the requested container/item details (switching to the appropriate widget)
@ POINTER_POINT
Pointer point.
void setOverlayObject(COverlayObject *_poOverlayObject)
Sets the overlay object to be displayed (and refreshes the underlying widget)
Generic overlay point.
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)
bool bVisible
Global (marker) visibility status.
virtual void refreshContent()
Refreshes the content of the underlying widget.
CPointerPoint(const QString &_rqsName)
virtual void draw(const CChart *_poChart, QPainter *_pqPainter)
Draws this object (itself or its content)
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
static COverlayDetailView * useOverlayDetailView()
static CPointerPointDetailView * usePointerPointDetailView()
static CChartTable * useChartTable()