本文整理汇总了C++中Projection::GeoToScreenDistance方法的典型用法代码示例。如果您正苦于以下问题:C++ Projection::GeoToScreenDistance方法的具体用法?C++ Projection::GeoToScreenDistance怎么用?C++ Projection::GeoToScreenDistance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projection
的用法示例。
在下文中一共展示了Projection::GeoToScreenDistance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
RenderObservationZone::Draw(Canvas &canvas, const Projection &projection,
const ObservationZonePoint &_oz) const
{
switch (_oz.shape) {
case ObservationZonePoint::LINE:
case ObservationZonePoint::FAI_SECTOR: {
const SectorZone &oz = (const SectorZone &)_oz;
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
if (layer != LAYER_ACTIVE)
canvas.segment(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
else {
RasterPoint p_start = projection.GeoToScreen(oz.get_SectorStart());
RasterPoint p_end = projection.GeoToScreen(oz.get_SectorEnd());
canvas.two_lines(p_start, p_center, p_end);
}
break;
}
case ObservationZonePoint::CYLINDER: {
const CylinderZone &oz = (const CylinderZone &)_oz;
if (layer != LAYER_INACTIVE) {
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.circle(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getRadius()));
}
break;
}
case ObservationZonePoint::BGA_START:
case ObservationZonePoint::SECTOR: {
const SectorZone &oz = (const SectorZone &)_oz;
if (layer != LAYER_INACTIVE) {
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.segment(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
RasterPoint p_start = projection.GeoToScreen(oz.get_SectorStart());
RasterPoint p_end = projection.GeoToScreen(oz.get_SectorEnd());
canvas.two_lines(p_start, p_center, p_end);
}
break;
}
case ObservationZonePoint::KEYHOLE:
case ObservationZonePoint::BGAFIXEDCOURSE:
case ObservationZonePoint::BGAENHANCEDOPTION: {
const SectorZone &oz = (const SectorZone &)_oz;
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.keyhole(p_center.x, p_center.y,
projection.GeoToScreenDistance(fixed(500)),
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
break;
}
case ObservationZonePoint::ANNULAR_SECTOR: {
const AnnularSectorZone &oz = (const AnnularSectorZone &)_oz;
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.annulus(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getInnerRadius()),
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
}
}
}
示例2: Prepare
void
OZRenderer::Draw(Canvas &canvas, Layer layer, const Projection &projection,
const ObservationZonePoint &_oz, int offset)
{
if (layer == LAYER_SHADE && offset < 0)
return;
Prepare(canvas, layer, offset);
switch (_oz.shape) {
case ObservationZonePoint::LINE:
case ObservationZonePoint::FAI_SECTOR: {
const SectorZone &oz = (const SectorZone &)_oz;
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
if (layer != LAYER_ACTIVE)
canvas.DrawSegment(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
else {
RasterPoint p_start = projection.GeoToScreen(oz.get_SectorStart());
RasterPoint p_end = projection.GeoToScreen(oz.get_SectorEnd());
canvas.DrawTwoLines(p_start, p_center, p_end);
}
break;
}
case ObservationZonePoint::CYLINDER: {
const CylinderZone &oz = (const CylinderZone &)_oz;
if (layer != LAYER_INACTIVE) {
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.circle(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getRadius()));
}
break;
}
case ObservationZonePoint::BGA_START:
case ObservationZonePoint::SECTOR: {
const SectorZone &oz = (const SectorZone &)_oz;
if (layer != LAYER_INACTIVE) {
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.DrawSegment(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
RasterPoint p_start = projection.GeoToScreen(oz.get_SectorStart());
RasterPoint p_end = projection.GeoToScreen(oz.get_SectorEnd());
canvas.DrawTwoLines(p_start, p_center, p_end);
}
break;
}
case ObservationZonePoint::KEYHOLE:
case ObservationZonePoint::BGAFIXEDCOURSE:
case ObservationZonePoint::BGAENHANCEDOPTION: {
const SectorZone &oz = (const SectorZone &)_oz;
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.DrawKeyhole(p_center.x, p_center.y,
projection.GeoToScreenDistance(fixed(500)),
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
break;
}
case ObservationZonePoint::ANNULAR_SECTOR: {
const AnnularSectorZone &oz = (const AnnularSectorZone &)_oz;
RasterPoint p_center = projection.GeoToScreen(oz.get_location());
canvas.DrawAnnulus(p_center.x, p_center.y,
projection.GeoToScreenDistance(oz.getInnerRadius()),
projection.GeoToScreenDistance(oz.getRadius()),
oz.getStartRadial() - projection.GetScreenAngle(),
oz.getEndRadial() - projection.GetScreenAngle());
}
}
Finish(canvas, layer);
}