#include <tcasdisplay.h>
Public Slots | |
| void | addThreat (threatType type, trendDir dir, int relAlt, int x, int y, unsigned long &key) |
| Add a threat to the TCAS display. | |
| void | removeThreat (int idx) |
| Remove a threat with the handle "idx". | |
Public Member Functions | |
| tcasDisplay (QWidget *parent=0) | |
| The default constructor. | |
| QSizePolicy | sizePolicy () const |
| Returns the size policy of this widget. | |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) |
| The overloaded paintEvent. | |
Private Member Functions | |
| void | paintThreat (QPainter *p, std::list< threatListItem >::iterator item) |
| Paint a threat on the display inside the QWidget. | |
| void | drawArrow (QPainter *p, int x, int y, trendDir dir, threatType type) |
| Paint an arrow (part of a threat symbol) on the display. | |
| void | drawAircraftSymbol (QPainter *p) |
| Draw the aircraft symbol in the center of the widget. | |
Private Attributes | |
| std::list< threatListItem > | tList |
| All created threats are stored in a STL std::list container. | |
| int | threatIndex |
| A counter that keeps track of the number of threats attached to the display. | |
This widget provides a TCAS-like display with which the user can display various threats according to the TCAS-II specifications. It can be used to display threats as defined in tcastypes.h.
Definition at line 23 of file tcasdisplay.h.
| tcasDisplay::tcasDisplay | ( | QWidget * | parent = 0 |
) |
| void tcasDisplay::addThreat | ( | threatType | type, | |
| trendDir | dir, | |||
| int | relAlt, | |||
| int | x, | |||
| int | y, | |||
| unsigned long & | key | |||
| ) | [slot] |
Add a threat to the TCAS display.
| type | A threat defined by threatType as defined in the tcastypes.h header file. | |
| dir | The trend direction of the threat as defined in tcastypes.h. | |
| relAlt | The altitude of the threat relative to the aircraft. | |
| x | The x location of the threat (this can be interpreted as latitude, meters, etc. This will likely be clarified as the development progresses. | |
| y | The y location of the threat (this can be interpreted as longitude, meters, etc. To be clarified. | |
| key | An integer value that is used to refer to the created threat later (for updates or deletion, etc). |
Definition at line 136 of file tcasdisplay.cpp.
References threatIndex, and tList.
| void tcasDisplay::drawAircraftSymbol | ( | QPainter * | p | ) | [private] |
Draw the aircraft symbol in the center of the widget.
Definition at line 165 of file tcasdisplay.cpp.
Referenced by paintEvent().
| void tcasDisplay::drawArrow | ( | QPainter * | p, | |
| int | x, | |||
| int | y, | |||
| trendDir | dir, | |||
| threatType | type | |||
| ) | [private] |
Paint an arrow (part of a threat symbol) on the display.
| p | A pointer to the painter that is to be used to paint the arrow symbol. | |
| x | The x coordinate origin of the threat symbol. | |
| y | The y coordinate origin of the threat symbol. | |
| dir | The direction of the trend of the threat (ascending, descending, or none) | |
| type | The type of threat being drawn. |
Definition at line 91 of file tcasdisplay.cpp.
Referenced by paintThreat().
| void tcasDisplay::paintEvent | ( | QPaintEvent * | event | ) | [protected] |
The overloaded paintEvent.
The list of threats is iterated over and drawn here.
Definition at line 19 of file tcasdisplay.cpp.
References drawAircraftSymbol(), paintThreat(), and tList.
| void tcasDisplay::paintThreat | ( | QPainter * | p, | |
| std::list< threatListItem >::iterator | item | |||
| ) | [private] |
Paint a threat on the display inside the QWidget.
| p | A pointer to the painter that is to be used to paint the threat symbol. | |
| item | An iterator of type threatlistItem that contains all the information related to the threat to be painted. |
Definition at line 39 of file tcasdisplay.cpp.
References drawArrow().
Referenced by paintEvent().
| void tcasDisplay::removeThreat | ( | int | idx | ) | [slot] |
Remove a threat with the handle "idx".
| idx | The index, or "handle", of the threat to be removed from the display. |
Definition at line 153 of file tcasdisplay.cpp.
References tList.
| QSizePolicy tcasDisplay::sizePolicy | ( | ) | const |
int tcasDisplay::threatIndex [private] |
A counter that keeps track of the number of threats attached to the display.
Definition at line 73 of file tcasdisplay.h.
Referenced by addThreat(), and tcasDisplay().
std::list<threatListItem> tcasDisplay::tList [private] |
All created threats are stored in a STL std::list container.
Definition at line 70 of file tcasdisplay.h.
Referenced by addThreat(), paintEvent(), and removeThreat().
1.4.7