Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
flightgear
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
FlightGear Flight Simulator
flightgear
Commits
6bf47cd2
You need to sign in or sign up before continuing.
Commit
6bf47cd2
authored
12 years ago
by
Christian Schmitt
Browse files
Options
Downloads
Patches
Plain Diff
MapWidget: make use of the new POI system and display cities on the map.
This is meant as a preview.
parent
664cb474
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GUI/MapWidget.cxx
+40
-0
40 additions, 0 deletions
src/GUI/MapWidget.cxx
src/GUI/MapWidget.hxx
+3
-0
3 additions, 0 deletions
src/GUI/MapWidget.hxx
with
43 additions
and
0 deletions
src/GUI/MapWidget.cxx
+
40
−
0
View file @
6bf47cd2
...
...
@@ -607,6 +607,7 @@ void MapWidget::draw(int dx, int dy)
drawAirports
();
drawNavaids
();
drawPOIs
();
drawTraffic
();
drawGPSData
();
drawNavRadio
(
fgGetNode
(
"/instrumentation/nav[0]"
,
false
));
...
...
@@ -995,6 +996,20 @@ void MapWidget::drawNavaids()
}
// of navaids || fixes are drawn test
}
void
MapWidget
::
drawPOIs
()
{
FGPositioned
::
TypeFilter
f
(
FGPositioned
::
CITY
);
FGPositioned
::
List
poi
=
FGPositioned
::
findWithinRange
(
_projectionCenter
,
_drawRangeNm
,
&
f
);
glLineWidth
(
1.0
);
for
(
unsigned
int
i
=
0
;
i
<
poi
.
size
();
++
i
)
{
FGPositioned
::
Type
ty
=
poi
[
i
]
->
type
();
if
(
ty
==
FGPositioned
::
CITY
)
{
drawCities
((
FGNavRecord
*
)
poi
[
i
].
get
());
}
}
// of navaid iteration
}
void
MapWidget
::
drawNDB
(
bool
tuned
,
FGNavRecord
*
ndb
)
{
SGVec2d
pos
=
project
(
ndb
->
geod
());
...
...
@@ -1149,6 +1164,31 @@ void MapWidget::drawTunedLocalizer(SGPropertyNode_ptr radio)
}
}
void
MapWidget
::
drawCities
(
FGNavRecord
*
rec
)
{
SGVec2d
pos
=
project
(
rec
->
geod
());
glColor3f
(
1.0
,
1.0
,
1.0
);
circleAt
(
pos
,
4
,
8
);
if
(
validDataForKey
(
rec
))
{
setAnchorForKey
(
rec
,
pos
);
return
;
}
char
buffer
[
1024
];
::
snprintf
(
buffer
,
1024
,
"%s"
,
rec
->
name
().
c_str
());
MapData
*
d
=
createDataForKey
(
rec
);
d
->
setPriority
(
40
);
d
->
setLabel
(
rec
->
ident
());
d
->
setText
(
buffer
);
d
->
setOffset
(
MapData
::
HALIGN_CENTER
|
MapData
::
VALIGN_BOTTOM
,
10
);
d
->
setAnchor
(
pos
);
}
/*
void MapWidget::drawObstacle(FGPositioned* obs)
{
...
...
This diff is collapsed.
Click to expand it.
src/GUI/MapWidget.hxx
+
3
−
0
View file @
6bf47cd2
...
...
@@ -63,9 +63,12 @@ private:
void
drawILS
(
bool
tuned
,
FGRunway
*
rwy
);
void
drawNavaids
();
void
drawPOIs
();
void
drawNDB
(
bool
tuned
,
FGNavRecord
*
nav
);
void
drawVOR
(
bool
tuned
,
FGNavRecord
*
nav
);
void
drawFix
(
FGFix
*
fix
);
void
drawCities
(
FGNavRecord
*
rec
);
void
drawTraffic
();
void
drawAIAircraft
(
const
SGPropertyNode
*
model
,
const
SGGeod
&
pos
,
double
hdg
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment