本文整理汇总了C++中StelProjectorP::projectInPlace方法的典型用法代码示例。如果您正苦于以下问题:C++ StelProjectorP::projectInPlace方法的具体用法?C++ StelProjectorP::projectInPlace怎么用?C++ StelProjectorP::projectInPlace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StelProjectorP
的用法示例。
在下文中一共展示了StelProjectorP::projectInPlace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPointer
void NebulaMgr::drawPointer(const StelCore* core, StelPainter& sPainter)
{
const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
const QList<StelObjectP> newSelected = GETSTELMODULE(StelObjectMgr)->getSelectedObject("Nebula");
if (!newSelected.empty())
{
const StelObjectP obj = newSelected[0];
Vec3d pos=obj->getJ2000EquatorialPos(core);
// Compute 2D pos and return if outside screen
if (!prj->projectInPlace(pos)) return;
if (StelApp::getInstance().getVisionModeNight())
sPainter.setColor(0.8f,0.0f,0.0f);
else
sPainter.setColor(0.4f,0.5f,0.8f);
texPointer->bind();
sPainter.enableTexture2d(true);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode
// Size on screen
float size = obj->getAngularSize(core)*M_PI/180.*prj->getPixelPerRadAtCenter();
size+=20.f + 10.f*std::sin(2.f * StelApp::getInstance().getTotalRunTime());
sPainter.drawSprite2dMode(pos[0]-size/2, pos[1]-size/2, 10, 90);
sPainter.drawSprite2dMode(pos[0]-size/2, pos[1]+size/2, 10, 0);
sPainter.drawSprite2dMode(pos[0]+size/2, pos[1]+size/2, 10, -90);
sPainter.drawSprite2dMode(pos[0]+size/2, pos[1]-size/2, 10, -180);
}
}