Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Airspaces::oaEngine Class Reference

Class representing the opened airspaces file. More...

#include <oaengine.h>

Collaboration diagram for Updraft::Airspaces::oaEngine:

List of all members.

Public Member Functions

 oaEngine (MapLayerGroupInterface *LG, CoreInterface *g_core)
 Class constructor.
QVector< QPair< osg::Node
*, QString > > * 
Draw (const QString &fileName)
 The main airspace drawing routine.
QVector< MapLayerInterface * > * DrawII (const QString &)
 Airspace drawing routines.

Private Member Functions

QVector< double > * ComputeHeightData (int *floor, int *ceiling, bool *floorAgl, bool *ceilingAgl, Position *heightRefPoint, OpenAirspace::Airspace *A, QVector< Position > *pointsWGS)
 Compute the height for given geometry.
void FillOGLArrays (QVector< Position > *pointsWGS, QVector< double > *pointsGnd, int floor, int ceiling, bool floorAgl, bool ceilingAgl)
 Fill the OpenGL vertex arrays.
osg::Geode * FindLayer (const QString &name)
 Find the layer of particular name in Layer Group.
void PushLayer (osg::Geode *geode, const QString &displayName)
 Insert the geometry Layer into the array.
osg::Geometry * DrawPolygon (QVector< Position > *pointsWGS, const QVector< double > *pointsGnd, osg::Vec4 &col, osg::PrimitiveSet::Mode primitive, int height, bool agl, bool cw)
 Draw polygon.
osg::Geometry * DrawPolygonSides (const QVector< Position > *pointsWGS, const QVector< double > *pointsGnd, osg::Vec4 &colBot, osg::Vec4 &colTop, osg::PrimitiveSet::Mode primitive, const int floor, const int ceiling, const bool floorAgl, const bool ceilingAgl)
 Draw polygon sides.
double DistToAngle (double dist)
 compute the WGS angle given the distance in nm
double ArcInRadians (const Position &from, const Position &to)
 Compute the arc between two WGS coords.
double DistanceInMeters (const Position &from, const Position &to)
 Compute the distance between two WGS coords.
void InsertArcI (const OpenAirspace::ArcI &aa, QVector< Position > *vertexList)
 Insert Arc into the OGL vertex array.
void InsertArcII (const OpenAirspace::ArcII &aa, QVector< Position > *vertexList)
void InsertCircle (const OpenAirspace::Circle &cc, QVector< Position > *vertexList)
void InsertMidArc (const Position &centre, double from, double to, const bool cw, const double &r, QVector< Position > *vertexList)
 Insert middle of the arc - angles from/to in rads, r in degs, pos WGS.
double AngleRad (const Position &centre, const Position &point)
 compute the circular coord angle given centre and point on circ 0 ontop return (-pi, +pi)
double AngleRadPos (const Position &centre, const Position &point)
 compute the angle btw 12oo position and point for given center return (0, 2pi)
Position ComputeArcPoint (const Position &centre, double r, double partAngle)
 Compute the point for given angle, centre and radius.
void SetWidthAndColour (const OpenAirspace::Airspace *A)
 Set the colour and width of the line if possible.
bool IsPolyOrientationCW (QVector< Position > *pointsWGS)
 Get the orientation for given array of closed poly points.

Private Attributes

MapLayerGroupInterfacemapLayerGroup
 Map Layer Interface.
QVector< QTreeWidgetItem * > treeItems
 The tree items.
osg::Geode * OAGeode
 The osg node, to which the geometry os added.
osgEarth::Util::ElevationManager * elevationMan
 The elevation manager for height data queries.
QVector< QPair< osg::Node
*, QString > > * 
mapLayers
 Map Layers.
SettingInterfacetestSetting
 Settings.
float width
 Line properties width, colour.
osg::Vec4f col
PositionheightRefPoint
 Centre of the airspace if possible where to take height.
bool USE_POINTWISE_ELEVATION
 Engine settings settings of how the drawing engine behaves Turn this on to read elevation data for each of the polygon polints.
float ELEV_TILE_RESOLUTION
 Elevation tile resolution set this to 0.0001 to get the highest resolution for polygon elevation essesment.
bool DRAW_UNDERGROUND
 Turn this on to simplify drawing by draw the polygons under ground (no ground elevation data needed)
bool TOP_FACE
 Turn this on to draw the top polygon face.
bool BOTTOM_FACE
 Turnt his on to draw the bottom polygon face.
bool SIDE_FACE
 Turn this on to draw the face sides.
bool TOP_WIREFRAME
 Turn this on to draw the top polygon wireframe.
bool BOTTOM_WIREFRAME
 Turnt his on to draw the bottom polygon wireframe.
bool SIDE_WIREFRAME
 Turn this on to draw the wireframe sides.
bool SIDE_COL_GRADIENT
 Turn this on to draw the sides with colour gradient.
float POLY_OPACITY_BOTTOM
 Opacity of the surface.
float POLY_OPACITY_TOP
float WIRE_OPACITY_BOTTOM
 Opacity of the wireframe.
float WIRE_OPACITY_TOP
int GND
 Default elevations in ft.
int ROOF

Detailed Description

Class representing the opened airspaces file.


Constructor & Destructor Documentation

Class constructor.

Parameters:
LGThe map pointer.
g_coreThe core pointer.

Member Function Documentation

double Updraft::Airspaces::oaEngine::AngleRad ( const Position centre,
const Position point 
) [private]

compute the circular coord angle given centre and point on circ 0 ontop return (-pi, +pi)

double Updraft::Airspaces::oaEngine::AngleRadPos ( const Position centre,
const Position point 
) [private]

compute the angle btw 12oo position and point for given center return (0, 2pi)

double Updraft::Airspaces::oaEngine::ArcInRadians ( const Position from,
const Position to 
) [private]

Compute the arc between two WGS coords.

Position Updraft::Airspaces::oaEngine::ComputeArcPoint ( const Position centre,
double  r,
double  partAngle 
) [private]

Compute the point for given angle, centre and radius.

QVector< double > * Updraft::Airspaces::oaEngine::ComputeHeightData ( int *  floor,
int *  ceiling,
bool *  floorAgl,
bool *  ceilingAgl,
Position heightRefPoint,
OpenAirspace::Airspace A,
QVector< Position > *  pointsWGS 
) [private]

Compute the height for given geometry.

Parameters:
floorThe AS floor elevation.
ceilingThe AS ceiling elevation.
floorAglThe flag telling if the height value is above the ground level or absolute.
ceilingAglSee the floorAgl.
double Updraft::Airspaces::oaEngine::DistanceInMeters ( const Position from,
const Position to 
) [private]

Compute the distance between two WGS coords.

double Updraft::Airspaces::oaEngine::DistToAngle ( double  dist) [private]

compute the WGS angle given the distance in nm

QVector< QPair< osg::Node *, QString > > * Updraft::Airspaces::oaEngine::Draw ( const QString &  fileName)

The main airspace drawing routine.

This routine calls the OpenAir parser and creates the geometry, which is added to the map as a layer.

Parameters:
fileNameThe name of the file containing the data to be drawn.
Returns:
The array of nodes to be drawn.
QVector< MapLayerInterface * > * Updraft::Airspaces::oaEngine::DrawII ( const QString &  fileName)

Airspace drawing routines.

The same as the draw(), but returns the map layers.

Returns:
The array of map layers.
osg::Geometry * Updraft::Airspaces::oaEngine::DrawPolygon ( QVector< Position > *  pointsWGS,
const QVector< double > *  pointsGnd,
osg::Vec4 &  col,
osg::PrimitiveSet::Mode  primitive,
int  height,
bool  agl,
bool  cw 
) [private]

Draw polygon.

osg::Geometry * Updraft::Airspaces::oaEngine::DrawPolygonSides ( const QVector< Position > *  pointsWGS,
const QVector< double > *  pointsGnd,
osg::Vec4 &  colBot,
osg::Vec4 &  colTop,
osg::PrimitiveSet::Mode  primitive,
const int  floor,
const int  ceiling,
const bool  floorAgl,
const bool  ceilingAgl 
) [private]

Draw polygon sides.

void Updraft::Airspaces::oaEngine::FillOGLArrays ( QVector< Position > *  pointsWGS,
QVector< double > *  pointsGnd,
int  floor,
int  ceiling,
bool  floorAgl,
bool  ceilingAgl 
) [private]

Fill the OpenGL vertex arrays.

osg::Geode * Updraft::Airspaces::oaEngine::FindLayer ( const QString &  name) [private]

Find the layer of particular name in Layer Group.

void Updraft::Airspaces::oaEngine::InsertArcI ( const OpenAirspace::ArcI aa,
QVector< Position > *  vertexList 
) [private]

Insert Arc into the OGL vertex array.

void Updraft::Airspaces::oaEngine::InsertArcII ( const OpenAirspace::ArcII aa,
QVector< Position > *  vertexList 
) [private]
void Updraft::Airspaces::oaEngine::InsertCircle ( const OpenAirspace::Circle cc,
QVector< Position > *  vertexList 
) [private]
void Updraft::Airspaces::oaEngine::InsertMidArc ( const Position centre,
double  from,
double  to,
const bool  cw,
const double &  r,
QVector< Position > *  vertexList 
) [private]

Insert middle of the arc - angles from/to in rads, r in degs, pos WGS.

bool Updraft::Airspaces::oaEngine::IsPolyOrientationCW ( QVector< Position > *  pointsWGS) [private]

Get the orientation for given array of closed poly points.

void Updraft::Airspaces::oaEngine::PushLayer ( osg::Geode *  geode,
const QString &  displayName 
) [private]

Insert the geometry Layer into the array.

Set the colour and width of the line if possible.


Member Data Documentation

Turnt his on to draw the bottom polygon face.

Turnt his on to draw the bottom polygon wireframe.

osg::Vec4f Updraft::Airspaces::oaEngine::col [private]

Turn this on to simplify drawing by draw the polygons under ground (no ground elevation data needed)

Elevation tile resolution set this to 0.0001 to get the highest resolution for polygon elevation essesment.

osgEarth::Util::ElevationManager* Updraft::Airspaces::oaEngine::elevationMan [private]

The elevation manager for height data queries.

Default elevations in ft.

Centre of the airspace if possible where to take height.

QVector<QPair<osg::Node*, QString> >* Updraft::Airspaces::oaEngine::mapLayers [private]

Map Layers.

The osg node, to which the geometry os added.

Opacity of the surface.

Turn this on to draw the sides with colour gradient.

Turn this on to draw the face sides.

Turn this on to draw the wireframe sides.

Turn this on to draw the top polygon face.

Turn this on to draw the top polygon wireframe.

QVector<QTreeWidgetItem*> Updraft::Airspaces::oaEngine::treeItems [private]

The tree items.

Engine settings settings of how the drawing engine behaves Turn this on to read elevation data for each of the polygon polints.

Line properties width, colour.

Opacity of the wireframe.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines