Updraft
1.0
Open source glider flight visualisation tool.
|
Class representing the opened airspaces file. More...
#include <oaengine.h>
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 ¢re, 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 ¢re, const Position &point) |
compute the circular coord angle given centre and point on circ 0 ontop return (-pi, +pi) | |
double | AngleRadPos (const Position ¢re, const Position &point) |
compute the angle btw 12oo position and point for given center return (0, 2pi) | |
Position | ComputeArcPoint (const Position ¢re, 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 | |
MapLayerGroupInterface * | mapLayerGroup |
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. | |
SettingInterface * | testSetting |
Settings. | |
float | width |
Line properties width, colour. | |
osg::Vec4f | col |
Position * | heightRefPoint |
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 |
Class representing the opened airspaces file.
Updraft::Airspaces::oaEngine::oaEngine | ( | MapLayerGroupInterface * | LG, |
CoreInterface * | g_core | ||
) |
Class constructor.
LG | The map pointer. |
g_core | The core pointer. |
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.
floor | The AS floor elevation. |
ceiling | The AS ceiling elevation. |
floorAgl | The flag telling if the height value is above the ground level or absolute. |
ceilingAgl | See 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.
fileName | The name of the file containing the data 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.
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.
void Updraft::Airspaces::oaEngine::SetWidthAndColour | ( | const OpenAirspace::Airspace * | A | ) | [private] |
Set the colour and width of the line if possible.
bool Updraft::Airspaces::oaEngine::BOTTOM_FACE [private] |
Turnt his on to draw the bottom polygon face.
bool Updraft::Airspaces::oaEngine::BOTTOM_WIREFRAME [private] |
Turnt his on to draw the bottom polygon wireframe.
osg::Vec4f Updraft::Airspaces::oaEngine::col [private] |
bool Updraft::Airspaces::oaEngine::DRAW_UNDERGROUND [private] |
Turn this on to simplify drawing by draw the polygons under ground (no ground elevation data needed)
float Updraft::Airspaces::oaEngine::ELEV_TILE_RESOLUTION [private] |
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.
int Updraft::Airspaces::oaEngine::GND [private] |
Default elevations in ft.
Centre of the airspace if possible where to take height.
Map Layer Interface.
QVector<QPair<osg::Node*, QString> >* Updraft::Airspaces::oaEngine::mapLayers [private] |
Map Layers.
osg::Geode* Updraft::Airspaces::oaEngine::OAGeode [private] |
The osg node, to which the geometry os added.
float Updraft::Airspaces::oaEngine::POLY_OPACITY_BOTTOM [private] |
Opacity of the surface.
float Updraft::Airspaces::oaEngine::POLY_OPACITY_TOP [private] |
int Updraft::Airspaces::oaEngine::ROOF [private] |
bool Updraft::Airspaces::oaEngine::SIDE_COL_GRADIENT [private] |
Turn this on to draw the sides with colour gradient.
bool Updraft::Airspaces::oaEngine::SIDE_FACE [private] |
Turn this on to draw the face sides.
bool Updraft::Airspaces::oaEngine::SIDE_WIREFRAME [private] |
Turn this on to draw the wireframe sides.
Settings.
bool Updraft::Airspaces::oaEngine::TOP_FACE [private] |
Turn this on to draw the top polygon face.
bool Updraft::Airspaces::oaEngine::TOP_WIREFRAME [private] |
Turn this on to draw the top polygon wireframe.
QVector<QTreeWidgetItem*> Updraft::Airspaces::oaEngine::treeItems [private] |
The tree items.
bool Updraft::Airspaces::oaEngine::USE_POINTWISE_ELEVATION [private] |
Engine settings settings of how the drawing engine behaves Turn this on to read elevation data for each of the polygon polints.
float Updraft::Airspaces::oaEngine::width [private] |
Line properties width, colour.
float Updraft::Airspaces::oaEngine::WIRE_OPACITY_BOTTOM [private] |
Opacity of the wireframe.
float Updraft::Airspaces::oaEngine::WIRE_OPACITY_TOP [private] |