本文整理汇总了C++中Chart::screenY方法的典型用法代码示例。如果您正苦于以下问题:C++ Chart::screenY方法的具体用法?C++ Chart::screenY怎么用?C++ Chart::screenY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chart
的用法示例。
在下文中一共展示了Chart::screenY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: map
void
CrossSectionWindow::PaintTerrain(Canvas &canvas, Chart &chart)
{
if (terrain == NULL)
return;
const GeoPoint p_diff = vec.EndPoint(start) - start;
RasterTerrain::Lease map(*terrain);
RasterPoint points[2 + AIRSPACE_SCANSIZE_X];
points[0].x = chart.screenX(vec.distance);
points[0].y = chart.screenY(fixed_zero);
points[1].x = chart.screenX(fixed_zero);
points[1].y = chart.screenY(fixed_zero);
unsigned i = 2;
for (unsigned j = 0; j < AIRSPACE_SCANSIZE_X; ++j) {
const fixed t_this = fixed(j) / (AIRSPACE_SCANSIZE_X - 1);
const GeoPoint p_this = start + p_diff * t_this;
short h = map->GetHeight(p_this);
if (RasterBuffer::is_special(h)) {
if (RasterBuffer::is_water(h))
/* water is at 0m MSL */
/* XXX paint in blue? */
h = 0;
else
/* skip "unknown" values */
continue;
}
points[i].x = chart.screenX(t_this * vec.distance);
points[i].y = chart.screenY(fixed(h));
i++;
}
if (i >= 4) {
canvas.SelectNullPen();
canvas.Select(look.terrain_brush);
canvas.polygon(&points[0], i);
}
}
示例2:
void
CrossSectionWindow::PaintAircraft(Canvas &canvas, const Chart &chart,
const PixelRect rc)
{
canvas.Select(look.aircraft_brush);
canvas.SelectNullPen();
RasterPoint line[4];
line[0].x = chart.screenX(fixed_zero);
line[0].y = chart.screenY(gps_info.nav_altitude);
line[1].x = rc.left;
line[1].y = line[0].y;
line[2].x = line[1].x;
line[2].y = line[0].y - (line[0].x - line[1].x) / 2;
line[3].x = (line[1].x + line[0].x) / 2;
line[3].y = line[0].y;
canvas.DrawTriangleFan(line, 4);
}
示例3: brush
void
CrossSectionWindow::PaintAircraft(Canvas &canvas, const Chart &chart,
const PixelRect rc)
{
Brush brush(text_color);
canvas.select(brush);
Pen pen(1, text_color);
canvas.select(pen);
RasterPoint line[4];
line[0].x = chart.screenX(fixed_zero);
line[0].y = chart.screenY(gps_info.NavAltitude);
line[1].x = rc.left;
line[1].y = line[0].y;
line[2].x = line[1].x;
line[2].y = line[0].y - (line[0].x - line[1].x) / 2;
line[3].x = (line[1].x + line[0].x) / 2;
line[3].y = line[0].y;
canvas.polygon(line, 4);
}