本文整理汇总了C++中Waypoint::IsAirport方法的典型用法代码示例。如果您正苦于以下问题:C++ Waypoint::IsAirport方法的具体用法?C++ Waypoint::IsAirport怎么用?C++ Waypoint::IsAirport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Waypoint
的用法示例。
在下文中一共展示了Waypoint::IsAirport方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddText
void
WaypointEditWidget::Prepare(gcc_unused ContainerWindow &parent,
gcc_unused const PixelRect &rc)
{
AddText(_("Name"), nullptr, value.name.c_str());
AddText(_("Comment"), nullptr, value.comment.c_str());
Add(_("Location"), nullptr, new GeoPointDataField(value.location,UIGlobals::GetFormatSettings().coordinate_format));
AddFloat(_("Altitude"), nullptr,
_T("%.0f %s"), _T("%.0f"),
0, 30000, 5, false,
UnitGroup::ALTITUDE, value.elevation);
AddEnum(_("Type"), nullptr, waypoint_types,
value.IsAirport() ? 1u : (value.IsLandable() ? 2u : 0u ));
}
示例2: AddText
void
WaypointEditWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
AddText(_("Name"), nullptr, value.name.c_str());
AddText(_("Comment"), nullptr, value.comment.c_str());
Add(_("Location"), nullptr, new GeoPointDataField(value.location,
// TODO: use configured CoordinateFormat
CoordinateFormat::DDMMSS));
AddFloat(_("Altitude"), nullptr,
_T("%.0f %s"), _T("%.0f"),
fixed(0), fixed(30000), fixed(5), false,
UnitGroup::ALTITUDE, value.elevation);
AddEnum(_("Type"), nullptr, waypoint_types,
value.IsAirport() ? 1u : (value.IsLandable() ? 2u : 0u ));
}
示例3: ToASCII
bool
CAI302Device::WriteNavpoint(unsigned id, const Waypoint &wp,
OperationEnvironment &env)
{
if (!DownloadMode(env))
return false;
char name[64], remark[64];
ToASCII(name, ARRAY_SIZE(name), wp.name.c_str());
ToASCII(remark, ARRAY_SIZE(remark), wp.comment.c_str());
if (!CAI302::DownloadNavpoint(port, wp.location, (int)wp.elevation, id,
wp.IsTurnpoint(), wp.IsAirport(), false,
wp.IsLandable(), wp.IsStartpoint(),
wp.IsFinishpoint(), wp.flags.home,
false, wp.IsTurnpoint(), false,
name, remark, env)) {
mode = Mode::UNKNOWN;
return false;
}
return true;
}
示例4: if
void
WaypointIconRenderer::DrawLandable(const Waypoint &waypoint,
const PixelPoint &point,
Reachability reachable)
{
if (!settings.vector_landable_rendering) {
const MaskedIcon *icon;
if (reachable == ReachableTerrain)
icon = waypoint.IsAirport()
? &look.airport_reachable_icon
: &look.field_reachable_icon;
else if (reachable == ReachableStraight)
icon = waypoint.IsAirport()
? &look.airport_marginal_icon
: &look.field_marginal_icon;
else
icon = waypoint.IsAirport()
? &look.airport_unreachable_icon
: &look.field_unreachable_icon;
icon->Draw(canvas, point);
return;
}
// SW rendering of landables
double scale = std::max(Layout::VptScale(settings.landable_rendering_scale),
110u) / 177.;
double radius = 10 * scale;
canvas.SelectBlackPen();
const bool is_reachable = reachable != Invalid && reachable != Unreachable;
switch (settings.landable_style) {
case WaypointRendererSettings::LandableStyle::PURPLE_CIRCLE:
// Render landable with reachable state
if (is_reachable) {
canvas.Select(reachable == ReachableTerrain
? look.reachable_brush
: look.terrain_unreachable_brush);
DrawLandableBase(canvas, point, waypoint.IsAirport(), 1.5 * radius);
}
canvas.Select(look.magenta_brush);
break;
case WaypointRendererSettings::LandableStyle::BW:
if (is_reachable)
canvas.Select(reachable == ReachableTerrain
? look.reachable_brush
: look.terrain_unreachable_brush);
else if (waypoint.IsAirport())
canvas.Select(look.white_brush);
else
canvas.Select(look.light_gray_brush);
break;
case WaypointRendererSettings::LandableStyle::TRAFFIC_LIGHTS:
if (is_reachable)
canvas.Select(reachable == ReachableTerrain
? look.reachable_brush
: look.orange_brush);
else
canvas.Select(look.unreachable_brush);
break;
}
DrawLandableBase(canvas, point, waypoint.IsAirport(), radius);
// Render runway indication
const Runway &runway = waypoint.runway;
if (runway.IsDirectionDefined()) {
double len;
if (settings.scale_runway_length && runway.IsLengthDefined())
len = radius / 2. +
(((int) runway.GetLength() - 500) / 500) * radius / 4.;
else
len = radius;
len += 2 * scale;
Angle runwayDrawingAngle = runway.GetDirection() - screen_rotation;
canvas.Select(look.white_brush);
DrawLandableRunway(canvas, point, runwayDrawingAngle, len, 5 * scale);
}
}
示例5: if
void
WaypointIconRenderer::DrawLandable(const Waypoint &waypoint,
const RasterPoint &point,
Reachability reachable)
{
if (!settings.vector_landable_rendering) {
const MaskedIcon *icon;
if (reachable == ReachableTerrain)
icon = waypoint.IsAirport()
? &look.airport_reachable_icon
: &look.field_reachable_icon;
else if (reachable == ReachableStraight)
icon = waypoint.IsAirport()
? &look.airport_marginal_icon
: &look.field_marginal_icon;
else
icon = waypoint.IsAirport()
? &look.airport_unreachable_icon
: &look.field_unreachable_icon;
icon->draw(canvas, point);
return;
}
// SW rendering of landables
fixed scale = fixed(Layout::SmallScale(settings.landable_rendering_scale)) /
fixed_int_constant(150);
fixed radius = fixed_int_constant(10) * scale;
canvas.black_pen();
if (settings.landable_style == wpLandableWinPilot) {
// Render landable with reachable state
if (reachable != Unreachable) {
canvas.select(reachable == ReachableTerrain
? look.reachable_brush
: look.terrain_unreachable_brush);
DrawLandableBase(canvas, point, waypoint.IsAirport(),
radius + radius / fixed_two);
}
canvas.select(look.magenta_brush);
} else if (settings.landable_style == wpLandableAltB) {
if (reachable != Unreachable)
canvas.select(reachable == ReachableTerrain
? look.reachable_brush
: look.orange_brush);
else
canvas.select(look.unreachable_brush);
} else {
if (reachable != Unreachable)
canvas.select(reachable == ReachableTerrain
? look.reachable_brush
: look.terrain_unreachable_brush);
else if (waypoint.IsAirport())
canvas.select(look.white_brush);
else
canvas.select(look.light_gray_brush);
}
DrawLandableBase(canvas, point, waypoint.IsAirport(), radius);
// Render runway indication
const Runway &runway = waypoint.runway;
if (runway.IsDirectionDefined()) {
fixed len;
if (settings.scale_runway_length && runway.IsLengthDefined())
len = (radius / fixed_two) +
(((int) runway.GetLength() - 500) / 500) * (radius / fixed_four);
else
len = radius;
len += fixed_two * scale;
Angle runwayDrawingAngle = runway.GetDirection() - screen_rotation;
canvas.select(look.white_brush);
DrawLandableRunway(canvas, point, runwayDrawingAngle, len,
fixed_int_constant(5) * scale);
}
}