Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
2b23003
added custom GrahpicsView to display Map
mRaetz Apr 28, 2025
290e313
added custom GraphicsPolygonItem class
mRaetz Apr 28, 2025
9be6afc
registered new class files
mRaetz Apr 28, 2025
f5a73e0
added Structure for new MapView
mRaetz Apr 28, 2025
2e349e4
Merge branch 'master' into new-SkycultureMenu
mRaetz Apr 28, 2025
02d63b9
Merge branch 'master' into new-SkycultureMenu
mRaetz May 12, 2025
ec2fb7c
added Button to switch between SC map and browser
mRaetz May 13, 2025
5481ec2
fixed indentation
mRaetz May 16, 2025
b5293c4
skyCulture is now updated on selection of polygon in map
mRaetz May 18, 2025
d02dbe3
time in skyculture map can now be changed
mRaetz May 18, 2025
9037258
skyCulture Polygon can be selected through list
mRaetz May 25, 2025
2bd4cd0
Merge branch 'master' into new-SkycultureMenu
mRaetz May 29, 2025
86c1b60
changed baseMap picture to blank svg map
mRaetz May 31, 2025
bb83e7f
Merge branch 'master' into new-SkycultureMenu
mRaetz May 31, 2025
ad27fe4
added first attempt to load more complex polygon
mRaetz Jun 3, 2025
4c6233f
added transformation for projection
mRaetz Jun 9, 2025
867e21b
added new base maps
mRaetz Jun 9, 2025
c07f98c
removed map image for testing
mRaetz Jul 6, 2025
47c41e2
added smooth zoom
mRaetz Jul 6, 2025
e67c839
adjustments to projection transformation
mRaetz Jul 6, 2025
b951e91
changed some skyculture regions to be consistent with the UN geoscheme
mRaetz Jul 8, 2025
0efec2c
skyculture list is now sorted by UN geoscheme
mRaetz Jul 19, 2025
6517d35
changed how sky culture description is accessed
mRaetz Jul 19, 2025
d7ed024
added search bar to skyculture list widget
mRaetz Jul 20, 2025
420831b
added Label for time
mRaetz Jul 27, 2025
d1a5d62
enhanced the skyculture searchbar design
mRaetz Jul 27, 2025
9279a9c
added auto time init
mRaetz Jul 28, 2025
0bbcabd
small convenience fixes
mRaetz Jul 29, 2025
71a6319
changed zoom duration to scale with devation from default
mRaetz Jul 29, 2025
25a9980
test GUI design for changeable time range
mRaetz Jul 30, 2025
38d7f87
added new Icons for SpinBox
mRaetz Aug 12, 2025
eb300ef
changed the size constraints for culturesListWidget
mRaetz Aug 12, 2025
d3c8db3
added new icons
mRaetz Aug 12, 2025
96e2151
added startTime and endTime to StelSkyCulture class
mRaetz Aug 12, 2025
5cbaed4
changed the skyCulture options GUI
mRaetz Aug 12, 2025
0f2fe19
added time initialization function
mRaetz Aug 12, 2025
1cdaed3
added dynamically changeable time limits
mRaetz Aug 12, 2025
e8bf922
time limits can now be used to filter the culture list
mRaetz Aug 12, 2025
b7272a2
Merge branch 'master' into new-SkycultureMenu
mRaetz Aug 14, 2025
8e0f466
UI improvements for the Skyculture (time) options
mRaetz Sep 16, 2025
9ce65db
UI improvement: added CheckBox to allow for map rotation
mRaetz Sep 16, 2025
1b19613
changed how polygon item selection behaves
mRaetz Sep 16, 2025
d5e45d4
fixed map zoom bug on dialog creation
mRaetz Sep 16, 2025
3bd887c
on selection: select all polygons of a culture
mRaetz Sep 16, 2025
44f894c
updated all previous made connections to modern function pointers
mRaetz Sep 17, 2025
891fcce
reimplemented GraphicsView's DragMode
mRaetz Sep 26, 2025
be5c745
added smaller zoom when holding CTRL
mRaetz Sep 26, 2025
9c87e8d
added map rotation and removed some leftovers
mRaetz Sep 26, 2025
dd8bd66
set current culture time limit labels when updating the default SC
mRaetz Sep 26, 2025
4dea7cd
Merge branch 'master' into new-SkycultureMenu
mRaetz Sep 26, 2025
5dad34c
Merge branch 'master' into new-SkycultureMenu
mRaetz Sep 27, 2025
086c57a
removed old test files
mRaetz Oct 16, 2025
b4df07a
added ComboBox component that supports selection of multiple items
mRaetz Oct 16, 2025
9c020c1
added preview items for ScMaker map (polygon digitizing)
mRaetz Oct 16, 2025
2ce70ad
added custom Tree item for polygon info in ScMaker
mRaetz Oct 16, 2025
1499585
added new Region type for combobox in ScMaker
mRaetz Oct 16, 2025
3a09ab2
one culture can have multiple regions
mRaetz Oct 16, 2025
d4bdb74
start and end time labels in ScMenu are correctly set
mRaetz Oct 16, 2025
2b0e3b1
updated skyculturePolygonItem visual appearance
mRaetz Oct 16, 2025
c9dfeea
load all available culture polygons from the respective json files
mRaetz Oct 16, 2025
abb2dec
added new CulturePolygon type for ScMaker
mRaetz Oct 16, 2025
0f74769
added geoLoc tab to ScMaker
mRaetz Oct 16, 2025
e8dba05
small changes pre merge
mRaetz Nov 20, 2025
3a36709
Merge branch 'master' into new-SkycultureMenu
mRaetz Nov 20, 2025
b3c8e30
renamed files to match other SCMaker file names
mRaetz Dec 3, 2025
e83e7c0
added final map image for SCE / SCM (+ removed test file)
mRaetz Dec 3, 2025
cf1952c
added new custom SpinBox class for SCMaker
mRaetz Dec 3, 2025
fd42b30
revised tooltip in SCMaker artwork dialog
mRaetz Dec 3, 2025
8c8e827
added some comments and removed some debug messages
mRaetz Dec 3, 2025
31563f5
changed the tooltip for the map in SCMaker from QToolTip to label
mRaetz Dec 3, 2025
b5c4e86
changed name of some components in ui file
mRaetz Dec 3, 2025
09e63fd
SCMaker / SCExplorer now support existing cultures
mRaetz Dec 3, 2025
3fa100b
resolved bug when using ESC key instead of titlebar
mRaetz Dec 3, 2025
c6bac79
added new controls for map navigation and new point
mRaetz Dec 3, 2025
8b2a062
added smooth zoom for multiple culture polygons
mRaetz Dec 3, 2025
1df56b2
changed (string) filter in search bar for cultureListWidget
mRaetz Dec 3, 2025
def6513
cleanup (remove debug messages, comments, ...)
mRaetz Dec 3, 2025
f1cc46f
Merge branch 'master' into new-SkycultureMenu
mRaetz Dec 3, 2025
eb1896e
Merge branch 'master' into new-SkycultureMenu
mRaetz Dec 4, 2025
931e7c7
added / removed some comments
mRaetz Dec 4, 2025
b437d86
changed removal of locations to safe pattern
mRaetz Dec 5, 2025
cc5cfd6
Merge branch 'master' into new-SkycultureMenu
mRaetz Dec 5, 2025
998cb8f
remove old eventFilter implementation
mRaetz Dec 5, 2025
a3bbd02
corrected naming of classes and fixed some warnings
mRaetz Dec 5, 2025
4e1d167
test ci
xLPMG Dec 6, 2025
33dd282
change file case
xLPMG Dec 6, 2025
da88657
try some fixes
xLPMG Dec 6, 2025
b7d3ea1
conditional svgwidgets
xLPMG Dec 6, 2025
794be94
install different package
xLPMG Dec 6, 2025
320de15
Update ci.yml
xLPMG Dec 6, 2025
d680b6e
linux qt6
xLPMG Dec 6, 2025
447d8e8
fix qt5 errors
xLPMG Dec 6, 2025
946e7d2
more qt5 issues
xLPMG Dec 6, 2025
5cc1150
fix other ci steps
xLPMG Dec 6, 2025
4524eed
fix more issues
xLPMG Dec 6, 2025
c752786
add QMath
xLPMG Dec 6, 2025
cf93ddc
test
xLPMG Dec 6, 2025
5578326
test #2
xLPMG Dec 6, 2025
df7b828
Merge pull request #27 from xLPMG/qt-svg-widgets
mRaetz Dec 6, 2025
eec88b5
fixed some warnings regarding compability in qt5
mRaetz Dec 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
qt6-qpa-plugins qt6-image-formats-plugins qt6-l10n-tools qt6-webengine-dev qt6-webengine-dev-tools libqt6charts6-dev \
libqt6charts6 libqt6opengl6-dev libqt6positioning6-plugins libqt6serialport6-dev qt6-base-dev libqt6webenginecore6-bin \
libqt6webengine6-data libexiv2-dev libnlopt-cxx-dev zlib1g-dev libgl1-mesa-dev libdrm-dev libglx-dev libxkbcommon-x11-dev \
libgps-dev libmd4c-dev libmd4c-html0-dev cmake gettext libgettextpo-dev libtidy-dev libunarr-dev
libgps-dev libmd4c-dev libmd4c-html0-dev cmake gettext libgettextpo-dev libtidy-dev libunarr-dev qt6-svg-dev libqt6svgwidgets6

