Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Sep 30, 2020
2 parents 47abfcf + 98818de commit 091d58a
Show file tree
Hide file tree
Showing 232 changed files with 37,609 additions and 28,912 deletions.
6 changes: 4 additions & 2 deletions 3rd-party/cove/app/colorseditform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ class ColorsEditingDelegate : public QItemDelegate
QVariant v = model->data(model->index(index.row(), 0, index),
Qt::BackgroundRole);
QColor c = v.value<QBrush>().color();
clr = QColorDialog::getRgba(c.rgb());
auto chosen_color = QColorDialog::getColor(c);
if (chosen_color.isValid())
clr = chosen_color.rgba();
setModelData(nullptr, model, index);
event->accept();
return true;
Expand Down Expand Up @@ -150,7 +152,7 @@ QVariant ColorsListModel::data(const QModelIndex& index, int role) const
.arg(qBlue(colors[index.row()])));
}
else if (index.column() == 2 && role == Qt::DisplayRole &&
index.row() < comments.size())
index.row() < int(comments.size()))
{
return QVariant(comments[index.row()]);
}
Expand Down
15 changes: 3 additions & 12 deletions 3rd-party/cove/app/mainform.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2019 Libor Pecháček.
* Copyright (c) 2005-2020 Libor Pecháček.
* Copyright 2020 Kai Pastor
*
* This file is part of CoVe
Expand Down Expand Up @@ -249,15 +249,6 @@ void mainForm::afterLoadImage()
}
}

//! Simple About dialog.
void mainForm::aboutDialog()
{
QMessageBox::about(this, tr("About"),
trUtf8("<h3>COntour VEctorizer</h3><br />"
"Author: Libor Pecháček<br />"
"License: GPL"));
}

