FlightGear next
BaseDiagram Class Reference

#include <BaseDiagram.hxx>

Inherits QQuickPaintedItem.

Inherited by AirportDiagram, CarrierDiagram, NavaidDiagram, and RouteDiagram.

Public Types

enum  IconOption { NoOptions = 0 , SmallIcons = 0x1 , LargeAirportPlans = 0x2 }
 

Public Member Functions

 BaseDiagram (QQuickItem *pr=nullptr)
 
void setAircraftType (LauncherController::AircraftType type)
 
QRect rect () const
 
Q_INVOKABLE void resetZoom ()
 

Static Public Member Functions

static QPixmap iconForPositioned (const FGPositionedRef &pos, const IconOptions &options=NoOptions)
 
static QPixmap iconForAirport (FGAirport *apt, const IconOptions &options=NoOptions)
 
static QVector< QLineF > projectAirportRuwaysIntoRect (FGAirportRef apt, const QRectF &bounds)
 
static QVector< QLineF > projectAirportRuwaysWithCenter (FGAirportRef apt, const SGGeod &c)
 

Protected Member Functions

void paint (QPainter *p) override
 
void mousePressEvent (QMouseEvent *me) override
 
void mouseMoveEvent (QMouseEvent *me) override
 
void wheelEvent (QWheelEvent *we) override
 
virtual void paintContents (QPainter *)
 
void recomputeBounds (bool resetZoom)
 
virtual void doComputeBounds ()
 
void extendBounds (const QPointF &p, double radiusM=1.0)
 
QPointF project (const SGGeod &geod) const
 
QTransform transform () const
 
void clearIgnoredNavaids ()
 
void addIgnoredNavaid (FGPositionedRef pos)
 
void paintAirplaneIcon (QPainter *painter, const SGGeod &geod, int headingDeg)
 
void paintCarrierIcon (QPainter *painter, const SGGeod &geod, int headingDeg)
 
void paintAirways (QPainter *painter, const FGPositionedList &navs)
 
QPointF projectedPosition (PositionedID pid) const
 
QPointF projectedPosition (FGPositionedRef pos) const
 

Static Protected Member Functions

static void extendRect (QRectF &r, const QPointF &p)
 
static QPointF project (const SGGeod &geod, const SGGeod &center)
 
static SGGeod unproject (const QPointF &xy, const SGGeod &center)
 

Protected Attributes

SGGeod m_projectionCenter
 
double m_scale
 
QRectF m_bounds
 
bool m_autoScalePan
 
QPointF m_panOffset
 
QPointF m_lastMousePos
 
int m_wheelAngleDeltaAccumulator
 
bool m_didPan
 
LauncherController::AircraftType m_aircraftType = LauncherController::Airplane
 

Detailed Description

Definition at line 37 of file BaseDiagram.hxx.

Member Enumeration Documentation

◆ IconOption

Enumerator
NoOptions 
SmallIcons 
LargeAirportPlans 

Definition at line 43 of file BaseDiagram.hxx.

Constructor & Destructor Documentation

◆ BaseDiagram()

BaseDiagram::BaseDiagram ( QQuickItem * pr = nullptr)

Definition at line 59 of file BaseDiagram.cxx.

Member Function Documentation

◆ addIgnoredNavaid()

void BaseDiagram::addIgnoredNavaid ( FGPositionedRef pos)
protected

Definition at line 88 of file BaseDiagram.cxx.

◆ clearIgnoredNavaids()

void BaseDiagram::clearIgnoredNavaids ( )
protected

Definition at line 83 of file BaseDiagram.cxx.

◆ doComputeBounds()

void BaseDiagram::doComputeBounds ( )
protectedvirtual

Reimplemented in AirportDiagram, CarrierDiagram, NavaidDiagram, and RouteDiagram.

Definition at line 706 of file BaseDiagram.cxx.

◆ extendBounds()

void BaseDiagram::extendBounds ( const QPointF & p,
double radiusM = 1.0 )
protected

Definition at line 711 of file BaseDiagram.cxx.

◆ extendRect()

void BaseDiagram::extendRect ( QRectF & r,
const QPointF & p )
staticprotected

Definition at line 95 of file BaseDiagram.cxx.

◆ iconForAirport()

QPixmap BaseDiagram::iconForAirport ( FGAirport * apt,
const IconOptions & options = NoOptions )
static

Definition at line 855 of file BaseDiagram.cxx.

◆ iconForPositioned()

QPixmap BaseDiagram::iconForPositioned ( const FGPositionedRef & pos,
const IconOptions & options = NoOptions )
static

Definition at line 809 of file BaseDiagram.cxx.

◆ mouseMoveEvent()

void BaseDiagram::mouseMoveEvent ( QMouseEvent * me)
overrideprotected

Definition at line 633 of file BaseDiagram.cxx.

◆ mousePressEvent()