- name: Checkout repository
uses: actions/checkout@v5
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
sudo apt install -y qt6-base-private-dev qt6-multimedia-dev qt6-positioning-dev qt6-tools-dev qt6-tools-dev-tools qt6-base-dev-tools qt6-qpa-plugins \
qt6-image-formats-plugins qt6-l10n-tools qt6-webengine-dev qt6-webengine-dev-tools libqt6charts6-dev libqt6charts6 libqt6opengl6-dev \
libqt6positioning6-plugins libqt6serialport6-dev qt6-base-dev libqt6webenginecore6-bin libqt6webengine6-data libexiv2-dev libnlopt-cxx-dev \
zlib1g-dev libgl1-mesa-dev libdrm-dev libglx-dev libxkbcommon-x11-dev libgps-dev libmd4c-dev libmd4c-html0-dev
zlib1g-dev libgl1-mesa-dev libdrm-dev libglx-dev libxkbcommon-x11-dev libgps-dev libmd4c-dev libmd4c-html0-dev qt6-svg-dev libqt6svgwidgets6

- name: Checkout repository
uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# https://github.com/actions/virtual-environments/issues/2703
#sudo ACCEPT_EULA=Y apt upgrade -o Dpkg::Options::="--force-overwrite" --yes
#sudo apt install -y qtbase5-private-dev qtscript5-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev libqt5opengl5-dev qtmultimedia5-dev libqt5multimedia5-plugins libqt5serialport5 libqt5serialport5-dev qtpositioning5-dev libgps-dev libqt5positioning5 libqt5positioning5-plugins qtwebengine5-dev libqt5charts5-dev zlib1g-dev libgl1-mesa-dev libdrm-dev cmake lcov libexiv2-dev libnlopt-cxx-dev
sudo apt install -y qt6-base-private-dev qt6-multimedia-dev qt6-positioning-dev qt6-tools-dev qt6-tools-dev-tools qt6-base-dev-tools qt6-qpa-plugins qt6-image-formats-plugins qt6-l10n-tools qt6-webengine-dev qt6-webengine-dev-tools libqt6charts6-dev libqt6charts6 libqt6opengl6-dev libqt6positioning6-plugins libqt6serialport6-dev qt6-base-dev libqt6webenginecore6-bin libqt6webengine6-data libexiv2-dev libnlopt-cxx-dev zlib1g-dev libgl1-mesa-dev libdrm-dev libglx-dev libxkbcommon-x11-dev libgps-dev zlib1g-dev libgl1-mesa-dev libdrm-dev cmake lcov libexiv2-dev libnlopt-cxx-dev python3-demjson libmd4c-dev libmd4c-html0-dev
sudo apt install -y qt6-base-private-dev qt6-multimedia-dev qt6-positioning-dev qt6-tools-dev qt6-tools-dev-tools qt6-base-dev-tools qt6-qpa-plugins qt6-image-formats-plugins qt6-l10n-tools qt6-webengine-dev qt6-webengine-dev-tools libqt6charts6-dev libqt6charts6 libqt6opengl6-dev libqt6positioning6-plugins libqt6serialport6-dev qt6-base-dev libqt6webenginecore6-bin libqt6webengine6-data libexiv2-dev libnlopt-cxx-dev zlib1g-dev libgl1-mesa-dev libdrm-dev libglx-dev libxkbcommon-x11-dev libgps-dev zlib1g-dev libgl1-mesa-dev libdrm-dev cmake lcov libexiv2-dev libnlopt-cxx-dev python3-demjson libmd4c-dev libmd4c-html0-dev qt6-svg-dev libqt6svgwidgets6

- name: Checkout repository
uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
# using force-overwrite due to
# https://github.com/actions/virtual-environments/issues/2703
#sudo ACCEPT_EULA=Y apt upgrade -o Dpkg::Options::="--force-overwrite" --yes
sudo apt install -y qt6-base-private-dev qt6-multimedia-dev qt6-positioning-dev qt6-tools-dev qt6-tools-dev-tools qt6-base-dev-tools qt6-qpa-plugins qt6-image-formats-plugins qt6-l10n-tools qt6-webengine-dev qt6-webengine-dev-tools libqt6charts6-dev libqt6charts6 libqt6opengl6-dev libqt6positioning6-plugins libqt6serialport6-dev qt6-base-dev libqt6webenginecore6-bin libqt6webengine6-data libexiv2-dev libnlopt-cxx-dev zlib1g-dev libgl1-mesa-dev libdrm-dev libglx-dev libxkbcommon-x11-dev libgps-dev libmd4c-dev libmd4c-html0-dev
sudo apt install -y qt6-base-private-dev qt6-multimedia-dev qt6-positioning-dev qt6-tools-dev qt6-tools-dev-tools qt6-base-dev-tools qt6-qpa-plugins qt6-image-formats-plugins qt6-l10n-tools qt6-webengine-dev qt6-webengine-dev-tools libqt6charts6-dev libqt6charts6 libqt6opengl6-dev libqt6positioning6-plugins libqt6serialport6-dev qt6-base-dev libqt6webenginecore6-bin libqt6webengine6-data libexiv2-dev libnlopt-cxx-dev zlib1g-dev libgl1-mesa-dev libdrm-dev libglx-dev libxkbcommon-x11-dev libgps-dev libmd4c-dev libmd4c-html0-dev qt6-svg-dev libqt6svgwidgets6

- name: Checkout repository
uses: actions/checkout@v5
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,12 @@ IF(${QT_VERSION} VERSION_LESS MINIMAL_QT_VERSION)
ELSE()
MESSAGE(STATUS "Found Qt${QT_VERSION_MAJOR}: ${QMAKE_LOCATION} (found suitable version ${QT_VERSION})")
ENDIF()
FIND_PACKAGE(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS
Concurrent Gui Network Widgets Charts Positioning)
FIND_PACKAGE(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent Gui Network Widgets Charts Positioning)
IF(Qt6_FOUND)
FIND_PACKAGE(Qt6 REQUIRED COMPONENTS SvgWidgets)
ELSEIF(Qt5_FOUND)
FIND_PACKAGE(Qt5 REQUIRED COMPONENTS Svg)
ENDIF()
SET(USE_BUNDLED_QTCOMPRESS 1 CACHE BOOL "Use bundled version of qtcompress")
# Qt 6.10 split off FooPrivate from Foo.
# https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.10.0/release-note.md
Expand Down
5 changes: 5 additions & 0 deletions data/gui/guiRes.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,10 @@
<file>uieScrolldown.png</file>
<file>uieScrollleft.png</file>
<file>uieScrollright.png</file>
<file>uieSpinboxAdd.png</file>
<file>uieSpinboxAdd-pressed.png</file>
<file>uieSpinboxRemove.png</file>
<file>uieSpinboxRemove-pressed.png</file>
<file>skyCultureWorldMap.svgz</file>
</qresource>
</RCC>
4 changes: 2 additions & 2 deletions data/gui/normalStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,8 @@ QListWidget#landscapesListWidget {
}

QListWidget#culturesListWidget {
min-width: 120px;
max-width: 220px;
min-width: 230px;
max-width: 290px;
}

/* Try to make them the same size */
Expand Down
Binary file added data/gui/skyCultureWorldMap.svgz
Binary file not shown.
Binary file added data/gui/uieSpinboxAdd-pressed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/gui/uieSpinboxAdd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/gui/uieSpinboxRemove-pressed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/gui/uieSpinboxRemove.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions plugins/SkyCultureMaker/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ SET( SkyCultureMaker_SRCS
gui/ScmSkyCultureExportDialog.cpp
gui/ScmStartDialog.hpp
gui/ScmStartDialog.cpp
gui/ScmGeoLocGraphicsView.hpp
gui/ScmGeoLocGraphicsView.cpp
gui/ScmPreviewPathItem.hpp
gui/ScmPreviewPathItem.cpp
gui/ScmPreviewPolygonItem.hpp
gui/ScmPreviewPolygonItem.cpp
gui/ScmPolygonInfoTreeItem.hpp
gui/ScmPolygonInfoTreeItem.cpp
gui/ScmMultiselectionComboBox.hpp
gui/ScmMultiselectionComboBox.cpp
gui/ScmAdvancedSpinBox.hpp
gui/ScmAdvancedSpinBox.cpp

types/Anchor.hpp
types/Classification.hpp
Expand Down Expand Up @@ -80,6 +92,12 @@ ADD_LIBRARY(SkyCultureMaker-static STATIC ${SkyCultureMaker_SRCS} ${SkyCultureMa
SET_TARGET_PROPERTIES(SkyCultureMaker-static PROPERTIES OUTPUT_NAME "SkyCultureMaker")

list(APPEND SKY_CULTURE_MAKER_PLUGIN_LINK_LIBS Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets)
IF (${QT_VERSION_MAJOR} EQUAL "5")
list(APPEND SKY_CULTURE_MAKER_PLUGIN_LINK_LIBS Qt${QT_VERSION_MAJOR}::Svg)
ELSE()
list(APPEND SKY_CULTURE_MAKER_PLUGIN_LINK_LIBS Qt${QT_VERSION_MAJOR}::SvgWidgets)
ENDIF()

# SCM_CONVERTER_ENABLED is inherited from the parent CMakeLists.txt scope
if(SCM_CONVERTER_ENABLED)
list(APPEND SKY_CULTURE_MAKER_PLUGIN_LINK_LIBS libskycultureconverter unarr)
Expand Down
50 changes: 50 additions & 0 deletions plugins/SkyCultureMaker/src/ScmSkyCulture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ void scm::ScmSkyCulture::setFallbackToInternationalNames(bool fallback)
ScmSkyCulture::fallbackToInternationalNames = fallback;
}

void scm::ScmSkyCulture::setStartTime(int startTime)
{
ScmSkyCulture::startTime = startTime;
}

void scm::ScmSkyCulture::setEndTime(const QString &endTime)
{
ScmSkyCulture::endTime = endTime;
}

scm::ScmConstellation &scm::ScmSkyCulture::addConstellation(const QString &id,
const std::vector<ConstellationLine> &lines,
const bool isDarkConstellation)
Expand All @@ -45,13 +55,25 @@ scm::ScmConstellation &scm::ScmSkyCulture::addConstellation(const QString &id,
return *constellations.back();
}

void scm::ScmSkyCulture::addLocation(const scm::CulturePolygon &polygon)
{
locations.push_back(polygon);
}

void scm::ScmSkyCulture::removeConstellation(const QString &id)
{
constellations.erase(remove_if(begin(constellations), end(constellations),
[id](const std::unique_ptr<ScmConstellation> &c) { return c->getId() == id; }),
end(constellations));
}

void scm::ScmSkyCulture::removeLocation(int id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would prefer if removeLocation used the same pattern as removeConstellation. Its a modern c++ pattern that avoids iterator invalidation issues and won't break if multiple items match (although in practice that shouldnt happen with ids anyway..). It might give the compiler more freedom for optimizations as well :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. In fact, i++ after location.erase(i) has undefined behavior.

{
locations.erase(std::remove_if(std::begin(locations), std::end(locations),
[id](const CulturePolygon &p) { return p.id == id; }),
std::end(locations));
}

scm::ScmConstellation *scm::ScmSkyCulture::getConstellation(const QString &id)
{
auto it = std::find_if(constellations.begin(), constellations.end(),
Expand All @@ -67,12 +89,25 @@ std::vector<std::unique_ptr<scm::ScmConstellation>> *scm::ScmSkyCulture::getCons
QJsonObject scm::ScmSkyCulture::toJson(const bool mergeLines) const
{
QJsonObject scJsonObj;

scJsonObj["id"] = id;

QJsonArray regionArray;
for (const auto &currentRegion : description.region)
{
regionArray.append(REGIONS.at(currentRegion).name);
}
scJsonObj["region"] = regionArray;

scJsonObj["startTime"] = startTime;
scJsonObj["endTime"] = endTime;

// for some reason, the classification is inside an array, eg. ["historical"]
QJsonArray classificationArray = QJsonArray::fromStringList(
QStringList() << classificationTypeToString(description.classification));
scJsonObj["classification"] = classificationArray;
scJsonObj["fallback_to_international_names"] = fallbackToInternationalNames;

QJsonArray constellationsArray;
for (const auto &constellation : constellations)
{
Expand All @@ -83,6 +118,21 @@ QJsonObject scm::ScmSkyCulture::toJson(const bool mergeLines) const
return scJsonObj;
}

QJsonObject scm::ScmSkyCulture::getTerritoryJson() const
{
QJsonObject locJsonObj;

QJsonArray locationsArray;
for (const auto &culturePolygon : locations)
{
locationsArray.append(culturePolygon.toJson());
}

locJsonObj["polygons"] = locationsArray;

return locJsonObj;
}

void scm::ScmSkyCulture::draw(StelCore *core) const
{
for (auto &constellation : constellations)
Expand Down
28 changes: 28 additions & 0 deletions plugins/SkyCultureMaker/src/ScmSkyCulture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "StelCore.hpp"
#include "StelSkyCultureMgr.hpp"
#include "types/Classification.hpp"
#include "types/CulturePolygon.hpp"
#include "types/ConstellationLine.hpp"
#include "types/Description.hpp"
#include "types/License.hpp"
Expand All @@ -52,6 +53,12 @@ class ScmSkyCulture
*/
const QString &getId() const;

/// Sets the start time of the sky culture
void setStartTime(int startTime);

/// Sets the end time of the sky culture
void setEndTime(const QString &endTime);

/// Sets whether to show common names in addition to the culture-specific ones
void setFallbackToInternationalNames(bool fallback);

Expand All @@ -60,9 +67,15 @@ class ScmSkyCulture
const std::vector<ConstellationLine> &lines,
const bool isDarkConstellation);

/// Adds a location to the sky culture
void addLocation(const scm::CulturePolygon &polygon);

/// Removes a constellation from the sky culture by its ID
void removeConstellation(const QString &id);

/// Removes a location from the sky culture by its ID
void removeLocation(int id);

/// Gets a constellation from the sky culture by its ID
ScmConstellation *getConstellation(const QString &id);

Expand All @@ -78,6 +91,11 @@ class ScmSkyCulture
*/
QJsonObject toJson(const bool mergeLines) const;

/**
* @brief Returns the territory of the sky culture as a JSON object
*/
QJsonObject getTerritoryJson() const;

/**
* @brief Draws the sky culture.
*/
Expand Down Expand Up @@ -117,6 +135,16 @@ class ScmSkyCulture

/// The description of the sky culture
scm::Description description;

/// The geographical location (as polygons) of the sky culture
QList<CulturePolygon> locations;

/// The earliest year associated with a territory of the sky culture
int startTime;

/// The latest year associated with a territory of the sky culture
// (represented as QString because culture can still exist)
QString endTime;
};

} // namespace scm
Expand Down
32 changes: 32 additions & 0 deletions plugins/SkyCultureMaker/src/SkyCultureMaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,38 @@ void SkyCultureMaker::setSkyCultureDescription(const scm::Description &descripti
}
}

void SkyCultureMaker::setSkyCultureStartTime(int startTime)
{
if (currentSkyCulture != nullptr)
{
currentSkyCulture->setStartTime(startTime);
}
}

void SkyCultureMaker::setSkyCultureEndTime(const QString &endTime)
{
if (currentSkyCulture != nullptr)
{
currentSkyCulture->setEndTime(endTime);
}
}

void SkyCultureMaker::addSkyCultureLocation(const scm::CulturePolygon &polygon)
{
if (currentSkyCulture != nullptr)
{
currentSkyCulture->addLocation(polygon);
}
}

void SkyCultureMaker::removeSkyCultureLocation(int id)
{
if (currentSkyCulture != nullptr)
{
currentSkyCulture->removeLocation(id);
}
}

void SkyCultureMaker::setTempArtwork(const scm::ScmConstellationArtwork *artwork)
{
tempArtwork = artwork;
Expand Down
24 changes: 24 additions & 0 deletions plugins/SkyCultureMaker/src/SkyCultureMaker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,30 @@ class SkyCultureMaker : public StelModule
*/
void setSkyCultureDescription(const scm::Description &description);

/**
* @brief Sets the current sky culture start time.
* @param startTime The start time to set.
*/
void setSkyCultureStartTime(int startTime);

/**
* @brief Sets the current sky culture end time.
* @param endTime The end time to set.
*/
void setSkyCultureEndTime(const QString &endTime);

/**
* @brief Adds a CulturePolygon to the sky culture.
* @param polygon The culturePolygon to add.
*/
void addSkyCultureLocation(const scm::CulturePolygon &polygon);

/**
* @brief Removes a CulturePolygon from the sky culture by its Id.
* @param id The identifier of the location.
*/
void removeSkyCultureLocation(int id);

/**
* @brief Saves the current sky culture description as markdown text.
* @param directory The directory to save the description in.
Expand Down
Loading
Loading