Skip to content

Commit

Permalink
A few tiny tests.
Browse files Browse the repository at this point in the history
- Tried craters as circles, but need ellipse.
- When time is not running, it seems returning from moon to earth,
moon craters are distributed over the sky.
  • Loading branch information
gzotti committed Jul 24, 2023
1 parent aed7d4d commit 9ae98aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 8 additions & 0 deletions src/core/modules/NomenclatureItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ void NomenclatureItem::draw(StelCore* core, StelPainter *painter)
return;
}

const double screenSize = 2.*getAngularRadius(core)*M_PI_180*static_cast<double>(painter->getProjector()->getPixelPerRadAtCenter());

// We can use ratio of angular size to the FOV to checking visibility of features also!
// double scale = getAngularSize(core)/painter->getProjector()->getFov();
// if (painter->getProjector()->projectCheck(XYZ, srcPos) && (dist >= XYZ.length()) && (scale>0.04 && scale<0.5))

// check visibility of feature
Vec3d srcPos;
const float scale = getAngularDiameterRatio(core);
Expand All @@ -395,6 +401,8 @@ void NomenclatureItem::draw(StelCore* core, StelPainter *painter)
brightness = 0.5f;
painter->setColor(color*brightness, labelsFader.getInterstate());
painter->drawCircle(static_cast<float>(srcPos[0]), static_cast<float>(srcPos[1]), 2.f);
if (nType==niCrater || nType==niSatelliteFeature) // probably all satellite features are satellite craters
painter->drawCircle(static_cast<float>(srcPos[0]), static_cast<float>(srcPos[1]), screenSize/2.);
painter->drawText(static_cast<float>(srcPos[0]), static_cast<float>(srcPos[1]), nameI18n, 0, 5.f, 5.f, false);
}
}
Expand Down
13 changes: 4 additions & 9 deletions src/core/modules/NomenclatureMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,9 @@ void NomenclatureMgr::loadNomenclature()
qWarning() << "ERROR - cannot parse record at line" << lineNumber << "in surface nomenclature file" << QDir::toNativeSeparators(surfNamesFile);
else
{
// Read the planet name
// Read planet name, feature ID, context
planet = recMatch.captured(1).trimmed();
// Read the ID of feature
featureId = recMatch.captured(2).toInt();
// Read the name of feature and context
QString ctxt = recMatch.captured(3).trimmed();
QRegularExpressionMatch ctxMatch=ctxRx.match(ctxt);
if (ctxMatch.hasMatch())
Expand All @@ -225,11 +223,9 @@ void NomenclatureMgr::loadNomenclature()
// Read the type of feature
QString ntypecode = recMatch.captured(4).trimmed();
ntype = NomenclatureItem::getNomenclatureItemType(ntypecode.toUpper());
// Read the latitude of feature
// Read lat/long/size of feature
latitude = recMatch.captured(5).toDouble();
// Read the longitude of feature
longitude = recMatch.captured(6).toDouble();
// Read the size of feature
size = recMatch.captured(7).toDouble();

if (planetName.isEmpty() || planet!=planetName)
Expand Down Expand Up @@ -257,9 +253,8 @@ void NomenclatureMgr::loadNomenclature()
qDebug() << "Loaded" << readOk << "/" << totalRecords << "items of planetary surface nomenclature";

faultPlanets.removeDuplicates();
int err = faultPlanets.size();
if (err>0)
qDebug().noquote() << "WARNING - These planets to assign nomenclature items were not found:" << faultPlanets.join(", ");
if (faultPlanets.size()>0)
qDebug() << "WARNING - Cannot find these planets to assign nomenclature items:" << faultPlanets.join(", ");
}
}

Expand Down

0 comments on commit 9ae98aa

Please sign in to comment.