本文整理汇总了C++中GeoBounds::IsInside方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoBounds::IsInside方法的具体用法?C++ GeoBounds::IsInside怎么用?C++ GeoBounds::IsInside使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoBounds
的用法示例。
在下文中一共展示了GeoBounds::IsInside方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindLatitudeLongitude
void
TrailRenderer::Draw(Canvas &canvas, const TraceComputer &trace_computer,
const WindowProjection &projection, unsigned min_time,
bool enable_traildrift, const RasterPoint pos,
const NMEAInfo &basic, const DerivedInfo &calculated,
const TrailSettings &settings)
{
if (settings.length == TrailSettings::Length::OFF)
return;
if (!LoadTrace(trace_computer, min_time, projection))
return;
if (!calculated.wind_available)
enable_traildrift = false;
GeoPoint traildrift;
if (enable_traildrift) {
GeoPoint tp1 = FindLatitudeLongitude(basic.location,
calculated.wind.bearing,
calculated.wind.norm);
traildrift = basic.location - tp1;
}
auto minmax = GetMinMax(settings.type, trace);
auto value_min = minmax.first;
auto value_max = minmax.second;
bool scaled_trail = settings.scaling_enabled &&
projection.GetMapScale() <= 6000;
const GeoBounds bounds = projection.GetScreenBounds().Scale(4);
RasterPoint last_point = RasterPoint(0, 0);
bool last_valid = false;
for (auto it = trace.begin(), end = trace.end(); it != end; ++it) {
const GeoPoint gp = enable_traildrift
? it->GetLocation().Parametric(traildrift,
it->CalculateDrift(basic.time))
: it->GetLocation();
if (!bounds.IsInside(gp)) {
/* the point is outside of the MapWindow; don't paint it */
last_valid = false;
continue;
}
RasterPoint pt = projection.GeoToScreen(gp);
if (last_valid) {
if (settings.type == TrailSettings::Type::ALTITUDE) {
unsigned index = GetAltitudeColorIndex(it->GetAltitude(),
value_min, value_max);
canvas.Select(look.trail_pens[index]);
canvas.DrawLinePiece(last_point, pt);
} else {
unsigned color_index = GetSnailColorIndex(it->GetVario(),
value_min, value_max);
if (it->GetVario() < 0 &&
(settings.type == TrailSettings::Type::VARIO_1_DOTS ||
settings.type == TrailSettings::Type::VARIO_2_DOTS ||
settings.type == TrailSettings::Type::VARIO_DOTS_AND_LINES)) {
canvas.SelectNullPen();
canvas.Select(look.trail_brushes[color_index]);
canvas.DrawCircle((pt.x + last_point.x) / 2, (pt.y + last_point.y) / 2,
look.trail_widths[color_index]);
} else {
// positive vario case
if (settings.type == TrailSettings::Type::VARIO_DOTS_AND_LINES) {
canvas.Select(look.trail_brushes[color_index]);
canvas.Select(look.trail_pens[color_index]); //fixed-width pen
canvas.DrawCircle((pt.x + last_point.x) / 2, (pt.y + last_point.y) / 2,
look.trail_widths[color_index]);
} else if (scaled_trail)
// width scaled to vario
canvas.Select(look.scaled_trail_pens[color_index]);
else
// fixed-width pen
canvas.Select(look.trail_pens[color_index]);
canvas.DrawLinePiece(last_point, pt);
}
}
}
last_point = pt;
last_valid = true;
}
if (last_valid)
canvas.DrawLine(last_point, pos);
}