1
0
Fork 0

MapWidget: make partially use of the new colocated DME information.

Until a better way to draw proper symbols is implemented, this has to do.
This commit is contained in:
Christian Schmitt 2013-03-10 18:18:45 +01:00
parent 08bae40991
commit f11201d3d9
2 changed files with 18 additions and 3 deletions

View file

@ -1061,7 +1061,11 @@ void MapWidget::drawVOR(bool tuned, FGNavRecord* vor)
glColor3f(0.0, 0.0, 1.0); glColor3f(0.0, 0.0, 1.0);
} }
circleAt(pos, 6, 8); circleAt(pos, 6, 9);
circleAt(pos, 8, 1);
if (vor->hasDME())
squareAt(pos, 9);
if (validDataForKey(vor)) { if (validDataForKey(vor)) {
setAnchorForKey(vor, pos); setAnchorForKey(vor, pos);
@ -1683,15 +1687,25 @@ void MapWidget::circleAt(const SGVec2d& center, int nSides, double r)
{ {
glBegin(GL_LINE_LOOP); glBegin(GL_LINE_LOOP);
double advance = (SGD_PI * 2) / nSides; double advance = (SGD_PI * 2) / nSides;
glVertex2d(center.x(), center.y() + r); glVertex2d(center.x() +r, center.y());
double t=advance; double t=advance;
for (int i=1; i<nSides; ++i) { for (int i=1; i<nSides; ++i) {
glVertex2d(center.x() + (sin(t) * r), center.y() + (cos(t) * r)); glVertex2d(center.x() + (cos(t) * r), center.y() + (sin(t) * r));
t += advance; t += advance;
} }
glEnd(); glEnd();
} }
void MapWidget::squareAt(const SGVec2d& center, double r)
{
glBegin(GL_LINE_LOOP);
glVertex2d(center.x() + r, center.y() + r);
glVertex2d(center.x() + r, center.y() - r);
glVertex2d(center.x() - r, center.y() - r);
glVertex2d(center.x() - r, center.y() + r);
glEnd();
}
void MapWidget::circleAtAlt(const SGVec2d& center, int nSides, double r, double r2) void MapWidget::circleAtAlt(const SGVec2d& center, int nSides, double r, double r2)
{ {
glBegin(GL_LINE_LOOP); glBegin(GL_LINE_LOOP);

View file

@ -91,6 +91,7 @@ private:
void circleAt(const SGVec2d& center, int nSides, double r); void circleAt(const SGVec2d& center, int nSides, double r);
void circleAtAlt(const SGVec2d& center, int nSides, double r, double r2); void circleAtAlt(const SGVec2d& center, int nSides, double r, double r2);
void squareAt(const SGVec2d& center, double r);
void drawLine(const SGVec2d& p1, const SGVec2d& p2); void drawLine(const SGVec2d& p1, const SGVec2d& p2);
void drawLegendBox(const SGVec2d& pos, const std::string& t); void drawLegendBox(const SGVec2d& pos, const std::string& t);