From 9ae98aa47f236bb33cb42c6a0f7b153bfe7dae9a Mon Sep 17 00:00:00 2001 From: Georg Zotti Date: Mon, 24 Jul 2023 19:53:18 +0200 Subject: [PATCH] A few tiny tests. - 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. --- src/core/modules/NomenclatureItem.cpp | 8 ++++++++ src/core/modules/NomenclatureMgr.cpp | 13 ++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/core/modules/NomenclatureItem.cpp b/src/core/modules/NomenclatureItem.cpp index b58f74b496fae8..7cec958f4c8e94 100644 --- a/src/core/modules/NomenclatureItem.cpp +++ b/src/core/modules/NomenclatureItem.cpp @@ -371,6 +371,12 @@ void NomenclatureItem::draw(StelCore* core, StelPainter *painter) return; } + const double screenSize = 2.*getAngularRadius(core)*M_PI_180*static_cast(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); @@ -395,6 +401,8 @@ void NomenclatureItem::draw(StelCore* core, StelPainter *painter) brightness = 0.5f; painter->setColor(color*brightness, labelsFader.getInterstate()); painter->drawCircle(static_cast(srcPos[0]), static_cast(srcPos[1]), 2.f); + if (nType==niCrater || nType==niSatelliteFeature) // probably all satellite features are satellite craters + painter->drawCircle(static_cast(srcPos[0]), static_cast(srcPos[1]), screenSize/2.); painter->drawText(static_cast(srcPos[0]), static_cast(srcPos[1]), nameI18n, 0, 5.f, 5.f, false); } } diff --git a/src/core/modules/NomenclatureMgr.cpp b/src/core/modules/NomenclatureMgr.cpp index 9f4105887d27df..971fa1f95d4fae 100644 --- a/src/core/modules/NomenclatureMgr.cpp +++ b/src/core/modules/NomenclatureMgr.cpp @@ -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()) @@ -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) @@ -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(", "); } }