本文整理汇总了C++中StelProjectorP::getViewportConvexPolygon方法的典型用法代码示例。如果您正苦于以下问题:C++ StelProjectorP::getViewportConvexPolygon方法的具体用法?C++ StelProjectorP::getViewportConvexPolygon怎么用?C++ StelProjectorP::getViewportConvexPolygon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StelProjectorP
的用法示例。
在下文中一共展示了StelProjectorP::getViewportConvexPolygon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
// Draw all the Nebulae
void NebulaMgr::draw(StelCore* core)
{
const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
StelPainter sPainter(prj);
StelSkyDrawer* skyDrawer = core->getSkyDrawer();
Nebula::hintsBrightness = hintsFader.getInterstate()*flagShow.getInterstate();
sPainter.enableTexture2d(true);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
// Use a 1 degree margin
const double margin = 1.*M_PI/180.*prj->getPixelPerRadAtCenter();
const SphericalRegionP& p = prj->getViewportConvexPolygon(margin, margin);
// Print all the nebulae of all the selected zones
float maxMagHints = skyDrawer->getLimitMagnitude()*1.2f-2.f+(hintsAmount*1.2f)-2.f;
float maxMagLabels = skyDrawer->getLimitMagnitude()-2.f+(labelsAmount*1.2f)-2.f;
sPainter.setFont(nebulaFont);
DrawNebulaFuncObject func(maxMagHints, maxMagLabels, &sPainter, core, hintsFader.getInterstate()>0.0001);
nebGrid.processIntersectingRegions(p, func);
if (GETSTELMODULE(StelObjectMgr)->getFlagSelectedObjectPointer())
drawPointer(core, sPainter);
}
示例2: drawArt
// Draw constellations art textures
void ConstellationMgr::drawArt(StelRenderer* renderer, StelProjectorP projector) const
{
renderer->setBlendMode(BlendMode_Add);
vector < Constellation * >::const_iterator iter;
SphericalRegionP region = projector->getViewportConvexPolygon();
for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
{
Constellation* cons = *iter;
if(NULL == cons->artTexture && !cons->artTexturePath.isEmpty())
{
cons->artTexture = renderer->createTexture(cons->artTexturePath);
}
if(NULL == cons->artVertices)
{
// Tesselate on the plane assuming a tangential projection for the image
const int resolution = 5;
cons->generateArtVertices(renderer, resolution);
}
cons->drawArtOptim(renderer, projector, *region);
}
}