/*! Return color randomly created from image pixels. It takes 5 scanlines and
* makes an average color of its pixels. */
QRgb mainForm::getColorFromImage(const QImage& image)
Expand Down Expand Up @@ -633,7 +624,7 @@ void mainForm::on_classificationOptionsButton_clicked()
void mainForm::on_initialColorsButton_clicked()
{
ColorsEditForm* optionsDialog = new ColorsEditForm(this);
int settingsNColors = settings.getInt("nColors");
auto settingsNColors = static_cast<std::size_t>(settings.getInt("nColors"));
std::vector<QString> comments;
auto colors = settings.getInitColors(comments);
auto nColors = colors.size();
Expand Down Expand Up @@ -791,7 +782,7 @@ void mainForm::on_bwImageSaveButton_clicked()

QString selectedFilter("PNG (*.png)");
QString newfilename = QFileDialog::getSaveFileName(
this, QString::null, QFileInfo(imageFileName).dir().path(), filter,
this, QString(), QFileInfo(imageFileName).dir().path(), filter,
&selectedFilter);

if (!newfilename.isEmpty())
Expand Down
3 changes: 1 addition & 2 deletions 3rd-party/cove/app/mainform.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2019 Libor Pecháček.
* Copyright (c) 2005-2020 Libor Pecháček.
*
* This file is part of CoVe
*
Expand Down Expand Up @@ -97,7 +97,6 @@ class mainForm : public QDialog
std::vector<bool> getSelectedColors();

public slots:
void aboutDialog();
void setInitialColors(bool on);
void colorButtonToggled(bool on);

Expand Down
3 changes: 0 additions & 3 deletions 3rd-party/cove/libvectorizer/Morphology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ bool Morphology::rosenfeld(ProgressObserver* progressObserver)
{
bool cancel = false; // whether the thinning was canceled
unsigned int x, y; // Pixel coordinates
unsigned int pc = 0; // Pass count
unsigned int count; // Deleted pixel count
unsigned int p, q; // Neighborhood maps of adjacent cells
unsigned int m; // Deletion direction mask

thinnedImage = image;
thinnedImage.detach();
Expand All @@ -144,7 +142,6 @@ bool Morphology::rosenfeld(ProgressObserver* progressObserver)

do
{ // Thin image lines until there are no deletions
pc++;
count = 0;

for (auto const m : masks)
Expand Down
4 changes: 4 additions & 0 deletions 3rd-party/cove/libvectorizer/Vectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,17 @@ namespace cove {
/*! \var PatternStrategy Vectorizer::patternStrategy
Selected pattern selection strategy. \sa setPatternStrategy */

// virtual
Vectorizer::~Vectorizer() = default;

Vectorizer::Vectorizer()
: mc(std::make_unique<MapColorRGB>(2.0))
, E(100000)
, initAlpha(0.1)
, q(0.5)
, minAlpha(1e-6)
, p(2)
, quality(0)
, learnMethod(KOHONEN_CLASSIC)
, colorSpace(COLSPC_RGB)
, alphaStrategy(ALPHA_CLASSIC)
Expand Down
7 changes: 4 additions & 3 deletions 3rd-party/cove/libvectorizer/Vectorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include <QImage>
#include <QRgb>

#include "MapColor.h"

namespace cove {

class MapColor;
class ProgressObserver;

class Vectorizer
Expand Down Expand Up @@ -81,8 +81,9 @@ class Vectorizer
void deleteColorsTable();

public:
virtual ~Vectorizer();
Vectorizer();
Vectorizer(QImage& im);
explicit Vectorizer(QImage& im);
virtual void setClassificationMethod(LearningMethod learnMethod);
virtual void setColorSpace(ColorSpace colorSpace);
virtual void setP(double p);
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif()

# Project declaration

project(Mapper VERSION 0.9.3 LANGUAGES CXX C)
project(Mapper VERSION 0.9.4 LANGUAGES CXX C)
set(Mapper_COPYRIGHT "(C) 2020 The OpenOrienteering developers")

math(EXPR Mapper_VERSION_CODE "${Mapper_VERSION_MAJOR} * 10000 + ${Mapper_VERSION_MINOR} * 100 + ${Mapper_VERSION_PATCH} * 2 + ${CMAKE_SIZEOF_VOID_P} / 4 - 1")
Expand Down
5 changes: 5 additions & 0 deletions ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ steps:
#
if [ -f build/default/openorienteering-mapper-ci/Testing/TAG ]; then
# Test result exist, so executables are runnable
OLD_PATH="$PATH"
if [ -n "$(MINGW)" ]; then
export PATH=`cygpath -u "$(SUPERBUILD_INSTALL_DIR)"`/$(MINGW)/superbuild/bin:${PATH}
fi
build/${TARGET:-default}/openorienteering-mapper-ci/src/gdal/mapper-gdal-info \
| tee output/OpenOrienteering-Mapper-GDAL-info-$(IMAGE_NAME)$(OUTPUT_SUFFIX).md;
export PATH="$OLD_PATH"
else
# No test results, probably cross-compiling
set +x # https://github.com/microsoft/azure-pipelines-tasks/issues/10331
Expand Down
9 changes: 5 additions & 4 deletions ci/filter-stderr.sed
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Cf. https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
/^\/.*openorienteering.*[Ww]arning:/ {
s,^\([a-zA-Z]:\)?/.*/build/source/openorienteering-mapper-ci/,,
/:.*[0-9]: [Ww]arning:/ {
/libocad/ b
s,^\([a-zA-Z]:\)?/.*/1/s/,,
s,^\([a-zA-Z]:\)?/.*/build/,,
s,^,##vso[task.LogIssue type=warning;],
s,^\([^;]*\);\]\([^:]*\):\([0-9]*\):\([0-9]*\): *[Ww]arning: *,\1;sourcepath=\2;linenumber=\3;columnnumber=\4;],
}
/^\/.*[Ee]rror:/ {
s,^\([a-zA-Z]:\)?/.*/build/source/openorienteering-mapper-ci/,,
s,^\([a-zA-Z]:\)?/.*/1/s/,,
s,^\([a-zA-Z]:\)?/.*/build/,,
s,^,##vso[task.LogIssue type=error;],
s,^\([^;]*\);\]\([^:]*\):\([0-9]*\):\([0-9]*\): *[Ee]rror: *,\1;sourcepath=\2;linenumber=\3;columnnumber=\4;],
}
# Include-what-you-use
/ should add these lines:$/ {
h
s,^\([a-zA-Z]:\)?/.*/build/source/openorienteering-mapper-ci/,,
s,^\([a-zA-Z]:\)?/.*/1/s/,,
s,^\([a-zA-Z]:\)?/.*/build/,,
s,^,##vso[task.LogIssue type=warning;],
s,^\([^;]*\);\]\([^:]*\) should add these lines:,\1;sourcepath=\2;]include-what-you-use reported diagnostics,
Expand Down
9 changes: 9 additions & 0 deletions code-check-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ for I in \
georeferencing.cpp \
georeferencing_dialog.cpp \
georeferencing_t.cpp \
icon_engine \
key_button_bar.cpp \
line_symbol.cpp \
main.cpp \
Expand All @@ -70,17 +71,22 @@ for I in \
map_editor.cpp \
map_find_feature.cpp \
map_widget.cpp \
mapper_proxystyle.cpp \
/object.cpp \
object_mover.cpp \
object_query.cpp \
ocd_file_format.cpp \
ocd_t.cpp \
overriding_shortcut.cpp \
paint_on_template \
point_symbol.cpp \
print_widget.cpp \
renderable.cpp \
renderable_implementation.cpp \
rotate_map_dialog.cpp \
settings_dialog.cpp \
stretch_map_dialog.cpp \
style_t.cpp \
/symbol.cpp \
symbol_replacement.cpp \
symbol_replacement_dialog.cpp \
Expand All @@ -94,8 +100,11 @@ for I in \
template_list_widget.cpp \
template_map.cpp \
template_placeholder.cpp \
template_table_model.cpp \
template_t.cpp \
template_tool \
template_track.cpp \
text_object_editor_helper.cpp \
text_brwoser_dialog \
toast.cpp \
track_t.cpp \
Expand Down
2 changes: 2 additions & 0 deletions codespell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ codespell -q 7 \
-L endwhile \
-L intrest \
"$@"

git log -n 20 | codespell -q 7 - | sed 's/^/git log: /'
21 changes: 17 additions & 4 deletions doc/licensing/superbuild-licensing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(NOT LICENSING_COPYRIGHT_DIR OR NOT LICENSING_COMMON_DIR)
endif()


# Based on OpenOrienteering superbuild as of 2020-03-26
# Based on OpenOrienteering superbuild as of 2020-06-21
list(APPEND third_party_components
giflib
libjpeg-turbo
Expand All @@ -47,6 +47,7 @@ list(APPEND third_party_components
libpng
libtiff
libwebp
poppler
)
find_package(Qt5Core REQUIRED QUIET)
if(NOT ${Qt5Core_VERSION} VERSION_LESS 5.9)
Expand All @@ -61,9 +62,10 @@ if(NOT APPLE)
libsqlite
)
endif()
if(WIN32)
if(ANDROID)
list(APPEND third_party_components
zlib
freetype
libiconv
)
endif()
if(CMAKE_ANDROID_STL_TYPE MATCHES "gnustl")
Expand All @@ -75,14 +77,25 @@ elseif(CMAKE_ANDROID_STL_TYPE MATCHES "c\\+\\+")
libc++
)
endif()
if(APPLE)
list(APPEND third_party_components
freetype
)
endif()
if(MINGW)
list(APPEND third_party_components
gcc-libs
libiconv
mingw-w64
winpthreads
)
endif()
if(WIN32)
list(APPEND third_party_components
freetype
libiconv
zlib
)
endif()

list(APPEND common_license_names
Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ message(STATUS "Conditional manual sections: ${MANUAL_SECTIONS}")
set(DOXYFILE_HTML_EXTRA )
if(ANDROID)
set(DOXYFILE_HTML_EXTRA "
FILE_PATTERNS = android* toolbar*
FILE_PATTERNS = android* toolbar* touch-mode*
USE_MDFILE_AS_MAINPAGE = android-app.md
")
endif()
Expand Down
Loading

0 comments on commit 091d58a

Please sign in to comment.