本文整理汇总了C++中AirspacePolygon类的典型用法代码示例。如果您正苦于以下问题:C++ AirspacePolygon类的具体用法?C++ AirspacePolygon怎么用?C++ AirspacePolygon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AirspacePolygon类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPolygonPoints
static void
GetPolygonPoints(std::vector<RasterPoint> &pts,
const AirspacePolygon &airspace,
const RasterPoint pt, unsigned radius)
{
GeoBounds bounds = airspace.GetGeoBounds();
GeoPoint center = bounds.GetCenter();
fixed geo_heigth = bounds.GetGeoHeight();
fixed geo_width = bounds.GetGeoWidth();
fixed geo_size = std::max(geo_heigth, geo_width);
WindowProjection projection;
projection.SetScreenSize({radius * 2, radius * 2});
projection.SetScreenOrigin(pt.x, pt.y);
projection.SetGeoLocation(center);
projection.SetScale(fixed(radius * 2) / geo_size);
projection.SetScreenAngle(Angle::Zero());
projection.UpdateScreenBounds();
const SearchPointVector &border = airspace.GetPoints();
pts.reserve(border.size());
for (auto it = border.begin(), it_end = border.end(); it != it_end; ++it)
pts.push_back(projection.GeoToScreen(it->GetLocation()));
}
示例2: VisitPolygon
void VisitPolygon(const AirspacePolygon &airspace) {
if (warnings.IsAcked(airspace))
return;
AirspaceClass airspace_class = airspace.GetType();
if (settings.classes[airspace_class].fill_mode ==
AirspaceClassRendererSettings::FillMode::NONE)
return;
BufferRenderStart();
SetBufferPens(airspace);
DrawSearchPointVector(airspace.GetPoints());
}
示例3: Visit
void Visit(const AirspacePolygon& airspace) {
if (!prepare_polygon(airspace.GetPoints()))
return;
bool fill_airspace = m_warnings.is_warning(airspace) ||
m_warnings.is_inside(airspace);
GLEnable stencil(GL_STENCIL_TEST);
if (!m_warnings.is_acked(airspace)) {
if (!fill_airspace) {
// set stencil for filling (bit 0)
set_fillstencil();
draw_prepared();
}
// fill interior without overpainting any previous outlines
{
setup_interior(airspace, !fill_airspace);
GLEnable blend(GL_BLEND);
draw_prepared();
}
if (!fill_airspace) {
// clear fill stencil (bit 0)
clear_fillstencil();
draw_prepared();
}
}
// draw outline
setup_outline(airspace);
draw_prepared();
}
示例4: VisitPolygon
void VisitPolygon(const AirspacePolygon &airspace) {
if (!PreparePolygon(airspace.GetPoints()))
return;
const AirspaceClassRendererSettings &class_settings =
settings.classes[airspace.GetType()];
bool fill_airspace = warning_manager.HasWarning(airspace) ||
warning_manager.IsInside(airspace) ||
class_settings.fill_mode ==
AirspaceClassRendererSettings::FillMode::ALL;
if (!warning_manager.IsAcked(airspace) &&
class_settings.fill_mode !=
AirspaceClassRendererSettings::FillMode::NONE) {
GLEnable stencil(GL_STENCIL_TEST);
if (!fill_airspace) {
// set stencil for filling (bit 0)
SetFillStencil();
DrawPrepared();
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
// fill interior without overpainting any previous outlines
{
SetupInterior(airspace, !fill_airspace);
GLEnable blend(GL_BLEND);
DrawPrepared();
}
if (!fill_airspace) {
// clear fill stencil (bit 0)
ClearFillStencil();
DrawPrepared();
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
}
// draw outline
if (SetupOutline(airspace))
DrawPrepared();
}