当前位置: 首页>>代码示例>>C++>>正文


C++ MapWindowProjection::SetScreenOrigin方法代码示例

本文整理汇总了C++中MapWindowProjection::SetScreenOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ MapWindowProjection::SetScreenOrigin方法的具体用法?C++ MapWindowProjection::SetScreenOrigin怎么用?C++ MapWindowProjection::SetScreenOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MapWindowProjection的用法示例。


在下文中一共展示了MapWindowProjection::SetScreenOrigin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sun_azimuth

void
TerrainPreviewWindow::OnPaint(Canvas &canvas)
{
  const GlueMapWindow *map = UIGlobals::GetMap();
  if (map == nullptr)
    return;

  MapWindowProjection projection = map->VisibleProjection();
  if (!projection.IsValid()) {
    /* TODO: initialise projection to middle of map instead of bailing
       out */
    canvas.ClearWhite();
    return;
  }

  projection.SetScreenSize(canvas.GetSize());
  projection.SetScreenOrigin(canvas.GetWidth() / 2, canvas.GetHeight() / 2);

  Angle sun_azimuth(Angle::Degrees(-45));
  if (renderer.GetSettings().slope_shading == SlopeShading::SUN &&
      CommonInterface::Calculated().sun_data_available)
    sun_azimuth = CommonInterface::Calculated().sun_azimuth;

  renderer.Generate(projection, sun_azimuth);

#ifdef ENABLE_OPENGL
  /* enable clipping because the OpenGL terrain renderer uses a large
     texture that exceeds the window dimensions */
  GLCanvasScissor scissor(canvas);
#endif

  renderer.Draw(canvas, projection);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:33,代码来源:TerrainDisplayConfigPanel.cpp

示例2: renderer

void
TerrainDisplayConfigPanel::OnPreviewPaint(Canvas &canvas)
{
  TerrainRenderer renderer(terrain);
  renderer.SetSettings(terrain_settings);

  MapWindowProjection projection =
    XCSoarInterface::main_window.GetProjection();
  projection.SetScreenSize(canvas.get_width(), canvas.get_height());
  projection.SetScreenOrigin(canvas.get_width() / 2, canvas.get_height() / 2);

  Angle sun_azimuth(Angle::Degrees(fixed(-45)));
  if (terrain_settings.slope_shading == SlopeShading::SUN &&
      XCSoarInterface::Calculated().sun_data_available)
    sun_azimuth = XCSoarInterface::Calculated().sun_azimuth;

  renderer.Generate(projection, sun_azimuth);
  renderer.Draw(canvas, projection);
}
开发者ID:davidswelt,项目名称:XCSoar,代码行数:19,代码来源:TerrainDisplayConfigPanel.cpp


注:本文中的MapWindowProjection::SetScreenOrigin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。