本文整理汇总了C++中AbstractAirspace::GetTop方法的典型用法代码示例。如果您正苦于以下问题:C++ AbstractAirspace::GetTop方法的具体用法?C++ AbstractAirspace::GetTop怎么用?C++ AbstractAirspace::GetTop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractAirspace
的用法示例。
在下文中一共展示了AbstractAirspace::GetTop方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
bool
IsAirspaceAltitudeVisible(const AbstractAirspace &airspace,
const AltitudeState &state,
const AirspaceComputerSettings &computer_settings,
const AirspaceRendererSettings &renderer_settings)
{
/// @todo airspace visibility did use ToMSL(..., map.Calculated().TerrainAlt);
switch (renderer_settings.altitude_mode) {
case AirspaceDisplayMode::ALLON:
return true;
case AirspaceDisplayMode::CLIP:
return airspace.GetBase().GetAltitude(state) <= fixed(renderer_settings.clip_altitude);
case AirspaceDisplayMode::AUTO:
return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.altitude_warning_margin))
&& airspace.GetTop().IsAbove(state, fixed(computer_settings.warnings.altitude_warning_margin));
case AirspaceDisplayMode::ALLBELOW:
return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.altitude_warning_margin));
case AirspaceDisplayMode::INSIDE:
return (airspace.GetBase().IsBelow(state) && airspace.GetTop().IsAbove(state));
case AirspaceDisplayMode::ALLOFF:
return false;
}
return true;
}
示例2: Visit
void Visit(const AbstractAirspace &as) {
if (do_report) {
*fout << as;
*fout << "# Name: " << as.GetName()
<< "Base: " << as.GetBase()
<< " Top: " << as.GetTop()
<< "\n";
}
}
示例3: operator
virtual bool operator()(const AbstractAirspace &airspace) const {
return CheckAirspace(airspace) &&
/* skip airspaces that we already entered */
!airspace.Inside(location) &&
/* check altitude; hard-coded margin of 50m (for now) */
(!altitude_available ||
(airspace.GetBase().IsBelow(altitude, fixed(50)) &&
airspace.GetTop().IsAbove(altitude, fixed(50))));
}
示例4: switch
bool
AirspaceVisiblePredicate::IsAltitudeVisible(const AbstractAirspace& airspace) const
{
/// @todo airspace visibility did use ToMSL(..., map.Calculated().TerrainAlt);
switch (renderer_settings.altitude_mode) {
case ALLON:
return true;
case CLIP:
return airspace.GetBase().GetAltitude(state) <= fixed(renderer_settings.clip_altitude);
case AUTO:
return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.AltWarningMargin))
&& airspace.GetTop().IsAbove(state, fixed(computer_settings.warnings.AltWarningMargin));
case ALLBELOW:
return airspace.GetBase().IsBelow(state, fixed(computer_settings.warnings.AltWarningMargin));
case INSIDE:
return (airspace.GetBase().IsBelow(state) && airspace.GetTop().IsAbove(state));
case ALLOFF:
return false;
}
return true;
}
示例5: visit_abstract
void visit_abstract(const AbstractAirspace &as) {
assert(!m_intersections.empty());
GeoPoint point = m_intersections[0].first;
RouteLink l = rpolar.GenerateIntermediate(link.first,
RoutePoint(proj.project(point), link.second.altitude),
proj);
if (l.second.altitude < RoughAltitude(as.GetBase().altitude) ||
l.second.altitude > RoughAltitude(as.GetTop().altitude))
return;
if (negative(min_distance) || (l.d < min_distance)) {
min_distance = l.d;
nearest = std::make_pair(&as, l.second);
}
}
示例6: Check
void Check(const AbstractAirspace &airspace) {
if (!active_predicate(airspace))
return;
/* check delta below */
fixed base = airspace.GetBase().GetAltitude(altitude);
fixed base_delta = base - altitude.altitude;
if (!negative(base_delta) && base_delta < fabs(nearest_delta)) {
nearest = &airspace;
nearest_delta = base_delta;
}
/* check delta above */
fixed top = airspace.GetTop().GetAltitude(altitude);
fixed top_delta = altitude.altitude - top;
if (!negative(top_delta) && top_delta < fabs(nearest_delta)) {
nearest = &airspace;
nearest_delta = -top_delta;
}
}
示例7: Visit
void Visit(const AbstractAirspace &as) override {
assert(!intersections.empty());
GeoPoint point = intersections[0].first;
RouteLink l =
rpolar.GenerateIntermediate(link.first,
RoutePoint(proj.ProjectInteger(point),
link.second.altitude),
proj);
if (l.second.altitude < as.GetBase().altitude ||
l.second.altitude > as.GetTop().altitude)
return;
if (min_distance < 0 || l.d < min_distance) {
min_distance = l.d;
nearest = std::make_pair(&as, l.second);
}
}
示例8: return
bool
AirspacePredicateHeightRange::check_height(const AbstractAirspace& t) const
{
return (int)t.GetTop().altitude >= h_min &&
(int)t.GetBase().altitude <= h_max;
}
示例9: RoughAltitude
bool
AirspacePredicateHeightRange::check_height(const AbstractAirspace& t) const
{
return RoughAltitude(t.GetTop().altitude) >= h_min &&
RoughAltitude(t.GetBase().altitude) <= h_max;
}
示例10: _T
tstring
AirspaceFormatter::GetVerticalText(const AbstractAirspace &airspace)
{
return _T("Base: ") + airspace.GetBase().GetAsText(false) +
_T(" Top: ") + airspace.GetTop().GetAsText(false);
}