void BaseDiagram::mousePressEvent ( QMouseEvent * me)
overrideprotected

Definition at line 622 of file BaseDiagram.cxx.

◆ paint()

void BaseDiagram::paint ( QPainter * p)
overrideprotected

Definition at line 117 of file BaseDiagram.cxx.

◆ paintAirplaneIcon()

void BaseDiagram::paintAirplaneIcon ( QPainter * painter,
const SGGeod & geod,
int headingDeg )
protected

Definition at line 141 of file BaseDiagram.cxx.

◆ paintAirways()

void BaseDiagram::paintAirways ( QPainter * painter,
const FGPositionedList & navs )
protected

Definition at line 367 of file BaseDiagram.cxx.

◆ paintCarrierIcon()

void BaseDiagram::paintCarrierIcon ( QPainter * painter,
const SGGeod & geod,
int headingDeg )
protected

Definition at line 160 of file BaseDiagram.cxx.

◆ paintContents()

void BaseDiagram::paintContents ( QPainter * painter)
protectedvirtual

Reimplemented in AirportDiagram, CarrierDiagram, NavaidDiagram, and RouteDiagram.

Definition at line 681 of file BaseDiagram.cxx.

◆ project() [1/2]

QPointF BaseDiagram::project ( const SGGeod & geod) const
protected

Definition at line 804 of file BaseDiagram.cxx.

◆ project() [2/2]

QPointF BaseDiagram::project ( const SGGeod & geod,
const SGGeod & center )
staticprotected

Definition at line 732 of file BaseDiagram.cxx.

◆ projectAirportRuwaysIntoRect()

QVector< QLineF > BaseDiagram::projectAirportRuwaysIntoRect ( FGAirportRef apt,
const QRectF & bounds )
static

Definition at line 928 of file BaseDiagram.cxx.

◆ projectAirportRuwaysWithCenter()

QVector< QLineF > BaseDiagram::projectAirportRuwaysWithCenter ( FGAirportRef apt,
const SGGeod & c )
static

Definition at line 910 of file BaseDiagram.cxx.

◆ projectedPosition() [1/2]

QPointF BaseDiagram::projectedPosition ( FGPositionedRef pos) const
protected

Definition at line 969 of file BaseDiagram.cxx.

◆ projectedPosition() [2/2]

QPointF BaseDiagram::projectedPosition ( PositionedID pid) const
protected

Definition at line 955 of file BaseDiagram.cxx.

◆ recomputeBounds()

void BaseDiagram::recomputeBounds ( bool resetZoom)
protected

Definition at line 686 of file BaseDiagram.cxx.

◆ rect()

QRect BaseDiagram::rect ( ) const

Definition at line 110 of file BaseDiagram.cxx.

◆ resetZoom()

void BaseDiagram::resetZoom ( )

Definition at line 698 of file BaseDiagram.cxx.

◆ setAircraftType()

void BaseDiagram::setAircraftType ( LauncherController::AircraftType type)

Definition at line 922 of file BaseDiagram.cxx.

◆ transform()

QTransform BaseDiagram::transform ( ) const
protected

Definition at line 70 of file BaseDiagram.cxx.

◆ unproject()

SGGeod BaseDiagram::unproject ( const QPointF & xy,
const SGGeod & center )
staticprotected

Definition at line 769 of file BaseDiagram.cxx.

◆ wheelEvent()

void BaseDiagram::wheelEvent ( QWheelEvent * we)
overrideprotected

Definition at line 653 of file BaseDiagram.cxx.

Member Data Documentation

◆ m_aircraftType

LauncherController::AircraftType BaseDiagram::m_aircraftType = LauncherController::Airplane
protected

Definition at line 93 of file BaseDiagram.hxx.

◆ m_autoScalePan

bool BaseDiagram::m_autoScalePan
protected

Definition at line 89 of file BaseDiagram.hxx.

◆ m_bounds

QRectF BaseDiagram::m_bounds
protected

Definition at line 88 of file BaseDiagram.hxx.

◆ m_didPan

bool BaseDiagram::m_didPan
protected

Definition at line 92 of file BaseDiagram.hxx.

◆ m_lastMousePos

QPointF BaseDiagram::m_lastMousePos
protected

Definition at line 90 of file BaseDiagram.hxx.

◆ m_panOffset

QPointF BaseDiagram::m_panOffset
protected

Definition at line 90 of file BaseDiagram.hxx.

◆ m_projectionCenter

SGGeod BaseDiagram::m_projectionCenter
protected

Definition at line 86 of file BaseDiagram.hxx.

◆ m_scale

double BaseDiagram::m_scale
protected

Definition at line 87 of file BaseDiagram.hxx.

◆ m_wheelAngleDeltaAccumulator

int BaseDiagram::m_wheelAngleDeltaAccumulator
protected

Definition at line 91 of file BaseDiagram.hxx.


The documentation for this class was generated from the following files: