-
-
Notifications
You must be signed in to change notification settings - Fork 978
Expansion of skycultures through spatial and temporal extent #4683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
added subclass of QGraphicsView to display a basemap (Pixmap) and several Polygons (GraphicItems)
added QStackedWidget with 2 pages at the old location of SkyCultureTextBrowser. First page holds custom GraphicsView and a Slider, second page holds skyCultureTextBrowser.
added QSlider and QSpinBox for time selection. Culture polygons are shown / hidden depending on the current year.
When clicking on the culturesListWidget, a fitting polygon is selected in the SkycultureMapGraphicsView. If needed the current year is updated as well.
loaded skyculture polygon from geojson file is visible on the map but not placed at the right position
EPSG 3857 coordinates (meter) can now be transformed into view coordinates and projected onto the base map. EPSG 4623 coordinates (lat / lon) can now be transformed into EPSG 3857 coordinates.
added new SVG files (normal, compressed SVG and compressed into SVGZ format)
When a culture is selected through the listWidget, the view smoothly zooms out to the extent of the base map and then smoothly zooms onto the desired culture poygon
removed switch page button and the stackedWidget. Added new page to ViewDialog with skyculture description.
Added a QLabel that displays 'time' in the users respective language to the skyculture map page in ViewDialog
Range of time for skyculture map (and Slider / SpinBox) is now initialized properly. (at least the maxYear part which corresponds to the current system time)
A new evenFilter was installed that fixes the same problem (b10f9c4)
|
I compiled this on my machine and your code generates a few new warnings that need to be fixed. Some examples include If these dont appear in your console, maybe try deleting the build folder and doing a fresh build. Also now that I see this warning: the usual name scheme was to use camel case for "SkyCulture", but your files use "Skyculture". Its only a cosmetic issue, but it would still be nice if the same naming scheme is used everywhere :)) |
Please add missing package in linux boxes |
Actually, even in English "Abort" and "Cancel" require too much consideration to figure out what one should press. What if we change them to more explicit "Drop progress and close" and "Don't close"? The current situation reminds me of the MSVC's age-old "Debug error!" dialog box with the stock "Abort", "Retry", "Ignore" buttons and the "(Press Retry to debug the application)" kludge instead of having sensible button labels. |
fixed some build issues and warnings
- fixed error in Qt5 where QList<QPointF> cannot be converted into a QPolygonF - previous change of class name left behind artifact in ui file - changed a small visual problem of the preview when setting the first point of a polygon (in SkyCultureMaker)
| #include <QJsonObject> | ||
| #include <QJsonDocument> | ||
| #include <QtMath> | ||
| #include <cmath> // for M_PI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<QtMath> is documented to define M_PI too. But why on Earth use QtMath at all? For qPow? How is it better than std::pow?
Besides the apparent uselessness, Qt is constantly making some crazy assumptions, like qFloor being templated (so that it could support large numbers) but returning a mere int (throwing away most of supportable integers), downcast from a call to std::floor (basically)!
So I'd advise to avoid QtMath, except maybe for the unique functions like the variadic qHypot overload or qNextPowerOfTwo, etc.
|
I had to apply the following patch to build without precompiled headers on Ubuntu 20.04 and Qt 6.4.1: diff --git a/src/gui/SkyCultureMapGraphicsView.cpp b/src/gui/SkyCultureMapGraphicsView.cpp
index c5fcee207a..edaa5faaec 100644
--- a/src/gui/SkyCultureMapGraphicsView.cpp
+++ b/src/gui/SkyCultureMapGraphicsView.cpp
@@ -20,6 +20,7 @@
#include "SkyCultureMapGraphicsView.hpp"
#include "SkyCulturePolygonItem.hpp"
#include "StelLocaleMgr.hpp"
+#include "StelFileMgr.hpp"
#include "StelSkyCultureMgr.hpp"
#include <qjsonarray.h>
#include <QGraphicsSvgItem>
@@ -27,7 +28,10 @@
#include <QJsonObject>
#include <QJsonDocument>
+#include <QWheelEvent>
+#include <QMouseEvent>
#include <QtMath>
+#include <QFile>
SkyCultureMapGraphicsView::SkyCultureMapGraphicsView(QWidget *parent)
: QGraphicsView(parent) |
|
So, I've finally tried this PR. Here's my critique:
|
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Originally, the map and description were in the same tab (a stackedWidget allowed users to switch between them). On the suggestion of GZotti / SMH, the description was later moved to this extra tab.
Yes, the name could definitely be better. If the description stays in its own tab, I would also prefer this name.
This was purely a design decision. I felt that buttons on the left and right would better convey the connection with the horizontal slider. The normal up/down buttons rotated and placed on the left/right looked a bit strange, which is why I used -/+ buttons. If this disturbs the overall design too much, the normal up/down buttons on the right side of the spin box can be used instead.
Yes, that's right. I initially used a strict query (toLower(filterString) must be contained in the word). While testing, I noticed that some cultures are difficult to find with this query. Typos are an obvious problem, but special characters can also prevent the filter from matching the word. A concrete example of this is as follows: In the German version, the indigenous culture of New Zealand is referred to as Māori. However, the ā is a very rare character, so it must be assumed that the user will enter Maori (normal a) in the search bar. Therefore, I tried to use a kind of string similarity measure to solve this problem. This is not perfect, but most importantly, it does not filter individual characters (a deviation of at least one character should be allowed to avoid the problems described above). Therefore, it is only used for 2 or more characters, which leads to the behavior described. I am sure there is a better solution for the whole thing, but the current implementation has basically done its job. However, I would also be open to using a simple, strict matching (via contains).
If the scene is the same size as the map, navigation of the map becomes restricted. On the one hand, you could then only view the edge of the map (depending on the zoom level) at the edge of the window, but most of the time you want the relevant part to be in the center of your field of view. On the other hand, there is a problem with smooth zooming after selecting a culture from the list. Since during this zoom only the scene is moved to create the illusion of smooth movement, it occurs, especially in the border areas of the map, that you reach the boundary of the scene, resulting in a rigid movement. This can be solved by setting the extent of the scene to a multiple of the map. |
I don't think it's a good idea, because it makes widget style inconsistent and makes it seem that the two spinboxes near each other are actually different kinds of widgets. We already have similar combinations of a slider and a (normal) spinbox, and they don't cause any confusion. See e.g. Labels and Markers in the DSO tab of the View dialog, or Shooting stars in the Sky tab.
You could strip diacritics from both the search term and the list of names before doing the filtering. See e.g. here on how to do it.
Even if we go this way, it shouldn't be possible to move the edge of the map farther away than to the center of the window. Currently I can move the whole map away when scaling up so as to fit Greenland in the window, and may have to pan several window heights to get the map back into the viewport. |

Description
This extension adds spatial and temporal dimensions to sky cultures. These are used to allow users to make interactive selections. The selection menu has been redesigned for this purpose. In addition to a list, users can now explore and select the available cultures using a time-resolved map.
All new cultures in the future should have both a temporal and spatial dimension, which is why the SkyCultureMaker plugin has been updated as well. In addition to a region selection feature, a simple digitization tool has been implemented that allows users to digitize the culture territories themselves. Furthermore, a few minor changes were made that could be described as bug fixes. For example, a problem with pressing the ESC key in ScmSkyCultureDialog was fixed, as well as the previously invisible button for the artwork tooltips in ScmConstellationDialog.
Type of change
How Has This Been Tested?
This extension has been manually tested on a desktop PC (Windows 10) and a laptop (Windows 11). In both cases, there were no compatibility issues. However, no statement can be made regarding correct functionality on other operating systems.
Test specification:
Checklist: