Landscape.cpp   Landscape.cpp 
skipping to change at line 132 skipping to change at line 132
sinMinAltitudeLimit = (float) std::sin(M_PI/180.0 * landscapeIni.val ue("landscape/minimal_altitude", -2.0).toDouble()); sinMinAltitudeLimit = (float) std::sin(M_PI/180.0 * landscapeIni.val ue("landscape/minimal_altitude", -2.0).toDouble());
// This is now optional for all classes, for mixing with a photo hor izon: // This is now optional for all classes, for mixing with a photo hor izon:
// they may have different offsets, like a south-centered pano and a geographically-oriented polygon. // they may have different offsets, like a south-centered pano and a geographically-oriented polygon.
// In case they are aligned, we can use one value angle_rotatez, or define the polygon rotation individually. // In case they are aligned, we can use one value angle_rotatez, or define the polygon rotation individually.
if (landscapeIni.contains("landscape/polygonal_horizon_list")) if (landscapeIni.contains("landscape/polygonal_horizon_list"))
{ {
createPolygonalHorizon( createPolygonalHorizon(
StelFileMgr::findFile("landscapes/" + landscapeId + "/" + landscapeIni.value("landscape/polygonal_horizon_list" ).toString()), StelFileMgr::findFile("landscapes/" + landscapeId + "/" + landscapeIni.value("landscape/polygonal_horizon_list" ).toString()),
landscapeIni.value("landscape/polygo nal_angle_rotatez", 0.f).toFloat(), landscapeIni.value("landscape/polygo nal_angle_rotatez", 0.f).toFloat(),
landscapeIni.value("landscape/polygo landscapeIni.value("landscape/polygo
nal_horizon_list_mode", "azDeg_altDeg").toString()); nal_horizon_list_mode", "azDeg_altDeg").toString(),
landscapeIni.value("landscape/polygo
nal_horizon_inverted", "false").toBool()
);
// This line can then be drawn in all classes with the color specified here. If not specified, don't draw it! (flagged by negative red) // This line can then be drawn in all classes with the color specified here. If not specified, don't draw it! (flagged by negative red)
horizonPolygonLineColor=StelUtils::strToVec3f(landscapeIni.v alue("landscape/horizon_line_color", "-1,0,0" ).toString()); horizonPolygonLineColor=StelUtils::strToVec3f(landscapeIni.v alue("landscape/horizon_line_color", "-1,0,0" ).toString());
} }
// we must get label color, this is global. (No sense to make that p er-landscape!) // we must get label color, this is global. (No sense to make that p er-landscape!)
QSettings *config = StelApp::getInstance().getSettings(); QSettings *config = StelApp::getInstance().getSettings();
labelColor=StelUtils::strToVec3f(config->value("landscape/label_colo r", "0.2,0.8,0.2").toString()); labelColor=StelUtils::strToVec3f(config->value("landscape/label_colo r", "0.2,0.8,0.2").toString());
fontSize=config->value("landscape/label_font_size", 18).toInt(); fontSize=config->value("landscape/label_font_size", 18).toInt();
loadLabels(landscapeId); loadLabels(landscapeId);
} }
void Landscape::createPolygonalHorizon(const QString& lineFileName, const f loat polyAngleRotateZ, const QString &listMode ) void Landscape::createPolygonalHorizon(const QString& lineFileName, const f loat polyAngleRotateZ, const QString &listMode , const bool polygonInverted )
{ {
// qDebug() << _name << " " << _fullpath << " " << _lineFileName ; // qDebug() << _name << " " << _fullpath << " " << _lineFileName ;
QStringList horizonModeList; QStringList horizonModeList;
horizonModeList << "azDeg_altDeg" << "azDeg_zdDeg" << "azRad_altRad" << "azRad_zdRad" << "azGrad_zdGrad" << "azGrad_zdGrad"; horizonModeList << "azDeg_altDeg" << "azDeg_zdDeg" << "azRad_altRad" << "azRad_zdRad" << "azGrad_zdGrad" << "azGrad_zdGrad";
const horizonListMode coordMode=(horizonListMode) horizonModeList.in dexOf(listMode); const horizonListMode coordMode=(horizonListMode) horizonModeList.in dexOf(listMode);
QVector<Vec3d> horiPoints(0); QVector<Vec3d> horiPoints(0);
QFile file(lineFileName); QFile file(lineFileName);
skipping to change at line 213 skipping to change at line 215
alt=list.at(1).toFloat()*M_PI/200.f; alt=list.at(1).toFloat()*M_PI/200.f;
break; break;
case azGrad_zdGrad: case azGrad_zdGrad:
az=(200.0f - list.at(0).toFloat())*M_PI/200 .f - polyAngleRotateZ*M_PI/180.f; az=(200.0f - list.at(0).toFloat())*M_PI/200 .f - polyAngleRotateZ*M_PI/180.f;
alt=(100.0f-list.at(1).toFloat())*M_PI/200.f ; alt=(100.0f-list.at(1).toFloat())*M_PI/200.f ;
break; break;
default: qWarning() << "invalid coordMode while read ing horizon line."; default: qWarning() << "invalid coordMode while read ing horizon line.";
} }
StelUtils::spheToRect(az, alt, point); StelUtils::spheToRect(az, alt, point);
horiPoints.append(point); if (polygonInverted)
horiPoints.prepend(point);
else
horiPoints.append(point);
} }
file.close(); file.close();
//horiPoints.append(horiPoints.at(0)); // close loop? Apparently not necessary. //horiPoints.append(horiPoints.at(0)); // close loop? Apparently not necessary.
//qDebug() << "created horiPoints with " << horiPoints.count() << "p oints:"; //qDebug() << "created horiPoints with " << horiPoints.count() << "p oints:";
//for (int i=0; i<horiPoints.count(); ++i) //for (int i=0; i<horiPoints.count(); ++i)
// qDebug() << horiPoints.at(i)[0] << "/" << horiPoints.at(i)[1 ] << "/" << horiPoints.at(i)[2] ; // qDebug() << horiPoints.at(i)[0] << "/" << horiPoints.at(i)[1 ] << "/" << horiPoints.at(i)[2] ;
AllSkySphericalRegion allskyRegion; AllSkySphericalRegion allskyRegion;
SphericalPolygon aboveHorizonPolygon; SphericalPolygon aboveHorizonPolygon;
aboveHorizonPolygon.setContour(horiPoints); aboveHorizonPolygon.setContour(horiPoints);
horizonPolygon = allskyRegion.getSubtraction(aboveHorizonPolygon); horizonPolygon = allskyRegion.getSubtraction(aboveHorizonPolygon);
if (polygonInverted)
{
AllSkySphericalRegion allskyRegion2;
horizonPolygon = allskyRegion2.getSubtraction(horizonPolygon
);
//horizonPolygon=&aboveHorizonPolygon;
}
} }
#include <iostream> #include <iostream>
const QString Landscape::getTexturePath(const QString& basename, const QStr ing& landscapeId) const const QString Landscape::getTexturePath(const QString& basename, const QStr ing& landscapeId) const
{ {
// look in the landscape directory first, and if not found default t o global textures directory // look in the landscape directory first, and if not found default t o global textures directory
QString path = StelFileMgr::findFile("landscapes/" + landscapeId + " /" + basename); QString path = StelFileMgr::findFile("landscapes/" + landscapeId + " /" + basename);
if (path.isEmpty()) if (path.isEmpty())
path = StelFileMgr::findFile("textures/" + basename); path = StelFileMgr::findFile("textures/" + basename);
return path; return path;
 End of changes. 4 change blocks. 
4 lines changed or deleted 17 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/