本文整理汇总了C++中StelPainter::drawSprite2dMode方法的典型用法代码示例。如果您正苦于以下问题:C++ StelPainter::drawSprite2dMode方法的具体用法?C++ StelPainter::drawSprite2dMode怎么用?C++ StelPainter::drawSprite2dMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StelPainter
的用法示例。
在下文中一共展示了StelPainter::drawSprite2dMode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: draw
void Galaxy::draw(StelCore* core, StelPainter& painter, float)
{
StelSkyDrawer* sd = core->getSkyDrawer();
Vec3f color = Vec3f(0.4f,0.5f,1.2f);
if (StelApp::getInstance().getVisionModeNight())
color = StelUtils::getNightColor(color);
double mag = getVMagnitude(core, true);
StelUtils::spheToRect(RA, DE, XYZ);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
painter.setColor(color[0], color[1], color[2], Galaxy::galaxyBrightness);
glColor4f(color[0],color[1],color[2], Galaxy::galaxyBrightness);
if (mag <= sd->getLimitMagnitude())
{
Galaxy::markerTexture->bind();
float size = getAngularSize(NULL)*M_PI/180.*painter.getProjector()->getPixelPerRadAtCenter();
float shift = 5.f + size/1.6f;
if (GETSTELMODULE(POGS)->getDisplayMode())
{
painter.drawSprite2dMode(XYZ, 6);
painter.drawText(XYZ, " ", 0, shift, shift, false);
}
else
{
painter.drawSprite2dMode(XYZ, 6);
painter.drawText(XYZ, designation, 0, shift, shift, false);
}
}
}
示例3: drawPointer
void StarMgr::drawPointer(StelPainter& sPainter, const StelCore* core)
{
const QList<StelObjectP> newSelected = objectMgr->getSelectedObject("Star");
if (!newSelected.empty())
{
const StelObjectP obj = newSelected[0];
Vec3d pos=obj->getJ2000EquatorialPos(core);
Vec3d screenpos;
// Compute 2D pos and return if outside screen
if (!sPainter.getProjector()->project(pos, screenpos))
return;
Vec3f c(obj->getInfoColor());
if (StelApp::getInstance().getVisionModeNight())
c = StelUtils::getNightColor(c);
sPainter.setColor(c[0], c[1], c[2]);
texPointer->bind();
sPainter.enableTexture2d(true);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode
sPainter.drawSprite2dMode(screenpos[0], screenpos[1], 13.f, StelApp::getInstance().getTotalRunTime()*40.);
}
}
示例4: draw
void Quasar::draw(StelCore* core, StelPainter& painter)
{
StelSkyDrawer* sd = core->getSkyDrawer();
Vec3f color = sd->indexToColor(BvToColorIndex(bV))*0.75f;
Vec3f dcolor = Vec3f(1.2f,0.5f,0.4f);
if (StelApp::getInstance().getVisionModeNight())
dcolor = StelUtils::getNightColor(dcolor);
float rcMag[2], size, shift;
double mag;
StelUtils::spheToRect(qRA, qDE, XYZ);
mag = getVMagnitude(core, true);
if (GETSTELMODULE(Quasars)->getDisplayMode())
{
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
painter.setColor(dcolor[0], dcolor[1], dcolor[2], 1);
Quasar::markerTexture->bind();
size = getAngularSize(NULL)*M_PI/180.*painter.getProjector()->getPixelPerRadAtCenter();
shift = 5.f + size/1.6f;
if (labelsFader.getInterstate()<=0.f)
{
painter.drawSprite2dMode(XYZ, 4);
painter.drawText(XYZ, " ", 0, shift, shift, false);
}
}
else
{
sd->preDrawPointSource(&painter);
if (mag <= sd->getLimitMagnitude())
{
sd->computeRCMag(mag, rcMag);
//sd->drawPointSource(&painter, Vec3f(XYZ[0], XYZ[1], XYZ[2]), rcMag, sd->indexToColor(BvToColorIndex(bV)), false);
sd->drawPointSource(&painter, XYZ, rcMag, sd->indexToColor(BvToColorIndex(bV)), false);
painter.setColor(color[0], color[1], color[2], 1);
size = getAngularSize(NULL)*M_PI/180.*painter.getProjector()->getPixelPerRadAtCenter();
shift = 6.f + size/1.8f;
if (labelsFader.getInterstate()<=0.f)
{
painter.drawText(XYZ, designation, 0, shift, shift, false);
}
}
sd->postDrawPointSource(&painter);
}
}
示例5: draw
void TleTraj::draw(const StelCore *core, StelPainter& painter)
{
Vec3d pos;
satd2StelCoord(curData, pos);
XYZ = core->altAzToJ2000(pos);
Vec3d xy;
if (painter.getProjector()->project(pos, xy))
{
glEnable(GL_TEXTURE_2D);
glColor3f(orbitColor->redF(), orbitColor->greenF(), orbitColor->blueF());
hintTexture->bind();
painter.drawSprite2dMode(xy[0], xy[1], 16);
glDisable(GL_TEXTURE_2D);
drawOrbit(painter);
}
}
示例6: drawHints
void Nebula::drawHints(StelPainter& sPainter, float maxMagHints)
{
float lim = mag;
if (lim > 50) lim = 15.f;
// temporary workaround of this bug: https://bugs.launchpad.net/stellarium/+bug/1115035 --AW
if (getEnglishName().contains("Pleiades"))
lim = 5.f;
if (lim>maxMagHints)
return;
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
float lum = 1.f;//qMin(1,4.f/getOnScreenSize(core))*0.8;
Vec3f col(circleColor[0]*lum*hintsBrightness, circleColor[1]*lum*hintsBrightness, circleColor[2]*lum*hintsBrightness);
sPainter.setColor(col[0], col[1], col[2], 1);
switch (nType)
{
case NebGx:
Nebula::texGalaxy->bind();
break;
case NebOc:
Nebula::texOpenCluster->bind();
break;
case NebGc:
Nebula::texGlobularCluster->bind();
break;
case NebN:
Nebula::texDiffuseNebula->bind();
break;
case NebPn:
Nebula::texPlanetaryNebula->bind();
break;
case NebCn:
Nebula::texOpenClusterWithNebulosity->bind();
break;
default:
Nebula::texCircle->bind();
}
sPainter.drawSprite2dMode(XY[0], XY[1], 6);
}
示例7: drawPointer
void Novae::drawPointer(StelCore* core, StelPainter &painter)
{
const QList<StelObjectP> newSelected = GETSTELMODULE(StelObjectMgr)->getSelectedObject("Nova");
if (!newSelected.empty())
{
const StelObjectP obj = newSelected[0];
Vec3d pos=obj->getJ2000EquatorialPos(core);
Vec3d screenpos;
// Compute 2D pos and return if outside screen
if (!painter.getProjector()->project(pos, screenpos))
return;
const Vec3f& c(obj->getInfoColor());
painter.setColor(c[0],c[1],c[2]);
texPointer->bind();
painter.enableTexture2d(true);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode
painter.drawSprite2dMode(screenpos[0], screenpos[1], 13.f, StelApp::getInstance().getTotalRunTime()*40.);
}
}
示例8: drawPointer
void Pulsars::drawPointer(StelCore* core, StelPainter& painter)
{
const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
const QList<StelObjectP> newSelected = GETSTELMODULE(StelObjectMgr)->getSelectedObject("Pulsar");
if (!newSelected.empty())
{
const StelObjectP obj = newSelected[0];
Vec3d pos=obj->getJ2000EquatorialPos(core);
Vec3d screenpos;
// Compute 2D pos and return if outside screen
if (!painter.getProjector()->project(pos, screenpos))
return;
const Vec3f& c(obj->getInfoColor());
painter.setColor(c[0],c[1],c[2]);
texPointer->bind();
painter.setBlending(true);
painter.drawSprite2dMode(screenpos[0], screenpos[1], 13.f, StelApp::getInstance().getTotalRunTime()*40.);
}
}
示例9: drawHints
void Nebula::drawHints(StelPainter& sPainter, float maxMagHints)
{
float lim = mag;
if (lim > 50) lim = 15.f;
// temporary workaround of this bug: https://bugs.launchpad.net/stellarium/+bug/1115035 --AW
if (getEnglishName().contains("Pleiades"))
lim = 5.f;
// Dark nebulae. Not sure how to assess visibility from opacity? --GZ
if (nType==NebDn)
{
// GZ: ad-hoc visibility formula: assuming good visibility if objects of mag9 are visible, "usual" opacity 5 and size 30', better visibility (discernability) comes with higher opacity and larger size,
// 9-(opac-5)-2*(angularSize-0.5)
if (angularSize>0 && mag<50)
lim = 15.0f - mag - 2.0f*angularSize;
else
lim = 9.0f;
}
else if (nType==NebHII || nType==NebHa)
{ // artificially increase visibility of (most) Sharpless objects? No magnitude recorded:-(
lim=9.0f;
}
if (lim>maxMagHints)
return;
Vec3d win;
// Check visibility of DSO hints
if (!(sPainter.getProjector()->projectCheck(XYZ, win)))
return;
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
float lum = 1.f;//qMin(1,4.f/getOnScreenSize(core))*0.8;
Vec3f col(circleColor[0]*lum*hintsBrightness, circleColor[1]*lum*hintsBrightness, circleColor[2]*lum*hintsBrightness);
sPainter.setColor(col[0], col[1], col[2], 1);
switch (nType)
{
case NebGx:
Nebula::texGalaxy->bind();
break;
case NebOc:
Nebula::texOpenCluster->bind();
break;
case NebGc:
Nebula::texGlobularCluster->bind();
break;
case NebN:
case NebHII:
case NebRn:
Nebula::texDiffuseNebula->bind();
break;
case NebPn:
Nebula::texPlanetaryNebula->bind();
break;
case NebDn:
Nebula::texDarkNebula->bind();
break;
case NebCn:
Nebula::texOpenClusterWithNebulosity->bind();
break;
default:
Nebula::texCircle->bind();
}
if (drawHintProportional)
{
float size = getAngularSize(NULL)*M_PI/180.*sPainter.getProjector()->getPixelPerRadAtCenter();
sPainter.drawSprite2dMode(XY[0], XY[1], qMax(6.0f,size));
}
else
sPainter.drawSprite2dMode(XY[0], XY[1], 6.0f);
}