StelMainScriptAPI.cpp   StelMainScriptAPI.cpp 
skipping to change at line 364 skipping to change at line 364
{ {
return StelApp::getInstance().getCore()->getProjection(StelCore::Fra meJ2000)->getMaskType() == StelProjector::MaskDisk; return StelApp::getInstance().getCore()->getProjection(StelCore::Fra meJ2000)->getMaskType() == StelProjector::MaskDisk;
} }
void StelMainScriptAPI::setDiskViewport(bool b) void StelMainScriptAPI::setDiskViewport(bool b)
{ {
emit(requestSetDiskViewport(b)); emit(requestSetDiskViewport(b));
} }
void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name, void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name,
double ra0, double dec0, double ra0, double dec0,
double ra1, double dec1, double ra1, double dec1,
double ra2, double dec2, double ra2, double dec2,
double ra3, double dec3, double ra3, double dec3,
double minR double minRes, double maxBright, bool v
es, double maxBright, bool visible) isible)
{ {
QString path = "scripts/" + filename; QString path = "scripts/" + filename;
emit(requestLoadSkyImage(id, path, ra0, dec0, ra1, dec1, ra2, dec2, ra3, dec3, minRes, maxBright, visible)); emit(requestLoadSkyImage(id, path, ra0, dec0, ra1, dec1, ra2, dec2, ra3, dec3, minRes, maxBright, visible));
} }
void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name, void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name,
con const QString& ra0, const QString& dec0
st QString& ra0, const QString& dec0, ,
con const QString& ra1, const QString& dec1
st QString& ra1, const QString& dec1, ,
con const QString& ra2, const QString& dec2
st QString& ra2, const QString& dec2, ,
con const QString& ra3, const QString& dec3
st QString& ra3, const QString& dec3, ,
dou double minRes, double maxBright, bool v
ble minRes, double maxBright, bool visible) isible)
{ {
loadSkyImage(id, filename, loadSkyImage(id, filename,
StelUtils::getDecAngle(ra0) *180./M_PI, Ste StelUtils::getDecAngle(ra0) *180./M_PI, StelUtils::getD
lUtils::getDecAngle(dec0)*180./M_PI, ecAngle(dec0)*180./M_PI,
StelUtils::getDecAngle(ra1) *180./M_PI, Ste StelUtils::getDecAngle(ra1) *180./M_PI, StelUtils::getD
lUtils::getDecAngle(dec1)*180./M_PI, ecAngle(dec1)*180./M_PI,
StelUtils::getDecAngle(ra2) *180./M_PI, Ste StelUtils::getDecAngle(ra2) *180./M_PI, StelUtils::getD
lUtils::getDecAngle(dec2)*180./M_PI, ecAngle(dec2)*180./M_PI,
StelUtils::getDecAngle(ra3) *180./M_PI, Ste StelUtils::getDecAngle(ra3) *180./M_PI, StelUtils::getD
lUtils::getDecAngle(dec3)*180./M_PI, ecAngle(dec3)*180./M_PI,
minRes, maxBright, visible); minRes, maxBright, visible);
} }
void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name, void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name,
dou double ra, double dec, double angSize,
ble ra, double dec, double angSize, double rotation, double rotation,
dou double minRes, double maxBright, bool v
ble minRes, double maxBright, bool visible) isible)
{ {
Vec3f XYZ; Vec3f XYZ;
static const float RADIUS_NEB = 1.; static const float RADIUS_NEB = 1.;
StelUtils::spheToRect(ra*M_PI/180., dec*M_PI/180., XYZ); StelUtils::spheToRect(ra*M_PI/180., dec*M_PI/180., XYZ);
XYZ*=RADIUS_NEB; XYZ*=RADIUS_NEB;
float texSize = RADIUS_NEB * sin(angSize/2/60*M_PI/180); float texSize = RADIUS_NEB * sin(angSize/2/60*M_PI/180);
Mat4f matPrecomp = Mat4f::translation(XYZ) * Mat4f matPrecomp = Mat4f::translation(XYZ) *
Mat4f::zrotation(ra*M_PI/180.) * Mat4f::zrotation(ra*M_PI/180.) *
Mat4f::yrotation(-dec*M_PI/180.) Mat4f::yrotation(-dec*M_PI/180.) *
* Mat4f::xrotation(rotation*M_PI/180.);
Mat4f::xrotation(rotation*M_PI/18
0.);
Vec3f corners[4]; Vec3f corners[4];
corners[0] = matPrecomp * Vec3f(0.f,-texSize,-texSize); corners[0] = matPrecomp * Vec3f(0.f,-texSize,-texSize);
corners[1] = matPrecomp * Vec3f(0.f,-texSize, texSize); corners[1] = matPrecomp * Vec3f(0.f,-texSize, texSize);
corners[2] = matPrecomp * Vec3f(0.f, texSize,-texSize); corners[2] = matPrecomp * Vec3f(0.f, texSize,-texSize);
corners[3] = matPrecomp * Vec3f(0.f, texSize, texSize); corners[3] = matPrecomp * Vec3f(0.f, texSize, texSize);
// convert back to ra/dec (radians) // convert back to ra/dec (radians)
Vec3f cornersRaDec[4]; Vec3f cornersRaDec[4];
for(int i=0; i<4; i++) for(int i=0; i<4; i++)
StelUtils::rectToSphe(&cornersRaDec[i][0], &cornersRaDec[i][ 1], corners[i]); StelUtils::rectToSphe(&cornersRaDec[i][0], &cornersRaDec[i][ 1], corners[i]);
loadSkyImage(id, filename, loadSkyImage(id, filename,
cornersRaDec[0][0]*180./M_PI, cornersRaDec[ cornersRaDec[0][0]*180./M_PI, cornersRaDec[0][1]*180./M
0][1]*180./M_PI, _PI,
cornersRaDec[1][0]*180./M_PI, cornersRaDec[ cornersRaDec[1][0]*180./M_PI, cornersRaDec[1][1]*180./M
1][1]*180./M_PI, _PI,
cornersRaDec[3][0]*180./M_PI, cornersRaDec[ cornersRaDec[3][0]*180./M_PI, cornersRaDec[3][1]*180./M
3][1]*180./M_PI, _PI,
cornersRaDec[2][0]*180./M_PI, cornersRaDec[ cornersRaDec[2][0]*180./M_PI, cornersRaDec[2][1]*180./M
2][1]*180./M_PI, _PI,
minRes, maxBright, visible); minRes, maxBright, visible);
} }
void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name, void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name,
con const QString& ra, const QString& dec,
st QString& ra, const QString& dec, double angSize, double rotation, double angSize, double rotation,
dou double minRes, double maxBright, bool v
ble minRes, double maxBright, bool visible) isible)
{ {
loadSkyImage(id, filename, StelUtils::getDecAngle(ra)*180./M_PI, loadSkyImage(id, filename, StelUtils::getDecAngle(ra)*180./M_PI,
StelUtils::getDecAngle(dec)*180./M_PI, angS StelUtils::getDecAngle(dec)*180./M_PI, angSize,
ize, rotation, minRes, maxBright, visible);
rotation, minRes, maxBright, visible);
} }
void StelMainScriptAPI::loadSkyImageAltAz(const QString& id, const QString& filename, void StelMainScriptAPI::loadSkyImageAltAz(const QString& id, const QString& filename,
double alt0, double azi0, double alt0, double azi0,
double alt1, double azi1, double alt1, double azi1,
double alt2, double azi2, double alt2, double azi2,
double alt3, double azi3, double alt3, double azi3,
double minR double minRes, double maxBright, b
es, double maxBright, bool visible) ool visible)
{ {
QString path = "scripts/" + filename; QString path = "scripts/" + filename;
emit(requestLoadSkyImageAltAz(id, path, alt0, azi0, alt1, azi1, alt2 , azi2, alt3, azi3, minRes, maxBright, visible)); emit(requestLoadSkyImageAltAz(id, path, alt0, azi0, alt1, azi1, alt2 , azi2, alt3, azi3, minRes, maxBright, visible));
} }
void StelMainScriptAPI::loadSkyImageAltAz(const QString& id, const QString& filename, void StelMainScriptAPI::loadSkyImageAltAz(const QString& id, const QString& filename,
dou double alt, double azi,
ble alt, double azi, double angSize, double rotation, double angSize, double rotation,
dou double minRes, double maxBright, b
ble minRes, double maxBright, bool visible) ool visible)
{ {
Vec3f XYZ; Vec3f XYZ;
static const float RADIUS_NEB = 1.; static const float RADIUS_NEB = 1.;
StelUtils::spheToRect((180-azi)*M_PI/180., alt*M_PI/180., XYZ); StelUtils::spheToRect((180-azi)*M_PI/180., alt*M_PI/180., XYZ);
XYZ*=RADIUS_NEB; XYZ*=RADIUS_NEB;
float texSize = RADIUS_NEB * sin(angSize/2/60*M_PI/180); float texSize = RADIUS_NEB * sin(angSize/2/60*M_PI/180);
Mat4f matPrecomp = Mat4f::translation(XYZ) * Mat4f matPrecomp = Mat4f::translation(XYZ) *
Mat4f::zrotation((180-azi)*M_PI/1 Mat4f::zrotation((180-azi)*M_PI/180.) *
80.) * Mat4f::yrotation(-alt*M_PI/180.) *
Mat4f::yrotation(-alt*M_PI/180.) Mat4f::xrotation((rotation+90)*M_PI/180.);
*
Mat4f::xrotation((rotation+90)*M_
PI/180.);
Vec3f corners[4]; Vec3f corners[4];
corners[0] = matPrecomp * Vec3f(0.f,-texSize,-texSize); corners[0] = matPrecomp * Vec3f(0.f,-texSize,-texSize);
corners[1] = matPrecomp * Vec3f(0.f,-texSize, texSize); corners[1] = matPrecomp * Vec3f(0.f,-texSize, texSize);
corners[2] = matPrecomp * Vec3f(0.f, texSize,-texSize); corners[2] = matPrecomp * Vec3f(0.f, texSize,-texSize);
corners[3] = matPrecomp * Vec3f(0.f, texSize, texSize); corners[3] = matPrecomp * Vec3f(0.f, texSize, texSize);
// convert back to alt/azi (radians) // convert back to alt/azi (radians)
Vec3f cornersAltAz[4]; Vec3f cornersAltAz[4];
for(int i=0; i<4; i++) for(int i=0; i<4; i++)
StelUtils::rectToSphe(&cornersAltAz[i][0], &cornersAltAz[i][ 1], corners[i]); StelUtils::rectToSphe(&cornersAltAz[i][0], &cornersAltAz[i][ 1], corners[i]);
loadSkyImageAltAz(id, filename, loadSkyImageAltAz(id, filename,
cornersAltAz[0][0]*180./M_PI, cornersAltAz[ cornersAltAz[0][0]*180./M_PI, cornersAltAz[0][1]*1
0][1]*180./M_PI, 80./M_PI,
cornersAltAz[1][0]*180./M_PI, cornersAltAz[ cornersAltAz[1][0]*180./M_PI, cornersAltAz[1][1]*1
1][1]*180./M_PI, 80./M_PI,
cornersAltAz[3][0]*180./M_PI, cornersAltAz[ cornersAltAz[3][0]*180./M_PI, cornersAltAz[3][1]*1
3][1]*180./M_PI, 80./M_PI,
cornersAltAz[2][0]*180./M_PI, cornersAltAz[ cornersAltAz[2][0]*180./M_PI, cornersAltAz[2][1]*1
2][1]*180./M_PI, 80./M_PI,
minRes, maxBright, visible); minRes, maxBright, visible);
} }
void StelMainScriptAPI::removeSkyImage(const QString& id) void StelMainScriptAPI::removeSkyImage(const QString& id)
{ {
emit(requestRemoveSkyImage(id)); emit(requestRemoveSkyImage(id));
} }
void StelMainScriptAPI::loadSound(const QString& filename, const QString& i d) void StelMainScriptAPI::loadSound(const QString& filename, const QString& i d)
{ {
QString path = StelFileMgr::findFile("scripts/" + filename); QString path = StelFileMgr::findFile("scripts/" + filename);
skipping to change at line 623 skipping to change at line 625
{ {
QCoreApplication::exit(); QCoreApplication::exit();
} }
void StelMainScriptAPI::debug(const QString& s) void StelMainScriptAPI::debug(const QString& s)
{ {
qDebug() << "script: " << s; qDebug() << "script: " << s;
StelApp::getInstance().getScriptMgr().debug(s); StelApp::getInstance().getScriptMgr().debug(s);
} }
void StelMainScriptAPI::output(const QString &s)
{
StelApp::getInstance().getScriptMgr().output(s);
}
double StelMainScriptAPI::jdFromDateString(const QString& dt, const QString & spec) double StelMainScriptAPI::jdFromDateString(const QString& dt, const QString & spec)
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
if (dt == "now") if (dt == "now")
return StelUtils::getJDFromSystem(); return StelUtils::getJDFromSystem();
bool ok; bool ok;
double jd; double jd;
if (spec=="local") if (spec=="local")
{ {
skipping to change at line 896 skipping to change at line 903
ssmgr->setFlagMoonScale(false); ssmgr->setFlagMoonScale(false);
ssmgr->setFlagTrails(false); ssmgr->setFlagTrails(false);
mmgr->setZHR(10); mmgr->setZHR(10);
glmgr->setFlagAzimuthalGrid(false); glmgr->setFlagAzimuthalGrid(false);
glmgr->setFlagGalacticGrid(false); glmgr->setFlagGalacticGrid(false);
glmgr->setFlagEquatorGrid(false); glmgr->setFlagEquatorGrid(false);
glmgr->setFlagEquatorLine(false); glmgr->setFlagEquatorLine(false);
glmgr->setFlagEclipticLine(false); glmgr->setFlagEclipticLine(false);
glmgr->setFlagMeridianLine(false); glmgr->setFlagMeridianLine(false);
glmgr->setFlagHorizonLine(false); glmgr->setFlagHorizonLine(false);
glmgr->setFlagGalacticPlaneLine(false); glmgr->setFlagGalacticEquatorLine(false);
glmgr->setFlagEquatorJ2000Grid(false); glmgr->setFlagEquatorJ2000Grid(false);
lmgr->setFlagCardinalsPoints(false); lmgr->setFlagCardinalsPoints(false);
cmgr->setFlagLines(false); cmgr->setFlagLines(false);
cmgr->setFlagLabels(false); cmgr->setFlagLabels(false);
cmgr->setFlagBoundaries(false); cmgr->setFlagBoundaries(false);
cmgr->setFlagArt(false); cmgr->setFlagArt(false);
smgr->setFlagLabels(false); smgr->setFlagLabels(false);
ssmgr->setFlagLabels(false); ssmgr->setFlagLabels(false);
nmgr->setFlagHints(false); nmgr->setFlagHints(false);
lmgr->setFlagLandscape(true); lmgr->setFlagLandscape(true);
skipping to change at line 928 skipping to change at line 935
ssmgr->setFlagMoonScale(false); ssmgr->setFlagMoonScale(false);
ssmgr->setFlagTrails(false); ssmgr->setFlagTrails(false);
mmgr->setZHR(0); mmgr->setZHR(0);
glmgr->setFlagAzimuthalGrid(false); glmgr->setFlagAzimuthalGrid(false);
glmgr->setFlagGalacticGrid(false); glmgr->setFlagGalacticGrid(false);
glmgr->setFlagEquatorGrid(true); glmgr->setFlagEquatorGrid(true);
glmgr->setFlagEquatorLine(false); glmgr->setFlagEquatorLine(false);
glmgr->setFlagEclipticLine(false); glmgr->setFlagEclipticLine(false);
glmgr->setFlagMeridianLine(false); glmgr->setFlagMeridianLine(false);
glmgr->setFlagHorizonLine(false); glmgr->setFlagHorizonLine(false);
glmgr->setFlagGalacticPlaneLine(false); glmgr->setFlagGalacticEquatorLine(false);
glmgr->setFlagEquatorJ2000Grid(false); glmgr->setFlagEquatorJ2000Grid(false);
lmgr->setFlagCardinalsPoints(false); lmgr->setFlagCardinalsPoints(false);
cmgr->setFlagLines(true); cmgr->setFlagLines(true);
cmgr->setFlagLabels(true); cmgr->setFlagLabels(true);
cmgr->setFlagBoundaries(true); cmgr->setFlagBoundaries(true);
cmgr->setFlagArt(false); cmgr->setFlagArt(false);
smgr->setFlagLabels(true); smgr->setFlagLabels(true);
ssmgr->setFlagLabels(true); ssmgr->setFlagLabels(true);
nmgr->setFlagHints(true); nmgr->setFlagHints(true);
lmgr->setFlagLandscape(false); lmgr->setFlagLandscape(false);
skipping to change at line 960 skipping to change at line 967
ssmgr->setFlagMoonScale(false); ssmgr->setFlagMoonScale(false);
ssmgr->setFlagTrails(false); ssmgr->setFlagTrails(false);
mmgr->setZHR(0); mmgr->setZHR(0);
glmgr->setFlagAzimuthalGrid(false); glmgr->setFlagAzimuthalGrid(false);
glmgr->setFlagGalacticGrid(false); glmgr->setFlagGalacticGrid(false);
glmgr->setFlagEquatorGrid(false); glmgr->setFlagEquatorGrid(false);
glmgr->setFlagEquatorLine(false); glmgr->setFlagEquatorLine(false);
glmgr->setFlagEclipticLine(false); glmgr->setFlagEclipticLine(false);
glmgr->setFlagMeridianLine(false); glmgr->setFlagMeridianLine(false);
glmgr->setFlagHorizonLine(false); glmgr->setFlagHorizonLine(false);
glmgr->setFlagGalacticPlaneLine(false); glmgr->setFlagGalacticEquatorLine(false);
glmgr->setFlagEquatorJ2000Grid(false); glmgr->setFlagEquatorJ2000Grid(false);
lmgr->setFlagCardinalsPoints(false); lmgr->setFlagCardinalsPoints(false);
cmgr->setFlagLines(false); cmgr->setFlagLines(false);
cmgr->setFlagLabels(false); cmgr->setFlagLabels(false);
cmgr->setFlagBoundaries(false); cmgr->setFlagBoundaries(false);
cmgr->setFlagArt(false); cmgr->setFlagArt(false);
smgr->setFlagLabels(false); smgr->setFlagLabels(false);
ssmgr->setFlagLabels(false); ssmgr->setFlagLabels(false);
nmgr->setFlagHints(false); nmgr->setFlagHints(false);
lmgr->setFlagLandscape(false); lmgr->setFlagLandscape(false);
 End of changes. 18 change blocks. 
86 lines changed or deleted 85 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/