tcasDisplay Class Reference

A TCAS-II compliant display widget. More...

#include <tcasdisplay.h>

List of all members.

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< threatListItemtList
 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.


Detailed Description

A TCAS-II compliant display widget.

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.


Constructor & Destructor Documentation

tcasDisplay::tcasDisplay ( QWidget *  parent = 0  ) 

The default constructor.

Definition at line 11 of file tcasdisplay.cpp.

References threatIndex.


Member Function Documentation

void tcasDisplay::addThreat ( threatType  type,
trendDir  dir,
int  relAlt,
int  x,
int  y,
unsigned long &  key 
) [slot]

Add a threat to the TCAS display.

Parameters:
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.

Parameters:
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.

Parameters:
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".

Parameters:
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

Returns the size policy of this widget.

Definition at line 34 of file tcasdisplay.cpp.


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Thu Aug 17 12:14:59 2006 for VisualODF by  doxygen 1.4.7