ConstellationMgr.cpp   ConstellationMgr.cpp 
skipping to change at line 64 skipping to change at line 64
constellationPickEnabled(false), constellationPickEnabled(false),
constellationDisplayStyle(ConstellationMgr::constellationsTranslat ed), constellationDisplayStyle(ConstellationMgr::constellationsTranslat ed),
artFadeDuration(2.), artFadeDuration(2.),
artIntensity(0), artIntensity(0),
artIntensityMinimumFov(1.0), artIntensityMinimumFov(1.0),
artIntensityMaximumFov(2.0), artIntensityMaximumFov(2.0),
artDisplayed(0), artDisplayed(0),
boundariesDisplayed(0), boundariesDisplayed(0),
linesDisplayed(0), linesDisplayed(0),
namesDisplayed(0), namesDisplayed(0),
constellationLineThickness(1.) constellationLineThickness(1)
{ {
setObjectName("ConstellationMgr"); setObjectName("ConstellationMgr");
Q_ASSERT(hipStarMgr); Q_ASSERT(hipStarMgr);
} }
ConstellationMgr::~ConstellationMgr() ConstellationMgr::~ConstellationMgr()
{ {
std::vector<Constellation *>::iterator iter; std::vector<Constellation *>::iterator iter;
for (iter = constellations.begin(); iter != constellations.end(); it er++) for (iter = constellations.begin(); iter != constellations.end(); it er++)
skipping to change at line 102 skipping to change at line 102
lastLoadedSkyCulture = "dummy"; lastLoadedSkyCulture = "dummy";
asterFont.setPixelSize(conf->value("viewing/constellation_font_size" , 14).toInt()); asterFont.setPixelSize(conf->value("viewing/constellation_font_size" , 14).toInt());
setFlagLines(conf->value("viewing/flag_constellation_drawing").toBoo l()); setFlagLines(conf->value("viewing/flag_constellation_drawing").toBoo l());
setFlagLabels(conf->value("viewing/flag_constellation_name").toBool( )); setFlagLabels(conf->value("viewing/flag_constellation_name").toBool( ));
setFlagBoundaries(conf->value("viewing/flag_constellation_boundaries ",false).toBool()); setFlagBoundaries(conf->value("viewing/flag_constellation_boundaries ",false).toBool());
setArtIntensity(conf->value("viewing/constellation_art_intensity", 0 .5f).toFloat()); setArtIntensity(conf->value("viewing/constellation_art_intensity", 0 .5f).toFloat());
setArtFadeDuration(conf->value("viewing/constellation_art_fade_durat ion",2.f).toFloat()); setArtFadeDuration(conf->value("viewing/constellation_art_fade_durat ion",2.f).toFloat());
setFlagArt(conf->value("viewing/flag_constellation_art").toBool()); setFlagArt(conf->value("viewing/flag_constellation_art").toBool());
setFlagIsolateSelected(conf->value("viewing/flag_constellation_isola te_selected", false).toBool()); setFlagIsolateSelected(conf->value("viewing/flag_constellation_isola te_selected", false).toBool());
setFlagConstellationPick(conf->value("viewing/flag_constellation_pic k", false).toBool()); setFlagConstellationPick(conf->value("viewing/flag_constellation_pic k", false).toBool());
setConstellationLineThickness(conf->value("viewing/constellation_lin e_thickness", 1.f).toFloat()); setConstellationLineThickness(conf->value("viewing/constellation_lin e_thickness", 1).toInt());
QString starloreDisplayStyle=conf->value("viewing/constellation_name _style", "translated").toString(); QString starloreDisplayStyle=conf->value("viewing/constellation_name _style", "translated").toString();
if (starloreDisplayStyle=="translated") if (starloreDisplayStyle=="translated")
{ {
setConstellationDisplayStyle(constellationsTranslated); setConstellationDisplayStyle(constellationsTranslated);
} }
else if (starloreDisplayStyle=="native") else if (starloreDisplayStyle=="native")
{ {
setConstellationDisplayStyle(constellationsNative); setConstellationDisplayStyle(constellationsNative);
} }
skipping to change at line 372 skipping to change at line 372
QString ConstellationMgr::getConstellationDisplayStyleString(ConstellationD isplayStyle style) QString ConstellationMgr::getConstellationDisplayStyleString(ConstellationD isplayStyle style)
{ {
return (style == constellationsAbbreviated ? "abbreviated" : (style == constellationsNative ? "native" : "translated")); return (style == constellationsAbbreviated ? "abbreviated" : (style == constellationsNative ? "native" : "translated"));
} }
ConstellationMgr::ConstellationDisplayStyle ConstellationMgr::getConstellat ionDisplayStyle() ConstellationMgr::ConstellationDisplayStyle ConstellationMgr::getConstellat ionDisplayStyle()
{ {
return constellationDisplayStyle; return constellationDisplayStyle;
} }
void ConstellationMgr::setConstellationLineThickness(const float thickness) void ConstellationMgr::setConstellationLineThickness(const int thickness)
{ {
if(thickness!=constellationLineThickness) if(thickness!=constellationLineThickness)
{ {
constellationLineThickness = thickness; constellationLineThickness = thickness;
if (constellationLineThickness<=0.f) // The line can not be if (constellationLineThickness<=0) // The line can not be ne
negative or zero thickness gative or zero thickness
constellationLineThickness = 1.f; constellationLineThickness = 1;
emit constellationLineThicknessChanged(thickness); emit constellationLineThicknessChanged(thickness);
} }
} }
void ConstellationMgr::loadLinesAndArt(const QString &fileName, const QStri ng &artfileName, const QString& cultureName) void ConstellationMgr::loadLinesAndArt(const QString &fileName, const QStri ng &artfileName, const QString& cultureName)
{ {
QFile in(fileName); QFile in(fileName);
if (!in.open(QIODevice::ReadOnly | QIODevice::Text)) if (!in.open(QIODevice::ReadOnly | QIODevice::Text))
{ {
skipping to change at line 612 skipping to change at line 612
(*iter)->drawArtOptim(sPainter, *region); (*iter)->drawArtOptim(sPainter, *region);
} }
sPainter.setCullFace(false); sPainter.setCullFace(false);
} }
// Draw constellations lines // Draw constellations lines
void ConstellationMgr::drawLines(StelPainter& sPainter, const StelCore* cor e) const void ConstellationMgr::drawLines(StelPainter& sPainter, const StelCore* cor e) const
{ {
sPainter.setBlending(true); sPainter.setBlending(true);
if (constellationLineThickness>1.f) if (constellationLineThickness>1)
sPainter.setLineWidth(constellationLineThickness); // set li ne thickness sPainter.setLineWidth(constellationLineThickness); // set li ne thickness
sPainter.setLineSmooth(true); sPainter.setLineSmooth(true);
const SphericalCap& viewportHalfspace = sPainter.getProjector()->get BoundingCap(); const SphericalCap& viewportHalfspace = sPainter.getProjector()->get BoundingCap();
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
for (iter = constellations.begin(); iter != constellations.end(); ++ iter) for (iter = constellations.begin(); iter != constellations.end(); ++ iter)
{ {
(*iter)->drawOptim(sPainter, core, viewportHalfspace); (*iter)->drawOptim(sPainter, core, viewportHalfspace);
} }
if (constellationLineThickness>1.f) if (constellationLineThickness>1)
sPainter.setLineWidth(1.f); // restore line thickness sPainter.setLineWidth(1); // restore line thickness
sPainter.setLineSmooth(false); sPainter.setLineSmooth(false);
} }
// Draw the names of all the constellations // Draw the names of all the constellations
void ConstellationMgr::drawNames(StelPainter& sPainter) const void ConstellationMgr::drawNames(StelPainter& sPainter) const
{ {
sPainter.setBlending(true); sPainter.setBlending(true);
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
for (iter = constellations.begin(); iter != constellations.end(); it er++) for (iter = constellations.begin(); iter != constellations.end(); it er++)
{ {
skipping to change at line 1266 skipping to change at line 1266
// Modified boundary file by Torsten Bronger with permission // Modified boundary file by Torsten Bronger with permission
// http://pp3.sourceforge.net // http://pp3.sourceforge.net
QFile dataFile(boundaryFile); QFile dataFile(boundaryFile);
if (!dataFile.open(QIODevice::ReadOnly | QIODevice::Text)) if (!dataFile.open(QIODevice::ReadOnly | QIODevice::Text))
{ {
qWarning() << "Boundary file " << QDir::toNativeSeparators(b oundaryFile) << " not found"; qWarning() << "Boundary file " << QDir::toNativeSeparators(b oundaryFile) << " not found";
return false; return false;
} }
QTextStream istr(&dataFile);
float DE, RA; float DE, RA;
Vec3f XYZ; Vec3f XYZ;
unsigned num, numc; unsigned num, numc;
vector<Vec3f> *points = Q_NULLPTR; vector<Vec3f> *points = Q_NULLPTR;
QString consname; QString consname, record, data = "";
i = 0; i = 0;
while (!istr.atEnd())
// Added support of comments for constellations_boundaries.dat file
QRegExp commentRx("^(\\s*#.*|\\s*)$");
while (!dataFile.atEnd())
{ {
points = new vector<Vec3f>; // Read the line
record = QString::fromUtf8(dataFile.readLine());
// Skip comments
if (commentRx.exactMatch(record))
continue;
// Append the data
data.append(record);
}
// Read and parse the data without comments
QTextStream istr(&data);
while (!istr.atEnd())
{
num = 0; num = 0;
istr >> num; istr >> num;
if(num == 0) continue; // empty line if(num == 0)
continue; // empty line
points = new vector<Vec3f>;
for (j=0;j<num;j++) for (j=0;j<num;j++)
{ {
istr >> RA >> DE; istr >> RA >> DE;
RA*=M_PI/12.; // Convert from hours to rad RA*=M_PI/12.; // Convert from hours to rad
DE*=M_PI/180.; // Convert from deg to rad DE*=M_PI/180.; // Convert from deg to rad
// Calc the Cartesian coord with RA and DE // Calc the Cartesian coord with RA and DE
StelUtils::spheToRect(RA,DE,XYZ); StelUtils::spheToRect(RA,DE,XYZ);
 End of changes. 12 change blocks. 
14 lines changed or deleted 32 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/