From 16351d2a887f40f7bc8395ca26d1dac8f7f7970f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:54:57 +0000 Subject: [PATCH 01/29] Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.3 to 1.12.4. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.12.3...v1.12.4) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be3b7623e..049b57901 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,7 +103,7 @@ jobs: name: artifact path: dist - - uses: pypa/gh-action-pypi-publish@v1.12.3 + - uses: pypa/gh-action-pypi-publish@v1.12.4 continue-on-error: true # might fail if we don't bump the version with: user: __token__ @@ -120,7 +120,7 @@ jobs: name: artifact path: dist - - uses: pypa/gh-action-pypi-publish@v1.12.3 + - uses: pypa/gh-action-pypi-publish@v1.12.4 with: user: __token__ password: ${{ secrets.pypi_password }} From c3fe77acd05d14602999f9271ef070fd50d084e1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 16 Feb 2025 20:28:22 +0100 Subject: [PATCH 02/29] Fixing issue #1987 (build failure against Qt6.8) --- scripts/mkqtdecl6/mkqtdecl.conf | 26 +++++++++++ src/gsiqt/qt6/QtCore/gsiDeclQEasingCurve.cc | 49 ++++----------------- src/gsiqt/qt6/QtCore/gsiDeclQTimeZone.cc | 9 ++++ 3 files changed, 44 insertions(+), 40 deletions(-) diff --git a/scripts/mkqtdecl6/mkqtdecl.conf b/scripts/mkqtdecl6/mkqtdecl.conf index ef5ebbcd7..1ec889db0 100644 --- a/scripts/mkqtdecl6/mkqtdecl.conf +++ b/scripts/mkqtdecl6/mkqtdecl.conf @@ -368,6 +368,8 @@ drop_method "QColormap", /QColormap::initialize/ # Must not hide Ruby's initiali drop_method "QAccessible", /QAccessible::initialize/ # Must not hide Ruby's initialize and is not public drop_method "QEasingCurve", /QEasingCurve::setCustomType/ # requires function * drop_method "QEasingCurve", /QEasingCurve::customType/ # requires function * +drop_method "QEasingCurve", /::operator\s*==/ # no longer supported on Qt 6.8 +drop_method "QEasingCurve", /::operator\s*!=/ # no longer supported on Qt 6.8 drop_method "QLibrary", /QLibrary::resolve/ # requires function * drop_method "QLoggingCategory", /QLoggingCategory::installFilter/ # requires function * drop_method "QMetaObject", /QMetaObject::cast\(/ # internal @@ -473,6 +475,30 @@ drop_method "QDebug", /QDebug::operator\s*<<\((?!const\s+QString\s*&)/ # don't m drop_method "", /::operator\s*<<\(QDebug\s*\w*\s*,\s*(?!const\s+QString\s*&)/ # don't map the others right now - too many (TODO: how to map?) drop_method "QNoDebug", /QNoDebug::operator<", "", "", "" ] include "QThread", [ "", "" ] diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQEasingCurve.cc b/src/gsiqt/qt6/QtCore/gsiDeclQEasingCurve.cc index bfad06037..db6218522 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQEasingCurve.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQEasingCurve.cc @@ -35,6 +35,12 @@ // ----------------------------------------------------------------------- // class QEasingCurve + static bool QEasingCurve_operator_eq(const QEasingCurve *a, const QEasingCurve &b) { + return *a == b; + } + static bool QEasingCurve_operator_ne(const QEasingCurve *a, const QEasingCurve &b) { + return !(*a == b); + } // Constructor QEasingCurve::QEasingCurve(QEasingCurve::Type type) @@ -144,25 +150,6 @@ static void _call_f_amplitude_c0 (const qt_gsi::GenericMethod * /*decl*/, void * } -// bool QEasingCurve::operator!=(const QEasingCurve &other) - - -static void _init_f_operator_excl__eq__c2510 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2510 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QEasingCurve &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QEasingCurve *)cls)->operator!= (arg1)); -} - - // QEasingCurve &QEasingCurve::operator=(const QEasingCurve &other) @@ -182,25 +169,6 @@ static void _call_f_operator_eq__2510 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QEasingCurve::operator==(const QEasingCurve &other) - - -static void _init_f_operator_eq__eq__c2510 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2510 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QEasingCurve &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QEasingCurve *)cls)->operator== (arg1)); -} - - // double QEasingCurve::overshoot() @@ -391,9 +359,7 @@ static gsi::Methods methods_QEasingCurve () { methods += new qt_gsi::GenericMethod ("addCubicBezierSegment", "@brief Method void QEasingCurve::addCubicBezierSegment(const QPointF &c1, const QPointF &c2, const QPointF &endPoint)\n", false, &_init_f_addCubicBezierSegment_5742, &_call_f_addCubicBezierSegment_5742); methods += new qt_gsi::GenericMethod ("addTCBSegment", "@brief Method void QEasingCurve::addTCBSegment(const QPointF &nextPoint, double t, double c, double b)\n", false, &_init_f_addTCBSegment_4875, &_call_f_addTCBSegment_4875); methods += new qt_gsi::GenericMethod (":amplitude", "@brief Method double QEasingCurve::amplitude()\n", true, &_init_f_amplitude_c0, &_call_f_amplitude_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QEasingCurve::operator!=(const QEasingCurve &other)\n", true, &_init_f_operator_excl__eq__c2510, &_call_f_operator_excl__eq__c2510); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QEasingCurve &QEasingCurve::operator=(const QEasingCurve &other)\n", false, &_init_f_operator_eq__2510, &_call_f_operator_eq__2510); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QEasingCurve::operator==(const QEasingCurve &other)\n", true, &_init_f_operator_eq__eq__c2510, &_call_f_operator_eq__eq__c2510); methods += new qt_gsi::GenericMethod (":overshoot", "@brief Method double QEasingCurve::overshoot()\n", true, &_init_f_overshoot_c0, &_call_f_overshoot_c0); methods += new qt_gsi::GenericMethod (":period", "@brief Method double QEasingCurve::period()\n", true, &_init_f_period_c0, &_call_f_period_c0); methods += new qt_gsi::GenericMethod ("setAmplitude|amplitude=", "@brief Method void QEasingCurve::setAmplitude(double amplitude)\n", false, &_init_f_setAmplitude_1071, &_call_f_setAmplitude_1071); @@ -408,6 +374,9 @@ static gsi::Methods methods_QEasingCurve () { } gsi::Class decl_QEasingCurve ("QtCore", "QEasingCurve", + gsi::method_ext("==", &QEasingCurve_operator_eq, gsi::arg ("other"), "@brief Method bool QEasingCurve::operator==(const QEasingCurve &) const") + + gsi::method_ext("!=", &QEasingCurve_operator_ne, gsi::arg ("other"), "@brief Method bool QEasingCurve::operator!=(const QEasingCurve &) const") ++ methods_QEasingCurve (), "@qt\n@brief Binding of QEasingCurve"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQTimeZone.cc b/src/gsiqt/qt6/QtCore/gsiDeclQTimeZone.cc index 4e89b5465..d0b2645f9 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQTimeZone.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQTimeZone.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QTimeZone + static bool QTimeZone_operator_eq(const QTimeZone *a, const QTimeZone &b) { + return *a == b; + } + static bool QTimeZone_operator_ne(const QTimeZone *a, const QTimeZone &b) { + return !(*a == b); + } // Constructor QTimeZone::QTimeZone() @@ -776,6 +782,9 @@ static gsi::Methods methods_QTimeZone () { } gsi::Class decl_QTimeZone ("QtCore", "QTimeZone", + gsi::method_ext("==", &QTimeZone_operator_eq, gsi::arg ("other"), "@brief Method bool QTimeZone::operator==(const QTimeZone &) const") + + gsi::method_ext("!=", &QTimeZone_operator_ne, gsi::arg ("other"), "@brief Method bool QTimeZone::operator!=(const QTimeZone &) const") ++ methods_QTimeZone (), "@qt\n@brief Binding of QTimeZone"); From f6616dfaf4b8ba67145027acd9578600f01dcca3 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 16 Feb 2025 21:49:05 +0100 Subject: [PATCH 03/29] WIP: more fixes for Qt 6.8 compatibility --- scripts/mkqtdecl6/mkqtdecl.conf | 70 +++++++++------ src/gsiqt/qt6/QtCore/gsiDeclQDir.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQFileInfo.cc | 49 ++-------- .../qt6/QtCore/gsiDeclQItemSelectionRange.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQJsonArray.cc | 49 ++-------- .../qt6/QtCore/gsiDeclQJsonArray_Iterator.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQJsonDocument.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQJsonObject.cc | 49 ++-------- .../qt6/QtCore/gsiDeclQJsonObject_Iterator.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQJsonValue.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQJsonValueRef.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQLine.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQLineF.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQMimeType.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc | 49 ++-------- .../QtCore/gsiDeclQPersistentModelIndex.cc | 89 ++----------------- .../qt6/QtCore/gsiDeclQProcessEnvironment.cc | 49 ++-------- .../qt6/QtCore/gsiDeclQRegularExpression.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc | 49 ++-------- src/gsiqt/qt6/QtCore/gsiDeclQUrlQuery.cc | 49 ++-------- .../qt6/QtCore/gsiDeclQXmlStreamAttribute.cc | 49 ++-------- .../gsiDeclQXmlStreamEntityDeclaration.cc | 49 ++-------- .../gsiDeclQXmlStreamNamespaceDeclaration.cc | 49 ++-------- .../gsiDeclQXmlStreamNotationDeclaration.cc | 49 ++-------- 24 files changed, 250 insertions(+), 987 deletions(-) diff --git a/scripts/mkqtdecl6/mkqtdecl.conf b/scripts/mkqtdecl6/mkqtdecl.conf index 1ec889db0..37672b679 100644 --- a/scripts/mkqtdecl6/mkqtdecl.conf +++ b/scripts/mkqtdecl6/mkqtdecl.conf @@ -18,6 +18,23 @@ load(File.join(File.dirname(__FILE__), "common.conf")) +def add_native_operator_neq(engine, cls) + cls_id = cls.gsub("::", "_") + engine.drop_method cls, /::operator\s*==/ + engine.drop_method cls, /::operator\s*!=/ + engine.add_native_impl(cls, <<"CODE", <<"DECL") + static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) { + return *a == b; + } + static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) { + return !(*a == b); + } +CODE + gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") + + gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const") +DECL +end + # -------------------------------------------------------------- # all modules @@ -368,8 +385,6 @@ drop_method "QColormap", /QColormap::initialize/ # Must not hide Ruby's initiali drop_method "QAccessible", /QAccessible::initialize/ # Must not hide Ruby's initialize and is not public drop_method "QEasingCurve", /QEasingCurve::setCustomType/ # requires function * drop_method "QEasingCurve", /QEasingCurve::customType/ # requires function * -drop_method "QEasingCurve", /::operator\s*==/ # no longer supported on Qt 6.8 -drop_method "QEasingCurve", /::operator\s*!=/ # no longer supported on Qt 6.8 drop_method "QLibrary", /QLibrary::resolve/ # requires function * drop_method "QLoggingCategory", /QLoggingCategory::installFilter/ # requires function * drop_method "QMetaObject", /QMetaObject::cast\(/ # internal @@ -462,8 +477,6 @@ drop_method "QTextCodec", /QTextCodec::codecForName\(const\s+QByteArray/ # clash drop_method "QTextCodec", /QTextCodec::toUnicode\(const\s+QByteArray/ # clashes with const char * variant drop_method "QTextCodec", /QTextCodec::fromUnicode\(const\s+QChar\s+\*/ # requires real QChar * drop_method "QTextEncoder", /QTextEncoder::fromUnicode\(const\s+QChar\s+\*/ # requires real QChar * -drop_method "QTimeZone", /::operator\s*==/ # no longer supported on Qt 6.7 -drop_method "QTimeZone", /::operator\s*!=/ # no longer supported on Qt 6.7 drop_method "", /::operator\s*==\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper drop_method "", /::operator\s*!=\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper drop_method "QByteArrayMatcher", /QByteArrayMatcher::indexIn\(const\s+QByteArray/ # clashes with const char * variant @@ -475,29 +488,32 @@ drop_method "QDebug", /QDebug::operator\s*<<\((?!const\s+QString\s*&)/ # don't m drop_method "", /::operator\s*<<\(QDebug\s*\w*\s*,\s*(?!const\s+QString\s*&)/ # don't map the others right now - too many (TODO: how to map?) drop_method "QNoDebug", /QNoDebug::operator<", "", "", "" ] include "QThread", [ "", "" ] diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQDir.cc b/src/gsiqt/qt6/QtCore/gsiDeclQDir.cc index 701ccffe4..cc0a01ddf 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQDir.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQDir.cc @@ -35,6 +35,12 @@ // ----------------------------------------------------------------------- // class QDir + static bool QDir_operator_eq(const QDir *a, const QDir &b) { + return *a == b; + } + static bool QDir_operator_ne(const QDir *a, const QDir &b) { + return !(*a == b); + } // Constructor QDir::QDir(const QDir &) @@ -524,25 +530,6 @@ static void _call_f_nameFilters_c0 (const qt_gsi::GenericMethod * /*decl*/, void } -// bool QDir::operator!=(const QDir &dir) - - -static void _init_f_operator_excl__eq__c1681 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("dir"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c1681 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QDir &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QDir *)cls)->operator!= (arg1)); -} - - // QDir &QDir::operator=(const QDir &) @@ -562,25 +549,6 @@ static void _call_f_operator_eq__1681 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QDir::operator==(const QDir &dir) - - -static void _init_f_operator_eq__eq__c1681 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("dir"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c1681 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QDir &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QDir *)cls)->operator== (arg1)); -} - - // QString QDir::operator[](int) @@ -1299,9 +1267,7 @@ static gsi::Methods methods_QDir () { methods += new qt_gsi::GenericMethod ("mkdir", "@brief Method bool QDir::mkdir(const QString &dirName)\n", true, &_init_f_mkdir_c2025, &_call_f_mkdir_c2025); methods += new qt_gsi::GenericMethod ("mkpath", "@brief Method bool QDir::mkpath(const QString &dirPath)\n", true, &_init_f_mkpath_c2025, &_call_f_mkpath_c2025); methods += new qt_gsi::GenericMethod (":nameFilters", "@brief Method QStringList QDir::nameFilters()\n", true, &_init_f_nameFilters_c0, &_call_f_nameFilters_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QDir::operator!=(const QDir &dir)\n", true, &_init_f_operator_excl__eq__c1681, &_call_f_operator_excl__eq__c1681); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QDir &QDir::operator=(const QDir &)\n", false, &_init_f_operator_eq__1681, &_call_f_operator_eq__1681); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QDir::operator==(const QDir &dir)\n", true, &_init_f_operator_eq__eq__c1681, &_call_f_operator_eq__eq__c1681); methods += new qt_gsi::GenericMethod ("[]", "@brief Method QString QDir::operator[](int)\n", true, &_init_f_operator_index__c767, &_call_f_operator_index__c767); methods += new qt_gsi::GenericMethod (":path", "@brief Method QString QDir::path()\n", true, &_init_f_path_c0, &_call_f_path_c0); methods += new qt_gsi::GenericMethod ("refresh", "@brief Method void QDir::refresh()\n", true, &_init_f_refresh_c0, &_call_f_refresh_c0); @@ -1344,6 +1310,9 @@ static gsi::Methods methods_QDir () { } gsi::Class decl_QDir ("QtCore", "QDir", + gsi::method_ext("==", &QDir_operator_eq, gsi::arg ("other"), "@brief Method bool QDir::operator==(const QDir &) const") + + gsi::method_ext("!=", &QDir_operator_ne, gsi::arg ("other"), "@brief Method bool QDir::operator!=(const QDir &) const") ++ methods_QDir (), "@qt\n@brief Binding of QDir"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQFileInfo.cc b/src/gsiqt/qt6/QtCore/gsiDeclQFileInfo.cc index 7b7e5c6b9..8624b0a19 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQFileInfo.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQFileInfo.cc @@ -37,6 +37,12 @@ // ----------------------------------------------------------------------- // class QFileInfo + static bool QFileInfo_operator_eq(const QFileInfo *a, const QFileInfo &b) { + return *a == b; + } + static bool QFileInfo_operator_ne(const QFileInfo *a, const QFileInfo &b) { + return !(*a == b); + } // Constructor QFileInfo::QFileInfo() @@ -706,25 +712,6 @@ static void _call_f_metadataChangeTime_c0 (const qt_gsi::GenericMethod * /*decl* } -// bool QFileInfo::operator!=(const QFileInfo &fileinfo) - - -static void _init_f_operator_excl__eq__c2174 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("fileinfo"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2174 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QFileInfo &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QFileInfo *)cls)->operator!= (arg1)); -} - - // QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo) @@ -744,25 +731,6 @@ static void _call_f_operator_eq__2174 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QFileInfo::operator==(const QFileInfo &fileinfo) - - -static void _init_f_operator_eq__eq__c2174 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("fileinfo"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2174 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QFileInfo &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QFileInfo *)cls)->operator== (arg1)); -} - - // QString QFileInfo::owner() @@ -1090,9 +1058,7 @@ static gsi::Methods methods_QFileInfo () { methods += new qt_gsi::GenericMethod ("lastRead", "@brief Method QDateTime QFileInfo::lastRead()\n", true, &_init_f_lastRead_c0, &_call_f_lastRead_c0); methods += new qt_gsi::GenericMethod ("makeAbsolute", "@brief Method bool QFileInfo::makeAbsolute()\n", false, &_init_f_makeAbsolute_0, &_call_f_makeAbsolute_0); methods += new qt_gsi::GenericMethod ("metadataChangeTime", "@brief Method QDateTime QFileInfo::metadataChangeTime()\n", true, &_init_f_metadataChangeTime_c0, &_call_f_metadataChangeTime_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QFileInfo::operator!=(const QFileInfo &fileinfo)\n", true, &_init_f_operator_excl__eq__c2174, &_call_f_operator_excl__eq__c2174); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)\n", false, &_init_f_operator_eq__2174, &_call_f_operator_eq__2174); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QFileInfo::operator==(const QFileInfo &fileinfo)\n", true, &_init_f_operator_eq__eq__c2174, &_call_f_operator_eq__eq__c2174); methods += new qt_gsi::GenericMethod ("owner", "@brief Method QString QFileInfo::owner()\n", true, &_init_f_owner_c0, &_call_f_owner_c0); methods += new qt_gsi::GenericMethod ("ownerId", "@brief Method unsigned int QFileInfo::ownerId()\n", true, &_init_f_ownerId_c0, &_call_f_ownerId_c0); methods += new qt_gsi::GenericMethod ("path", "@brief Method QString QFileInfo::path()\n", true, &_init_f_path_c0, &_call_f_path_c0); @@ -1113,6 +1079,9 @@ static gsi::Methods methods_QFileInfo () { } gsi::Class decl_QFileInfo ("QtCore", "QFileInfo", + gsi::method_ext("==", &QFileInfo_operator_eq, gsi::arg ("other"), "@brief Method bool QFileInfo::operator==(const QFileInfo &) const") + + gsi::method_ext("!=", &QFileInfo_operator_ne, gsi::arg ("other"), "@brief Method bool QFileInfo::operator!=(const QFileInfo &) const") ++ methods_QFileInfo (), "@qt\n@brief Binding of QFileInfo"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQItemSelectionRange.cc b/src/gsiqt/qt6/QtCore/gsiDeclQItemSelectionRange.cc index 6b1541529..121d2a25e 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQItemSelectionRange.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQItemSelectionRange.cc @@ -37,6 +37,12 @@ // ----------------------------------------------------------------------- // class QItemSelectionRange + static bool QItemSelectionRange_operator_eq(const QItemSelectionRange *a, const QItemSelectionRange &b) { + return *a == b; + } + static bool QItemSelectionRange_operator_ne(const QItemSelectionRange *a, const QItemSelectionRange &b) { + return !(*a == b); + } // Constructor QItemSelectionRange::QItemSelectionRange() @@ -296,44 +302,6 @@ static void _call_f_model_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, } -// bool QItemSelectionRange::operator!=(const QItemSelectionRange &other) - - -static void _init_f_operator_excl__eq__c3220 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c3220 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QItemSelectionRange &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QItemSelectionRange *)cls)->operator!= (arg1)); -} - - -// bool QItemSelectionRange::operator==(const QItemSelectionRange &other) - - -static void _init_f_operator_eq__eq__c3220 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c3220 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QItemSelectionRange &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QItemSelectionRange *)cls)->operator== (arg1)); -} - - // QModelIndex QItemSelectionRange::parent() @@ -450,8 +418,6 @@ static gsi::Methods methods_QItemSelectionRange () { methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QItemSelectionRange::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("left", "@brief Method int QItemSelectionRange::left()\n", true, &_init_f_left_c0, &_call_f_left_c0); methods += new qt_gsi::GenericMethod ("model", "@brief Method const QAbstractItemModel *QItemSelectionRange::model()\n", true, &_init_f_model_c0, &_call_f_model_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QItemSelectionRange::operator!=(const QItemSelectionRange &other)\n", true, &_init_f_operator_excl__eq__c3220, &_call_f_operator_excl__eq__c3220); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QItemSelectionRange::operator==(const QItemSelectionRange &other)\n", true, &_init_f_operator_eq__eq__c3220, &_call_f_operator_eq__eq__c3220); methods += new qt_gsi::GenericMethod ("parent", "@brief Method QModelIndex QItemSelectionRange::parent()\n", true, &_init_f_parent_c0, &_call_f_parent_c0); methods += new qt_gsi::GenericMethod ("right", "@brief Method int QItemSelectionRange::right()\n", true, &_init_f_right_c0, &_call_f_right_c0); methods += new qt_gsi::GenericMethod ("swap", "@brief Method void QItemSelectionRange::swap(QItemSelectionRange &other)\n", false, &_init_f_swap_2525, &_call_f_swap_2525); @@ -462,6 +428,9 @@ static gsi::Methods methods_QItemSelectionRange () { } gsi::Class decl_QItemSelectionRange ("QtCore", "QItemSelectionRange", + gsi::method_ext("==", &QItemSelectionRange_operator_eq, gsi::arg ("other"), "@brief Method bool QItemSelectionRange::operator==(const QItemSelectionRange &) const") + + gsi::method_ext("!=", &QItemSelectionRange_operator_ne, gsi::arg ("other"), "@brief Method bool QItemSelectionRange::operator!=(const QItemSelectionRange &) const") ++ methods_QItemSelectionRange (), "@qt\n@brief Binding of QItemSelectionRange"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray.cc index f68234648..01bd46047 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QJsonArray + static bool QJsonArray_operator_eq(const QJsonArray *a, const QJsonArray &b) { + return *a == b; + } + static bool QJsonArray_operator_ne(const QJsonArray *a, const QJsonArray &b) { + return !(*a == b); + } // Constructor QJsonArray::QJsonArray() @@ -317,25 +323,6 @@ static void _call_f_operator_eq__2315 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonArray::operator!=(const QJsonArray &other) - - -static void _init_f_operator_excl__eq__c2315 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2315 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray *)cls)->operator!= (arg1)); -} - - // QJsonArray QJsonArray::operator+(const QJsonValue &v) @@ -393,25 +380,6 @@ static void _call_f_operator_lt__lt__2313 (const qt_gsi::GenericMethod * /*decl* } -// bool QJsonArray::operator==(const QJsonArray &other) - - -static void _init_f_operator_eq__eq__c2315 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2315 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray *)cls)->operator== (arg1)); -} - - // QJsonValueRef QJsonArray::operator[](qsizetype i) @@ -727,11 +695,9 @@ static gsi::Methods methods_QJsonArray () { methods += new qt_gsi::GenericMethod ("isEmpty?", "@brief Method bool QJsonArray::isEmpty()\n", true, &_init_f_isEmpty_c0, &_call_f_isEmpty_c0); methods += new qt_gsi::GenericMethod ("last", "@brief Method QJsonValue QJsonArray::last()\n", true, &_init_f_last_c0, &_call_f_last_c0); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonArray &QJsonArray::operator =(const QJsonArray &other)\n", false, &_init_f_operator_eq__2315, &_call_f_operator_eq__2315); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QJsonArray::operator!=(const QJsonArray &other)\n", true, &_init_f_operator_excl__eq__c2315, &_call_f_operator_excl__eq__c2315); methods += new qt_gsi::GenericMethod ("+", "@brief Method QJsonArray QJsonArray::operator+(const QJsonValue &v)\n", true, &_init_f_operator_plus__c2313, &_call_f_operator_plus__c2313); methods += new qt_gsi::GenericMethod ("+=", "@brief Method QJsonArray &QJsonArray::operator+=(const QJsonValue &v)\n", false, &_init_f_operator_plus__eq__2313, &_call_f_operator_plus__eq__2313); methods += new qt_gsi::GenericMethod ("<<", "@brief Method QJsonArray &QJsonArray::operator<<(const QJsonValue &v)\n", false, &_init_f_operator_lt__lt__2313, &_call_f_operator_lt__lt__2313); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QJsonArray::operator==(const QJsonArray &other)\n", true, &_init_f_operator_eq__eq__c2315, &_call_f_operator_eq__eq__c2315); methods += new qt_gsi::GenericMethod ("[]", "@brief Method QJsonValueRef QJsonArray::operator[](qsizetype i)\n", false, &_init_f_operator_index__1442, &_call_f_operator_index__1442); methods += new qt_gsi::GenericMethod ("pop_back", "@brief Method void QJsonArray::pop_back()\n", false, &_init_f_pop_back_0, &_call_f_pop_back_0); methods += new qt_gsi::GenericMethod ("pop_front", "@brief Method void QJsonArray::pop_front()\n", false, &_init_f_pop_front_0, &_call_f_pop_front_0); @@ -752,6 +718,9 @@ static gsi::Methods methods_QJsonArray () { } gsi::Class decl_QJsonArray ("QtCore", "QJsonArray", + gsi::method_ext("==", &QJsonArray_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonArray::operator==(const QJsonArray &) const") + + gsi::method_ext("!=", &QJsonArray_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonArray::operator!=(const QJsonArray &) const") ++ methods_QJsonArray (), "@qt\n@brief Binding of QJsonArray"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc index f4e50f553..f164892b4 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QJsonArray::iterator + static bool QJsonArray_iterator_operator_eq(const QJsonArray::iterator *a, const QJsonArray::iterator &b) { + return *a == b; + } + static bool QJsonArray_iterator_operator_ne(const QJsonArray::iterator *a, const QJsonArray::iterator &b) { + return !(*a == b); + } // Constructor QJsonArray::iterator::iterator() @@ -93,25 +99,6 @@ static void _call_ctor_QJsonArray_Iterator_3305 (const qt_gsi::GenericStaticMeth } -// bool QJsonArray::iterator::operator!=(const QJsonArray::iterator &o) - - -static void _init_f_operator_excl__eq__c3305 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("o"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c3305 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray::iterator *)cls)->operator!= (arg1)); -} - - // QJsonValueRef QJsonArray::iterator::operator*() @@ -362,25 +349,6 @@ static void _call_f_operator_eq__3305 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonArray::iterator::operator==(const QJsonArray::iterator &o) - - -static void _init_f_operator_eq__eq__c3305 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("o"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c3305 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray::iterator *)cls)->operator== (arg1)); -} - - // bool QJsonArray::iterator::operator>(const QJsonArray::iterator &other) @@ -447,7 +415,6 @@ static gsi::Methods methods_QJsonArray_Iterator () { methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonArray::iterator::iterator()\nThis method creates an object of class QJsonArray::iterator.", &_init_ctor_QJsonArray_Iterator_0, &_call_ctor_QJsonArray_Iterator_0); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonArray::iterator::iterator(QJsonArray *array, qsizetype index)\nThis method creates an object of class QJsonArray::iterator.", &_init_ctor_QJsonArray_Iterator_2958, &_call_ctor_QJsonArray_Iterator_2958); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonArray::iterator::iterator(const QJsonArray::iterator &other)\nThis method creates an object of class QJsonArray::iterator.", &_init_ctor_QJsonArray_Iterator_3305, &_call_ctor_QJsonArray_Iterator_3305); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QJsonArray::iterator::operator!=(const QJsonArray::iterator &o)\n", true, &_init_f_operator_excl__eq__c3305, &_call_f_operator_excl__eq__c3305); methods += new qt_gsi::GenericMethod ("*", "@brief Method QJsonValueRef QJsonArray::iterator::operator*()\n", true, &_init_f_operator_star__c0, &_call_f_operator_star__c0); methods += new qt_gsi::GenericMethod ("+", "@brief Method QJsonArray::iterator QJsonArray::iterator::operator+(qsizetype j)\n", true, &_init_f_operator_plus__c1442, &_call_f_operator_plus__c1442); methods += new qt_gsi::GenericMethod ("++", "@brief Method QJsonArray::iterator &QJsonArray::iterator::operator++()\n", false, &_init_f_operator_plus__plus__0, &_call_f_operator_plus__plus__0); @@ -462,7 +429,6 @@ static gsi::Methods methods_QJsonArray_Iterator () { methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QJsonArray::iterator::operator<(const QJsonArray::iterator &other)\n", true, &_init_f_operator_lt__c3305, &_call_f_operator_lt__c3305); methods += new qt_gsi::GenericMethod ("<=", "@brief Method bool QJsonArray::iterator::operator<=(const QJsonArray::iterator &other)\n", true, &_init_f_operator_lt__eq__c3305, &_call_f_operator_lt__eq__c3305); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonArray::iterator &QJsonArray::iterator::operator=(const QJsonArray::iterator &other)\n", false, &_init_f_operator_eq__3305, &_call_f_operator_eq__3305); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QJsonArray::iterator::operator==(const QJsonArray::iterator &o)\n", true, &_init_f_operator_eq__eq__c3305, &_call_f_operator_eq__eq__c3305); methods += new qt_gsi::GenericMethod (">", "@brief Method bool QJsonArray::iterator::operator>(const QJsonArray::iterator &other)\n", true, &_init_f_operator_gt__c3305, &_call_f_operator_gt__c3305); methods += new qt_gsi::GenericMethod (">=", "@brief Method bool QJsonArray::iterator::operator>=(const QJsonArray::iterator &other)\n", true, &_init_f_operator_gt__eq__c3305, &_call_f_operator_gt__eq__c3305); methods += new qt_gsi::GenericMethod ("[]", "@brief Method QJsonValueRef QJsonArray::iterator::operator[](qsizetype j)\n", true, &_init_f_operator_index__c1442, &_call_f_operator_index__c1442); @@ -470,6 +436,9 @@ static gsi::Methods methods_QJsonArray_Iterator () { } gsi::Class decl_QJsonArray_Iterator ("QtCore", "QJsonArray_Iterator", + gsi::method_ext("==", &QJsonArray_iterator_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator==(const QJsonArray::iterator &) const") + + gsi::method_ext("!=", &QJsonArray_iterator_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator!=(const QJsonArray::iterator &) const") ++ methods_QJsonArray_Iterator (), "@qt\n@brief Binding of QJsonArray::iterator"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonDocument.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonDocument.cc index 8a1c93d1b..9639f2f45 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonDocument.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonDocument.cc @@ -38,6 +38,12 @@ // ----------------------------------------------------------------------- // class QJsonDocument + static bool QJsonDocument_operator_eq(const QJsonDocument *a, const QJsonDocument &b) { + return *a == b; + } + static bool QJsonDocument_operator_ne(const QJsonDocument *a, const QJsonDocument &b) { + return !(*a == b); + } // Constructor QJsonDocument::QJsonDocument() @@ -220,44 +226,6 @@ static void _call_f_operator_eq__2635 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonDocument::operator!=(const QJsonDocument &other) - - -static void _init_f_operator_excl__eq__c2635 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2635 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonDocument &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonDocument *)cls)->operator!= (arg1)); -} - - -// bool QJsonDocument::operator==(const QJsonDocument &other) - - -static void _init_f_operator_eq__eq__c2635 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2635 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonDocument &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonDocument *)cls)->operator== (arg1)); -} - - // const QJsonValue QJsonDocument::operator[](const QString &key) @@ -448,8 +416,6 @@ static gsi::Methods methods_QJsonDocument () { methods += new qt_gsi::GenericMethod ("isObject?", "@brief Method bool QJsonDocument::isObject()\n", true, &_init_f_isObject_c0, &_call_f_isObject_c0); methods += new qt_gsi::GenericMethod ("object", "@brief Method QJsonObject QJsonDocument::object()\n", true, &_init_f_object_c0, &_call_f_object_c0); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other)\n", false, &_init_f_operator_eq__2635, &_call_f_operator_eq__2635); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QJsonDocument::operator!=(const QJsonDocument &other)\n", true, &_init_f_operator_excl__eq__c2635, &_call_f_operator_excl__eq__c2635); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QJsonDocument::operator==(const QJsonDocument &other)\n", true, &_init_f_operator_eq__eq__c2635, &_call_f_operator_eq__eq__c2635); methods += new qt_gsi::GenericMethod ("[]", "@brief Method const QJsonValue QJsonDocument::operator[](const QString &key)\n", true, &_init_f_operator_index__c2025, &_call_f_operator_index__c2025); methods += new qt_gsi::GenericMethod ("[]", "@brief Method const QJsonValue QJsonDocument::operator[](qsizetype i)\n", true, &_init_f_operator_index__c1442, &_call_f_operator_index__c1442); methods += new qt_gsi::GenericMethod ("setArray|array=", "@brief Method void QJsonDocument::setArray(const QJsonArray &array)\n", false, &_init_f_setArray_2315, &_call_f_setArray_2315); @@ -463,6 +429,9 @@ static gsi::Methods methods_QJsonDocument () { } gsi::Class decl_QJsonDocument ("QtCore", "QJsonDocument", + gsi::method_ext("==", &QJsonDocument_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonDocument::operator==(const QJsonDocument &) const") + + gsi::method_ext("!=", &QJsonDocument_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonDocument::operator!=(const QJsonDocument &) const") ++ methods_QJsonDocument (), "@qt\n@brief Binding of QJsonDocument"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject.cc index 4522462f6..9a38d3306 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QJsonObject + static bool QJsonObject_operator_eq(const QJsonObject *a, const QJsonObject &b) { + return *a == b; + } + static bool QJsonObject_operator_ne(const QJsonObject *a, const QJsonObject &b) { + return !(*a == b); + } // Constructor QJsonObject::QJsonObject() @@ -274,44 +280,6 @@ static void _call_f_operator_eq__2403 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonObject::operator!=(const QJsonObject &other) - - -static void _init_f_operator_excl__eq__c2403 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2403 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject *)cls)->operator!= (arg1)); -} - - -// bool QJsonObject::operator==(const QJsonObject &other) - - -static void _init_f_operator_eq__eq__c2403 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2403 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject *)cls)->operator== (arg1)); -} - - // QJsonValueRef QJsonObject::operator[](const QString &key) @@ -512,8 +480,6 @@ static gsi::Methods methods_QJsonObject () { methods += new qt_gsi::GenericMethod ("keys", "@brief Method QStringList QJsonObject::keys()\n", true, &_init_f_keys_c0, &_call_f_keys_c0); methods += new qt_gsi::GenericMethod ("length", "@brief Method qsizetype QJsonObject::length()\n", true, &_init_f_length_c0, &_call_f_length_c0); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonObject &QJsonObject::operator =(const QJsonObject &other)\n", false, &_init_f_operator_eq__2403, &_call_f_operator_eq__2403); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QJsonObject::operator!=(const QJsonObject &other)\n", true, &_init_f_operator_excl__eq__c2403, &_call_f_operator_excl__eq__c2403); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QJsonObject::operator==(const QJsonObject &other)\n", true, &_init_f_operator_eq__eq__c2403, &_call_f_operator_eq__eq__c2403); methods += new qt_gsi::GenericMethod ("[]", "@brief Method QJsonValueRef QJsonObject::operator[](const QString &key)\n", false, &_init_f_operator_index__2025, &_call_f_operator_index__2025); methods += new qt_gsi::GenericMethod ("remove", "@brief Method void QJsonObject::remove(const QString &key)\n", false, &_init_f_remove_2025, &_call_f_remove_2025); methods += new qt_gsi::GenericMethod ("size", "@brief Method qsizetype QJsonObject::size()\n", true, &_init_f_size_c0, &_call_f_size_c0); @@ -528,6 +494,9 @@ static gsi::Methods methods_QJsonObject () { } gsi::Class decl_QJsonObject ("QtCore", "QJsonObject", + gsi::method_ext("==", &QJsonObject_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonObject::operator==(const QJsonObject &) const") + + gsi::method_ext("!=", &QJsonObject_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonObject::operator!=(const QJsonObject &) const") ++ methods_QJsonObject (), "@qt\n@brief Binding of QJsonObject"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc index 9579197ae..83388aca0 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QJsonObject::iterator + static bool QJsonObject_iterator_operator_eq(const QJsonObject::iterator *a, const QJsonObject::iterator &b) { + return *a == b; + } + static bool QJsonObject_iterator_operator_ne(const QJsonObject::iterator *a, const QJsonObject::iterator &b) { + return !(*a == b); + } // Constructor QJsonObject::iterator::iterator() @@ -108,25 +114,6 @@ static void _call_f_key_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, g } -// bool QJsonObject::iterator::operator!=(const QJsonObject::iterator &other) - - -static void _init_f_operator_excl__eq__c3393 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c3393 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject::iterator *)cls)->operator!= (arg1)); -} - - // QJsonValueRef QJsonObject::iterator::operator*() @@ -377,25 +364,6 @@ static void _call_f_operator_eq__3393 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonObject::iterator::operator==(const QJsonObject::iterator &other) - - -static void _init_f_operator_eq__eq__c3393 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c3393 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject::iterator *)cls)->operator== (arg1)); -} - - // bool QJsonObject::iterator::operator>(const QJsonObject::iterator &other) @@ -478,7 +446,6 @@ static gsi::Methods methods_QJsonObject_Iterator () { methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonObject::iterator::iterator(QJsonObject *obj, qsizetype index)\nThis method creates an object of class QJsonObject::iterator.", &_init_ctor_QJsonObject_Iterator_3046, &_call_ctor_QJsonObject_Iterator_3046); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QJsonObject::iterator::iterator(const QJsonObject::iterator &other)\nThis method creates an object of class QJsonObject::iterator.", &_init_ctor_QJsonObject_Iterator_3393, &_call_ctor_QJsonObject_Iterator_3393); methods += new qt_gsi::GenericMethod ("key", "@brief Method QString QJsonObject::iterator::key()\n", true, &_init_f_key_c0, &_call_f_key_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QJsonObject::iterator::operator!=(const QJsonObject::iterator &other)\n", true, &_init_f_operator_excl__eq__c3393, &_call_f_operator_excl__eq__c3393); methods += new qt_gsi::GenericMethod ("*", "@brief Method QJsonValueRef QJsonObject::iterator::operator*()\n", true, &_init_f_operator_star__c0, &_call_f_operator_star__c0); methods += new qt_gsi::GenericMethod ("+", "@brief Method QJsonObject::iterator QJsonObject::iterator::operator+(qsizetype j)\n", true, &_init_f_operator_plus__c1442, &_call_f_operator_plus__c1442); methods += new qt_gsi::GenericMethod ("++", "@brief Method QJsonObject::iterator &QJsonObject::iterator::operator++()\n", false, &_init_f_operator_plus__plus__0, &_call_f_operator_plus__plus__0); @@ -493,7 +460,6 @@ static gsi::Methods methods_QJsonObject_Iterator () { methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QJsonObject::iterator::operator<(const QJsonObject::iterator &other)\n", true, &_init_f_operator_lt__c3393, &_call_f_operator_lt__c3393); methods += new qt_gsi::GenericMethod ("<=", "@brief Method bool QJsonObject::iterator::operator<=(const QJsonObject::iterator &other)\n", true, &_init_f_operator_lt__eq__c3393, &_call_f_operator_lt__eq__c3393); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonObject::iterator &QJsonObject::iterator::operator=(const QJsonObject::iterator &other)\n", false, &_init_f_operator_eq__3393, &_call_f_operator_eq__3393); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QJsonObject::iterator::operator==(const QJsonObject::iterator &other)\n", true, &_init_f_operator_eq__eq__c3393, &_call_f_operator_eq__eq__c3393); methods += new qt_gsi::GenericMethod (">", "@brief Method bool QJsonObject::iterator::operator>(const QJsonObject::iterator &other)\n", true, &_init_f_operator_gt__c3393, &_call_f_operator_gt__c3393); methods += new qt_gsi::GenericMethod (">=", "@brief Method bool QJsonObject::iterator::operator>=(const QJsonObject::iterator &other)\n", true, &_init_f_operator_gt__eq__c3393, &_call_f_operator_gt__eq__c3393); methods += new qt_gsi::GenericMethod ("[]", "@brief Method const QJsonValueRef QJsonObject::iterator::operator[](qsizetype j)\n", false, &_init_f_operator_index__1442, &_call_f_operator_index__1442); @@ -502,6 +468,9 @@ static gsi::Methods methods_QJsonObject_Iterator () { } gsi::Class decl_QJsonObject_Iterator ("QtCore", "QJsonObject_Iterator", + gsi::method_ext("==", &QJsonObject_iterator_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator==(const QJsonObject::iterator &) const") + + gsi::method_ext("!=", &QJsonObject_iterator_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator!=(const QJsonObject::iterator &) const") ++ methods_QJsonObject_Iterator (), "@qt\n@brief Binding of QJsonObject::iterator"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonValue.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonValue.cc index 8b2c09647..77aa26ee5 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonValue.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonValue.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QJsonValue + static bool QJsonValue_operator_eq(const QJsonValue *a, const QJsonValue &b) { + return *a == b; + } + static bool QJsonValue_operator_ne(const QJsonValue *a, const QJsonValue &b) { + return !(*a == b); + } // Constructor QJsonValue::QJsonValue(QJsonValue::Type) @@ -313,44 +319,6 @@ static void _call_f_operator_eq__2313 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonValue::operator!=(const QJsonValue &other) - - -static void _init_f_operator_excl__eq__c2313 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2313 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonValue &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonValue *)cls)->operator!= (arg1)); -} - - -// bool QJsonValue::operator==(const QJsonValue &other) - - -static void _init_f_operator_eq__eq__c2313 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2313 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonValue &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonValue *)cls)->operator== (arg1)); -} - - // const QJsonValue QJsonValue::operator[](const QString &key) @@ -658,8 +626,6 @@ static gsi::Methods methods_QJsonValue () { methods += new qt_gsi::GenericMethod ("isString?", "@brief Method bool QJsonValue::isString()\n", true, &_init_f_isString_c0, &_call_f_isString_c0); methods += new qt_gsi::GenericMethod ("isUndefined?", "@brief Method bool QJsonValue::isUndefined()\n", true, &_init_f_isUndefined_c0, &_call_f_isUndefined_c0); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonValue &QJsonValue::operator =(const QJsonValue &other)\n", false, &_init_f_operator_eq__2313, &_call_f_operator_eq__2313); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QJsonValue::operator!=(const QJsonValue &other)\n", true, &_init_f_operator_excl__eq__c2313, &_call_f_operator_excl__eq__c2313); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QJsonValue::operator==(const QJsonValue &other)\n", true, &_init_f_operator_eq__eq__c2313, &_call_f_operator_eq__eq__c2313); methods += new qt_gsi::GenericMethod ("[]", "@brief Method const QJsonValue QJsonValue::operator[](const QString &key)\n", true, &_init_f_operator_index__c2025, &_call_f_operator_index__c2025); methods += new qt_gsi::GenericMethod ("[]", "@brief Method const QJsonValue QJsonValue::operator[](qsizetype i)\n", true, &_init_f_operator_index__c1442, &_call_f_operator_index__c1442); methods += new qt_gsi::GenericMethod ("swap", "@brief Method void QJsonValue::swap(QJsonValue &other)\n", false, &_init_f_swap_1618, &_call_f_swap_1618); @@ -680,6 +646,9 @@ static gsi::Methods methods_QJsonValue () { } gsi::Class decl_QJsonValue ("QtCore", "QJsonValue", + gsi::method_ext("==", &QJsonValue_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonValue::operator==(const QJsonValue &) const") + + gsi::method_ext("!=", &QJsonValue_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonValue::operator!=(const QJsonValue &) const") ++ methods_QJsonValue (), "@qt\n@brief Binding of QJsonValue"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonValueRef.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonValueRef.cc index c5cde8a58..0d3972f42 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonValueRef.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonValueRef.cc @@ -37,6 +37,12 @@ // ----------------------------------------------------------------------- // class QJsonValueRef + static bool QJsonValueRef_operator_eq(const QJsonValueRef *a, const QJsonValueRef &b) { + return *a == b; + } + static bool QJsonValueRef_operator_ne(const QJsonValueRef *a, const QJsonValueRef &b) { + return !(*a == b); + } // Constructor QJsonValueRef::QJsonValueRef(QJsonArray *array, qsizetype idx) @@ -244,44 +250,6 @@ static void _call_f_operator_eq__2598 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonValueRef::operator!=(const QJsonValue &other) - - -static void _init_f_operator_excl__eq__c2313 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2313 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonValue &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonValueRef *)cls)->operator!= (arg1)); -} - - -// bool QJsonValueRef::operator==(const QJsonValue &other) - - -static void _init_f_operator_eq__eq__c2313 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2313 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonValue &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonValueRef *)cls)->operator== (arg1)); -} - - // const QJsonValue QJsonValueRef::operator[](qsizetype i) @@ -474,8 +442,6 @@ static gsi::Methods methods_QJsonValueRef () { methods += new qt_gsi::GenericMethod ("isUndefined?", "@brief Method bool QJsonValueRef::isUndefined()\n", true, &_init_f_isUndefined_c0, &_call_f_isUndefined_c0); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonValueRef &QJsonValueRef::operator =(const QJsonValue &val)\n", false, &_init_f_operator_eq__2313, &_call_f_operator_eq__2313); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonValueRef &QJsonValueRef::operator =(const QJsonValueRef &val)\n", false, &_init_f_operator_eq__2598, &_call_f_operator_eq__2598); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QJsonValueRef::operator!=(const QJsonValue &other)\n", true, &_init_f_operator_excl__eq__c2313, &_call_f_operator_excl__eq__c2313); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QJsonValueRef::operator==(const QJsonValue &other)\n", true, &_init_f_operator_eq__eq__c2313, &_call_f_operator_eq__eq__c2313); methods += new qt_gsi::GenericMethod ("[]", "@brief Method const QJsonValue QJsonValueRef::operator[](qsizetype i)\n", true, &_init_f_operator_index__c1442, &_call_f_operator_index__c1442); methods += new qt_gsi::GenericMethod ("toArray", "@brief Method QJsonArray QJsonValueRef::toArray()\n", true, &_init_f_toArray_c0, &_call_f_toArray_c0); methods += new qt_gsi::GenericMethod ("toBool", "@brief Method bool QJsonValueRef::toBool(bool defaultValue)\n", true, &_init_f_toBool_c864, &_call_f_toBool_c864); @@ -490,6 +456,9 @@ static gsi::Methods methods_QJsonValueRef () { } gsi::Class decl_QJsonValueRef ("QtCore", "QJsonValueRef", + gsi::method_ext("==", &QJsonValueRef_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonValueRef::operator==(const QJsonValueRef &) const") + + gsi::method_ext("!=", &QJsonValueRef_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonValueRef::operator!=(const QJsonValueRef &) const") ++ methods_QJsonValueRef (), "@qt\n@brief Binding of QJsonValueRef"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQLine.cc b/src/gsiqt/qt6/QtCore/gsiDeclQLine.cc index 08a875889..0bf783a6a 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQLine.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQLine.cc @@ -35,6 +35,12 @@ // ----------------------------------------------------------------------- // class QLine + static bool QLine_operator_eq(const QLine *a, const QLine &b) { + return *a == b; + } + static bool QLine_operator_ne(const QLine *a, const QLine &b) { + return !(*a == b); + } // Constructor QLine::QLine() @@ -161,44 +167,6 @@ static void _call_f_isNull_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls } -// bool QLine::operator!=(const QLine &d) - - -static void _init_f_operator_excl__eq__c1786 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("d"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c1786 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QLine &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QLine *)cls)->operator!= (arg1)); -} - - -// bool QLine::operator==(const QLine &d) - - -static void _init_f_operator_eq__eq__c1786 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("d"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c1786 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QLine &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QLine *)cls)->operator== (arg1)); -} - - // QPoint QLine::p1() @@ -478,8 +446,6 @@ static gsi::Methods methods_QLine () { methods += new qt_gsi::GenericMethod ("dx", "@brief Method int QLine::dx()\n", true, &_init_f_dx_c0, &_call_f_dx_c0); methods += new qt_gsi::GenericMethod ("dy", "@brief Method int QLine::dy()\n", true, &_init_f_dy_c0, &_call_f_dy_c0); methods += new qt_gsi::GenericMethod ("isNull?", "@brief Method bool QLine::isNull()\n", true, &_init_f_isNull_c0, &_call_f_isNull_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QLine::operator!=(const QLine &d)\n", true, &_init_f_operator_excl__eq__c1786, &_call_f_operator_excl__eq__c1786); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QLine::operator==(const QLine &d)\n", true, &_init_f_operator_eq__eq__c1786, &_call_f_operator_eq__eq__c1786); methods += new qt_gsi::GenericMethod (":p1", "@brief Method QPoint QLine::p1()\n", true, &_init_f_p1_c0, &_call_f_p1_c0); methods += new qt_gsi::GenericMethod (":p2", "@brief Method QPoint QLine::p2()\n", true, &_init_f_p2_c0, &_call_f_p2_c0); methods += new qt_gsi::GenericMethod ("setLine", "@brief Method void QLine::setLine(int x1, int y1, int x2, int y2)\n", false, &_init_f_setLine_2744, &_call_f_setLine_2744); @@ -498,6 +464,9 @@ static gsi::Methods methods_QLine () { } gsi::Class decl_QLine ("QtCore", "QLine", + gsi::method_ext("==", &QLine_operator_eq, gsi::arg ("other"), "@brief Method bool QLine::operator==(const QLine &) const") + + gsi::method_ext("!=", &QLine_operator_ne, gsi::arg ("other"), "@brief Method bool QLine::operator!=(const QLine &) const") ++ methods_QLine (), "@qt\n@brief Binding of QLine"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQLineF.cc b/src/gsiqt/qt6/QtCore/gsiDeclQLineF.cc index 20d9915b6..c285add81 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQLineF.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQLineF.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QLineF + static bool QLineF_operator_eq(const QLineF *a, const QLineF &b) { + return *a == b; + } + static bool QLineF_operator_ne(const QLineF *a, const QLineF &b) { + return !(*a == b); + } // Constructor QLineF::QLineF() @@ -267,44 +273,6 @@ static void _call_f_normalVector_c0 (const qt_gsi::GenericMethod * /*decl*/, voi } -// bool QLineF::operator!=(const QLineF &d) - - -static void _init_f_operator_excl__eq__c1856 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("d"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c1856 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QLineF &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QLineF *)cls)->operator!= (arg1)); -} - - -// bool QLineF::operator==(const QLineF &d) - - -static void _init_f_operator_eq__eq__c1856 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("d"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c1856 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QLineF &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QLineF *)cls)->operator== (arg1)); -} - - // QPointF QLineF::p1() @@ -701,8 +669,6 @@ static gsi::Methods methods_QLineF () { methods += new qt_gsi::GenericMethod ("isNull?", "@brief Method bool QLineF::isNull()\n", true, &_init_f_isNull_c0, &_call_f_isNull_c0); methods += new qt_gsi::GenericMethod (":length", "@brief Method double QLineF::length()\n", true, &_init_f_length_c0, &_call_f_length_c0); methods += new qt_gsi::GenericMethod ("normalVector", "@brief Method QLineF QLineF::normalVector()\n", true, &_init_f_normalVector_c0, &_call_f_normalVector_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QLineF::operator!=(const QLineF &d)\n", true, &_init_f_operator_excl__eq__c1856, &_call_f_operator_excl__eq__c1856); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QLineF::operator==(const QLineF &d)\n", true, &_init_f_operator_eq__eq__c1856, &_call_f_operator_eq__eq__c1856); methods += new qt_gsi::GenericMethod (":p1", "@brief Method QPointF QLineF::p1()\n", true, &_init_f_p1_c0, &_call_f_p1_c0); methods += new qt_gsi::GenericMethod (":p2", "@brief Method QPointF QLineF::p2()\n", true, &_init_f_p2_c0, &_call_f_p2_c0); methods += new qt_gsi::GenericMethod ("pointAt", "@brief Method QPointF QLineF::pointAt(double t)\n", true, &_init_f_pointAt_c1071, &_call_f_pointAt_c1071); @@ -727,6 +693,9 @@ static gsi::Methods methods_QLineF () { } gsi::Class decl_QLineF ("QtCore", "QLineF", + gsi::method_ext("==", &QLineF_operator_eq, gsi::arg ("other"), "@brief Method bool QLineF::operator==(const QLineF &) const") + + gsi::method_ext("!=", &QLineF_operator_ne, gsi::arg ("other"), "@brief Method bool QLineF::operator!=(const QLineF &) const") ++ methods_QLineF (), "@qt\n@brief Binding of QLineF"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQMimeType.cc b/src/gsiqt/qt6/QtCore/gsiDeclQMimeType.cc index f4c3df8c2..2378859fc 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQMimeType.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQMimeType.cc @@ -34,6 +34,12 @@ // ----------------------------------------------------------------------- // class QMimeType + static bool QMimeType_operator_eq(const QMimeType *a, const QMimeType &b) { + return *a == b; + } + static bool QMimeType_operator_ne(const QMimeType *a, const QMimeType &b) { + return !(*a == b); + } // Constructor QMimeType::QMimeType() @@ -238,25 +244,6 @@ static void _call_f_name_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, } -// bool QMimeType::operator!=(const QMimeType &other) - - -static void _init_f_operator_excl__eq__c2204 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2204 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QMimeType &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QMimeType *)cls)->operator!= (arg1)); -} - - // QMimeType &QMimeType::operator=(const QMimeType &other) @@ -276,25 +263,6 @@ static void _call_f_operator_eq__2204 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QMimeType::operator==(const QMimeType &other) - - -static void _init_f_operator_eq__eq__c2204 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2204 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QMimeType &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QMimeType *)cls)->operator== (arg1)); -} - - // QStringList QMimeType::parentMimeTypes() @@ -379,9 +347,7 @@ static gsi::Methods methods_QMimeType () { methods += new qt_gsi::GenericMethod ("isDefault?", "@brief Method bool QMimeType::isDefault()\n", true, &_init_f_isDefault_c0, &_call_f_isDefault_c0); methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QMimeType::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("name", "@brief Method QString QMimeType::name()\n", true, &_init_f_name_c0, &_call_f_name_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QMimeType::operator!=(const QMimeType &other)\n", true, &_init_f_operator_excl__eq__c2204, &_call_f_operator_excl__eq__c2204); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QMimeType &QMimeType::operator=(const QMimeType &other)\n", false, &_init_f_operator_eq__2204, &_call_f_operator_eq__2204); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QMimeType::operator==(const QMimeType &other)\n", true, &_init_f_operator_eq__eq__c2204, &_call_f_operator_eq__eq__c2204); methods += new qt_gsi::GenericMethod ("parentMimeTypes", "@brief Method QStringList QMimeType::parentMimeTypes()\n", true, &_init_f_parentMimeTypes_c0, &_call_f_parentMimeTypes_c0); methods += new qt_gsi::GenericMethod ("preferredSuffix", "@brief Method QString QMimeType::preferredSuffix()\n", true, &_init_f_preferredSuffix_c0, &_call_f_preferredSuffix_c0); methods += new qt_gsi::GenericMethod ("suffixes", "@brief Method QStringList QMimeType::suffixes()\n", true, &_init_f_suffixes_c0, &_call_f_suffixes_c0); @@ -390,6 +356,9 @@ static gsi::Methods methods_QMimeType () { } gsi::Class decl_QMimeType ("QtCore", "QMimeType", + gsi::method_ext("==", &QMimeType_operator_eq, gsi::arg ("other"), "@brief Method bool QMimeType::operator==(const QMimeType &) const") + + gsi::method_ext("!=", &QMimeType_operator_ne, gsi::arg ("other"), "@brief Method bool QMimeType::operator!=(const QMimeType &) const") ++ methods_QMimeType (), "@qt\n@brief Binding of QMimeType"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc b/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc index 338220643..2c4dea35f 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QModelIndex + static bool QModelIndex_operator_eq(const QModelIndex *a, const QModelIndex &b) { + return *a == b; + } + static bool QModelIndex_operator_ne(const QModelIndex *a, const QModelIndex &b) { + return !(*a == b); + } // Constructor QModelIndex::QModelIndex() @@ -196,25 +202,6 @@ static void _call_f_multiData_c2196 (const qt_gsi::GenericMethod * /*decl*/, voi } -// bool QModelIndex::operator!=(const QModelIndex &other) - - -static void _init_f_operator_excl__eq__c2395 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2395 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QModelIndex *)cls)->operator!= (arg1)); -} - - // bool QModelIndex::operator<(const QModelIndex &other) @@ -234,25 +221,6 @@ static void _call_f_operator_lt__c2395 (const qt_gsi::GenericMethod * /*decl*/, } -// bool QModelIndex::operator==(const QModelIndex &other) - - -static void _init_f_operator_eq__eq__c2395 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2395 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QModelIndex *)cls)->operator== (arg1)); -} - - // QModelIndex QModelIndex::parent() @@ -359,9 +327,7 @@ static gsi::Methods methods_QModelIndex () { methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QModelIndex::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("model", "@brief Method const QAbstractItemModel *QModelIndex::model()\n", true, &_init_f_model_c0, &_call_f_model_c0); methods += new qt_gsi::GenericMethod ("multiData", "@brief Method void QModelIndex::multiData(QModelRoleDataSpan roleDataSpan)\n", true, &_init_f_multiData_c2196, &_call_f_multiData_c2196); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QModelIndex::operator!=(const QModelIndex &other)\n", true, &_init_f_operator_excl__eq__c2395, &_call_f_operator_excl__eq__c2395); methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QModelIndex::operator<(const QModelIndex &other)\n", true, &_init_f_operator_lt__c2395, &_call_f_operator_lt__c2395); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QModelIndex::operator==(const QModelIndex &other)\n", true, &_init_f_operator_eq__eq__c2395, &_call_f_operator_eq__eq__c2395); methods += new qt_gsi::GenericMethod ("parent", "@brief Method QModelIndex QModelIndex::parent()\n", true, &_init_f_parent_c0, &_call_f_parent_c0); methods += new qt_gsi::GenericMethod ("row", "@brief Method int QModelIndex::row()\n", true, &_init_f_row_c0, &_call_f_row_c0); methods += new qt_gsi::GenericMethod ("sibling", "@brief Method QModelIndex QModelIndex::sibling(int row, int column)\n", true, &_init_f_sibling_c1426, &_call_f_sibling_c1426); @@ -371,6 +337,9 @@ static gsi::Methods methods_QModelIndex () { } gsi::Class decl_QModelIndex ("QtCore", "QModelIndex", + gsi::method_ext("==", &QModelIndex_operator_eq, gsi::arg ("other"), "@brief Method bool QModelIndex::operator==(const QModelIndex &) const") + + gsi::method_ext("!=", &QModelIndex_operator_ne, gsi::arg ("other"), "@brief Method bool QModelIndex::operator!=(const QModelIndex &) const") ++ methods_QModelIndex (), "@qt\n@brief Binding of QModelIndex"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc b/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc index 35b7a6ba2..7fecee04c 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc @@ -37,6 +37,12 @@ // ----------------------------------------------------------------------- // class QPersistentModelIndex + static bool QPersistentModelIndex_operator_eq(const QPersistentModelIndex *a, const QPersistentModelIndex &b) { + return *a == b; + } + static bool QPersistentModelIndex_operator_ne(const QPersistentModelIndex *a, const QPersistentModelIndex &b) { + return !(*a == b); + } #if QT_VERSION < 0x60000 static const QModelIndex &castToQModelIndex(const QPersistentModelIndex *m) { @@ -246,44 +252,6 @@ static void _call_f_multiData_c2196 (const qt_gsi::GenericMethod * /*decl*/, voi } -// bool QPersistentModelIndex::operator!=(const QPersistentModelIndex &other) - - -static void _init_f_operator_excl__eq__c3468 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c3468 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QPersistentModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QPersistentModelIndex *)cls)->operator!= (arg1)); -} - - -// bool QPersistentModelIndex::operator!=(const QModelIndex &other) - - -static void _init_f_operator_excl__eq__c2395 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2395 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QPersistentModelIndex *)cls)->operator!= (arg1)); -} - - // bool QPersistentModelIndex::operator<(const QPersistentModelIndex &other) @@ -341,44 +309,6 @@ static void _call_f_operator_eq__2395 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QPersistentModelIndex::operator==(const QPersistentModelIndex &other) - - -static void _init_f_operator_eq__eq__c3468 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c3468 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QPersistentModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QPersistentModelIndex *)cls)->operator== (arg1)); -} - - -// bool QPersistentModelIndex::operator==(const QModelIndex &other) - - -static void _init_f_operator_eq__eq__c2395 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2395 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QPersistentModelIndex *)cls)->operator== (arg1)); -} - - // QModelIndex QPersistentModelIndex::parent() @@ -469,13 +399,9 @@ static gsi::Methods methods_QPersistentModelIndex () { methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QPersistentModelIndex::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("model", "@brief Method const QAbstractItemModel *QPersistentModelIndex::model()\n", true, &_init_f_model_c0, &_call_f_model_c0); methods += new qt_gsi::GenericMethod ("multiData", "@brief Method void QPersistentModelIndex::multiData(QModelRoleDataSpan roleDataSpan)\n", true, &_init_f_multiData_c2196, &_call_f_multiData_c2196); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QPersistentModelIndex::operator!=(const QPersistentModelIndex &other)\n", true, &_init_f_operator_excl__eq__c3468, &_call_f_operator_excl__eq__c3468); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QPersistentModelIndex::operator!=(const QModelIndex &other)\n", true, &_init_f_operator_excl__eq__c2395, &_call_f_operator_excl__eq__c2395); methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QPersistentModelIndex::operator<(const QPersistentModelIndex &other)\n", true, &_init_f_operator_lt__c3468, &_call_f_operator_lt__c3468); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QPersistentModelIndex &QPersistentModelIndex::operator=(const QPersistentModelIndex &other)\n", false, &_init_f_operator_eq__3468, &_call_f_operator_eq__3468); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QPersistentModelIndex &QPersistentModelIndex::operator=(const QModelIndex &other)\n", false, &_init_f_operator_eq__2395, &_call_f_operator_eq__2395); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QPersistentModelIndex::operator==(const QPersistentModelIndex &other)\n", true, &_init_f_operator_eq__eq__c3468, &_call_f_operator_eq__eq__c3468); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QPersistentModelIndex::operator==(const QModelIndex &other)\n", true, &_init_f_operator_eq__eq__c2395, &_call_f_operator_eq__eq__c2395); methods += new qt_gsi::GenericMethod ("parent", "@brief Method QModelIndex QPersistentModelIndex::parent()\n", true, &_init_f_parent_c0, &_call_f_parent_c0); methods += new qt_gsi::GenericMethod ("row", "@brief Method int QPersistentModelIndex::row()\n", true, &_init_f_row_c0, &_call_f_row_c0); methods += new qt_gsi::GenericMethod ("sibling", "@brief Method QModelIndex QPersistentModelIndex::sibling(int row, int column)\n", true, &_init_f_sibling_c1426, &_call_f_sibling_c1426); @@ -484,6 +410,9 @@ static gsi::Methods methods_QPersistentModelIndex () { } gsi::Class decl_QPersistentModelIndex ("QtCore", "QPersistentModelIndex", + gsi::method_ext("==", &QPersistentModelIndex_operator_eq, gsi::arg ("other"), "@brief Method bool QPersistentModelIndex::operator==(const QPersistentModelIndex &) const") + + gsi::method_ext("!=", &QPersistentModelIndex_operator_ne, gsi::arg ("other"), "@brief Method bool QPersistentModelIndex::operator!=(const QPersistentModelIndex &) const") ++ gsi::method_ext("castToQModelIndex", &castToQModelIndex, "@brief Binding for \"operator const QModelIndex &\".") + methods_QPersistentModelIndex (), diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQProcessEnvironment.cc b/src/gsiqt/qt6/QtCore/gsiDeclQProcessEnvironment.cc index 5706f3c89..d1505a386 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQProcessEnvironment.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQProcessEnvironment.cc @@ -34,6 +34,12 @@ // ----------------------------------------------------------------------- // class QProcessEnvironment + static bool QProcessEnvironment_operator_eq(const QProcessEnvironment *a, const QProcessEnvironment &b) { + return *a == b; + } + static bool QProcessEnvironment_operator_ne(const QProcessEnvironment *a, const QProcessEnvironment &b) { + return !(*a == b); + } // Constructor QProcessEnvironment::QProcessEnvironment() @@ -177,25 +183,6 @@ static void _call_f_keys_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cls, } -// bool QProcessEnvironment::operator!=(const QProcessEnvironment &other) - - -static void _init_f_operator_excl__eq__c3302 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c3302 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QProcessEnvironment &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QProcessEnvironment *)cls)->operator!= (arg1)); -} - - // QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &other) @@ -215,25 +202,6 @@ static void _call_f_operator_eq__3302 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QProcessEnvironment::operator==(const QProcessEnvironment &other) - - -static void _init_f_operator_eq__eq__c3302 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c3302 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QProcessEnvironment &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QProcessEnvironment *)cls)->operator== (arg1)); -} - - // void QProcessEnvironment::remove(const QString &name) @@ -340,9 +308,7 @@ static gsi::Methods methods_QProcessEnvironment () { methods += new qt_gsi::GenericMethod ("insert", "@brief Method void QProcessEnvironment::insert(const QProcessEnvironment &e)\n", false, &_init_f_insert_3302, &_call_f_insert_3302); methods += new qt_gsi::GenericMethod ("isEmpty?", "@brief Method bool QProcessEnvironment::isEmpty()\n", true, &_init_f_isEmpty_c0, &_call_f_isEmpty_c0); methods += new qt_gsi::GenericMethod ("keys", "@brief Method QStringList QProcessEnvironment::keys()\n", true, &_init_f_keys_c0, &_call_f_keys_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QProcessEnvironment::operator!=(const QProcessEnvironment &other)\n", true, &_init_f_operator_excl__eq__c3302, &_call_f_operator_excl__eq__c3302); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &other)\n", false, &_init_f_operator_eq__3302, &_call_f_operator_eq__3302); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QProcessEnvironment::operator==(const QProcessEnvironment &other)\n", true, &_init_f_operator_eq__eq__c3302, &_call_f_operator_eq__eq__c3302); methods += new qt_gsi::GenericMethod ("remove", "@brief Method void QProcessEnvironment::remove(const QString &name)\n", false, &_init_f_remove_2025, &_call_f_remove_2025); methods += new qt_gsi::GenericMethod ("swap", "@brief Method void QProcessEnvironment::swap(QProcessEnvironment &other)\n", false, &_init_f_swap_2607, &_call_f_swap_2607); methods += new qt_gsi::GenericMethod ("toStringList", "@brief Method QStringList QProcessEnvironment::toStringList()\n", true, &_init_f_toStringList_c0, &_call_f_toStringList_c0); @@ -352,6 +318,9 @@ static gsi::Methods methods_QProcessEnvironment () { } gsi::Class decl_QProcessEnvironment ("QtCore", "QProcessEnvironment", + gsi::method_ext("==", &QProcessEnvironment_operator_eq, gsi::arg ("other"), "@brief Method bool QProcessEnvironment::operator==(const QProcessEnvironment &) const") + + gsi::method_ext("!=", &QProcessEnvironment_operator_ne, gsi::arg ("other"), "@brief Method bool QProcessEnvironment::operator!=(const QProcessEnvironment &) const") ++ methods_QProcessEnvironment (), "@qt\n@brief Binding of QProcessEnvironment"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQRegularExpression.cc b/src/gsiqt/qt6/QtCore/gsiDeclQRegularExpression.cc index 23d4d3e43..cd8779126 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQRegularExpression.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQRegularExpression.cc @@ -36,6 +36,12 @@ // ----------------------------------------------------------------------- // class QRegularExpression + static bool QRegularExpression_operator_eq(const QRegularExpression *a, const QRegularExpression &b) { + return *a == b; + } + static bool QRegularExpression_operator_ne(const QRegularExpression *a, const QRegularExpression &b) { + return !(*a == b); + } // Constructor QRegularExpression::QRegularExpression() @@ -209,25 +215,6 @@ static void _call_f_namedCaptureGroups_c0 (const qt_gsi::GenericMethod * /*decl* } -// bool QRegularExpression::operator!=(const QRegularExpression &re) - - -static void _init_f_operator_excl__eq__c3188 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("re"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c3188 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QRegularExpression &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QRegularExpression *)cls)->operator!= (arg1)); -} - - // QRegularExpression &QRegularExpression::operator=(const QRegularExpression &re) @@ -247,25 +234,6 @@ static void _call_f_operator_eq__3188 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QRegularExpression::operator==(const QRegularExpression &re) - - -static void _init_f_operator_eq__eq__c3188 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("re"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c3188 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QRegularExpression &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QRegularExpression *)cls)->operator== (arg1)); -} - - // void QRegularExpression::optimize() @@ -462,9 +430,7 @@ static gsi::Methods methods_QRegularExpression () { methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QRegularExpression::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("match", "@brief Method QRegularExpressionMatch QRegularExpression::match(const QString &subject, qsizetype offset, QRegularExpression::MatchType matchType, QFlags matchOptions)\n", true, &_init_f_match_c10730, &_call_f_match_c10730); methods += new qt_gsi::GenericMethod ("namedCaptureGroups", "@brief Method QStringList QRegularExpression::namedCaptureGroups()\n", true, &_init_f_namedCaptureGroups_c0, &_call_f_namedCaptureGroups_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QRegularExpression::operator!=(const QRegularExpression &re)\n", true, &_init_f_operator_excl__eq__c3188, &_call_f_operator_excl__eq__c3188); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QRegularExpression &QRegularExpression::operator=(const QRegularExpression &re)\n", false, &_init_f_operator_eq__3188, &_call_f_operator_eq__3188); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QRegularExpression::operator==(const QRegularExpression &re)\n", true, &_init_f_operator_eq__eq__c3188, &_call_f_operator_eq__eq__c3188); methods += new qt_gsi::GenericMethod ("optimize", "@brief Method void QRegularExpression::optimize()\n", true, &_init_f_optimize_c0, &_call_f_optimize_c0); methods += new qt_gsi::GenericMethod (":pattern", "@brief Method QString QRegularExpression::pattern()\n", true, &_init_f_pattern_c0, &_call_f_pattern_c0); methods += new qt_gsi::GenericMethod ("patternErrorOffset", "@brief Method qsizetype QRegularExpression::patternErrorOffset()\n", true, &_init_f_patternErrorOffset_c0, &_call_f_patternErrorOffset_c0); @@ -479,6 +445,9 @@ static gsi::Methods methods_QRegularExpression () { } gsi::Class decl_QRegularExpression ("QtCore", "QRegularExpression", + gsi::method_ext("==", &QRegularExpression_operator_eq, gsi::arg ("other"), "@brief Method bool QRegularExpression::operator==(const QRegularExpression &) const") + + gsi::method_ext("!=", &QRegularExpression_operator_ne, gsi::arg ("other"), "@brief Method bool QRegularExpression::operator!=(const QRegularExpression &) const") ++ methods_QRegularExpression (), "@qt\n@brief Binding of QRegularExpression"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc b/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc index 6a754e6b6..8f0302a8b 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc @@ -35,6 +35,12 @@ // ----------------------------------------------------------------------- // class QUrl + static bool QUrl_operator_eq(const QUrl *a, const QUrl &b) { + return *a == b; + } + static bool QUrl_operator_ne(const QUrl *a, const QUrl &b) { + return !(*a == b); + } // Constructor QUrl::QUrl() @@ -380,25 +386,6 @@ static void _call_f_matches_c9164 (const qt_gsi::GenericMethod * /*decl*/, void } -// bool QUrl::operator !=(const QUrl &url) - - -static void _init_f_operator_excl__eq__c1701 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("url"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c1701 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QUrl &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QUrl *)cls)->operator != (arg1)); -} - - // bool QUrl::operator <(const QUrl &url) @@ -437,25 +424,6 @@ static void _call_f_operator_eq__1701 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QUrl::operator ==(const QUrl &url) - - -static void _init_f_operator_eq__eq__c1701 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("url"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c1701 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QUrl &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QUrl *)cls)->operator == (arg1)); -} - - // QUrl &QUrl::operator=(const QString &url) @@ -1254,10 +1222,8 @@ static gsi::Methods methods_QUrl () { methods += new qt_gsi::GenericMethod ("isRelative?", "@brief Method bool QUrl::isRelative()\n", true, &_init_f_isRelative_c0, &_call_f_isRelative_c0); methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QUrl::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("matches", "@brief Method bool QUrl::matches(const QUrl &url, QUrlTwoFlags options)\n", true, &_init_f_matches_c9164, &_call_f_matches_c9164); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QUrl::operator !=(const QUrl &url)\n", true, &_init_f_operator_excl__eq__c1701, &_call_f_operator_excl__eq__c1701); methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QUrl::operator <(const QUrl &url)\n", true, &_init_f_operator_lt__c1701, &_call_f_operator_lt__c1701); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QUrl &QUrl::operator =(const QUrl ©)\n", false, &_init_f_operator_eq__1701, &_call_f_operator_eq__1701); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QUrl::operator ==(const QUrl &url)\n", true, &_init_f_operator_eq__eq__c1701, &_call_f_operator_eq__eq__c1701); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QUrl &QUrl::operator=(const QString &url)\n", false, &_init_f_operator_eq__2025, &_call_f_operator_eq__2025); methods += new qt_gsi::GenericMethod ("password", "@brief Method QString QUrl::password(QFlags)\n", true, &_init_f_password_c4267, &_call_f_password_c4267); methods += new qt_gsi::GenericMethod ("path", "@brief Method QString QUrl::path(QFlags options)\n", true, &_init_f_path_c4267, &_call_f_path_c4267); @@ -1300,6 +1266,9 @@ static gsi::Methods methods_QUrl () { } gsi::Class decl_QUrl ("QtCore", "QUrl", + gsi::method_ext("==", &QUrl_operator_eq, gsi::arg ("other"), "@brief Method bool QUrl::operator==(const QUrl &) const") + + gsi::method_ext("!=", &QUrl_operator_ne, gsi::arg ("other"), "@brief Method bool QUrl::operator!=(const QUrl &) const") ++ methods_QUrl (), "@qt\n@brief Binding of QUrl"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQUrlQuery.cc b/src/gsiqt/qt6/QtCore/gsiDeclQUrlQuery.cc index d91da6006..623676e7c 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQUrlQuery.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQUrlQuery.cc @@ -35,6 +35,12 @@ // ----------------------------------------------------------------------- // class QUrlQuery + static bool QUrlQuery_operator_eq(const QUrlQuery *a, const QUrlQuery &b) { + return *a == b; + } + static bool QUrlQuery_operator_ne(const QUrlQuery *a, const QUrlQuery &b) { + return !(*a == b); + } // Constructor QUrlQuery::QUrlQuery() @@ -218,25 +224,6 @@ static void _call_f_isEmpty_c0 (const qt_gsi::GenericMethod * /*decl*/, void *cl } -// bool QUrlQuery::operator!=(const QUrlQuery &other) - - -static void _init_f_operator_excl__eq__c2235 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c2235 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QUrlQuery &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QUrlQuery *)cls)->operator!= (arg1)); -} - - // QUrlQuery &QUrlQuery::operator=(const QUrlQuery &other) @@ -256,25 +243,6 @@ static void _call_f_operator_eq__2235 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QUrlQuery::operator==(const QUrlQuery &other) - - -static void _init_f_operator_eq__eq__c2235 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c2235 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QUrlQuery &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QUrlQuery *)cls)->operator== (arg1)); -} - - // QString QUrlQuery::query(QFlags encoding) @@ -553,9 +521,7 @@ static gsi::Methods methods_QUrlQuery () { methods += new qt_gsi::GenericMethod ("hasQueryItem", "@brief Method bool QUrlQuery::hasQueryItem(const QString &key)\n", true, &_init_f_hasQueryItem_c2025, &_call_f_hasQueryItem_c2025); methods += new qt_gsi::GenericMethod ("isDetached?", "@brief Method bool QUrlQuery::isDetached()\n", true, &_init_f_isDetached_c0, &_call_f_isDetached_c0); methods += new qt_gsi::GenericMethod ("isEmpty?", "@brief Method bool QUrlQuery::isEmpty()\n", true, &_init_f_isEmpty_c0, &_call_f_isEmpty_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QUrlQuery::operator!=(const QUrlQuery &other)\n", true, &_init_f_operator_excl__eq__c2235, &_call_f_operator_excl__eq__c2235); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QUrlQuery &QUrlQuery::operator=(const QUrlQuery &other)\n", false, &_init_f_operator_eq__2235, &_call_f_operator_eq__2235); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QUrlQuery::operator==(const QUrlQuery &other)\n", true, &_init_f_operator_eq__eq__c2235, &_call_f_operator_eq__eq__c2235); methods += new qt_gsi::GenericMethod ("query", "@brief Method QString QUrlQuery::query(QFlags encoding)\n", true, &_init_f_query_c4267, &_call_f_query_c4267); methods += new qt_gsi::GenericMethod ("queryItemValue", "@brief Method QString QUrlQuery::queryItemValue(const QString &key, QFlags encoding)\n", true, &_init_f_queryItemValue_c6184, &_call_f_queryItemValue_c6184); methods += new qt_gsi::GenericMethod ("queryItems", "@brief Method QList > QUrlQuery::queryItems(QFlags encoding)\n", true, &_init_f_queryItems_c4267, &_call_f_queryItems_c4267); @@ -574,6 +540,9 @@ static gsi::Methods methods_QUrlQuery () { } gsi::Class decl_QUrlQuery ("QtCore", "QUrlQuery", + gsi::method_ext("==", &QUrlQuery_operator_eq, gsi::arg ("other"), "@brief Method bool QUrlQuery::operator==(const QUrlQuery &) const") + + gsi::method_ext("!=", &QUrlQuery_operator_ne, gsi::arg ("other"), "@brief Method bool QUrlQuery::operator!=(const QUrlQuery &) const") ++ methods_QUrlQuery (), "@qt\n@brief Binding of QUrlQuery"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamAttribute.cc b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamAttribute.cc index 7e6802ad6..eebc44941 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamAttribute.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamAttribute.cc @@ -34,6 +34,12 @@ // ----------------------------------------------------------------------- // class QXmlStreamAttribute + static bool QXmlStreamAttribute_operator_eq(const QXmlStreamAttribute *a, const QXmlStreamAttribute &b) { + return *a == b; + } + static bool QXmlStreamAttribute_operator_ne(const QXmlStreamAttribute *a, const QXmlStreamAttribute &b) { + return !(*a == b); + } // Constructor QXmlStreamAttribute::QXmlStreamAttribute() @@ -112,44 +118,6 @@ static void _call_f_isDefault_c0 (const qt_gsi::GenericMethod * /*decl*/, void * } -// bool QXmlStreamAttribute::operator!=(const QXmlStreamAttribute &other) - - -static void _init_f_operator_excl__eq__c3267 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c3267 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamAttribute &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamAttribute *)cls)->operator!= (arg1)); -} - - -// bool QXmlStreamAttribute::operator==(const QXmlStreamAttribute &other) - - -static void _init_f_operator_eq__eq__c3267 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c3267 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamAttribute &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamAttribute *)cls)->operator== (arg1)); -} - - namespace gsi { @@ -160,12 +128,13 @@ static gsi::Methods methods_QXmlStreamAttribute () { methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QString &value)\nThis method creates an object of class QXmlStreamAttribute.", &_init_ctor_QXmlStreamAttribute_3942, &_call_ctor_QXmlStreamAttribute_3942); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamAttribute::QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value)\nThis method creates an object of class QXmlStreamAttribute.", &_init_ctor_QXmlStreamAttribute_5859, &_call_ctor_QXmlStreamAttribute_5859); methods += new qt_gsi::GenericMethod ("isDefault?", "@brief Method bool QXmlStreamAttribute::isDefault()\n", true, &_init_f_isDefault_c0, &_call_f_isDefault_c0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QXmlStreamAttribute::operator!=(const QXmlStreamAttribute &other)\n", true, &_init_f_operator_excl__eq__c3267, &_call_f_operator_excl__eq__c3267); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QXmlStreamAttribute::operator==(const QXmlStreamAttribute &other)\n", true, &_init_f_operator_eq__eq__c3267, &_call_f_operator_eq__eq__c3267); return methods; } gsi::Class decl_QXmlStreamAttribute ("QtCore", "QXmlStreamAttribute", + gsi::method_ext("==", &QXmlStreamAttribute_operator_eq, gsi::arg ("other"), "@brief Method bool QXmlStreamAttribute::operator==(const QXmlStreamAttribute &) const") + + gsi::method_ext("!=", &QXmlStreamAttribute_operator_ne, gsi::arg ("other"), "@brief Method bool QXmlStreamAttribute::operator!=(const QXmlStreamAttribute &) const") ++ methods_QXmlStreamAttribute (), "@qt\n@brief Binding of QXmlStreamAttribute"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamEntityDeclaration.cc b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamEntityDeclaration.cc index 9d8b7ccef..aa60aefa9 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamEntityDeclaration.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamEntityDeclaration.cc @@ -34,6 +34,12 @@ // ----------------------------------------------------------------------- // class QXmlStreamEntityDeclaration + static bool QXmlStreamEntityDeclaration_operator_eq(const QXmlStreamEntityDeclaration *a, const QXmlStreamEntityDeclaration &b) { + return *a == b; + } + static bool QXmlStreamEntityDeclaration_operator_ne(const QXmlStreamEntityDeclaration *a, const QXmlStreamEntityDeclaration &b) { + return !(*a == b); + } // Constructor QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration() @@ -50,44 +56,6 @@ static void _call_ctor_QXmlStreamEntityDeclaration_0 (const qt_gsi::GenericStati } -// bool QXmlStreamEntityDeclaration::operator!=(const QXmlStreamEntityDeclaration &other) - - -static void _init_f_operator_excl__eq__c4082 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c4082 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamEntityDeclaration &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamEntityDeclaration *)cls)->operator!= (arg1)); -} - - -// bool QXmlStreamEntityDeclaration::operator==(const QXmlStreamEntityDeclaration &other) - - -static void _init_f_operator_eq__eq__c4082 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c4082 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamEntityDeclaration &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamEntityDeclaration *)cls)->operator== (arg1)); -} - - namespace gsi { @@ -95,12 +63,13 @@ namespace gsi static gsi::Methods methods_QXmlStreamEntityDeclaration () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration()\nThis method creates an object of class QXmlStreamEntityDeclaration.", &_init_ctor_QXmlStreamEntityDeclaration_0, &_call_ctor_QXmlStreamEntityDeclaration_0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QXmlStreamEntityDeclaration::operator!=(const QXmlStreamEntityDeclaration &other)\n", true, &_init_f_operator_excl__eq__c4082, &_call_f_operator_excl__eq__c4082); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QXmlStreamEntityDeclaration::operator==(const QXmlStreamEntityDeclaration &other)\n", true, &_init_f_operator_eq__eq__c4082, &_call_f_operator_eq__eq__c4082); return methods; } gsi::Class decl_QXmlStreamEntityDeclaration ("QtCore", "QXmlStreamEntityDeclaration", + gsi::method_ext("==", &QXmlStreamEntityDeclaration_operator_eq, gsi::arg ("other"), "@brief Method bool QXmlStreamEntityDeclaration::operator==(const QXmlStreamEntityDeclaration &) const") + + gsi::method_ext("!=", &QXmlStreamEntityDeclaration_operator_ne, gsi::arg ("other"), "@brief Method bool QXmlStreamEntityDeclaration::operator!=(const QXmlStreamEntityDeclaration &) const") ++ methods_QXmlStreamEntityDeclaration (), "@qt\n@brief Binding of QXmlStreamEntityDeclaration"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNamespaceDeclaration.cc b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNamespaceDeclaration.cc index d0a2feac0..d128d3318 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNamespaceDeclaration.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNamespaceDeclaration.cc @@ -34,6 +34,12 @@ // ----------------------------------------------------------------------- // class QXmlStreamNamespaceDeclaration + static bool QXmlStreamNamespaceDeclaration_operator_eq(const QXmlStreamNamespaceDeclaration *a, const QXmlStreamNamespaceDeclaration &b) { + return *a == b; + } + static bool QXmlStreamNamespaceDeclaration_operator_ne(const QXmlStreamNamespaceDeclaration *a, const QXmlStreamNamespaceDeclaration &b) { + return !(*a == b); + } // Constructor QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration() @@ -72,44 +78,6 @@ static void _call_ctor_QXmlStreamNamespaceDeclaration_3942 (const qt_gsi::Generi } -// bool QXmlStreamNamespaceDeclaration::operator!=(const QXmlStreamNamespaceDeclaration &other) - - -static void _init_f_operator_excl__eq__c4354 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c4354 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamNamespaceDeclaration &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamNamespaceDeclaration *)cls)->operator!= (arg1)); -} - - -// bool QXmlStreamNamespaceDeclaration::operator==(const QXmlStreamNamespaceDeclaration &other) - - -static void _init_f_operator_eq__eq__c4354 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c4354 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamNamespaceDeclaration &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamNamespaceDeclaration *)cls)->operator== (arg1)); -} - - namespace gsi { @@ -118,12 +86,13 @@ static gsi::Methods methods_QXmlStreamNamespaceDeclaration () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration()\nThis method creates an object of class QXmlStreamNamespaceDeclaration.", &_init_ctor_QXmlStreamNamespaceDeclaration_0, &_call_ctor_QXmlStreamNamespaceDeclaration_0); methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(const QString &prefix, const QString &namespaceUri)\nThis method creates an object of class QXmlStreamNamespaceDeclaration.", &_init_ctor_QXmlStreamNamespaceDeclaration_3942, &_call_ctor_QXmlStreamNamespaceDeclaration_3942); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QXmlStreamNamespaceDeclaration::operator!=(const QXmlStreamNamespaceDeclaration &other)\n", true, &_init_f_operator_excl__eq__c4354, &_call_f_operator_excl__eq__c4354); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QXmlStreamNamespaceDeclaration::operator==(const QXmlStreamNamespaceDeclaration &other)\n", true, &_init_f_operator_eq__eq__c4354, &_call_f_operator_eq__eq__c4354); return methods; } gsi::Class decl_QXmlStreamNamespaceDeclaration ("QtCore", "QXmlStreamNamespaceDeclaration", + gsi::method_ext("==", &QXmlStreamNamespaceDeclaration_operator_eq, gsi::arg ("other"), "@brief Method bool QXmlStreamNamespaceDeclaration::operator==(const QXmlStreamNamespaceDeclaration &) const") + + gsi::method_ext("!=", &QXmlStreamNamespaceDeclaration_operator_ne, gsi::arg ("other"), "@brief Method bool QXmlStreamNamespaceDeclaration::operator!=(const QXmlStreamNamespaceDeclaration &) const") ++ methods_QXmlStreamNamespaceDeclaration (), "@qt\n@brief Binding of QXmlStreamNamespaceDeclaration"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNotationDeclaration.cc b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNotationDeclaration.cc index eaced5dab..fa48b4194 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNotationDeclaration.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQXmlStreamNotationDeclaration.cc @@ -34,6 +34,12 @@ // ----------------------------------------------------------------------- // class QXmlStreamNotationDeclaration + static bool QXmlStreamNotationDeclaration_operator_eq(const QXmlStreamNotationDeclaration *a, const QXmlStreamNotationDeclaration &b) { + return *a == b; + } + static bool QXmlStreamNotationDeclaration_operator_ne(const QXmlStreamNotationDeclaration *a, const QXmlStreamNotationDeclaration &b) { + return !(*a == b); + } // Constructor QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration() @@ -50,44 +56,6 @@ static void _call_ctor_QXmlStreamNotationDeclaration_0 (const qt_gsi::GenericSta } -// bool QXmlStreamNotationDeclaration::operator!=(const QXmlStreamNotationDeclaration &other) - - -static void _init_f_operator_excl__eq__c4289 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_excl__eq__c4289 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamNotationDeclaration &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamNotationDeclaration *)cls)->operator!= (arg1)); -} - - -// bool QXmlStreamNotationDeclaration::operator==(const QXmlStreamNotationDeclaration &other) - - -static void _init_f_operator_eq__eq__c4289 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_eq__eq__c4289 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QXmlStreamNotationDeclaration &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QXmlStreamNotationDeclaration *)cls)->operator== (arg1)); -} - - namespace gsi { @@ -95,12 +63,13 @@ namespace gsi static gsi::Methods methods_QXmlStreamNotationDeclaration () { gsi::Methods methods; methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration()\nThis method creates an object of class QXmlStreamNotationDeclaration.", &_init_ctor_QXmlStreamNotationDeclaration_0, &_call_ctor_QXmlStreamNotationDeclaration_0); - methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QXmlStreamNotationDeclaration::operator!=(const QXmlStreamNotationDeclaration &other)\n", true, &_init_f_operator_excl__eq__c4289, &_call_f_operator_excl__eq__c4289); - methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QXmlStreamNotationDeclaration::operator==(const QXmlStreamNotationDeclaration &other)\n", true, &_init_f_operator_eq__eq__c4289, &_call_f_operator_eq__eq__c4289); return methods; } gsi::Class decl_QXmlStreamNotationDeclaration ("QtCore", "QXmlStreamNotationDeclaration", + gsi::method_ext("==", &QXmlStreamNotationDeclaration_operator_eq, gsi::arg ("other"), "@brief Method bool QXmlStreamNotationDeclaration::operator==(const QXmlStreamNotationDeclaration &) const") + + gsi::method_ext("!=", &QXmlStreamNotationDeclaration_operator_ne, gsi::arg ("other"), "@brief Method bool QXmlStreamNotationDeclaration::operator!=(const QXmlStreamNotationDeclaration &) const") ++ methods_QXmlStreamNotationDeclaration (), "@qt\n@brief Binding of QXmlStreamNotationDeclaration"); From 7d1ddd95df66a77a5cc20afe041410e7fd084f56 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 16 Feb 2025 22:38:29 +0100 Subject: [PATCH 04/29] More patches --- scripts/mkqtdecl6/mkqtdecl.conf | 70 +++++++++++- .../qt6/QtCore/gsiDeclQJsonArray_Iterator.cc | 100 ++++-------------- .../qt6/QtCore/gsiDeclQJsonObject_Iterator.cc | 100 ++++-------------- src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc | 26 +---- .../QtCore/gsiDeclQPersistentModelIndex.cc | 26 +---- .../qt6/QtCore/gsiDeclQStringConverterBase.cc | 16 --- src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc | 26 +---- 7 files changed, 116 insertions(+), 248 deletions(-) diff --git a/scripts/mkqtdecl6/mkqtdecl.conf b/scripts/mkqtdecl6/mkqtdecl.conf index 37672b679..427141e2b 100644 --- a/scripts/mkqtdecl6/mkqtdecl.conf +++ b/scripts/mkqtdecl6/mkqtdecl.conf @@ -35,6 +35,65 @@ CODE DECL end +def add_native_operator_neqlt(engine, cls) + cls_id = cls.gsub("::", "_") + engine.drop_method cls, /::operator\s*==/ + engine.drop_method cls, /::operator\s*!=/ + engine.drop_method cls, /::operator\s*/ + engine.drop_method cls, /::operator\s*>=/ + engine.add_native_impl(cls, <<"CODE", <<"DECL") + static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) { + return *a == b; + } + static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) { + return *a != b; + } + static bool #{cls_id}_operator_le(const #{cls} *a, const #{cls} &b) { + return *a <= b; + } + static bool #{cls_id}_operator_lt(const #{cls} *a, const #{cls} &b) { + return *a < b; + } + static bool #{cls_id}_operator_ge(const #{cls} *a, const #{cls} &b) { + return *a >= b; + } + static bool #{cls_id}_operator_gt(const #{cls} *a, const #{cls} &b) { + return *a > b; + } +CODE + gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") + + gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const") + + gsi::method_ext("<=", &#{cls_id}_operator_le, gsi::arg ("other"), "@brief Method bool #{cls}::operator<=(const #{cls} &) const") + + gsi::method_ext("<", &#{cls_id}_operator_lt, gsi::arg ("other"), "@brief Method bool #{cls}::operator<(const #{cls} &) const") + + gsi::method_ext(">=", &#{cls_id}_operator_ge, gsi::arg ("other"), "@brief Method bool #{cls}::operator>=(const #{cls} &) const") + + gsi::method_ext(">", &#{cls_id}_operator_gt, gsi::arg ("other"), "@brief Method bool #{cls}::operator>(const #{cls} &) const") +DECL +end + # -------------------------------------------------------------- # all modules @@ -495,20 +554,20 @@ add_native_operator_neq(self, "QDir") add_native_operator_neq(self, "QFileInfo") add_native_operator_neq(self, "QItemSelectionRange") add_native_operator_neq(self, "QJsonArray") -add_native_operator_neq(self, "QJsonArray::iterator") +add_native_operator_cmp(self, "QJsonArray::iterator") add_native_operator_neq(self, "QJsonDocument") add_native_operator_neq(self, "QJsonObject") -add_native_operator_neq(self, "QJsonObject::iterator") +add_native_operator_cmp(self, "QJsonObject::iterator") add_native_operator_neq(self, "QJsonValue") add_native_operator_neq(self, "QJsonValueRef") add_native_operator_neq(self, "QLine") add_native_operator_neq(self, "QLineF") add_native_operator_neq(self, "QMimeType") -add_native_operator_neq(self, "QModelIndex") -add_native_operator_neq(self, "QPersistentModelIndex") +add_native_operator_neqlt(self, "QModelIndex") +add_native_operator_neqlt(self, "QPersistentModelIndex") add_native_operator_neq(self, "QProcessEnvironment") add_native_operator_neq(self, "QRegularExpression") -add_native_operator_neq(self, "QUrl") +add_native_operator_neqlt(self, "QUrl") add_native_operator_neq(self, "QUrlQuery") add_native_operator_neq(self, "QXmlStreamAttribute") add_native_operator_neq(self, "QXmlStreamEntityDeclaration") @@ -593,6 +652,7 @@ no_default_ctor "QModelRoleData" no_default_ctor "QPartialOrdering" no_default_ctor "QOperatingSystemVersion" no_default_ctor "QStringConverter" +no_default_ctor "QStringConverterBase" drop_method "QMessageLogger", /QMessageLogger::critical.*\.\.\./ # does not support ... drop_method "QMessageLogger", /QMessageLogger::debug.*\.\.\./ # does not support ... diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc index f164892b4..7ac46db3c 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonArray_Iterator.cc @@ -40,7 +40,19 @@ return *a == b; } static bool QJsonArray_iterator_operator_ne(const QJsonArray::iterator *a, const QJsonArray::iterator &b) { - return !(*a == b); + return *a != b; + } + static bool QJsonArray_iterator_operator_le(const QJsonArray::iterator *a, const QJsonArray::iterator &b) { + return *a <= b; + } + static bool QJsonArray_iterator_operator_lt(const QJsonArray::iterator *a, const QJsonArray::iterator &b) { + return *a < b; + } + static bool QJsonArray_iterator_operator_ge(const QJsonArray::iterator *a, const QJsonArray::iterator &b) { + return *a >= b; + } + static bool QJsonArray_iterator_operator_gt(const QJsonArray::iterator *a, const QJsonArray::iterator &b) { + return *a > b; } // Constructor QJsonArray::iterator::iterator() @@ -292,44 +304,6 @@ static void _call_f_operator_minus__gt__c0 (const qt_gsi::GenericMethod * /*decl } -// bool QJsonArray::iterator::operator<(const QJsonArray::iterator &other) - - -static void _init_f_operator_lt__c3305 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_lt__c3305 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray::iterator *)cls)->operator< (arg1)); -} - - -// bool QJsonArray::iterator::operator<=(const QJsonArray::iterator &other) - - -static void _init_f_operator_lt__eq__c3305 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_lt__eq__c3305 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray::iterator *)cls)->operator<= (arg1)); -} - - // QJsonArray::iterator &QJsonArray::iterator::operator=(const QJsonArray::iterator &other) @@ -349,44 +323,6 @@ static void _call_f_operator_eq__3305 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonArray::iterator::operator>(const QJsonArray::iterator &other) - - -static void _init_f_operator_gt__c3305 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_gt__c3305 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray::iterator *)cls)->operator> (arg1)); -} - - -// bool QJsonArray::iterator::operator>=(const QJsonArray::iterator &other) - - -static void _init_f_operator_gt__eq__c3305 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_gt__eq__c3305 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonArray::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonArray::iterator *)cls)->operator>= (arg1)); -} - - // QJsonValueRef QJsonArray::iterator::operator[](qsizetype j) @@ -426,18 +362,18 @@ static gsi::Methods methods_QJsonArray_Iterator () { methods += new qt_gsi::GenericMethod ("--", "@brief Method QJsonArray::iterator QJsonArray::iterator::operator--(int)\n", false, &_init_f_operator_minus__minus__767, &_call_f_operator_minus__minus__767); methods += new qt_gsi::GenericMethod ("-=", "@brief Method QJsonArray::iterator &QJsonArray::iterator::operator-=(qsizetype j)\n", false, &_init_f_operator_minus__eq__1442, &_call_f_operator_minus__eq__1442); methods += new qt_gsi::GenericMethod ("->", "@brief Method QJsonValueRef *QJsonArray::iterator::operator->()\n", true, &_init_f_operator_minus__gt__c0, &_call_f_operator_minus__gt__c0); - methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QJsonArray::iterator::operator<(const QJsonArray::iterator &other)\n", true, &_init_f_operator_lt__c3305, &_call_f_operator_lt__c3305); - methods += new qt_gsi::GenericMethod ("<=", "@brief Method bool QJsonArray::iterator::operator<=(const QJsonArray::iterator &other)\n", true, &_init_f_operator_lt__eq__c3305, &_call_f_operator_lt__eq__c3305); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonArray::iterator &QJsonArray::iterator::operator=(const QJsonArray::iterator &other)\n", false, &_init_f_operator_eq__3305, &_call_f_operator_eq__3305); - methods += new qt_gsi::GenericMethod (">", "@brief Method bool QJsonArray::iterator::operator>(const QJsonArray::iterator &other)\n", true, &_init_f_operator_gt__c3305, &_call_f_operator_gt__c3305); - methods += new qt_gsi::GenericMethod (">=", "@brief Method bool QJsonArray::iterator::operator>=(const QJsonArray::iterator &other)\n", true, &_init_f_operator_gt__eq__c3305, &_call_f_operator_gt__eq__c3305); methods += new qt_gsi::GenericMethod ("[]", "@brief Method QJsonValueRef QJsonArray::iterator::operator[](qsizetype j)\n", true, &_init_f_operator_index__c1442, &_call_f_operator_index__c1442); return methods; } gsi::Class decl_QJsonArray_Iterator ("QtCore", "QJsonArray_Iterator", gsi::method_ext("==", &QJsonArray_iterator_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator==(const QJsonArray::iterator &) const") + - gsi::method_ext("!=", &QJsonArray_iterator_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator!=(const QJsonArray::iterator &) const") + gsi::method_ext("!=", &QJsonArray_iterator_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator!=(const QJsonArray::iterator &) const") + + gsi::method_ext("<=", &QJsonArray_iterator_operator_le, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator<=(const QJsonArray::iterator &) const") + + gsi::method_ext("<", &QJsonArray_iterator_operator_lt, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator<(const QJsonArray::iterator &) const") + + gsi::method_ext(">=", &QJsonArray_iterator_operator_ge, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator>=(const QJsonArray::iterator &) const") + + gsi::method_ext(">", &QJsonArray_iterator_operator_gt, gsi::arg ("other"), "@brief Method bool QJsonArray::iterator::operator>(const QJsonArray::iterator &) const") + methods_QJsonArray_Iterator (), "@qt\n@brief Binding of QJsonArray::iterator"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc b/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc index 83388aca0..6665c2325 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQJsonObject_Iterator.cc @@ -40,7 +40,19 @@ return *a == b; } static bool QJsonObject_iterator_operator_ne(const QJsonObject::iterator *a, const QJsonObject::iterator &b) { - return !(*a == b); + return *a != b; + } + static bool QJsonObject_iterator_operator_le(const QJsonObject::iterator *a, const QJsonObject::iterator &b) { + return *a <= b; + } + static bool QJsonObject_iterator_operator_lt(const QJsonObject::iterator *a, const QJsonObject::iterator &b) { + return *a < b; + } + static bool QJsonObject_iterator_operator_ge(const QJsonObject::iterator *a, const QJsonObject::iterator &b) { + return *a >= b; + } + static bool QJsonObject_iterator_operator_gt(const QJsonObject::iterator *a, const QJsonObject::iterator &b) { + return *a > b; } // Constructor QJsonObject::iterator::iterator() @@ -307,44 +319,6 @@ static void _call_f_operator_minus__gt__c0 (const qt_gsi::GenericMethod * /*decl } -// bool QJsonObject::iterator::operator<(const QJsonObject::iterator &other) - - -static void _init_f_operator_lt__c3393 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_lt__c3393 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject::iterator *)cls)->operator< (arg1)); -} - - -// bool QJsonObject::iterator::operator<=(const QJsonObject::iterator &other) - - -static void _init_f_operator_lt__eq__c3393 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_lt__eq__c3393 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject::iterator *)cls)->operator<= (arg1)); -} - - // QJsonObject::iterator &QJsonObject::iterator::operator=(const QJsonObject::iterator &other) @@ -364,44 +338,6 @@ static void _call_f_operator_eq__3393 (const qt_gsi::GenericMethod * /*decl*/, v } -// bool QJsonObject::iterator::operator>(const QJsonObject::iterator &other) - - -static void _init_f_operator_gt__c3393 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_gt__c3393 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject::iterator *)cls)->operator> (arg1)); -} - - -// bool QJsonObject::iterator::operator>=(const QJsonObject::iterator &other) - - -static void _init_f_operator_gt__eq__c3393 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_gt__eq__c3393 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QJsonObject::iterator &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QJsonObject::iterator *)cls)->operator>= (arg1)); -} - - // const QJsonValueRef QJsonObject::iterator::operator[](qsizetype j) @@ -457,11 +393,7 @@ static gsi::Methods methods_QJsonObject_Iterator () { methods += new qt_gsi::GenericMethod ("--", "@brief Method QJsonObject::iterator QJsonObject::iterator::operator--(int)\n", false, &_init_f_operator_minus__minus__767, &_call_f_operator_minus__minus__767); methods += new qt_gsi::GenericMethod ("-=", "@brief Method QJsonObject::iterator &QJsonObject::iterator::operator-=(qsizetype j)\n", false, &_init_f_operator_minus__eq__1442, &_call_f_operator_minus__eq__1442); methods += new qt_gsi::GenericMethod ("->", "@brief Method QJsonValueRef *QJsonObject::iterator::operator->()\n", true, &_init_f_operator_minus__gt__c0, &_call_f_operator_minus__gt__c0); - methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QJsonObject::iterator::operator<(const QJsonObject::iterator &other)\n", true, &_init_f_operator_lt__c3393, &_call_f_operator_lt__c3393); - methods += new qt_gsi::GenericMethod ("<=", "@brief Method bool QJsonObject::iterator::operator<=(const QJsonObject::iterator &other)\n", true, &_init_f_operator_lt__eq__c3393, &_call_f_operator_lt__eq__c3393); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QJsonObject::iterator &QJsonObject::iterator::operator=(const QJsonObject::iterator &other)\n", false, &_init_f_operator_eq__3393, &_call_f_operator_eq__3393); - methods += new qt_gsi::GenericMethod (">", "@brief Method bool QJsonObject::iterator::operator>(const QJsonObject::iterator &other)\n", true, &_init_f_operator_gt__c3393, &_call_f_operator_gt__c3393); - methods += new qt_gsi::GenericMethod (">=", "@brief Method bool QJsonObject::iterator::operator>=(const QJsonObject::iterator &other)\n", true, &_init_f_operator_gt__eq__c3393, &_call_f_operator_gt__eq__c3393); methods += new qt_gsi::GenericMethod ("[]", "@brief Method const QJsonValueRef QJsonObject::iterator::operator[](qsizetype j)\n", false, &_init_f_operator_index__1442, &_call_f_operator_index__1442); methods += new qt_gsi::GenericMethod ("value", "@brief Method QJsonValueRef QJsonObject::iterator::value()\n", true, &_init_f_value_c0, &_call_f_value_c0); return methods; @@ -469,7 +401,11 @@ static gsi::Methods methods_QJsonObject_Iterator () { gsi::Class decl_QJsonObject_Iterator ("QtCore", "QJsonObject_Iterator", gsi::method_ext("==", &QJsonObject_iterator_operator_eq, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator==(const QJsonObject::iterator &) const") + - gsi::method_ext("!=", &QJsonObject_iterator_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator!=(const QJsonObject::iterator &) const") + gsi::method_ext("!=", &QJsonObject_iterator_operator_ne, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator!=(const QJsonObject::iterator &) const") + + gsi::method_ext("<=", &QJsonObject_iterator_operator_le, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator<=(const QJsonObject::iterator &) const") + + gsi::method_ext("<", &QJsonObject_iterator_operator_lt, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator<(const QJsonObject::iterator &) const") + + gsi::method_ext(">=", &QJsonObject_iterator_operator_ge, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator>=(const QJsonObject::iterator &) const") + + gsi::method_ext(">", &QJsonObject_iterator_operator_gt, gsi::arg ("other"), "@brief Method bool QJsonObject::iterator::operator>(const QJsonObject::iterator &) const") + methods_QJsonObject_Iterator (), "@qt\n@brief Binding of QJsonObject::iterator"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc b/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc index 2c4dea35f..db672f30f 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQModelIndex.cc @@ -42,6 +42,9 @@ static bool QModelIndex_operator_ne(const QModelIndex *a, const QModelIndex &b) { return !(*a == b); } + static bool QModelIndex_operator_lt(const QModelIndex *a, const QModelIndex &b) { + return *a < b; + } // Constructor QModelIndex::QModelIndex() @@ -202,25 +205,6 @@ static void _call_f_multiData_c2196 (const qt_gsi::GenericMethod * /*decl*/, voi } -// bool QModelIndex::operator<(const QModelIndex &other) - - -static void _init_f_operator_lt__c2395 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_lt__c2395 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QModelIndex *)cls)->operator< (arg1)); -} - - // QModelIndex QModelIndex::parent() @@ -327,7 +311,6 @@ static gsi::Methods methods_QModelIndex () { methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QModelIndex::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("model", "@brief Method const QAbstractItemModel *QModelIndex::model()\n", true, &_init_f_model_c0, &_call_f_model_c0); methods += new qt_gsi::GenericMethod ("multiData", "@brief Method void QModelIndex::multiData(QModelRoleDataSpan roleDataSpan)\n", true, &_init_f_multiData_c2196, &_call_f_multiData_c2196); - methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QModelIndex::operator<(const QModelIndex &other)\n", true, &_init_f_operator_lt__c2395, &_call_f_operator_lt__c2395); methods += new qt_gsi::GenericMethod ("parent", "@brief Method QModelIndex QModelIndex::parent()\n", true, &_init_f_parent_c0, &_call_f_parent_c0); methods += new qt_gsi::GenericMethod ("row", "@brief Method int QModelIndex::row()\n", true, &_init_f_row_c0, &_call_f_row_c0); methods += new qt_gsi::GenericMethod ("sibling", "@brief Method QModelIndex QModelIndex::sibling(int row, int column)\n", true, &_init_f_sibling_c1426, &_call_f_sibling_c1426); @@ -338,7 +321,8 @@ static gsi::Methods methods_QModelIndex () { gsi::Class decl_QModelIndex ("QtCore", "QModelIndex", gsi::method_ext("==", &QModelIndex_operator_eq, gsi::arg ("other"), "@brief Method bool QModelIndex::operator==(const QModelIndex &) const") + - gsi::method_ext("!=", &QModelIndex_operator_ne, gsi::arg ("other"), "@brief Method bool QModelIndex::operator!=(const QModelIndex &) const") + gsi::method_ext("!=", &QModelIndex_operator_ne, gsi::arg ("other"), "@brief Method bool QModelIndex::operator!=(const QModelIndex &) const") + + gsi::method_ext("<", &QModelIndex_operator_lt, gsi::arg ("other"), "@brief Method bool QModelIndex::operator<(const QModelIndex &) const") + methods_QModelIndex (), "@qt\n@brief Binding of QModelIndex"); diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc b/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc index 7fecee04c..1b412617f 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQPersistentModelIndex.cc @@ -43,6 +43,9 @@ static bool QPersistentModelIndex_operator_ne(const QPersistentModelIndex *a, const QPersistentModelIndex &b) { return !(*a == b); } + static bool QPersistentModelIndex_operator_lt(const QPersistentModelIndex *a, const QPersistentModelIndex &b) { + return *a < b; + } #if QT_VERSION < 0x60000 static const QModelIndex &castToQModelIndex(const QPersistentModelIndex *m) { @@ -252,25 +255,6 @@ static void _call_f_multiData_c2196 (const qt_gsi::GenericMethod * /*decl*/, voi } -// bool QPersistentModelIndex::operator<(const QPersistentModelIndex &other) - - -static void _init_f_operator_lt__c3468 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("other"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_lt__c3468 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QPersistentModelIndex &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QPersistentModelIndex *)cls)->operator< (arg1)); -} - - // QPersistentModelIndex &QPersistentModelIndex::operator=(const QPersistentModelIndex &other) @@ -399,7 +383,6 @@ static gsi::Methods methods_QPersistentModelIndex () { methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QPersistentModelIndex::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("model", "@brief Method const QAbstractItemModel *QPersistentModelIndex::model()\n", true, &_init_f_model_c0, &_call_f_model_c0); methods += new qt_gsi::GenericMethod ("multiData", "@brief Method void QPersistentModelIndex::multiData(QModelRoleDataSpan roleDataSpan)\n", true, &_init_f_multiData_c2196, &_call_f_multiData_c2196); - methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QPersistentModelIndex::operator<(const QPersistentModelIndex &other)\n", true, &_init_f_operator_lt__c3468, &_call_f_operator_lt__c3468); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QPersistentModelIndex &QPersistentModelIndex::operator=(const QPersistentModelIndex &other)\n", false, &_init_f_operator_eq__3468, &_call_f_operator_eq__3468); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QPersistentModelIndex &QPersistentModelIndex::operator=(const QModelIndex &other)\n", false, &_init_f_operator_eq__2395, &_call_f_operator_eq__2395); methods += new qt_gsi::GenericMethod ("parent", "@brief Method QModelIndex QPersistentModelIndex::parent()\n", true, &_init_f_parent_c0, &_call_f_parent_c0); @@ -411,7 +394,8 @@ static gsi::Methods methods_QPersistentModelIndex () { gsi::Class decl_QPersistentModelIndex ("QtCore", "QPersistentModelIndex", gsi::method_ext("==", &QPersistentModelIndex_operator_eq, gsi::arg ("other"), "@brief Method bool QPersistentModelIndex::operator==(const QPersistentModelIndex &) const") + - gsi::method_ext("!=", &QPersistentModelIndex_operator_ne, gsi::arg ("other"), "@brief Method bool QPersistentModelIndex::operator!=(const QPersistentModelIndex &) const") + gsi::method_ext("!=", &QPersistentModelIndex_operator_ne, gsi::arg ("other"), "@brief Method bool QPersistentModelIndex::operator!=(const QPersistentModelIndex &) const") + + gsi::method_ext("<", &QPersistentModelIndex_operator_lt, gsi::arg ("other"), "@brief Method bool QPersistentModelIndex::operator<(const QPersistentModelIndex &) const") + gsi::method_ext("castToQModelIndex", &castToQModelIndex, "@brief Binding for \"operator const QModelIndex &\".") + diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQStringConverterBase.cc b/src/gsiqt/qt6/QtCore/gsiDeclQStringConverterBase.cc index e43180127..52b17a1b8 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQStringConverterBase.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQStringConverterBase.cc @@ -35,28 +35,12 @@ // ----------------------------------------------------------------------- // class QStringConverterBase -// Constructor QStringConverterBase::QStringConverterBase() - - -static void _init_ctor_QStringConverterBase_0 (qt_gsi::GenericStaticMethod *decl) -{ - decl->set_return_new (); -} - -static void _call_ctor_QStringConverterBase_0 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - ret.write (new QStringConverterBase ()); -} - - namespace gsi { static gsi::Methods methods_QStringConverterBase () { gsi::Methods methods; - methods += new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QStringConverterBase::QStringConverterBase()\nThis method creates an object of class QStringConverterBase.", &_init_ctor_QStringConverterBase_0, &_call_ctor_QStringConverterBase_0); return methods; } diff --git a/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc b/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc index 8f0302a8b..da7e2d095 100644 --- a/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc +++ b/src/gsiqt/qt6/QtCore/gsiDeclQUrl.cc @@ -41,6 +41,9 @@ static bool QUrl_operator_ne(const QUrl *a, const QUrl &b) { return !(*a == b); } + static bool QUrl_operator_lt(const QUrl *a, const QUrl &b) { + return *a < b; + } // Constructor QUrl::QUrl() @@ -386,25 +389,6 @@ static void _call_f_matches_c9164 (const qt_gsi::GenericMethod * /*decl*/, void } -// bool QUrl::operator <(const QUrl &url) - - -static void _init_f_operator_lt__c1701 (qt_gsi::GenericMethod *decl) -{ - static gsi::ArgSpecBase argspec_0 ("url"); - decl->add_arg (argspec_0); - decl->set_return (); -} - -static void _call_f_operator_lt__c1701 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) -{ - __SUPPRESS_UNUSED_WARNING(args); - tl::Heap heap; - const QUrl &arg1 = gsi::arg_reader() (args, heap); - ret.write ((bool)((QUrl *)cls)->operator < (arg1)); -} - - // QUrl &QUrl::operator =(const QUrl ©) @@ -1222,7 +1206,6 @@ static gsi::Methods methods_QUrl () { methods += new qt_gsi::GenericMethod ("isRelative?", "@brief Method bool QUrl::isRelative()\n", true, &_init_f_isRelative_c0, &_call_f_isRelative_c0); methods += new qt_gsi::GenericMethod ("isValid?", "@brief Method bool QUrl::isValid()\n", true, &_init_f_isValid_c0, &_call_f_isValid_c0); methods += new qt_gsi::GenericMethod ("matches", "@brief Method bool QUrl::matches(const QUrl &url, QUrlTwoFlags options)\n", true, &_init_f_matches_c9164, &_call_f_matches_c9164); - methods += new qt_gsi::GenericMethod ("<", "@brief Method bool QUrl::operator <(const QUrl &url)\n", true, &_init_f_operator_lt__c1701, &_call_f_operator_lt__c1701); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QUrl &QUrl::operator =(const QUrl ©)\n", false, &_init_f_operator_eq__1701, &_call_f_operator_eq__1701); methods += new qt_gsi::GenericMethod ("assign", "@brief Method QUrl &QUrl::operator=(const QString &url)\n", false, &_init_f_operator_eq__2025, &_call_f_operator_eq__2025); methods += new qt_gsi::GenericMethod ("password", "@brief Method QString QUrl::password(QFlags)\n", true, &_init_f_password_c4267, &_call_f_password_c4267); @@ -1267,7 +1250,8 @@ static gsi::Methods methods_QUrl () { gsi::Class decl_QUrl ("QtCore", "QUrl", gsi::method_ext("==", &QUrl_operator_eq, gsi::arg ("other"), "@brief Method bool QUrl::operator==(const QUrl &) const") + - gsi::method_ext("!=", &QUrl_operator_ne, gsi::arg ("other"), "@brief Method bool QUrl::operator!=(const QUrl &) const") + gsi::method_ext("!=", &QUrl_operator_ne, gsi::arg ("other"), "@brief Method bool QUrl::operator!=(const QUrl &) const") + + gsi::method_ext("<", &QUrl_operator_lt, gsi::arg ("other"), "@brief Method bool QUrl::operator<(const QUrl &) const") + methods_QUrl (), "@qt\n@brief Binding of QUrl"); From b9079cdfdc5f8967ad1b1c28081c03959b3e9e61 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 18 Feb 2025 23:36:30 +0100 Subject: [PATCH 05/29] First proposal for a feature to configure lazy PCell evaluation - The PCell page gets an option menu instead of "show parameter names" - That option goes into that menu - In addition, there is a "lazy PCell evaluation" submenu with the modes: * As requested by PCell (like now) * Never * Always --- src/edt/edt/edtConfig.cc | 1 + src/edt/edt/edtConfig.h | 1 + src/edt/edt/edtPCellParametersPage.cc | 100 ++++++++++++++++++++++---- src/edt/edt/edtPCellParametersPage.h | 8 ++- 4 files changed, 95 insertions(+), 15 deletions(-) diff --git a/src/edt/edt/edtConfig.cc b/src/edt/edt/edtConfig.cc index 8d2c5203a..255b9ccbd 100644 --- a/src/edt/edt/edtConfig.cc +++ b/src/edt/edt/edtConfig.cc @@ -62,6 +62,7 @@ std::string cfg_edit_hier_copy_mode ("edit-hier-copy-mode"); std::string cfg_edit_show_shapes_of_instances ("edit-show-shapes-of-instances"); std::string cfg_edit_max_shapes_of_instances ("edit-max-shapes-of-instances"); std::string cfg_edit_pcell_show_parameter_names ("edit-pcell-show-parameter-names"); +std::string cfg_edit_pcell_lazy_eval_mode ("edit-pcell-lazy-eval-mode"); std::string cfg_edit_global_grid ("grid-micron"); std::string cfg_edit_combine_mode ("combine-mode"); diff --git a/src/edt/edt/edtConfig.h b/src/edt/edt/edtConfig.h index b4a6859ed..97964a9e0 100644 --- a/src/edt/edt/edtConfig.h +++ b/src/edt/edt/edtConfig.h @@ -70,6 +70,7 @@ extern EDT_PUBLIC std::string cfg_edit_inst_column_y; extern EDT_PUBLIC std::string cfg_edit_inst_place_origin; extern EDT_PUBLIC std::string cfg_edit_top_level_selection; extern EDT_PUBLIC std::string cfg_edit_pcell_show_parameter_names; +extern EDT_PUBLIC std::string cfg_edit_pcell_lazy_eval_mode; extern EDT_PUBLIC std::string cfg_edit_hier_copy_mode; extern EDT_PUBLIC std::string cfg_edit_combine_mode; diff --git a/src/edt/edt/edtPCellParametersPage.cc b/src/edt/edt/edtPCellParametersPage.cc index d68c0b319..9ff61cc0f 100644 --- a/src/edt/edt/edtPCellParametersPage.cc +++ b/src/edt/edt/edtPCellParametersPage.cc @@ -154,10 +154,11 @@ static void set_value (const db::PCellParameterDeclaration &p, QWidget *widget, } PCellParametersPage::PCellParametersPage (QWidget *parent, lay::Dispatcher *dispatcher, bool dense) - : QFrame (parent), mp_dispatcher (dispatcher), m_dense (dense), m_show_parameter_names (false), dm_parameter_changed (this, &PCellParametersPage::do_parameter_changed) + : QFrame (parent), mp_dispatcher (dispatcher), m_dense (dense), m_show_parameter_names (false), m_lazy_evaluation (-1), dm_parameter_changed (this, &PCellParametersPage::do_parameter_changed) { if (mp_dispatcher) { mp_dispatcher->config_get (cfg_edit_pcell_show_parameter_names, m_show_parameter_names); + mp_dispatcher->config_get (cfg_edit_pcell_lazy_eval_mode, m_lazy_evaluation); } init (); @@ -236,28 +237,99 @@ PCellParametersPage::init () error_frame_layout->setColumnStretch (2, 1); - QFrame *show_parameter_names_frame = new QFrame (this); - show_parameter_names_frame->setFrameShape (QFrame::NoFrame); - frame_layout->addWidget (show_parameter_names_frame, 3, 0, 1, 1); + QFrame *options_frame = new QFrame (this); + options_frame->setFrameShape (QFrame::NoFrame); + frame_layout->addWidget (options_frame, 3, 0, 1, 1); - QHBoxLayout *show_parameter_names_frame_layout = new QHBoxLayout (show_parameter_names_frame); - show_parameter_names_frame->setLayout (show_parameter_names_frame_layout); + QHBoxLayout *options_frame_layout = new QHBoxLayout (options_frame); + options_frame->setLayout (options_frame_layout); if (m_dense) { - show_parameter_names_frame_layout->setContentsMargins (4, 4, 4, 4); + options_frame_layout->setContentsMargins (4, 4, 4, 4); } - mp_show_parameter_names_cb = new QCheckBox (show_parameter_names_frame); - mp_show_parameter_names_cb->setText (tr ("Show parameter names")); - mp_show_parameter_names_cb->setChecked (m_show_parameter_names); - show_parameter_names_frame_layout->addWidget (mp_show_parameter_names_cb); + QToolButton *dot_menu_button = new QToolButton (options_frame); + dot_menu_button->setText (tr ("Options ")); + dot_menu_button->setAutoRaise (true); + dot_menu_button->setPopupMode (QToolButton::InstantPopup); + dot_menu_button->setToolButtonStyle (Qt::ToolButtonTextOnly); + options_frame_layout->addWidget (dot_menu_button); + options_frame_layout->addStretch (); - connect (mp_show_parameter_names_cb, SIGNAL (clicked (bool)), this, SLOT (show_parameter_names (bool))); + QMenu *dot_menu = new QMenu (dot_menu_button); + dot_menu_button->setMenu (dot_menu); + mp_show_parameter_names_action = new QAction (dot_menu); + dot_menu->addAction (mp_show_parameter_names_action); + mp_show_parameter_names_action->setText (tr ("Show parameter names")); + mp_show_parameter_names_action->setCheckable (true); + mp_show_parameter_names_action->setChecked (m_show_parameter_names); + connect (mp_show_parameter_names_action, SIGNAL (triggered (bool)), this, SLOT (show_parameter_names (bool))); + + QMenu *lazy_eval_menu = new QMenu (dot_menu); + lazy_eval_menu->setTitle (tr ("Lazy PCell evaluation")); + dot_menu->addMenu (lazy_eval_menu); + + mp_auto_lazy_eval_action = new QAction (lazy_eval_menu); + lazy_eval_menu->addAction (mp_auto_lazy_eval_action); + mp_auto_lazy_eval_action->setText (tr ("As requested by PCell")); + mp_auto_lazy_eval_action->setCheckable (true); + mp_auto_lazy_eval_action->setChecked (m_lazy_evaluation < 0); + connect (mp_auto_lazy_eval_action, SIGNAL (triggered ()), this, SLOT (lazy_eval_mode_slot ())); + + mp_always_lazy_eval_action = new QAction (lazy_eval_menu); + lazy_eval_menu->addAction (mp_always_lazy_eval_action); + mp_always_lazy_eval_action->setText (tr ("Always")); + mp_always_lazy_eval_action->setCheckable (true); + mp_always_lazy_eval_action->setChecked (m_lazy_evaluation > 0); + connect (mp_always_lazy_eval_action, SIGNAL (triggered ()), this, SLOT (lazy_eval_mode_slot ())); + + mp_never_lazy_eval_action = new QAction (lazy_eval_menu); + lazy_eval_menu->addAction (mp_never_lazy_eval_action); + mp_never_lazy_eval_action->setText (tr ("Never")); + mp_never_lazy_eval_action->setCheckable (true); + mp_never_lazy_eval_action->setChecked (m_lazy_evaluation == 0); + connect (mp_never_lazy_eval_action, SIGNAL (triggered ()), this, SLOT (lazy_eval_mode_slot ())); } bool PCellParametersPage::lazy_evaluation () { - return mp_pcell_decl.get () && mp_pcell_decl->wants_lazy_evaluation (); + if (m_lazy_evaluation < 0) { + return mp_pcell_decl.get () && mp_pcell_decl->wants_lazy_evaluation (); + } else { + return m_lazy_evaluation > 0; + } +} + +void +PCellParametersPage::lazy_eval_mode_slot () +{ + if (sender () == mp_always_lazy_eval_action) { + lazy_eval_mode (1); + } else if (sender () == mp_never_lazy_eval_action) { + lazy_eval_mode (0); + } else if (sender () == mp_auto_lazy_eval_action) { + lazy_eval_mode (-1); + } +} + +void +PCellParametersPage::lazy_eval_mode (int mode) +{ + if (mode == m_lazy_evaluation) { + return; + } + + mp_never_lazy_eval_action->setChecked (mode == 0); + mp_always_lazy_eval_action->setChecked (mode > 0); + mp_auto_lazy_eval_action->setChecked (mode < 0); + + m_lazy_evaluation = mode; + + if (mp_dispatcher) { + mp_dispatcher->config_set (cfg_edit_pcell_lazy_eval_mode, m_lazy_evaluation); + } + + setup (mp_view, m_cv_index, mp_pcell_decl.get (), get_parameters ()); } void @@ -268,7 +340,7 @@ PCellParametersPage::show_parameter_names (bool f) } m_show_parameter_names = f; - mp_show_parameter_names_cb->setChecked (f); + mp_show_parameter_names_action->setChecked (f); if (mp_dispatcher) { mp_dispatcher->config_set (cfg_edit_pcell_show_parameter_names, m_show_parameter_names); diff --git a/src/edt/edt/edtPCellParametersPage.h b/src/edt/edt/edtPCellParametersPage.h index a6c862452..1007a0163 100644 --- a/src/edt/edt/edtPCellParametersPage.h +++ b/src/edt/edt/edtPCellParametersPage.h @@ -144,10 +144,12 @@ signals: public slots: void show_parameter_names (bool f); + void lazy_eval_mode (int); private slots: void parameter_changed (); void update_button_pressed (); + void lazy_eval_mode_slot (); private: lay::Dispatcher *mp_dispatcher; @@ -160,7 +162,10 @@ private: QLabel *mp_changed_icon; QToolButton *mp_update_button; QFrame *mp_error_frame, *mp_update_frame; - QCheckBox *mp_show_parameter_names_cb; + QAction *mp_show_parameter_names_action; + QAction *mp_auto_lazy_eval_action; + QAction *mp_always_lazy_eval_action; + QAction *mp_never_lazy_eval_action; tl::weak_ptr mp_pcell_decl; std::vector m_widgets; std::vector m_icon_widgets; @@ -168,6 +173,7 @@ private: lay::LayoutViewBase *mp_view; int m_cv_index; bool m_dense, m_show_parameter_names; + int m_lazy_evaluation; tl::DeferredMethod dm_parameter_changed; db::ParameterStates m_current_states, m_initial_states; db::ParameterStates m_states; From 50ab16938529458e84ccc25f29b52a9d929ca4c4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 18 Feb 2025 23:41:20 +0100 Subject: [PATCH 06/29] Default for lazy eval mode is 'as requested by PCell' for backward compatibility --- src/edt/edt/edtPlugin.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/edt/edt/edtPlugin.cc b/src/edt/edt/edtPlugin.cc index 626e9ef08..422fa7b4a 100644 --- a/src/edt/edt/edtPlugin.cc +++ b/src/edt/edt/edtPlugin.cc @@ -142,6 +142,7 @@ void get_inst_options (std::vector < std::pair > &opti options.push_back (std::pair (cfg_edit_inst_column_y, "0.0")); options.push_back (std::pair (cfg_edit_inst_place_origin, "false")); options.push_back (std::pair (cfg_edit_pcell_show_parameter_names, "false")); + options.push_back (std::pair (cfg_edit_pcell_lazy_eval_mode, "-1")); options.push_back (std::pair (cfg_edit_max_shapes_of_instances, "1000")); options.push_back (std::pair (cfg_edit_show_shapes_of_instances, "true")); } From cb0b0baa4a286e472dbe3c94536af5aa9d93bd6d Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 22 Feb 2025 18:49:29 +0100 Subject: [PATCH 07/29] Switching to upload-artifact v4 as v3 is deprecated --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be3b7623e..5b6bfc894 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,7 @@ jobs: mv ./wheelhouse/.ccache $HOST_CCACHE_DIR ls -la $HOST_CCACHE_DIR ccache -s - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl @@ -90,7 +90,7 @@ jobs: - name: Build SDist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz From d21cba7321a07bbcd77ba347b27fe810f7917902 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:39:07 +0000 Subject: [PATCH 08/29] Bump pypa/cibuildwheel from 2.22.0 to 2.23.0 Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.22.0 to 2.23.0. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v2.22.0...v2.23.0) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de811ab93..96f3106dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: HOST_CCACHE_DIR="$(ccache -k cache_dir)" mkdir -p $HOST_CCACHE_DIR - name: Build wheels # check https://cibuildwheel.readthedocs.io/en/stable/setup/#github-actions - uses: pypa/cibuildwheel@v2.22.0 + uses: pypa/cibuildwheel@v2.23.0 # to supply options, put them in 'env', like: # env: # CIBW_SOME_OPTION: value From 08666aeb82c8454dcf98b51befc720e015042d75 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 2 Mar 2025 17:30:47 +0100 Subject: [PATCH 09/29] API implementation ... many, many new functions named 'split_...' --- src/db/db/dbAsIfFlatEdgePairs.cc | 32 ++- src/db/db/dbAsIfFlatEdgePairs.h | 1 + src/db/db/dbAsIfFlatEdges.cc | 17 ++ src/db/db/dbAsIfFlatEdges.h | 1 + src/db/db/dbAsIfFlatRegion.cc | 19 ++ src/db/db/dbAsIfFlatRegion.h | 1 + src/db/db/dbAsIfFlatTexts.cc | 17 ++ src/db/db/dbAsIfFlatTexts.h | 1 + src/db/db/dbDeepEdgePairs.cc | 65 ++++-- src/db/db/dbDeepEdgePairs.h | 3 +- src/db/db/dbDeepEdges.cc | 77 +++++-- src/db/db/dbDeepEdges.h | 3 +- src/db/db/dbDeepRegion.cc | 77 +++++-- src/db/db/dbDeepRegion.h | 4 +- src/db/db/dbDeepTexts.cc | 68 ++++-- src/db/db/dbDeepTexts.h | 3 +- src/db/db/dbEdgePairs.h | 12 + src/db/db/dbEdgePairsDelegate.h | 1 + src/db/db/dbEdges.h | 12 + src/db/db/dbEdgesDelegate.h | 1 + src/db/db/dbEmptyEdgePairs.h | 1 + src/db/db/dbEmptyEdges.h | 1 + src/db/db/dbEmptyRegion.h | 1 + src/db/db/dbEmptyTexts.h | 1 + src/db/db/dbRegion.h | 12 + src/db/db/dbRegionDelegate.h | 1 + src/db/db/dbTexts.h | 22 ++ src/db/db/dbTextsDelegate.h | 1 + src/db/db/gsiDeclDbEdgePairs.cc | 329 +++++++++++++++++++++++++--- src/db/db/gsiDeclDbEdges.cc | 113 +++++++++- src/db/db/gsiDeclDbRegion.cc | 363 +++++++++++++++++++++++++++---- src/db/db/gsiDeclDbTexts.cc | 44 ++++ 32 files changed, 1150 insertions(+), 154 deletions(-) diff --git a/src/db/db/dbAsIfFlatEdgePairs.cc b/src/db/db/dbAsIfFlatEdgePairs.cc index fc087ffa8..5a28a1ae9 100644 --- a/src/db/db/dbAsIfFlatEdgePairs.cc +++ b/src/db/db/dbAsIfFlatEdgePairs.cc @@ -226,6 +226,16 @@ AsIfFlatEdgePairs::processed_to_edges (const EdgePairToEdgeProcessorBase &filter return edges.release (); } +static void +insert_ep (FlatEdgePairs *dest, const db::EdgePair &ep, db::properties_id_type prop_id) +{ + if (prop_id != 0) { + dest->insert (db::EdgePairWithProperties (ep, prop_id)); + } else { + dest->insert (ep); + } +} + EdgePairsDelegate * AsIfFlatEdgePairs::filtered (const EdgePairFilterBase &filter) const { @@ -234,18 +244,28 @@ AsIfFlatEdgePairs::filtered (const EdgePairFilterBase &filter) const for (EdgePairsIterator p (begin ()); ! p.at_end (); ++p) { if (filter.selected (*p)) { - db::properties_id_type prop_id = pm (p.prop_id ()); - if (prop_id != 0) { - new_edge_pairs->insert (db::EdgePairWithProperties (*p, prop_id)); - } else { - new_edge_pairs->insert (*p); - } + insert_ep (new_edge_pairs.get (), *p, pm (p.prop_id ())); } } return new_edge_pairs.release (); } +std::pair +AsIfFlatEdgePairs::filtered_pair (const EdgePairFilterBase &filter) const +{ + std::unique_ptr new_edge_pairs_true (new FlatEdgePairs ()); + std::unique_ptr new_edge_pairs_false (new FlatEdgePairs ()); + db::PropertyMapper pm (new_edge_pairs_true->properties_repository (), properties_repository ()); + + for (EdgePairsIterator p (begin ()); ! p.at_end (); ++p) { + FlatEdgePairs *dest = filter.selected (*p) ? new_edge_pairs_true.get () : new_edge_pairs_false.get (); + insert_ep (dest, *p, pm (p.prop_id ())); + } + + return std::make_pair (new_edge_pairs_true.release (), new_edge_pairs_false.release ()); +} + RegionDelegate * AsIfFlatEdgePairs::pull_interacting (const Region &other) const { diff --git a/src/db/db/dbAsIfFlatEdgePairs.h b/src/db/db/dbAsIfFlatEdgePairs.h index 9a251dccb..c437fb79f 100644 --- a/src/db/db/dbAsIfFlatEdgePairs.h +++ b/src/db/db/dbAsIfFlatEdgePairs.h @@ -53,6 +53,7 @@ public: } virtual EdgePairsDelegate *filtered (const EdgePairFilterBase &) const; + virtual std::pair filtered_pair (const EdgePairFilterBase &filter) const; virtual EdgePairsDelegate *process_in_place (const EdgePairProcessorBase &proc) { diff --git a/src/db/db/dbAsIfFlatEdges.cc b/src/db/db/dbAsIfFlatEdges.cc index f9f3beb30..cc3fdeee8 100644 --- a/src/db/db/dbAsIfFlatEdges.cc +++ b/src/db/db/dbAsIfFlatEdges.cc @@ -717,6 +717,23 @@ AsIfFlatEdges::filtered (const EdgeFilterBase &filter) const return new_region.release (); } +std::pair +AsIfFlatEdges::filtered_pair (const EdgeFilterBase &filter) const +{ + std::unique_ptr new_region_true (new FlatEdges ()); + std::unique_ptr new_region_false (new FlatEdges ()); + + for (EdgesIterator p (begin_merged ()); ! p.at_end (); ++p) { + if (filter.selected (*p)) { + new_region_true->insert (*p); + } else { + new_region_false->insert (*p); + } + } + + return std::make_pair (new_region_true.release (), new_region_false.release ()); +} + EdgePairsDelegate * AsIfFlatEdges::run_check (db::edge_relation_type rel, const Edges *other, db::Coord d, const db::EdgesCheckOptions &options) const { diff --git a/src/db/db/dbAsIfFlatEdges.h b/src/db/db/dbAsIfFlatEdges.h index a0bb035ab..a1113e074 100644 --- a/src/db/db/dbAsIfFlatEdges.h +++ b/src/db/db/dbAsIfFlatEdges.h @@ -101,6 +101,7 @@ public: } virtual EdgesDelegate *filtered (const EdgeFilterBase &) const; + virtual std::pair filtered_pair (const EdgeFilterBase &filter) const; virtual EdgesDelegate *merged_in_place () { diff --git a/src/db/db/dbAsIfFlatRegion.cc b/src/db/db/dbAsIfFlatRegion.cc index 38f52cba2..b4d14617b 100644 --- a/src/db/db/dbAsIfFlatRegion.cc +++ b/src/db/db/dbAsIfFlatRegion.cc @@ -414,6 +414,25 @@ AsIfFlatRegion::filtered (const PolygonFilterBase &filter) const return new_region.release (); } +std::pair +AsIfFlatRegion::filtered_pair (const PolygonFilterBase &filter) const +{ + std::unique_ptr new_region_true (new FlatRegion ()); + std::unique_ptr new_region_false (new FlatRegion ()); + + for (RegionIterator p (begin_merged ()); ! p.at_end (); ++p) { + if (filter.selected (*p)) { + new_region_true->insert (*p); + } else { + new_region_true->insert (*p); + } + } + + new_region_true->set_is_merged (true); + new_region_false->set_is_merged (true); + return std::make_pair (new_region_true.release (), new_region_false.release ()); +} + RegionDelegate * AsIfFlatRegion::processed (const PolygonProcessorBase &filter) const { diff --git a/src/db/db/dbAsIfFlatRegion.h b/src/db/db/dbAsIfFlatRegion.h index b34b58299..51b182443 100644 --- a/src/db/db/dbAsIfFlatRegion.h +++ b/src/db/db/dbAsIfFlatRegion.h @@ -101,6 +101,7 @@ public: } virtual RegionDelegate *filtered (const PolygonFilterBase &filter) const; + virtual std::pair filtered_pair (const PolygonFilterBase &filter) const; virtual RegionDelegate *merged_in_place () { diff --git a/src/db/db/dbAsIfFlatTexts.cc b/src/db/db/dbAsIfFlatTexts.cc index c5498fd64..6576d0d5e 100644 --- a/src/db/db/dbAsIfFlatTexts.cc +++ b/src/db/db/dbAsIfFlatTexts.cc @@ -164,6 +164,23 @@ AsIfFlatTexts::filtered (const TextFilterBase &filter) const return new_texts.release (); } +std::pair +AsIfFlatTexts::filtered_pair (const TextFilterBase &filter) const +{ + std::unique_ptr new_texts_true (new FlatTexts ()); + std::unique_ptr new_texts_false (new FlatTexts ()); + + for (TextsIterator p (begin ()); ! p.at_end (); ++p) { + if (filter.selected (*p)) { + new_texts_true->insert (*p); + } else { + new_texts_false->insert (*p); + } + } + + return std::make_pair (new_texts_true.release (), new_texts_false.release ()); +} + TextsDelegate * AsIfFlatTexts::processed (const TextProcessorBase &filter) const { diff --git a/src/db/db/dbAsIfFlatTexts.h b/src/db/db/dbAsIfFlatTexts.h index 62046626b..79591cf33 100644 --- a/src/db/db/dbAsIfFlatTexts.h +++ b/src/db/db/dbAsIfFlatTexts.h @@ -54,6 +54,7 @@ public: } virtual TextsDelegate *filtered (const TextFilterBase &) const; + virtual std::pair filtered_pair (const TextFilterBase &filter) const; virtual TextsDelegate *process_in_place (const TextProcessorBase &proc) { diff --git a/src/db/db/dbDeepEdgePairs.cc b/src/db/db/dbDeepEdgePairs.cc index cf4f06923..444bc4743 100644 --- a/src/db/db/dbDeepEdgePairs.cc +++ b/src/db/db/dbDeepEdgePairs.cc @@ -375,18 +375,24 @@ EdgePairsDelegate * DeepEdgePairs::filter_in_place (const EdgePairFilterBase &filter) { // TODO: implement to be really in-place - *this = *apply_filter (filter); + *this = *apply_filter (filter, true, false).first; return this; } EdgePairsDelegate * DeepEdgePairs::filtered (const EdgePairFilterBase &filter) const { - return apply_filter (filter); + return apply_filter (filter, true, false).first; } -DeepEdgePairs * -DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const +std::pair +DeepEdgePairs::filtered_pair (const EdgePairFilterBase &filter) const +{ + return apply_filter (filter, true, true); +} + +std::pair +DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter, bool with_true, bool with_false) const { const db::DeepLayer &edge_pairs = deep_layer (); db::Layout &layout = const_cast (edge_pairs.layout ()); @@ -404,9 +410,10 @@ DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const } - std::map > to_commit; + std::map > to_commit_true, to_commit_false; - std::unique_ptr res (new db::DeepEdgePairs (edge_pairs.derived ())); + std::unique_ptr res_true (with_true ? new db::DeepEdgePairs (edge_pairs.derived ()) : 0); + std::unique_ptr res_false (with_false ? new db::DeepEdgePairs (edge_pairs.derived ()) : 0); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { const db::Shapes &s = c->shapes (edge_pairs.layer ()); @@ -416,18 +423,34 @@ DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const const std::set &vv = vars->variants (c->cell_index ()); for (auto v = vv.begin (); v != vv.end (); ++v) { - db::Shapes *st; + db::Shapes *st_true = 0, *st_false = 0; if (vv.size () == 1) { - st = & c->shapes (res->deep_layer ().layer ()); + if (with_true) { + st_true = & c->shapes (res_true->deep_layer ().layer ()); + } + if (with_false) { + st_false = & c->shapes (res_false->deep_layer ().layer ()); + } } else { - st = & to_commit [c->cell_index ()] [*v]; + if (with_true) { + st_true = & to_commit_true [c->cell_index ()] [*v]; + } + if (with_false) { + st_false = & to_commit_false [c->cell_index ()] [*v]; + } } const db::ICplxTrans &tr = *v; for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::EdgePairs); ! si.at_end (); ++si) { if (filter.selected (si->edge_pair ().transformed (tr))) { - st->insert (*si); + if (st_true) { + st_true->insert (*si); + } + } else { + if (st_false) { + st_false->insert (*si); + } } } @@ -435,11 +458,18 @@ DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const } else { - db::Shapes &st = c->shapes (res->deep_layer ().layer ()); + db::Shapes *st_true = with_true ? &c->shapes (res_true->deep_layer ().layer ()) : 0; + db::Shapes *st_false = with_false ? &c->shapes (res_false->deep_layer ().layer ()) : 0; for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::EdgePairs); ! si.at_end (); ++si) { if (filter.selected (si->edge_pair ())) { - st.insert (*si); + if (with_true) { + st_true->insert (*si); + } + } else { + if (with_false) { + st_false->insert (*si); + } } } @@ -447,11 +477,16 @@ DeepEdgePairs::apply_filter (const EdgePairFilterBase &filter) const } - if (! to_commit.empty () && vars.get ()) { - vars->commit_shapes (res->deep_layer ().layer (), to_commit); + if (! to_commit_true.empty () && vars.get ()) { + tl_assert (res_true.get () != 0); + vars->commit_shapes (res_true->deep_layer ().layer (), to_commit_true); + } + if (! to_commit_false.empty () && vars.get ()) { + tl_assert (res_false.get () != 0); + vars->commit_shapes (res_false->deep_layer ().layer (), to_commit_false); } - return res.release (); + return std::make_pair (res_true.release (), res_false.release ()); } EdgePairsDelegate *DeepEdgePairs::process_in_place (const EdgePairProcessorBase &filter) diff --git a/src/db/db/dbDeepEdgePairs.h b/src/db/db/dbDeepEdgePairs.h index 89a659cbf..8537d77c8 100644 --- a/src/db/db/dbDeepEdgePairs.h +++ b/src/db/db/dbDeepEdgePairs.h @@ -78,6 +78,7 @@ public: virtual EdgePairsDelegate *filter_in_place (const EdgePairFilterBase &filter); virtual EdgePairsDelegate *filtered (const EdgePairFilterBase &) const; + virtual std::pair filtered_pair (const EdgePairFilterBase &filter) const; virtual EdgePairsDelegate *process_in_place (const EdgePairProcessorBase &); virtual EdgePairsDelegate *processed (const EdgePairProcessorBase &) const; virtual RegionDelegate *processed_to_polygons (const EdgePairToPolygonProcessorBase &filter) const; @@ -117,7 +118,7 @@ private: void init (); EdgesDelegate *generic_edges (bool first, bool second) const; - DeepEdgePairs *apply_filter (const EdgePairFilterBase &filter) const; + std::pair apply_filter (const EdgePairFilterBase &filter, bool with_true, bool with_false) const; }; } diff --git a/src/db/db/dbDeepEdges.cc b/src/db/db/dbDeepEdges.cc index 8f1872b76..c2e86caaa 100644 --- a/src/db/db/dbDeepEdges.cc +++ b/src/db/db/dbDeepEdges.cc @@ -809,18 +809,24 @@ EdgesDelegate * DeepEdges::filter_in_place (const EdgeFilterBase &filter) { // TODO: implement to be really in-place - *this = *apply_filter (filter); + *this = *apply_filter (filter, true, false).first; return this; } EdgesDelegate * DeepEdges::filtered (const EdgeFilterBase &filter) const { - return apply_filter (filter); + return apply_filter (filter, true, false).first; } -DeepEdges * -DeepEdges::apply_filter (const EdgeFilterBase &filter) const +std::pair +DeepEdges::filtered_pair (const EdgeFilterBase &filter) const +{ + return apply_filter (filter, true, true); +} + +std::pair +DeepEdges::apply_filter (const EdgeFilterBase &filter, bool with_true, bool with_false) const { const db::DeepLayer &edges = filter.requires_raw_input () ? deep_layer () : merged_deep_layer (); db::Layout &layout = const_cast (edges.layout ()); @@ -838,9 +844,10 @@ DeepEdges::apply_filter (const EdgeFilterBase &filter) const } - std::map > to_commit; + std::map > to_commit_true, to_commit_false; - std::unique_ptr res (new db::DeepEdges (edges.derived ())); + std::unique_ptr res_true (with_true ? new db::DeepEdges (edges.derived ()) : 0); + std::unique_ptr res_false (with_false ? new db::DeepEdges (edges.derived ()) : 0); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { const db::Shapes &s = c->shapes (edges.layer ()); @@ -850,16 +857,34 @@ DeepEdges::apply_filter (const EdgeFilterBase &filter) const const std::set &vv = vars->variants (c->cell_index ()); for (auto v = vv.begin (); v != vv.end (); ++v) { - db::Shapes *st; + db::Shapes *st_true = 0, *st_false = 0; if (vv.size () == 1) { - st = & c->shapes (res->deep_layer ().layer ()); + if (with_true) { + st_true = & c->shapes (res_true->deep_layer ().layer ()); + } + if (with_false) { + st_false = & c->shapes (res_false->deep_layer ().layer ()); + } } else { - st = & to_commit [c->cell_index ()] [*v]; + if (with_true) { + st_true = & to_commit_true [c->cell_index ()] [*v]; + } + if (with_false) { + st_false = & to_commit_false [c->cell_index ()] [*v]; + } } + const db::ICplxTrans &tr = *v; + for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::Edges); ! si.at_end (); ++si) { - if (filter.selected (si->edge ().transformed (*v))) { - st->insert (*si); + if (filter.selected (si->edge ().transformed (tr))) { + if (st_true) { + st_true->insert (*si); + } + } else { + if (st_false) { + st_false->insert (*si); + } } } @@ -867,11 +892,18 @@ DeepEdges::apply_filter (const EdgeFilterBase &filter) const } else { - db::Shapes &st = c->shapes (res->deep_layer ().layer ()); + db::Shapes *st_true = with_true ? &c->shapes (res_true->deep_layer ().layer ()) : 0; + db::Shapes *st_false = with_false ? &c->shapes (res_false->deep_layer ().layer ()) : 0; for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::Edges); ! si.at_end (); ++si) { if (filter.selected (si->edge ())) { - st.insert (*si); + if (with_true) { + st_true->insert (*si); + } + } else { + if (with_false) { + st_false->insert (*si); + } } } @@ -879,14 +911,25 @@ DeepEdges::apply_filter (const EdgeFilterBase &filter) const } - if (! to_commit.empty () && vars.get ()) { - vars->commit_shapes (res->deep_layer ().layer (), to_commit); + if (! to_commit_true.empty () && vars.get ()) { + tl_assert (res_true.get () != 0); + vars->commit_shapes (res_true->deep_layer ().layer (), to_commit_true); + } + if (! to_commit_false.empty () && vars.get ()) { + tl_assert (res_false.get () != 0); + vars->commit_shapes (res_false->deep_layer ().layer (), to_commit_false); } if (! filter.requires_raw_input ()) { - res->set_is_merged (true); + if (res_true.get ()) { + res_true->set_is_merged (true); + } + if (res_false.get ()) { + res_false->set_is_merged (true); + } } - return res.release (); + + return std::make_pair (res_true.release (), res_false.release ()); } EdgesDelegate *DeepEdges::merged_in_place () diff --git a/src/db/db/dbDeepEdges.h b/src/db/db/dbDeepEdges.h index da104c0ec..3a1262732 100644 --- a/src/db/db/dbDeepEdges.h +++ b/src/db/db/dbDeepEdges.h @@ -127,6 +127,7 @@ public: virtual EdgesDelegate *filter_in_place (const EdgeFilterBase &filter); virtual EdgesDelegate *filtered (const EdgeFilterBase &) const; + virtual std::pair filtered_pair (const EdgeFilterBase &filter) const; virtual EdgesDelegate *process_in_place (const EdgeProcessorBase &); virtual EdgesDelegate *processed (const EdgeProcessorBase &) const; virtual EdgePairsDelegate *processed_to_edge_pairs (const EdgeToEdgePairProcessorBase &filter) const; @@ -199,7 +200,7 @@ private: virtual std::pair selected_interacting_pair_generic (const Region ®ion, EdgeInteractionMode mode, size_t min_count, size_t max_count) const; EdgesDelegate *selected_interacting_generic_impl (const DeepRegion *other_deep, EdgeInteractionMode mode, bool inverse, size_t min_count, size_t max_count) const; std::pair selected_interacting_pair_generic_impl (const DeepRegion *other_deep, EdgeInteractionMode mode, size_t min_count, size_t max_count) const; - DeepEdges *apply_filter (const EdgeFilterBase &filter) const; + std::pair apply_filter (const EdgeFilterBase &filter, bool with_true, bool with_false) const; template OutputContainer *processed_impl (const edge_processor &filter) const; }; diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index 03e278d26..9dac1d01e 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -1599,7 +1599,7 @@ DeepRegion::filter_in_place (const PolygonFilterBase &filter) } // TODO: implement to be really in-place - *this = *apply_filter (filter); + *this = *apply_filter (filter, true, false).first; return this; } @@ -1610,11 +1610,17 @@ DeepRegion::filtered (const PolygonFilterBase &filter) const return clone (); } - return apply_filter (filter); + return apply_filter (filter, true, false).first; } -DeepRegion * -DeepRegion::apply_filter (const PolygonFilterBase &filter) const +std::pair +DeepRegion::filtered_pair (const PolygonFilterBase &filter) const +{ + return apply_filter (filter, true, true); +} + +std::pair +DeepRegion::apply_filter (const PolygonFilterBase &filter, bool with_true, bool with_false) const { const db::DeepLayer &polygons = filter.requires_raw_input () ? deep_layer () : merged_deep_layer (); db::Layout &layout = const_cast (polygons.layout ()); @@ -1632,9 +1638,10 @@ DeepRegion::apply_filter (const PolygonFilterBase &filter) const } - std::map > to_commit; + std::map > to_commit_true, to_commit_false; - std::unique_ptr res (new db::DeepRegion (polygons.derived ())); + std::unique_ptr res_true (with_true ? new db::DeepRegion (polygons.derived ()) : 0); + std::unique_ptr res_false (with_false ? new db::DeepRegion (polygons.derived ()) : 0); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { const db::Shapes &s = c->shapes (polygons.layer ()); @@ -1644,18 +1651,36 @@ DeepRegion::apply_filter (const PolygonFilterBase &filter) const const std::set &vv = vars->variants (c->cell_index ()); for (auto v = vv.begin (); v != vv.end (); ++v) { - db::Shapes *st; + db::Shapes *st_true = 0, *st_false = 0; if (vv.size () == 1) { - st = & c->shapes (res->deep_layer ().layer ()); + if (with_true) { + st_true = & c->shapes (res_true->deep_layer ().layer ()); + } + if (with_false) { + st_false = & c->shapes (res_false->deep_layer ().layer ()); + } } else { - st = & to_commit [c->cell_index ()] [*v]; + if (with_true) { + st_true = & to_commit_true [c->cell_index ()] [*v]; + } + if (with_false) { + st_false = & to_commit_false [c->cell_index ()] [*v]; + } } + const db::ICplxTrans &tr = *v; + for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::All); ! si.at_end (); ++si) { db::Polygon poly; si->polygon (poly); - if (filter.selected (poly.transformed (*v))) { - st->insert (*si); + if (filter.selected (poly.transformed (tr))) { + if (st_true) { + st_true->insert (*si); + } + } else { + if (st_false) { + st_false->insert (*si); + } } } @@ -1663,13 +1688,20 @@ DeepRegion::apply_filter (const PolygonFilterBase &filter) const } else { - db::Shapes &st = c->shapes (res->deep_layer ().layer ()); + db::Shapes *st_true = with_true ? &c->shapes (res_true->deep_layer ().layer ()) : 0; + db::Shapes *st_false = with_false ? &c->shapes (res_false->deep_layer ().layer ()) : 0; for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::All); ! si.at_end (); ++si) { db::Polygon poly; si->polygon (poly); if (filter.selected (poly)) { - st.insert (*si); + if (with_true) { + st_true->insert (*si); + } + } else { + if (with_false) { + st_false->insert (*si); + } } } @@ -1677,14 +1709,25 @@ DeepRegion::apply_filter (const PolygonFilterBase &filter) const } - if (! to_commit.empty () && vars.get ()) { - vars->commit_shapes (res->deep_layer ().layer (), to_commit); + if (! to_commit_true.empty () && vars.get ()) { + tl_assert (res_true.get () != 0); + vars->commit_shapes (res_true->deep_layer ().layer (), to_commit_true); + } + if (! to_commit_false.empty () && vars.get ()) { + tl_assert (res_false.get () != 0); + vars->commit_shapes (res_false->deep_layer ().layer (), to_commit_false); } if (! filter.requires_raw_input ()) { - res->set_is_merged (true); + if (res_true.get ()) { + res_true->set_is_merged (true); + } + if (res_false.get ()) { + res_false->set_is_merged (true); + } } - return res.release (); + + return std::make_pair (res_true.release (), res_false.release ()); } RegionDelegate * diff --git a/src/db/db/dbDeepRegion.h b/src/db/db/dbDeepRegion.h index 6860fc472..b162168a4 100644 --- a/src/db/db/dbDeepRegion.h +++ b/src/db/db/dbDeepRegion.h @@ -127,6 +127,7 @@ public: virtual EdgePairsDelegate *processed_to_edge_pairs (const PolygonToEdgePairProcessorBase &filter) const; virtual RegionDelegate *filter_in_place (const PolygonFilterBase &filter); virtual RegionDelegate *filtered (const PolygonFilterBase &filter) const; + virtual std::pair filtered_pair (const PolygonFilterBase &filter) const; virtual RegionDelegate *merged_in_place (); virtual RegionDelegate *merged_in_place (bool min_coherence, unsigned int min_wc); @@ -183,8 +184,7 @@ private: DeepLayer not_with_impl (const DeepRegion *other, PropertyConstraint property_constraint) const; DeepLayer and_with_impl (const DeepRegion *other, PropertyConstraint property_constraint) const; std::pair and_and_not_with (const DeepRegion *other, PropertyConstraint property_constraint) const; - DeepRegion *apply_filter (const PolygonFilterBase &filter) const; - + std::pair apply_filter (const PolygonFilterBase &filter, bool with_true, bool with_false) const; template void configure_proc (Proc &proc) const { diff --git a/src/db/db/dbDeepTexts.cc b/src/db/db/dbDeepTexts.cc index 3d9df8ca4..8933f79c5 100644 --- a/src/db/db/dbDeepTexts.cc +++ b/src/db/db/dbDeepTexts.cc @@ -395,16 +395,23 @@ TextsDelegate *DeepTexts::add (const Texts &other) const TextsDelegate *DeepTexts::filter_in_place (const TextFilterBase &filter) { // TODO: implement as really in place - *this = *apply_filter (filter); + *this = *apply_filter (filter, true, false).first; return this; } TextsDelegate *DeepTexts::filtered (const TextFilterBase &filter) const { - return apply_filter (filter); + return apply_filter (filter, true, false).first; } -DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const +std::pair +DeepTexts::filtered_pair (const TextFilterBase &filter) const +{ + return apply_filter (filter, true, true); +} + +std::pair +DeepTexts::apply_filter (const TextFilterBase &filter, bool with_true, bool with_false) const { const db::DeepLayer &texts = deep_layer (); db::Layout &layout = const_cast (texts.layout ()); @@ -422,9 +429,10 @@ DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const } - std::map > to_commit; + std::map > to_commit_true, to_commit_false; - std::unique_ptr res (new db::DeepTexts (texts.derived ())); + std::unique_ptr res_true (with_true ? new db::DeepTexts (texts.derived ()) : 0); + std::unique_ptr res_false (with_false ? new db::DeepTexts (texts.derived ()) : 0); for (db::Layout::iterator c = layout.begin (); c != layout.end (); ++c) { const db::Shapes &s = c->shapes (texts.layer ()); @@ -434,18 +442,36 @@ DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const const std::set &vv = vars->variants (c->cell_index ()); for (auto v = vv.begin (); v != vv.end (); ++v) { - db::Shapes *st; + db::Shapes *st_true = 0, *st_false = 0; if (vv.size () == 1) { - st = & c->shapes (res->deep_layer ().layer ()); + if (with_true) { + st_true = & c->shapes (res_true->deep_layer ().layer ()); + } + if (with_false) { + st_false = & c->shapes (res_false->deep_layer ().layer ()); + } } else { - st = & to_commit [c->cell_index ()] [*v]; + if (with_true) { + st_true = & to_commit_true [c->cell_index ()] [*v]; + } + if (with_false) { + st_false = & to_commit_false [c->cell_index ()] [*v]; + } } + const db::ICplxTrans &tr = *v; + for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::Texts); ! si.at_end (); ++si) { db::Text text; si->text (text); - if (filter.selected (text.transformed (*v))) { - st->insert (*si); + if (filter.selected (text.transformed (tr))) { + if (st_true) { + st_true->insert (*si); + } + } else { + if (st_false) { + st_false->insert (*si); + } } } @@ -453,13 +479,20 @@ DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const } else { - db::Shapes &st = c->shapes (res->deep_layer ().layer ()); + db::Shapes *st_true = with_true ? &c->shapes (res_true->deep_layer ().layer ()) : 0; + db::Shapes *st_false = with_false ? &c->shapes (res_false->deep_layer ().layer ()) : 0; for (db::Shapes::shape_iterator si = s.begin (db::ShapeIterator::Texts); ! si.at_end (); ++si) { db::Text text; si->text (text); if (filter.selected (text)) { - st.insert (*si); + if (with_true) { + st_true->insert (*si); + } + } else { + if (with_false) { + st_false->insert (*si); + } } } @@ -467,11 +500,16 @@ DeepTexts *DeepTexts::apply_filter (const TextFilterBase &filter) const } - if (! to_commit.empty () && vars.get ()) { - vars->commit_shapes (res->deep_layer ().layer (), to_commit); + if (! to_commit_true.empty () && vars.get ()) { + tl_assert (res_true.get () != 0); + vars->commit_shapes (res_true->deep_layer ().layer (), to_commit_true); + } + if (! to_commit_false.empty () && vars.get ()) { + tl_assert (res_false.get () != 0); + vars->commit_shapes (res_false->deep_layer ().layer (), to_commit_false); } - return res.release (); + return std::make_pair (res_true.release (), res_false.release ()); } TextsDelegate *DeepTexts::process_in_place (const TextProcessorBase &filter) diff --git a/src/db/db/dbDeepTexts.h b/src/db/db/dbDeepTexts.h index 95d0d13e1..7c8e125ff 100644 --- a/src/db/db/dbDeepTexts.h +++ b/src/db/db/dbDeepTexts.h @@ -79,6 +79,7 @@ public: virtual TextsDelegate *filter_in_place (const TextFilterBase &filter); virtual TextsDelegate *filtered (const TextFilterBase &) const; + virtual std::pair filtered_pair (const TextFilterBase &filter) const; virtual TextsDelegate *process_in_place (const TextProcessorBase &); virtual TextsDelegate *processed (const TextProcessorBase &) const; @@ -107,7 +108,7 @@ private: DeepTexts &operator= (const DeepTexts &other); void init (); - DeepTexts *apply_filter (const TextFilterBase &filter) const; + std::pair apply_filter (const TextFilterBase &filter, bool with_true, bool with_false) const; virtual TextsDelegate *selected_interacting_generic (const Region &other, bool inverse) const; virtual RegionDelegate *pull_generic (const Region &other) const; diff --git a/src/db/db/dbEdgePairs.h b/src/db/db/dbEdgePairs.h index b1b451a58..36b8960f8 100644 --- a/src/db/db/dbEdgePairs.h +++ b/src/db/db/dbEdgePairs.h @@ -346,6 +346,18 @@ public: return EdgePairs (mp_delegate->filtered (filter)); } + /** + * @brief Returns the filtered edge pairs and the others + * + * This method will return a new edge pair collection with only those edge pairs which + * conform to the filter criterion and another for those which don't. + */ + std::pair split_filter (const EdgePairFilterBase &filter) const + { + std::pair p = mp_delegate->filtered_pair (filter); + return std::pair (EdgePairs (p.first), EdgePairs (p.second)); + } + /** * @brief Processes the edge pairs in-place * diff --git a/src/db/db/dbEdgePairsDelegate.h b/src/db/db/dbEdgePairsDelegate.h index eeb05ec19..419c61409 100644 --- a/src/db/db/dbEdgePairsDelegate.h +++ b/src/db/db/dbEdgePairsDelegate.h @@ -201,6 +201,7 @@ public: virtual EdgePairsDelegate *filter_in_place (const EdgePairFilterBase &filter) = 0; virtual EdgePairsDelegate *filtered (const EdgePairFilterBase &filter) const = 0; + virtual std::pair filtered_pair (const EdgePairFilterBase &filter) const = 0; virtual EdgePairsDelegate *process_in_place (const EdgePairProcessorBase &proc) = 0; virtual EdgePairsDelegate *processed (const EdgePairProcessorBase &proc) const = 0; virtual RegionDelegate *processed_to_polygons (const EdgePairToPolygonProcessorBase &proc) const = 0; diff --git a/src/db/db/dbEdges.h b/src/db/db/dbEdges.h index 649ded1c3..bb57ada29 100644 --- a/src/db/db/dbEdges.h +++ b/src/db/db/dbEdges.h @@ -468,6 +468,18 @@ public: return Edges (mp_delegate->filtered (filter)); } + /** + * @brief Returns the filtered edges and the others + * + * This method will return a new edge collection with only those edges which + * conform to the filter criterion and another for those which don't. + */ + std::pair split_filter (const EdgeFilterBase &filter) const + { + std::pair p = mp_delegate->filtered_pair (filter); + return std::pair (Edges (p.first), Edges (p.second)); + } + /** * @brief Processes the (merged) edges * diff --git a/src/db/db/dbEdgesDelegate.h b/src/db/db/dbEdgesDelegate.h index caeab6524..c0b971044 100644 --- a/src/db/db/dbEdgesDelegate.h +++ b/src/db/db/dbEdgesDelegate.h @@ -228,6 +228,7 @@ public: virtual EdgesDelegate *filter_in_place (const EdgeFilterBase &filter) = 0; virtual EdgesDelegate *filtered (const EdgeFilterBase &filter) const = 0; + virtual std::pair filtered_pair (const EdgeFilterBase &filter) const = 0; virtual EdgesDelegate *process_in_place (const EdgeProcessorBase &filter) = 0; virtual EdgesDelegate *processed (const EdgeProcessorBase &filter) const = 0; virtual EdgePairsDelegate *processed_to_edge_pairs (const EdgeToEdgePairProcessorBase &filter) const = 0; diff --git a/src/db/db/dbEmptyEdgePairs.h b/src/db/db/dbEmptyEdgePairs.h index f1f6b981a..6f01ddd92 100644 --- a/src/db/db/dbEmptyEdgePairs.h +++ b/src/db/db/dbEmptyEdgePairs.h @@ -56,6 +56,7 @@ public: virtual EdgePairsDelegate *filter_in_place (const EdgePairFilterBase &) { return this; } virtual EdgePairsDelegate *filtered (const EdgePairFilterBase &) const { return new EmptyEdgePairs (); } + virtual std::pair filtered_pair (const EdgePairFilterBase &) const { return std::make_pair (new EmptyEdgePairs (), new EmptyEdgePairs ()); } virtual EdgePairsDelegate *process_in_place (const EdgePairProcessorBase &) { return this; } virtual EdgePairsDelegate *processed (const EdgePairProcessorBase &) const { return new EmptyEdgePairs (); } virtual RegionDelegate *processed_to_polygons (const EdgePairToPolygonProcessorBase &filter) const; diff --git a/src/db/db/dbEmptyEdges.h b/src/db/db/dbEmptyEdges.h index 4514ea80d..13dfd39d3 100644 --- a/src/db/db/dbEmptyEdges.h +++ b/src/db/db/dbEmptyEdges.h @@ -66,6 +66,7 @@ public: virtual EdgesDelegate *filter_in_place (const EdgeFilterBase &) { return this; } virtual EdgesDelegate *filtered (const EdgeFilterBase &) const { return new EmptyEdges (); } + virtual std::pair filtered_pair (const EdgeFilterBase &) const { return std::make_pair (new EmptyEdges (), new EmptyEdges ()); } virtual EdgesDelegate *process_in_place (const EdgeProcessorBase &) { return this; } virtual EdgesDelegate *processed (const EdgeProcessorBase &) const { return new EmptyEdges (); } virtual EdgePairsDelegate *processed_to_edge_pairs (const EdgeToEdgePairProcessorBase &) const; diff --git a/src/db/db/dbEmptyRegion.h b/src/db/db/dbEmptyRegion.h index 46dc1397a..1016b6080 100644 --- a/src/db/db/dbEmptyRegion.h +++ b/src/db/db/dbEmptyRegion.h @@ -85,6 +85,7 @@ public: virtual EdgesDelegate *edges (const EdgeFilterBase *, const PolygonToEdgeProcessorBase *) const; virtual RegionDelegate *filter_in_place (const PolygonFilterBase &) { return this; } virtual RegionDelegate *filtered (const PolygonFilterBase &) const { return new EmptyRegion (); } + virtual std::pair filtered_pair (const PolygonFilterBase &) const { return std::make_pair (new EmptyRegion (), new EmptyRegion ()); } virtual RegionDelegate *process_in_place (const PolygonProcessorBase &) { return this; } virtual RegionDelegate *processed (const PolygonProcessorBase &) const { return new EmptyRegion (); } virtual EdgesDelegate *processed_to_edges (const PolygonToEdgeProcessorBase &) const; diff --git a/src/db/db/dbEmptyTexts.h b/src/db/db/dbEmptyTexts.h index ecc3f313a..934bf62c9 100644 --- a/src/db/db/dbEmptyTexts.h +++ b/src/db/db/dbEmptyTexts.h @@ -56,6 +56,7 @@ public: virtual TextsDelegate *filter_in_place (const TextFilterBase &) { return this; } virtual TextsDelegate *filtered (const TextFilterBase &) const { return new EmptyTexts (); } + virtual std::pair filtered_pair (const TextFilterBase &) const { return std::make_pair (new EmptyTexts (), new EmptyTexts ()); } virtual TextsDelegate *process_in_place (const TextProcessorBase &) { return this; } virtual TextsDelegate *processed (const TextProcessorBase &) const { return new EmptyTexts (); } diff --git a/src/db/db/dbRegion.h b/src/db/db/dbRegion.h index 26a908fe7..893931949 100644 --- a/src/db/db/dbRegion.h +++ b/src/db/db/dbRegion.h @@ -572,6 +572,18 @@ public: return Region (mp_delegate->filtered (filter)); } + /** + * @brief Returns the filtered polygons and the others + * + * This method will return a new region with only those polygons which + * conform to the filter criterion and another for those which don't. + */ + std::pair split_filter (const PolygonFilterBase &filter) const + { + std::pair p = mp_delegate->filtered_pair (filter); + return std::pair (Region (p.first), Region (p.second)); + } + /** * @brief Processes the (merged) polygons * diff --git a/src/db/db/dbRegionDelegate.h b/src/db/db/dbRegionDelegate.h index 70acd8810..0920cb0e9 100644 --- a/src/db/db/dbRegionDelegate.h +++ b/src/db/db/dbRegionDelegate.h @@ -214,6 +214,7 @@ public: virtual EdgesDelegate *edges (const EdgeFilterBase *filter, const db::PolygonToEdgeProcessorBase *proc) const = 0; virtual RegionDelegate *filter_in_place (const PolygonFilterBase &filter) = 0; virtual RegionDelegate *filtered (const PolygonFilterBase &filter) const = 0; + virtual std::pair filtered_pair (const PolygonFilterBase &filter) const = 0; virtual RegionDelegate *process_in_place (const PolygonProcessorBase &filter) = 0; virtual RegionDelegate *processed (const PolygonProcessorBase &filter) const = 0; virtual EdgesDelegate *processed_to_edges (const PolygonToEdgeProcessorBase &filter) const = 0; diff --git a/src/db/db/dbTexts.h b/src/db/db/dbTexts.h index 86b2a7e24..03594f1fd 100644 --- a/src/db/db/dbTexts.h +++ b/src/db/db/dbTexts.h @@ -213,6 +213,16 @@ public: return mp_delegate; } + /** + * @brief Takes the underlying delegate object + */ + TextsDelegate *take_delegate () + { + TextsDelegate *delegate = mp_delegate; + mp_delegate = 0; + return delegate; + } + /** * @brief Iterator of the text set * @@ -323,6 +333,18 @@ public: return Texts (mp_delegate->filtered (filter)); } + /** + * @brief Returns the filtered texts and the others + * + * This method will return a new text collection with only those texts which + * conform to the filter criterion and another for those which don't. + */ + std::pair split_filter (const TextFilterBase &filter) const + { + std::pair p = mp_delegate->filtered_pair (filter); + return std::pair (Texts (p.first), Texts (p.second)); + } + /** * @brief Processes the edge pairs in-place * diff --git a/src/db/db/dbTextsDelegate.h b/src/db/db/dbTextsDelegate.h index c22e6be67..ea6ca62f1 100644 --- a/src/db/db/dbTextsDelegate.h +++ b/src/db/db/dbTextsDelegate.h @@ -95,6 +95,7 @@ public: virtual TextsDelegate *filter_in_place (const TextFilterBase &filter) = 0; virtual TextsDelegate *filtered (const TextFilterBase &filter) const = 0; + virtual std::pair filtered_pair (const TextFilterBase &filter) const = 0; virtual TextsDelegate *process_in_place (const TextProcessorBase &proc) = 0; virtual TextsDelegate *processed (const TextProcessorBase &proc) const = 0; virtual RegionDelegate *processed_to_polygons (const TextToPolygonProcessorBase &proc) const = 0; diff --git a/src/db/db/gsiDeclDbEdgePairs.cc b/src/db/db/gsiDeclDbEdgePairs.cc index 99f289880..e17e89c48 100644 --- a/src/db/db/gsiDeclDbEdgePairs.cc +++ b/src/db/db/gsiDeclDbEdgePairs.cc @@ -409,6 +409,11 @@ static void filter (db::EdgePairs *r, const EdgePairFilterImpl *f) r->filter (*f); } +static std::vector split_filter (const db::EdgePairs *r, const EdgePairFilterImpl *f) +{ + return as_2edge_pairs_vector (r->split_filter (*f)); +} + static db::EdgePairs processed_epep (const db::EdgePairs *r, const shape_processor_impl *f) { return r->processed (*f); @@ -439,12 +444,24 @@ static db::EdgePairs with_distance1 (const db::EdgePairs *r, db::EdgePairs::dist return r->filtered (ef); } +static std::vector split_with_distance1 (const db::EdgePairs *r, db::EdgePairs::distance_type length) +{ + db::EdgePairFilterByDistance ef (length, length + 1, false); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_distance2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::EdgePairFilterByDistance ef (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); return r->filtered (ef); } +static std::vector split_with_distance2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max) +{ + db::EdgePairFilterByDistance ef (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_length1 (const db::EdgePairs *r, db::EdgePairs::distance_type length, bool inverse) { db::EdgeLengthFilter f (length, length + 1, inverse); @@ -452,6 +469,13 @@ static db::EdgePairs with_length1 (const db::EdgePairs *r, db::EdgePairs::distan return r->filtered (ef); } +static std::vector split_with_length1 (const db::EdgePairs *r, db::EdgePairs::distance_type length) +{ + db::EdgeLengthFilter f (length, length + 1, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_length2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); @@ -459,6 +483,13 @@ static db::EdgePairs with_length2 (const db::EdgePairs *r, const tl::Variant &mi return r->filtered (ef); } +static std::vector split_with_length2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max) +{ + db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_length_both1 (const db::EdgePairs *r, db::EdgePairs::distance_type length, bool inverse) { db::EdgeLengthFilter f (length, length + 1, inverse); @@ -466,6 +497,13 @@ static db::EdgePairs with_length_both1 (const db::EdgePairs *r, db::EdgePairs::d return r->filtered (ef); } +static std::vector split_with_length_both1 (const db::EdgePairs *r, db::EdgePairs::distance_type length) +{ + db::EdgeLengthFilter f (length, length + 1, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_length_both2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); @@ -473,6 +511,13 @@ static db::EdgePairs with_length_both2 (const db::EdgePairs *r, const tl::Varian return r->filtered (ef); } +static std::vector split_with_length_both2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max) +{ + db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_angle1 (const db::EdgePairs *r, double a, bool inverse) { db::EdgeOrientationFilter f (a, inverse, false); @@ -480,6 +525,13 @@ static db::EdgePairs with_angle1 (const db::EdgePairs *r, double a, bool inverse return r->filtered (ef); } +static std::vector split_with_angle1 (const db::EdgePairs *r, double a) +{ + db::EdgeOrientationFilter f (a, false, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_angle2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, false); @@ -487,6 +539,13 @@ static db::EdgePairs with_angle2 (const db::EdgePairs *r, double amin, double am return r->filtered (ef); } +static std::vector split_with_angle2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +{ + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_abs_angle1 (const db::EdgePairs *r, double a, bool inverse) { db::EdgeOrientationFilter f (a, inverse, true); @@ -494,6 +553,13 @@ static db::EdgePairs with_abs_angle1 (const db::EdgePairs *r, double a, bool inv return r->filtered (ef); } +static std::vector split_with_abs_angle1 (const db::EdgePairs *r, double a) +{ + db::EdgeOrientationFilter f (a, false, true); + db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_abs_angle2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, true); @@ -501,6 +567,13 @@ static db::EdgePairs with_abs_angle2 (const db::EdgePairs *r, double amin, doubl return r->filtered (ef); } +static std::vector split_with_abs_angle2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +{ + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, true); + db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_angle3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type, bool inverse) { db::SpecialEdgeOrientationFilter f (type, inverse); @@ -508,6 +581,13 @@ static db::EdgePairs with_angle3 (const db::EdgePairs *r, db::SpecialEdgeOrienta return r->filtered (ef); } +static std::vector split_with_angle3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type) +{ + db::SpecialEdgeOrientationFilter f (type, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_angle_both1 (const db::EdgePairs *r, double a, bool inverse) { db::EdgeOrientationFilter f (a, inverse, false); @@ -515,6 +595,13 @@ static db::EdgePairs with_angle_both1 (const db::EdgePairs *r, double a, bool in return r->filtered (ef); } +static std::vector split_with_angle_both1 (const db::EdgePairs *r, double a) +{ + db::EdgeOrientationFilter f (a, false, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, false); @@ -522,6 +609,13 @@ static db::EdgePairs with_angle_both2 (const db::EdgePairs *r, double amin, doub return r->filtered (ef); } +static std::vector split_with_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +{ + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_abs_angle_both1 (const db::EdgePairs *r, double a, bool inverse) { db::EdgeOrientationFilter f (a, inverse, true); @@ -529,6 +623,13 @@ static db::EdgePairs with_abs_angle_both1 (const db::EdgePairs *r, double a, boo return r->filtered (ef); } +static std::vector split_with_abs_angle_both1 (const db::EdgePairs *r, double a) +{ + db::EdgeOrientationFilter f (a, false, true); + db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_abs_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, true); @@ -536,6 +637,13 @@ static db::EdgePairs with_abs_angle_both2 (const db::EdgePairs *r, double amin, return r->filtered (ef); } +static std::vector split_with_abs_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +{ + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, true); + db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_angle_both3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type, bool inverse) { db::SpecialEdgeOrientationFilter f (type, inverse); @@ -543,30 +651,61 @@ static db::EdgePairs with_angle_both3 (const db::EdgePairs *r, db::SpecialEdgeOr return r->filtered (ef); } +static std::vector split_with_angle_both3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type) +{ + db::SpecialEdgeOrientationFilter f (type, false); + db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); + return as_2edge_pairs_vector (r->split_filter (ef)); +} + static db::EdgePairs with_internal_angle1 (const db::EdgePairs *r, double a, bool inverse) { db::InternalAngleEdgePairFilter f (a, inverse); return r->filtered (f); } +static std::vector split_with_internal_angle1 (const db::EdgePairs *r, double a) +{ + db::InternalAngleEdgePairFilter f (a, false); + return as_2edge_pairs_vector (r->split_filter (f)); +} + static db::EdgePairs with_internal_angle2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { db::InternalAngleEdgePairFilter f (amin, include_amin, amax, include_amax, inverse); return r->filtered (f); } +static std::vector split_with_internal_angle2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +{ + db::InternalAngleEdgePairFilter f (amin, include_amin, amax, include_amax, false); + return as_2edge_pairs_vector (r->split_filter (f)); +} + static db::EdgePairs with_area1 (const db::EdgePairs *r, db::EdgePair::area_type a, bool inverse) { db::EdgePairFilterByArea f (a, a + 1, inverse); return r->filtered (f); } +static std::vector split_with_area1 (const db::EdgePairs *r, db::EdgePair::area_type a) +{ + db::EdgePairFilterByArea f (a, a + 1, false); + return as_2edge_pairs_vector (r->split_filter (f)); +} + static db::EdgePairs with_area2 (const db::EdgePairs *r, db::EdgePair::area_type amin, db::EdgePair::area_type amax, bool inverse) { db::EdgePairFilterByArea f (amin, amax, inverse); return r->filtered (f); } +static std::vector split_with_area2 (const db::EdgePairs *r, db::EdgePair::area_type amin, db::EdgePair::area_type amax) +{ + db::EdgePairFilterByArea f (amin, amax, false); + return as_2edge_pairs_vector (r->split_filter (f)); +} + extern Class decl_dbShapeCollection; Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", @@ -911,12 +1050,18 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been introduced in version 0.29.\n" ) + - method_ext ("filtered", &filtered, gsi::arg ("filtered"), + method_ext ("filtered", &filtered, gsi::arg ("filter"), "@brief Applies a generic filter and returns a filtered copy\n" "See \\EdgePairFilter for a description of this feature.\n" "\n" "This method has been introduced in version 0.29.\n" ) + + method_ext ("split_filter", &split_filter, gsi::arg ("filter"), + "@brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones\n" + "See \\EdgePairFilter for a description of this feature.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("process", &process_epep, gsi::arg ("process"), "@brief Applies a generic edge pair processor in place (replacing the edge pairs from the EdgePairs collection)\n" "See \\EdgePairProcessor for a description of this feature.\n" @@ -959,6 +1104,18 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.1.\n" ) + + method_ext ("split_with_length", split_with_length1, gsi::arg ("length"), + "@brief Like \\with_length, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_length", split_with_length2, gsi::arg ("min_length"), gsi::arg ("max_length"), + "@brief Like \\with_length, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_length_both", with_length_both1, gsi::arg ("length"), gsi::arg ("inverse"), "@brief Filters the edge pairs by length of both of their edges\n" "Filters the edge pairs in the edge pair collection by length of both of their edges. If \"inverse\" is false, only " @@ -977,6 +1134,18 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.1.\n" ) + + method_ext ("split_with_length_both", split_with_length_both1, gsi::arg ("length"), + "@brief Like \\with_length_both, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_length_both", split_with_length_both2, gsi::arg ("min_length"), gsi::arg ("max_length"), + "@brief Like \\with_length_both, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_distance", with_distance1, gsi::arg ("distance"), gsi::arg ("inverse"), "@brief Filters the edge pairs by the distance of the edges\n" "Filters the edge pairs in the edge pair collection by distance of the edges. If \"inverse\" is false, only " @@ -997,6 +1166,18 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.1.\n" ) + + method_ext ("split_with_distance", split_with_distance1, gsi::arg ("distance"), + "@brief Like \\with_distance, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_distance", split_with_distance2, gsi::arg ("min_distance"), gsi::arg ("max_distance"), + "@brief Like \\with_distance, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_angle", with_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Filter the edge pairs by orientation of their edges\n" "Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only " @@ -1038,22 +1219,6 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.1.\n" ) + - method_ext ("with_abs_angle", with_abs_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), - "@brief Filter the edge pairs by orientation of their edges\n" - "\n" - "This method behaves like \\with_angle, but angles are always positive - i.e. there is no " - "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" - "\n" - "This method has been added in version 0.29.1.\n" - ) + - method_ext ("with_abs_angle", with_abs_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), - "@brief Filter the edge pairs by orientation of their edges\n" - "\n" - "This method behaves like \\with_angle, but angles are always positive - i.e. there is no " - "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" - "\n" - "This method has been added in version 0.29.1.\n" - ) + method_ext ("with_angle", with_angle3, gsi::arg ("type"), gsi::arg ("inverse"), "@brief Filter the edge pairs by orientation of their edges\n" "Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only " @@ -1073,6 +1238,52 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.28.\n" ) + + method_ext ("split_with_angle", split_with_angle1, gsi::arg ("angle"), + "@brief Like \\with_angle, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_angle", split_with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Like \\with_angle, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_angle", split_with_angle3, gsi::arg ("type"), + "@brief Like \\with_angle, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("with_abs_angle", with_abs_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), + "@brief Filter the edge pairs by orientation of their edges\n" + "\n" + "This method behaves like \\with_angle, but angles are always positive - i.e. there is no " + "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" + "\n" + "This method has been added in version 0.29.1.\n" + ) + + method_ext ("with_abs_angle", with_abs_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Filter the edge pairs by orientation of their edges\n" + "\n" + "This method behaves like \\with_angle, but angles are always positive - i.e. there is no " + "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" + "\n" + "This method has been added in version 0.29.1.\n" + ) + + method_ext ("split_with_abs_angle", split_with_abs_angle1, gsi::arg ("angle"), + "@brief Like \\with_abs_angle, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_abs_angle", split_with_abs_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Like \\with_abs_angle, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_angle_both", with_angle_both1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Filter the edge pairs by orientation of both of their edges\n" "Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only " @@ -1114,21 +1325,6 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.1.\n" ) + - method_ext ("with_abs_angle_both", with_abs_angle_both1, gsi::arg ("angle"), gsi::arg ("inverse"), - "@brief Filter the edge pairs by orientation of both of their edges\n" - "\n" - "This method behaves like \\with_angle_both, but angles are always positive - i.e. there is no " - "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" - "\n" - "This method has been added in version 0.29.1.\n" - ) + - method_ext ("with_abs_angle_both", with_abs_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), - "\n" - "This method behaves like \\with_angle_both, but angles are always positive - i.e. there is no " - "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" - "\n" - "This method has been added in version 0.29.1.\n" - ) + method_ext ("with_angle_both", with_angle_both3, gsi::arg ("type"), gsi::arg ("inverse"), "@brief Filter the edge pairs by orientation of their edges\n" "Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only " @@ -1148,6 +1344,51 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.28.\n" ) + + method_ext ("split_with_angle_both", split_with_angle_both1, gsi::arg ("angle"), + "@brief Like \\with_angle_both, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_angle_both", split_with_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Like \\with_angle_both, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_angle_both", split_with_angle_both3, gsi::arg ("type"), + "@brief Like \\with_angle_both, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("with_abs_angle_both", with_abs_angle_both1, gsi::arg ("angle"), gsi::arg ("inverse"), + "@brief Filter the edge pairs by orientation of both of their edges\n" + "\n" + "This method behaves like \\with_angle_both, but angles are always positive - i.e. there is no " + "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" + "\n" + "This method has been added in version 0.29.1.\n" + ) + + method_ext ("with_abs_angle_both", with_abs_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "\n" + "This method behaves like \\with_angle_both, but angles are always positive - i.e. there is no " + "differentiation between edges sloping 'down' vs. edges sloping 'up.\n" + "\n" + "This method has been added in version 0.29.1.\n" + ) + + method_ext ("split_with_abs_angle_both", split_with_abs_angle_both1, gsi::arg ("angle"), + "@brief Like \\with_abs_angle_both, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_abs_angle_both", split_with_abs_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Like \\with_abs_angle_both, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_area", with_area1, gsi::arg ("area"), gsi::arg ("inverse"), "@brief Filters the edge pairs by the enclosed area\n" "Filters the edge pairs in the edge pair collection by enclosed area. If \"inverse\" is false, only " @@ -1164,6 +1405,18 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.2.\n" ) + + method_ext ("split_with_area", split_with_area1, gsi::arg ("area"), + "@brief Like \\with_area, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_area", split_with_area2, gsi::arg ("min_area"), gsi::arg ("max_area"), + "@brief Like \\with_area, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_internal_angle", with_internal_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Filters the edge pairs by the angle between their edges\n" "Filters the edge pairs in the edge pair collection by the angle between their edges. If \"inverse\" is false, only " @@ -1187,6 +1440,18 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.2.\n" ) + + method_ext ("split_with_internal_angle", split_with_internal_angle1, gsi::arg ("angle"), + "@brief Like \\with_internal_angle, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_internal_angle", split_with_internal_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Like \\with_internal_angle, but returning two edge pair collections\n" + "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("polygons", &polygons1, "@brief Converts the edge pairs to polygons\n" "This method creates polygons from the edge pairs. Each polygon will be a triangle or quadrangle " diff --git a/src/db/db/gsiDeclDbEdges.cc b/src/db/db/gsiDeclDbEdges.cc index 76181040e..51722c2f9 100644 --- a/src/db/db/gsiDeclDbEdges.cc +++ b/src/db/db/gsiDeclDbEdges.cc @@ -399,6 +399,11 @@ static db::Edges filtered (const db::Edges *r, const EdgeFilterImpl *f) return r->filtered (*f); } +static std::vector split_filter (const db::Edges *r, const EdgeFilterImpl *f) +{ + return as_2edges_vector (r->split_filter (*f)); +} + static void filter (db::Edges *r, const EdgeFilterImpl *f) { r->filter (*f); @@ -432,42 +437,84 @@ static db::Edges with_length1 (const db::Edges *r, db::Edges::distance_type leng return r->filtered (f); } +static std::vector split_with_length1 (const db::Edges *r, db::Edges::distance_type length) +{ + db::EdgeLengthFilter f (length, length + 1, false); + return as_2edges_vector (r->split_filter (f)); +} + static db::Edges with_length2 (const db::Edges *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); return r->filtered (f); } +static std::vector split_with_length2 (const db::Edges *r, const tl::Variant &min, const tl::Variant &max) +{ + db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + return as_2edges_vector (r->split_filter (f)); +} + static db::Edges with_angle1 (const db::Edges *r, double a, bool inverse) { db::EdgeOrientationFilter f (a, inverse, false); return r->filtered (f); } +static std::vector split_with_angle1 (const db::Edges *r, double a) +{ + db::EdgeOrientationFilter f (a, false, false); + return as_2edges_vector (r->split_filter (f)); +} + static db::Edges with_angle2 (const db::Edges *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, false); return r->filtered (f); } +static std::vector split_with_angle2 (const db::Edges *r, double amin, double amax, bool include_amin, bool include_amax) +{ + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, false); + return as_2edges_vector (r->split_filter (f)); +} + static db::Edges with_abs_angle1 (const db::Edges *r, double a, bool inverse) { db::EdgeOrientationFilter f (a, inverse, true); return r->filtered (f); } +static std::vector split_with_abs_angle1 (const db::Edges *r, double a) +{ + db::EdgeOrientationFilter f (a, false, true); + return as_2edges_vector (r->split_filter (f)); +} + static db::Edges with_abs_angle2 (const db::Edges *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, true); return r->filtered (f); } +static std::vector split_with_abs_angle2 (const db::Edges *r, double amin, double amax, bool include_amin, bool include_amax) +{ + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, true); + return as_2edges_vector (r->split_filter (f)); +} + static db::Edges with_angle3 (const db::Edges *r, db::SpecialEdgeOrientationFilter::FilterType type, bool inverse) { db::SpecialEdgeOrientationFilter f (type, inverse); return r->filtered (f); } +static std::vector split_with_angle3 (const db::Edges *r, db::SpecialEdgeOrientationFilter::FilterType type) +{ + db::SpecialEdgeOrientationFilter f (type, false); + return as_2edges_vector (r->split_filter (f)); +} + static db::EdgePairs width2 (const db::Edges *r, db::Edges::coord_type d, bool whole_edges, db::metrics_type metrics, const tl::Variant &ignore_angle, const tl::Variant &min_projection, const tl::Variant &max_projection, db::zero_distance_mode zd_mode) { return r->width_check (d, db::EdgesCheckOptions (whole_edges, @@ -867,12 +914,18 @@ Class decl_Edges (decl_dbShapeCollection, "db", "Edges", "\n" "This method has been introduced in version 0.29.\n" ) + - method_ext ("filtered", &filtered, gsi::arg ("filtered"), + method_ext ("filtered", &filtered, gsi::arg ("filter"), "@brief Applies a generic filter and returns a filtered copy\n" "See \\EdgeFilter for a description of this feature.\n" "\n" "This method has been introduced in version 0.29.\n" ) + + method_ext ("split_filter", &split_filter, gsi::arg ("filter"), + "@brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones\n" + "See \\EdgeFilter for a description of this feature.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("process", &process_ee, gsi::arg ("process"), "@brief Applies a generic edge processor in place (replacing the edges from the Edges collection)\n" "See \\EdgeProcessor for a description of this feature.\n" @@ -913,6 +966,18 @@ Class decl_Edges (decl_dbShapeCollection, "db", "Edges", "\n" "If you don't want to specify a lower or upper limit, pass nil to that parameter.\n" ) + + method_ext ("split_with_length", split_with_length1, gsi::arg ("length"), + "@brief Like \\with_length, but returning two edge collections\n" + "The first edge collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_length", split_with_length2, gsi::arg ("min_length"), gsi::arg ("max_length"), + "@brief Like \\with_length, but returning two edge collections\n" + "The first edge collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_angle", with_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Filters the edges by orientation\n" "Filters the edges in the edge collection by orientation. If \"inverse\" is false, only " @@ -937,6 +1002,35 @@ Class decl_Edges (decl_dbShapeCollection, "db", "Edges", "\n" "The two \"include..\" arguments have been added in version 0.27.\n" ) + + method_ext ("with_angle", with_angle3, gsi::arg ("type"), gsi::arg ("inverse"), + "@brief Filters the edges by orientation type\n" + "Filters the edges in the edge collection by orientation. If \"inverse\" is false, only " + "edges which have an angle of the given type are returned. If \"inverse\" is true, " + "edges which do not conform to this criterion are returned.\n" + "\n" + "This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations " + "and are specified using one of the \\OrthoEdges, \\DiagonalEdges or \\OrthoDiagonalEdges types.\n" + "\n" + "This method has been added in version 0.28.\n" + ) + + method_ext ("split_with_angle", split_with_angle1, gsi::arg ("angle"), + "@brief Like \\with_angle, but returning two edge collections\n" + "The first edge collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_angle", split_with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Like \\with_angle, but returning two edge collections\n" + "The first edge collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_angle", split_with_angle3, gsi::arg ("type"), + "@brief Like \\with_angle, but returning two edge collections\n" + "The first edge collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_abs_angle", with_abs_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Filter the edges by orientation\n" "\n" @@ -953,16 +1047,17 @@ Class decl_Edges (decl_dbShapeCollection, "db", "Edges", "\n" "This method has been added in version 0.29.1.\n" ) + - method_ext ("with_angle", with_angle3, gsi::arg ("type"), gsi::arg ("inverse"), - "@brief Filters the edges by orientation type\n" - "Filters the edges in the edge collection by orientation. If \"inverse\" is false, only " - "edges which have an angle of the given type are returned. If \"inverse\" is true, " - "edges which do not conform to this criterion are returned.\n" + method_ext ("split_with_abs_angle", split_with_abs_angle1, gsi::arg ("angle"), + "@brief Like \\with_abs_angle, but returning two edge collections\n" + "The first edge collection will contain all matching shapes, the other the non-matching ones.\n" "\n" - "This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations " - "and are specified using one of the \\OrthoEdges, \\DiagonalEdges or \\OrthoDiagonalEdges types.\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_abs_angle", split_with_abs_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + "@brief Like \\with_abs_angle, but returning two edge collections\n" + "The first edge collection will contain all matching shapes, the other the non-matching ones.\n" "\n" - "This method has been added in version 0.28.\n" + "This method has been introduced in version 0.29.12.\n" ) + method ("insert", (void (db::Edges::*)(const db::Edge &)) &db::Edges::insert, gsi::arg ("edge"), "@brief Inserts an edge\n" diff --git a/src/db/db/gsiDeclDbRegion.cc b/src/db/db/gsiDeclDbRegion.cc index 9294f23d4..0775c78ec 100644 --- a/src/db/db/gsiDeclDbRegion.cc +++ b/src/db/db/gsiDeclDbRegion.cc @@ -513,6 +513,11 @@ static db::Region filtered (const db::Region *r, const PolygonFilterImpl *f) return r->filtered (*f); } +static std::vector split_filter (const db::Region *r, const PolygonFilterImpl *f) +{ + return as_2region_vector (r->split_filter (*f)); +} + static void filter (db::Region *r, const PolygonFilterImpl *f) { r->filter (*f); @@ -544,84 +549,240 @@ static db::Region with_perimeter1 (const db::Region *r, db::Region::perimeter_ty return r->filtered (f); } +static std::vector split_with_perimeter1 (const db::Region *r, db::Region::perimeter_type perimeter) +{ + db::RegionPerimeterFilter f (perimeter, perimeter + 1, false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_perimeter2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::RegionPerimeterFilter f (min.is_nil () ? db::Region::perimeter_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); return r->filtered (f); } +static std::vector split_with_perimeter2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max) +{ + db::RegionPerimeterFilter f (min.is_nil () ? db::Region::perimeter_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_area1 (const db::Region *r, db::Region::area_type area, bool inverse) { db::RegionAreaFilter f (area, area + 1, inverse); return r->filtered (f); } +static std::vector split_with_area1 (const db::Region *r, db::Region::area_type area) +{ + db::RegionAreaFilter f (area, area + 1, false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_area2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::RegionAreaFilter f (min.is_nil () ? db::Region::area_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); return r->filtered (f); } +static std::vector split_with_area2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max) +{ + db::RegionAreaFilter f (min.is_nil () ? db::Region::area_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_holes1 (const db::Region *r, size_t n, bool inverse) { db::HoleCountFilter f (n, n + 1, inverse); return r->filtered (f); } +static std::vector split_with_holes1 (const db::Region *r, size_t n) +{ + db::HoleCountFilter f (n, n + 1, false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_holes2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::HoleCountFilter f (min.is_nil () ? size_t (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); return r->filtered (f); } +static std::vector split_with_holes2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max) +{ + db::HoleCountFilter f (min.is_nil () ? size_t (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_width1 (const db::Region *r, db::Region::distance_type bbox_width, bool inverse) { db::RegionBBoxFilter f (bbox_width, bbox_width + 1, inverse, db::RegionBBoxFilter::BoxWidth); return r->filtered (f); } +static std::vector split_with_bbox_width1 (const db::Region *r, db::Region::distance_type bbox_width) +{ + db::RegionBBoxFilter f (bbox_width, bbox_width + 1, false, db::RegionBBoxFilter::BoxWidth); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_width2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse, db::RegionBBoxFilter::BoxWidth); return r->filtered (f); } +static std::vector split_with_bbox_width2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max) +{ + db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false, db::RegionBBoxFilter::BoxWidth); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_height1 (const db::Region *r, db::Region::distance_type bbox_height, bool inverse) { db::RegionBBoxFilter f (bbox_height, bbox_height + 1, inverse, db::RegionBBoxFilter::BoxHeight); return r->filtered (f); } +static std::vector split_with_bbox_height1 (const db::Region *r, db::Region::distance_type bbox_height) +{ + db::RegionBBoxFilter f (bbox_height, bbox_height + 1, false, db::RegionBBoxFilter::BoxHeight); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_height2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse, db::RegionBBoxFilter::BoxHeight); return r->filtered (f); } +static std::vector split_with_bbox_height2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max) +{ + db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false, db::RegionBBoxFilter::BoxHeight); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_min1 (const db::Region *r, db::Region::distance_type bbox_min, bool inverse) { db::RegionBBoxFilter f (bbox_min, bbox_min + 1, inverse, db::RegionBBoxFilter::BoxMinDim); return r->filtered (f); } +static std::vector split_with_bbox_min1 (const db::Region *r, db::Region::distance_type bbox_min) +{ + db::RegionBBoxFilter f (bbox_min, bbox_min + 1, false, db::RegionBBoxFilter::BoxMinDim); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_min2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse, db::RegionBBoxFilter::BoxMinDim); return r->filtered (f); } +static std::vector split_with_bbox_min2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max) +{ + db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false, db::RegionBBoxFilter::BoxMinDim); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_max1 (const db::Region *r, db::Region::distance_type bbox_max, bool inverse) { db::RegionBBoxFilter f (bbox_max, bbox_max + 1, inverse, db::RegionBBoxFilter::BoxMaxDim); return r->filtered (f); } +static std::vector split_with_bbox_max1 (const db::Region *r, db::Region::distance_type bbox_max) +{ + db::RegionBBoxFilter f (bbox_max, bbox_max + 1, false, db::RegionBBoxFilter::BoxMaxDim); + return as_2region_vector (r->split_filter (f)); +} + static db::Region with_bbox_max2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse, db::RegionBBoxFilter::BoxMaxDim); return r->filtered (f); } +static std::vector split_with_bbox_max2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max) +{ + db::RegionBBoxFilter f (min.is_nil () ? db::Region::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false, db::RegionBBoxFilter::BoxMaxDim); + return as_2region_vector (r->split_filter (f)); +} + +static db::Region with_bbox_aspect_ratio1 (const db::Region *r, double v, bool inverse) +{ + db::RegionRatioFilter f (v, true, v, true, inverse, db::RegionRatioFilter::AspectRatio); + return r->filtered (f); +} + +static std::vector split_with_bbox_aspect_ratio1 (const db::Region *r, double v) +{ + db::RegionRatioFilter f (v, true, v, true, false, db::RegionRatioFilter::AspectRatio); + return as_2region_vector (r->split_filter (f)); +} + +static db::Region with_bbox_aspect_ratio2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse, bool min_included, bool max_included) +{ + db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, inverse, db::RegionRatioFilter::AspectRatio); + return r->filtered (f); +} + +static std::vector split_with_bbox_aspect_ratio2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool min_included, bool max_included) +{ + db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, false, db::RegionRatioFilter::AspectRatio); + return as_2region_vector (r->split_filter (f)); +} + +static db::Region with_area_ratio1 (const db::Region *r, double v, bool inverse) +{ + db::RegionRatioFilter f (v, true, v, true, inverse, db::RegionRatioFilter::AreaRatio); + return r->filtered (f); +} + +static std::vector split_with_area_ratio1 (const db::Region *r, double v) +{ + db::RegionRatioFilter f (v, true, v, true, false, db::RegionRatioFilter::AreaRatio); + return as_2region_vector (r->split_filter (f)); +} + +static db::Region with_area_ratio2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse, bool min_included, bool max_included) +{ + db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, inverse, db::RegionRatioFilter::AreaRatio); + return r->filtered (f); +} + +static std::vector split_with_area_ratio2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool min_included, bool max_included) +{ + db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, false, db::RegionRatioFilter::AreaRatio); + return as_2region_vector (r->split_filter (f)); +} + +static db::Region with_relative_height1 (const db::Region *r, double v, bool inverse) +{ + db::RegionRatioFilter f (v, true, v, true, inverse, db::RegionRatioFilter::RelativeHeight); + return r->filtered (f); +} + +static std::vector split_with_relative_height1 (const db::Region *r, double v) +{ + db::RegionRatioFilter f (v, true, v, true, false, db::RegionRatioFilter::RelativeHeight); + return as_2region_vector (r->split_filter (f)); +} + +static db::Region with_relative_height2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse, bool min_included, bool max_included) +{ + db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, inverse, db::RegionRatioFilter::RelativeHeight); + return r->filtered (f); +} + +static std::vector split_with_relative_height2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool min_included, bool max_included) +{ + db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, false, db::RegionRatioFilter::RelativeHeight); + return as_2region_vector (r->split_filter (f)); +} + static db::EdgePairs angle_check1 (const db::Region *r, double angle, bool inverse) { return r->angle_check (angle, angle + 1e-4, inverse); @@ -632,42 +793,6 @@ static db::EdgePairs angle_check2 (const db::Region *r, double amin, double amax return r->angle_check (amin, amax, inverse); } -static db::Region with_bbox_aspect_ratio1 (const db::Region *r, double v, bool inverse) -{ - db::RegionRatioFilter f (v, true, v, true, inverse, db::RegionRatioFilter::AspectRatio); - return r->filtered (f); -} - -static db::Region with_bbox_aspect_ratio2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse, bool min_included, bool max_included) -{ - db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, inverse, db::RegionRatioFilter::AspectRatio); - return r->filtered (f); -} - -static db::Region with_area_ratio1 (const db::Region *r, double v, bool inverse) -{ - db::RegionRatioFilter f (v, true, v, true, inverse, db::RegionRatioFilter::AreaRatio); - return r->filtered (f); -} - -static db::Region with_area_ratio2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse, bool min_included, bool max_included) -{ - db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, inverse, db::RegionRatioFilter::AreaRatio); - return r->filtered (f); -} - -static db::Region with_relative_height1 (const db::Region *r, double v, bool inverse) -{ - db::RegionRatioFilter f (v, true, v, true, inverse, db::RegionRatioFilter::RelativeHeight); - return r->filtered (f); -} - -static db::Region with_relative_height2 (const db::Region *r, const tl::Variant &min, const tl::Variant &max, bool inverse, bool min_included, bool max_included) -{ - db::RegionRatioFilter f (min.is_nil () ? 0.0 : min.to (), min_included, max.is_nil () ? std::numeric_limits ::max () : max.to (), max_included, inverse, db::RegionRatioFilter::RelativeHeight); - return r->filtered (f); -} - static db::Region in (const db::Region *r, const db::Region &other) { return r->in (other, false); @@ -695,6 +820,12 @@ static db::Region non_rectangles (const db::Region *r) return r->filtered (f); } +static std::vector split_rectangles (const db::Region *r) +{ + db::RectangleFilter f (false, false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region squares (const db::Region *r) { db::RectangleFilter f (true, false); @@ -707,6 +838,12 @@ static db::Region non_squares (const db::Region *r) return r->filtered (f); } +static std::vector split_squares (const db::Region *r) +{ + db::RectangleFilter f (true, false); + return as_2region_vector (r->split_filter (f)); +} + static db::Region rectilinear (const db::Region *r) { db::RectilinearFilter f (false); @@ -719,6 +856,12 @@ static db::Region non_rectilinear (const db::Region *r) return r->filtered (f); } +static std::vector split_rectilinear (const db::Region *r) +{ + db::RectilinearFilter f (false); + return as_2region_vector (r->split_filter (f)); +} + static void break_polygons (db::Region *r, size_t max_vertex_count, double max_area_ratio) { r->process (db::PolygonBreaker (max_vertex_count, max_area_ratio)); @@ -1416,6 +1559,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_with_perimeter", split_with_perimeter1, gsi::arg ("perimeter"), + "@brief Like \\with_perimeter, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_perimeter", split_with_perimeter2, gsi::arg ("min_perimeter"), gsi::arg ("max_perimeter"), + "@brief Like \\with_perimeter, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_area", with_area1, gsi::arg ("area"), gsi::arg ("inverse"), "@brief Filter the polygons by area\n" "Filters the polygons of the region by area. If \"inverse\" is false, only " @@ -1436,6 +1591,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_with_area", split_with_area1, gsi::arg ("area"), + "@brief Like \\with_area, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_area", split_with_area2, gsi::arg ("min_area"), gsi::arg ("max_area"), + "@brief Like \\with_area, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_holes", with_holes1, gsi::arg ("nholes"), gsi::arg ("inverse"), "@brief Filters the polygons by their number of holes\n" "Filters the polygons of the region by number of holes. If \"inverse\" is false, only " @@ -1446,7 +1613,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.27.\n" ) + - method_ext ("with_holes", with_holes2, gsi::arg ("min_bholes"), gsi::arg ("max_nholes"), gsi::arg ("inverse"), + method_ext ("with_holes", with_holes2, gsi::arg ("min_nholes"), gsi::arg ("max_nholes"), gsi::arg ("inverse"), "@brief Filter the polygons by their number of holes\n" "Filters the polygons of the region by number of holes. If \"inverse\" is false, only " "polygons which have a hole count larger or equal to \"min_nholes\" and less than \"max_nholes\" are " @@ -1460,6 +1627,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.27.\n" ) + + method_ext ("split_with_holes", split_with_holes1, gsi::arg ("nholes"), + "@brief Like \\with_holes, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_holes", split_with_holes2, gsi::arg ("min_nholes"), gsi::arg ("max_nholes"), + "@brief Like \\with_holes, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_bbox_width", with_bbox_width1, gsi::arg ("width"), gsi::arg ("inverse"), "@brief Filter the polygons by bounding box width\n" "Filters the polygons of the region by the width of their bounding box. If \"inverse\" is false, only " @@ -1478,6 +1657,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_with_bbox_width", split_with_bbox_width1, gsi::arg ("width"), + "@brief Like \\with_bbox_width, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_bbox_width", split_with_bbox_width2, gsi::arg ("min_width"), gsi::arg ("max_width"), + "@brief Like \\with_bbox_width, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_bbox_height", with_bbox_height1, gsi::arg ("height"), gsi::arg ("inverse"), "@brief Filter the polygons by bounding box height\n" "Filters the polygons of the region by the height of their bounding box. If \"inverse\" is false, only " @@ -1496,6 +1687,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_with_bbox_height", split_with_bbox_height1, gsi::arg ("height"), + "@brief Like \\with_bbox_height, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_bbox_height", split_with_bbox_height2, gsi::arg ("min_height"), gsi::arg ("max_height"), + "@brief Like \\with_bbox_height, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_bbox_min", with_bbox_min1, gsi::arg ("dim"), gsi::arg ("inverse"), "@brief Filter the polygons by bounding box width or height, whichever is smaller\n" "Filters the polygons inside the region by the minimum dimension of their bounding box. " @@ -1516,6 +1719,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_with_bbox_min", split_with_bbox_min1, gsi::arg ("dim"), + "@brief Like \\with_bbox_min, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_bbox_min", split_with_bbox_min2, gsi::arg ("min_dim"), gsi::arg ("max_dim"), + "@brief Like \\with_bbox_min, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_bbox_max", with_bbox_max1, gsi::arg ("dim"), gsi::arg ("inverse"), "@brief Filter the polygons by bounding box width or height, whichever is larger\n" "Filters the polygons of the region by the maximum dimension of their bounding box. " @@ -1536,6 +1751,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_with_bbox_max", split_with_bbox_max1, gsi::arg ("dim"), + "@brief Like \\with_bbox_max, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_bbox_max", split_with_bbox_max2, gsi::arg ("min_dim"), gsi::arg ("max_dim"), + "@brief Like \\with_bbox_max, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_bbox_aspect_ratio", with_bbox_aspect_ratio1, gsi::arg ("ratio"), gsi::arg ("inverse"), "@brief Filters the polygons by the aspect ratio of their bounding boxes\n" "Filters the polygons of the region by the aspect ratio of their bounding boxes. " @@ -1565,6 +1792,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.27.\n" ) + + method_ext ("split_with_bbox_aspect_ratio", split_with_bbox_aspect_ratio1, gsi::arg ("ratio"), + "@brief Like \\with_bbox_aspect_ratio, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_bbox_aspect_ratio", split_with_bbox_aspect_ratio2, gsi::arg ("min_ratio"), gsi::arg ("max_ratio"), gsi::arg ("min_included", true), gsi::arg ("max_included", true), + "@brief Like \\with_bbox_aspect_ratio, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_area_ratio", with_area_ratio1, gsi::arg ("ratio"), gsi::arg ("inverse"), "@brief Filters the polygons by the bounding box area to polygon area ratio\n" "The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure " @@ -1594,6 +1833,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.27.\n" ) + + method_ext ("split_with_area_ratio", split_with_area_ratio1, gsi::arg ("ratio"), + "@brief Like \\with_area_ratio, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_area_ratio", split_with_area_ratio2, gsi::arg ("min_ratio"), gsi::arg ("max_ratio"), gsi::arg ("min_included", true), gsi::arg ("max_included", true), + "@brief Like \\with_area_ratio, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_relative_height", with_relative_height1, gsi::arg ("ratio"), gsi::arg ("inverse"), "@brief Filters the polygons by the ratio of height to width\n" "This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. " @@ -1625,6 +1876,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.27.\n" ) + + method_ext ("split_with_relative_height", split_with_relative_height1, gsi::arg ("ratio"), + "@brief Like \\with_relative_height, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + + method_ext ("split_with_relative_height", split_with_relative_height2, gsi::arg ("min_ratio"), gsi::arg ("max_ratio"), gsi::arg ("min_included", true), gsi::arg ("max_included", true), + "@brief Like \\with_relative_height, but returning two regions\n" + "The first region will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method ("strange_polygon_check", &db::Region::strange_polygon_check, "@brief Returns a region containing those parts of polygons which are \"strange\"\n" "Strange parts of polygons are self-overlapping parts or non-orientable parts (i.e. in the \"8\" configuration).\n" @@ -2849,12 +3112,18 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.29.\n" ) + - method_ext ("filtered", &filtered, gsi::arg ("filtered"), + method_ext ("filtered", &filtered, gsi::arg ("filter"), "@brief Applies a generic filter and returns a filtered copy\n" "See \\PolygonFilter for a description of this feature.\n" "\n" "This method has been introduced in version 0.29.\n" ) + + method_ext ("split_filter", &split_filter, gsi::arg ("filter"), + "@brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones\n" + "See \\PolygonFilter for a description of this feature.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("process", &process_pp, gsi::arg ("process"), "@brief Applies a generic polygon processor in place (replacing the polygons from the Region)\n" "See \\PolygonProcessor for a description of this feature.\n" @@ -2889,6 +3158,12 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This method returns all polygons in self which are not rectangles." "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_rectangles", &split_rectangles, + "@brief Combined results of \\rectangles and \\non_rectangles\n" + "This method returns a list with two Regions, the first is the result of \\rectangles, the second the result of \\non_rectangles. " + "Using this method is faster when you need both.\n\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("squares", &squares, "@brief Returns all polygons which are squares\n" "This method returns all polygons in self which are squares." @@ -2903,6 +3178,12 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method has been introduced in version 0.27.\n" ) + + method_ext ("split_squares", &split_squares, + "@brief Combined results of \\squares and \\non_squares\n" + "This method returns a list with two Regions, the first is the result of \\squares, the second the result of \\non_squares. " + "Using this method is faster when you need both.\n\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("rectilinear", &rectilinear, "@brief Returns all polygons which are rectilinear\n" "This method returns all polygons in self which are rectilinear." @@ -2913,6 +3194,12 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "This method returns all polygons in self which are not rectilinear." "Merged semantics applies for this method (see \\merged_semantics= for a description of this concept)\n" ) + + method_ext ("split_rectilinear", &split_rectilinear, + "@brief Combined results of \\rectilinear and \\non_rectilinear\n" + "This method returns a list with two Regions, the first is the result of \\rectilinear, the second the result of \\non_rectilinear. " + "Using this method is faster when you need both.\n\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("break_polygons|#break", &break_polygons, gsi::arg ("max_vertex_count"), gsi::arg ("max_area_ratio", 0.0), "@brief Breaks the polygons of the region into smaller ones\n" "\n" diff --git a/src/db/db/gsiDeclDbTexts.cc b/src/db/db/gsiDeclDbTexts.cc index 241e734c4..227a754c3 100644 --- a/src/db/db/gsiDeclDbTexts.cc +++ b/src/db/db/gsiDeclDbTexts.cc @@ -187,6 +187,15 @@ Class > decl_TextToPolygonP // --------------------------------------------------------------------------------- // Texts binding +static inline std::vector as_2texts_vector (const std::pair &rp) +{ + std::vector res; + res.reserve (2); + res.push_back (db::Texts (const_cast (rp.first).take_delegate ())); + res.push_back (db::Texts (const_cast (rp.second).take_delegate ())); + return res; +} + static db::Texts *new_v () { return new db::Texts (); @@ -316,6 +325,11 @@ static void filter (db::Texts *r, const TextFilterImpl *f) r->filter (*f); } +static std::vector split_filter (const db::Texts *r, const TextFilterImpl *f) +{ + return as_2texts_vector (r->split_filter (*f)); +} + static db::Texts processed_tt (const db::Texts *r, const shape_processor_impl *f) { return r->processed (*f); @@ -339,12 +353,24 @@ static db::Texts with_text (const db::Texts *r, const std::string &text, bool in return r->filtered (f); } +static std::vector split_with_text (const db::Texts *r, const std::string &text) +{ + db::TextStringFilter f (text, false); + return as_2texts_vector (r->split_filter (f)); +} + static db::Texts with_match (const db::Texts *r, const std::string &pattern, bool inverse) { db::TextPatternFilter f (pattern, inverse); return r->filtered (f); } +static std::vector split_with_match (const db::Texts *r, const std::string &pattern) +{ + db::TextPatternFilter f (pattern, false); + return as_2texts_vector (r->split_filter (f)); +} + static db::Region pull_interacting (const db::Texts *r, const db::Region &other) { db::Region out; @@ -600,6 +626,12 @@ Class decl_Texts (decl_dbShapeCollection, "db", "Texts", "\n" "This method has been introduced in version 0.29.\n" ) + + method_ext ("split_filter", &split_filter, gsi::arg ("filter"), + "@brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones\n" + "See \\TextFilter for a description of this feature.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("process", &process_tt, gsi::arg ("process"), "@brief Applies a generic text processor in place (replacing the texts from the text collection)\n" "See \\TextProcessor for a description of this feature.\n" @@ -623,12 +655,24 @@ Class decl_Texts (decl_dbShapeCollection, "db", "Texts", "If \"inverse\" is false, this method returns the texts with the given string.\n" "If \"inverse\" is true, this method returns the texts not having the given string.\n" ) + + method_ext ("split_with_text", split_with_text, gsi::arg ("text"), + "@brief Like \\with_text, but returning two text collections\n" + "The first text collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method_ext ("with_match", with_match, gsi::arg ("pattern"), gsi::arg ("inverse"), "@brief Filter the text by glob pattern\n" "\"pattern\" is a glob-style pattern (e.g. \"A*\" will select all texts starting with a capital \"A\").\n" "If \"inverse\" is false, this method returns the texts matching the pattern.\n" "If \"inverse\" is true, this method returns the texts not matching the pattern.\n" ) + + method_ext ("split_with_match", split_with_match, gsi::arg ("pattern"), + "@brief Like \\with_match, but returning two text collections\n" + "The first text collection will contain all matching shapes, the other the non-matching ones.\n" + "\n" + "This method has been introduced in version 0.29.12.\n" + ) + method ("interacting|&", (db::Texts (db::Texts::*) (const db::Region &) const) &db::Texts::selected_interacting, gsi::arg ("other"), "@brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region\n" "\n" From c6e7c47d6c2dff92af6601b15b03725c705de0cd Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 2 Mar 2025 18:30:31 +0100 Subject: [PATCH 10/29] Some bug fixes, updated tests --- src/db/db/dbAsIfFlatRegion.cc | 2 +- src/db/db/gsiDeclDbEdgePairs.cc | 98 ++++++++++++++++++-------------- testdata/ruby/dbEdgePairsTest.rb | 41 ++++++++++++- testdata/ruby/dbEdgesTest.rb | 12 ++++ testdata/ruby/dbRegionTest.rb | 52 +++++++++++++++++ testdata/ruby/dbTextsTest.rb | 6 ++ 6 files changed, 167 insertions(+), 44 deletions(-) diff --git a/src/db/db/dbAsIfFlatRegion.cc b/src/db/db/dbAsIfFlatRegion.cc index b4d14617b..7e9b2c9a1 100644 --- a/src/db/db/dbAsIfFlatRegion.cc +++ b/src/db/db/dbAsIfFlatRegion.cc @@ -424,7 +424,7 @@ AsIfFlatRegion::filtered_pair (const PolygonFilterBase &filter) const if (filter.selected (*p)) { new_region_true->insert (*p); } else { - new_region_true->insert (*p); + new_region_false->insert (*p); } } diff --git a/src/db/db/gsiDeclDbEdgePairs.cc b/src/db/db/gsiDeclDbEdgePairs.cc index e17e89c48..087031191 100644 --- a/src/db/db/gsiDeclDbEdgePairs.cc +++ b/src/db/db/gsiDeclDbEdgePairs.cc @@ -469,9 +469,9 @@ static db::EdgePairs with_length1 (const db::EdgePairs *r, db::EdgePairs::distan return r->filtered (ef); } -static std::vector split_with_length1 (const db::EdgePairs *r, db::EdgePairs::distance_type length) +static std::vector split_with_length1 (const db::EdgePairs *r, db::EdgePairs::distance_type length, bool inverse) { - db::EdgeLengthFilter f (length, length + 1, false); + db::EdgeLengthFilter f (length, length + 1, inverse); db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -483,9 +483,9 @@ static db::EdgePairs with_length2 (const db::EdgePairs *r, const tl::Variant &mi return r->filtered (ef); } -static std::vector split_with_length2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max) +static std::vector split_with_length2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { - db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -497,9 +497,9 @@ static db::EdgePairs with_length_both1 (const db::EdgePairs *r, db::EdgePairs::d return r->filtered (ef); } -static std::vector split_with_length_both1 (const db::EdgePairs *r, db::EdgePairs::distance_type length) +static std::vector split_with_length_both1 (const db::EdgePairs *r, db::EdgePairs::distance_type length, bool inverse) { - db::EdgeLengthFilter f (length, length + 1, false); + db::EdgeLengthFilter f (length, length + 1, inverse); db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -511,9 +511,9 @@ static db::EdgePairs with_length_both2 (const db::EdgePairs *r, const tl::Varian return r->filtered (ef); } -static std::vector split_with_length_both2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max) +static std::vector split_with_length_both2 (const db::EdgePairs *r, const tl::Variant &min, const tl::Variant &max, bool inverse) { - db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), false); + db::EdgeLengthFilter f (min.is_nil () ? db::Edges::distance_type (0) : min.to (), max.is_nil () ? std::numeric_limits ::max () : max.to (), inverse); db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -525,9 +525,9 @@ static db::EdgePairs with_angle1 (const db::EdgePairs *r, double a, bool inverse return r->filtered (ef); } -static std::vector split_with_angle1 (const db::EdgePairs *r, double a) +static std::vector split_with_angle1 (const db::EdgePairs *r, double a, bool inverse) { - db::EdgeOrientationFilter f (a, false, false); + db::EdgeOrientationFilter f (a, inverse, false); db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -539,9 +539,9 @@ static db::EdgePairs with_angle2 (const db::EdgePairs *r, double amin, double am return r->filtered (ef); } -static std::vector split_with_angle2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +static std::vector split_with_angle2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { - db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, false); + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, false); db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -553,9 +553,9 @@ static db::EdgePairs with_abs_angle1 (const db::EdgePairs *r, double a, bool inv return r->filtered (ef); } -static std::vector split_with_abs_angle1 (const db::EdgePairs *r, double a) +static std::vector split_with_abs_angle1 (const db::EdgePairs *r, double a, bool inverse) { - db::EdgeOrientationFilter f (a, false, true); + db::EdgeOrientationFilter f (a, inverse, true); db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -567,9 +567,9 @@ static db::EdgePairs with_abs_angle2 (const db::EdgePairs *r, double amin, doubl return r->filtered (ef); } -static std::vector split_with_abs_angle2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +static std::vector split_with_abs_angle2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { - db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, true); + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, true); db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -581,9 +581,9 @@ static db::EdgePairs with_angle3 (const db::EdgePairs *r, db::SpecialEdgeOrienta return r->filtered (ef); } -static std::vector split_with_angle3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type) +static std::vector split_with_angle3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type, bool inverse) { - db::SpecialEdgeOrientationFilter f (type, false); + db::SpecialEdgeOrientationFilter f (type, inverse); db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -595,9 +595,9 @@ static db::EdgePairs with_angle_both1 (const db::EdgePairs *r, double a, bool in return r->filtered (ef); } -static std::vector split_with_angle_both1 (const db::EdgePairs *r, double a) +static std::vector split_with_angle_both1 (const db::EdgePairs *r, double a, bool inverse) { - db::EdgeOrientationFilter f (a, false, false); + db::EdgeOrientationFilter f (a, inverse, false); db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -609,9 +609,9 @@ static db::EdgePairs with_angle_both2 (const db::EdgePairs *r, double amin, doub return r->filtered (ef); } -static std::vector split_with_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +static std::vector split_with_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { - db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, false); + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, false); db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -623,9 +623,9 @@ static db::EdgePairs with_abs_angle_both1 (const db::EdgePairs *r, double a, boo return r->filtered (ef); } -static std::vector split_with_abs_angle_both1 (const db::EdgePairs *r, double a) +static std::vector split_with_abs_angle_both1 (const db::EdgePairs *r, double a, bool inverse) { - db::EdgeOrientationFilter f (a, false, true); + db::EdgeOrientationFilter f (a, inverse, true); db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -637,9 +637,9 @@ static db::EdgePairs with_abs_angle_both2 (const db::EdgePairs *r, double amin, return r->filtered (ef); } -static std::vector split_with_abs_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool include_amin, bool include_amax) +static std::vector split_with_abs_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax) { - db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, false, true); + db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, true); db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -651,9 +651,9 @@ static db::EdgePairs with_angle_both3 (const db::EdgePairs *r, db::SpecialEdgeOr return r->filtered (ef); } -static std::vector split_with_angle_both3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type) +static std::vector split_with_angle_both3 (const db::EdgePairs *r, db::SpecialEdgeOrientationFilter::FilterType type, bool inverse) { - db::SpecialEdgeOrientationFilter f (type, false); + db::SpecialEdgeOrientationFilter f (type, inverse); db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/); return as_2edge_pairs_vector (r->split_filter (ef)); } @@ -1104,15 +1104,17 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.1.\n" ) + - method_ext ("split_with_length", split_with_length1, gsi::arg ("length"), + method_ext ("split_with_length", split_with_length1, gsi::arg ("length"), gsi::arg ("inverse"), "@brief Like \\with_length, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_length", split_with_length2, gsi::arg ("min_length"), gsi::arg ("max_length"), + method_ext ("split_with_length", split_with_length2, gsi::arg ("min_length"), gsi::arg ("max_length"), gsi::arg ("inverse"), "@brief Like \\with_length, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + @@ -1134,15 +1136,17 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.27.1.\n" ) + - method_ext ("split_with_length_both", split_with_length_both1, gsi::arg ("length"), + method_ext ("split_with_length_both", split_with_length_both1, gsi::arg ("length"), gsi::arg ("inverse"), "@brief Like \\with_length_both, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_length_both", split_with_length_both2, gsi::arg ("min_length"), gsi::arg ("max_length"), + method_ext ("split_with_length_both", split_with_length_both2, gsi::arg ("min_length"), gsi::arg ("max_length"), gsi::arg ("inverse"), "@brief Like \\with_length_both, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + @@ -1238,21 +1242,24 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.28.\n" ) + - method_ext ("split_with_angle", split_with_angle1, gsi::arg ("angle"), + method_ext ("split_with_angle", split_with_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Like \\with_angle, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_angle", split_with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + method_ext ("split_with_angle", split_with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), "@brief Like \\with_angle, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_angle", split_with_angle3, gsi::arg ("type"), + method_ext ("split_with_angle", split_with_angle3, gsi::arg ("type"), gsi::arg ("inverse"), "@brief Like \\with_angle, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + @@ -1272,15 +1279,17 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.29.1.\n" ) + - method_ext ("split_with_abs_angle", split_with_abs_angle1, gsi::arg ("angle"), + method_ext ("split_with_abs_angle", split_with_abs_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Like \\with_abs_angle, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_abs_angle", split_with_abs_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + method_ext ("split_with_abs_angle", split_with_abs_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), "@brief Like \\with_abs_angle, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + @@ -1344,21 +1353,24 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.28.\n" ) + - method_ext ("split_with_angle_both", split_with_angle_both1, gsi::arg ("angle"), + method_ext ("split_with_angle_both", split_with_angle_both1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Like \\with_angle_both, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_angle_both", split_with_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + method_ext ("split_with_angle_both", split_with_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), "@brief Like \\with_angle_both, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_angle_both", split_with_angle_both3, gsi::arg ("type"), + method_ext ("split_with_angle_both", split_with_angle_both3, gsi::arg ("type"), gsi::arg ("inverse"), "@brief Like \\with_angle_both, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + @@ -1377,15 +1389,17 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs", "\n" "This method has been added in version 0.29.1.\n" ) + - method_ext ("split_with_abs_angle_both", split_with_abs_angle_both1, gsi::arg ("angle"), + method_ext ("split_with_abs_angle_both", split_with_abs_angle_both1, gsi::arg ("angle"), gsi::arg ("inverse"), "@brief Like \\with_abs_angle_both, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + - method_ext ("split_with_abs_angle_both", split_with_abs_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), + method_ext ("split_with_abs_angle_both", split_with_abs_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), "@brief Like \\with_abs_angle_both, but returning two edge pair collections\n" "The first edge pair collection will contain all matching shapes, the other the non-matching ones.\n" + "Note that 'inverse' controls the way each edge is checked, not overall.\n" "\n" "This method has been introduced in version 0.29.12.\n" ) + diff --git a/testdata/ruby/dbEdgePairsTest.rb b/testdata/ruby/dbEdgePairsTest.rb index 0c46601c7..3afa3458f 100644 --- a/testdata/ruby/dbEdgePairsTest.rb +++ b/testdata/ruby/dbEdgePairsTest.rb @@ -294,53 +294,90 @@ class DBEdgePairs_TestClass < TestBase ep4 = RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 10), RBA::Edge::new(10, 0, 10, 10)) r1 = RBA::EdgePairs::new([ ep1, ep2, ep3, ep4 ]) - assert_equal(r1.with_angle(0, 90, false).to_s, "") # @@@ + assert_equal(r1.with_angle(0, 90, false).to_s, "") assert_equal(r1.with_distance(10, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_distance(10)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_distance(5, 20, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_distance(5, 20)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_distance(15, 20, false).to_s, "") + assert_equal(r1.split_with_distance(15, 20)[0].to_s, "") assert_equal(r1.with_distance(15, 20, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_distance(15, 20)[1].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_length(10, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_length(10, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_length(10, 20, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_length(10, 20, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_length(10, 21, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_length(10, 21, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_length(10, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0)") + assert_equal(r1.split_with_length(10, false)[1].to_s, "(0,0;0,20)/(10,20;10,0)") assert_equal(r1.with_length_both(10, false).to_s, "(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_length_both(10, false)[0].to_s, "(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_length_both(10, 20, false).to_s, "(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_length_both(10, 20, false)[0].to_s, "(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_length_both(10, 21, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_length_both(10, 21, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_length_both(10, true).to_s, "(0,0;0,20)/(10,20;10,0)") + assert_equal(r1.split_with_length_both(10, false)[1].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0)") assert_equal(r1.with_angle(0, false).to_s, "") + assert_equal(r1.split_with_angle(0, false)[0].to_s, "") assert_equal(r1.with_abs_angle(0, false).to_s, "") + assert_equal(r1.split_with_abs_angle(0, false)[0].to_s, "") assert_equal(r1.with_angle(0, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_angle(0, false)[1].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_abs_angle(0, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_abs_angle(0, false)[1].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_angle(90, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_angle(90, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_abs_angle(90, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_abs_angle(90, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_angle(0, 90, false).to_s, "") + assert_equal(r1.split_with_angle(0, 90, false)[0].to_s, "") assert_equal(r1.with_abs_angle(0, 90, false).to_s, "") + assert_equal(r1.split_with_abs_angle(0, 90, false)[0].to_s, "") assert_equal(r1.with_angle(0, 90, false, true, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_angle(0, 90, false, true, true)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_abs_angle(0, 90, false, true, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_abs_angle(0, 90, false, true, true)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_angle_both(0, false).to_s, "") + assert_equal(r1.split_with_angle_both(0, false)[0].to_s, "") assert_equal(r1.with_abs_angle_both(0, false).to_s, "") + assert_equal(r1.split_with_abs_angle_both(0, false)[0].to_s, "") assert_equal(r1.with_angle_both(0, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_angle_both(0, false)[1].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_abs_angle_both(0, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_abs_angle_both(0, false)[1].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_angle_both(90, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_angle_both(90, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_abs_angle_both(90, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_abs_angle_both(90, false)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_angle_both(0, 90, false).to_s, "") assert_equal(r1.with_abs_angle_both(0, 90, false).to_s, "") assert_equal(r1.with_angle_both(0, 90, false, true, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_abs_angle_both(0, 90, false, true, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_area(0, false).to_s, "(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_area(0)[0].to_s, "(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_area(150, false).to_s, "(0,0;0,10)/(10,20;10,0)") + assert_equal(r1.split_with_area(150)[0].to_s, "(0,0;0,10)/(10,20;10,0)") assert_equal(r1.with_area(0, true).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0)") + assert_equal(r1.split_with_area(0)[1].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0)") assert_equal(r1.with_area(150, 151, false).to_s, "(0,0;0,10)/(10,20;10,0)") + assert_equal(r1.split_with_area(150, 151)[0].to_s, "(0,0;0,10)/(10,20;10,0)") assert_equal(r1.with_area(150, 150, false).to_s, "") + assert_equal(r1.split_with_area(150, 150)[0].to_s, "") assert_equal(r1.with_area(150, 151, true).to_s, "(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_area(150, 151)[1].to_s, "(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_internal_angle(0, false).to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") + assert_equal(r1.split_with_internal_angle(0)[0].to_s, "(0,0;0,10)/(10,20;10,0);(0,0;0,10)/(10,0;10,20);(0,0;0,20)/(10,20;10,0);(0,0;0,10)/(10,0;10,10)") assert_equal(r1.with_internal_angle(0, 0, false).to_s, "") + assert_equal(r1.split_with_internal_angle(0, 0)[0].to_s, "") assert_equal(r1.with_internal_angle(0, true).to_s, "") + assert_equal(r1.split_with_internal_angle(0)[1].to_s, "") ep1 = RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 10), RBA::Edge::new(10, 20, 10, 0)) ep2 = RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 10), RBA::Edge::new(20, 0, 30, 0)) @@ -419,6 +456,8 @@ class DBEdgePairs_TestClass < TestBase edge_pairs.insert(RBA::EdgePair::new([200, 0, 300, 0], [200, 100, 220, 300 ])) assert_equal(edge_pairs.filtered(f).to_s, "(0,0;100,0)/(0,100;0,300)") + assert_equal(edge_pairs.split_filter(f)[0].to_s, "(0,0;100,0)/(0,100;0,300)") + assert_equal(edge_pairs.split_filter(f)[1].to_s, "(200,0;300,0)/(200,100;220,300)") assert_equal(edge_pairs.to_s, "(0,0;100,0)/(0,100;0,300);(200,0;300,0)/(200,100;220,300)") edge_pairs.filter(f) assert_equal(edge_pairs.to_s, "(0,0;100,0)/(0,100;0,300)") diff --git a/testdata/ruby/dbEdgesTest.rb b/testdata/ruby/dbEdgesTest.rb index 87bc8674a..329d6b7f1 100644 --- a/testdata/ruby/dbEdgesTest.rb +++ b/testdata/ruby/dbEdgesTest.rb @@ -585,25 +585,35 @@ class DBEdges_TestClass < TestBase r.insert(RBA::Edge::new(0, 0, 100, 0)) r.insert(RBA::Edge::new(100, 0, 100, 50)) assert_equal(r.with_angle(0, false).to_s, "(0,0;100,0)") + assert_equal(r.split_with_angle(0)[0].to_s, "(0,0;100,0)") assert_equal(r.with_abs_angle(0, false).to_s, "(0,0;100,0)") + assert_equal(r.split_with_abs_angle(0)[0].to_s, "(0,0;100,0)") assert_equal(r.with_angle(0, true).to_s, "(100,0;100,50)") + assert_equal(r.split_with_angle(0)[1].to_s, "(100,0;100,50)") assert_equal(r.with_abs_angle(0, true).to_s, "(100,0;100,50)") + assert_equal(r.split_with_abs_angle(0)[1].to_s, "(100,0;100,50)") assert_equal(r.with_angle(90, false).to_s, "(100,0;100,50)") assert_equal(r.with_abs_angle(90, false).to_s, "(100,0;100,50)") assert_equal(r.with_angle(90, true).to_s, "(0,0;100,0)") assert_equal(r.with_abs_angle(90, true).to_s, "(0,0;100,0)") assert_equal(r.with_angle(-10, 10, false).to_s, "(0,0;100,0)") + assert_equal(r.split_with_angle(-10, 10)[0].to_s, "(0,0;100,0)") assert_equal(r.with_abs_angle(-10, 10, false).to_s, "(0,0;100,0)") assert_equal(r.with_angle(-10, 10, true).to_s, "(100,0;100,50)") + assert_equal(r.split_with_angle(-10, 10)[1].to_s, "(100,0;100,50)") assert_equal(r.with_abs_angle(-10, 10, true).to_s, "(100,0;100,50)") assert_equal(r.with_angle(80, 100, false).to_s, "(100,0;100,50)") assert_equal(r.with_abs_angle(80, 100, false).to_s, "(100,0;100,50)") assert_equal(r.with_length(100, false).to_s, "(0,0;100,0)") + assert_equal(r.split_with_length(100)[0].to_s, "(0,0;100,0)") assert_equal(r.with_length(100, true).to_s, "(100,0;100,50)") + assert_equal(r.split_with_length(100)[1].to_s, "(100,0;100,50)") assert_equal(r.with_length(50, false).to_s, "(100,0;100,50)") assert_equal(r.with_length(50, true).to_s, "(0,0;100,0)") assert_equal(r.with_length(100, nil, false).to_s, "(0,0;100,0)") + assert_equal(r.split_with_length(100, nil)[0].to_s, "(0,0;100,0)") assert_equal(r.with_length(100, 200, true).to_s, "(100,0;100,50)") + assert_equal(r.split_with_length(100, 200)[1].to_s, "(100,0;100,50)") assert_equal(r.with_length(nil, 100, false).to_s, "(100,0;100,50)") r = RBA::Edges::new @@ -882,6 +892,8 @@ class DBEdges_TestClass < TestBase edges.insert(RBA::Edge::new(100, 100, 100, 200)) assert_equal(edges.filtered(f).to_s, "(100,0;200,100)") + assert_equal(edges.split_filter(f)[0].to_s, "(100,0;200,100)") + assert_equal(edges.split_filter(f)[1].to_s, "(100,100;100,200)") assert_equal(edges.to_s, "(100,0;200,100);(100,100;100,200)") edges.filter(f) assert_equal(edges.to_s, "(100,0;200,100)") diff --git a/testdata/ruby/dbRegionTest.rb b/testdata/ruby/dbRegionTest.rb index ea7b13feb..531fcea11 100644 --- a/testdata/ruby/dbRegionTest.rb +++ b/testdata/ruby/dbRegionTest.rb @@ -485,46 +485,68 @@ class DBRegion_TestClass < TestBase r.merged_semantics = false assert_equal(r.with_area(20000, false).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_area(20000)[0].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_area(20000, true).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_area(20000)[1].to_s, "(0,0;0,100;400,100;400,0)") assert_equal(csort(r.with_area(10000, nil, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_area(10000, 20000, false).to_s, "") assert_equal(r.with_area(nil, 20001, false).to_s, "(0,0;0,200;100,200;100,0)") assert_equal(csort(r.with_area(10000, 20000, true).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_perimeter(600, false).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_perimeter(600)[0].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_perimeter(600, true).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_perimeter(600)[1].to_s, "(0,0;0,100;400,100;400,0)") assert_equal(csort(r.with_perimeter(600, nil, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_perimeter(600, 1000, false).to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_perimeter(nil, 1000, false).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_perimeter(nil, 1000)[0].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_perimeter(600, 1000, true).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_perimeter(600, 1000)[1].to_s, "(0,0;0,100;400,100;400,0)") assert_equal(r.with_bbox_height(200, false).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_bbox_height(200)[0].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_bbox_height(200, true).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_bbox_height(200)[1].to_s, "(0,0;0,100;400,100;400,0)") assert_equal(csort(r.with_bbox_height(100, nil, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_bbox_height(100, 200, false).to_s, "(0,0;0,100;400,100;400,0)") assert_equal(csort(r.with_bbox_height(nil, 201, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) + assert_equal(csort(r.split_with_bbox_height(nil, 201)[0].to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_bbox_height(100, 200, true).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_bbox_height(100, 200)[1].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_bbox_width(400, false).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_bbox_width(400)[0].to_s, "(0,0;0,100;400,100;400,0)") assert_equal(r.with_bbox_width(400, true).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_bbox_width(400)[1].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(csort(r.with_bbox_width(100, nil, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_bbox_width(100, 400, false).to_s, "(0,0;0,200;100,200;100,0)") assert_equal(csort(r.with_bbox_width(nil, 401, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) + assert_equal(csort(r.split_with_bbox_width(nil, 401)[0].to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_bbox_width(100, 400, true).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_bbox_width(100, 400)[1].to_s, "(0,0;0,100;400,100;400,0)") assert_equal(csort(r.with_bbox_min(100, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) + assert_equal(csort(r.split_with_bbox_min(100)[0].to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_bbox_min(100, true).to_s, "") + assert_equal(r.split_with_bbox_min(100)[1].to_s, "") assert_equal(csort(r.with_bbox_min(100, nil, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(csort(r.with_bbox_min(100, 101, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(csort(r.with_bbox_min(nil, 101, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) + assert_equal(csort(r.split_with_bbox_min(nil, 101)[0].to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_bbox_min(100, 101, true).to_s, "") + assert_equal(r.split_with_bbox_min(100, 101)[1].to_s, "") assert_equal(r.with_bbox_max(200, false).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_bbox_max(200)[0].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_bbox_max(200, true).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_bbox_max(200)[1].to_s, "(0,0;0,100;400,100;400,0)") assert_equal(csort(r.with_bbox_max(200, nil, false).to_s), csort("(0,0;0,200;100,200;100,0);(0,0;0,100;400,100;400,0)")) assert_equal(r.with_bbox_max(200, 400, false).to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_bbox_max(nil, 400, false).to_s, "(0,0;0,200;100,200;100,0)") + assert_equal(r.split_with_bbox_max(nil, 400)[0].to_s, "(0,0;0,200;100,200;100,0)") assert_equal(r.with_bbox_max(200, 400, true).to_s, "(0,0;0,100;400,100;400,0)") + assert_equal(r.split_with_bbox_max(200, 400)[1].to_s, "(0,0;0,100;400,100;400,0)") end @@ -840,15 +862,23 @@ class DBRegion_TestClass < TestBase r1.merged_semantics = false assert_equal(csort(r1.rectangles.to_s), csort("(10,20;10,200;100,200;100,20);(50,70;50,270;150,270;150,70)")) + assert_equal(csort(r1.split_rectangles[0].to_s), csort("(10,20;10,200;100,200;100,20);(50,70;50,270;150,270;150,70)")) assert_equal(csort(r1.non_rectangles.to_s), csort("(0,0;100,100;100,0);(0,0;0,100;50,100;50,200;100,200;100,0)")) + assert_equal(csort(r1.split_rectangles[1].to_s), csort("(0,0;100,100;100,0);(0,0;0,100;50,100;50,200;100,200;100,0)")) assert_equal(csort(r1.rectilinear.to_s), csort("(10,20;10,200;100,200;100,20);(50,70;50,270;150,270;150,70);(0,0;0,100;50,100;50,200;100,200;100,0)")) + assert_equal(csort(r1.split_rectilinear[0].to_s), csort("(10,20;10,200;100,200;100,20);(50,70;50,270;150,270;150,70);(0,0;0,100;50,100;50,200;100,200;100,0)")) assert_equal(r1.non_rectilinear.to_s, "(0,0;100,100;100,0)") + assert_equal(r1.split_rectilinear[1].to_s, "(0,0;100,100;100,0)") r1.merged_semantics = true assert_equal(r1.rectangles.to_s, "") + assert_equal(r1.split_rectangles[0].to_s, "") assert_equal(r1.non_rectangles.to_s, "(0,0;0,100;10,100;10,200;50,200;50,270;150,270;150,70;100,70;100,0)") + assert_equal(r1.split_rectangles[1].to_s, "(0,0;0,100;10,100;10,200;50,200;50,270;150,270;150,70;100,70;100,0)") assert_equal(r1.rectilinear.to_s, "(0,0;0,100;10,100;10,200;50,200;50,270;150,270;150,70;100,70;100,0)") + assert_equal(r1.split_rectilinear[0].to_s, "(0,0;0,100;10,100;10,200;50,200;50,270;150,270;150,70;100,70;100,0)") assert_equal(r1.non_rectilinear.to_s, "") + assert_equal(r1.split_rectilinear[1].to_s, "") end @@ -1188,19 +1218,25 @@ class DBRegion_TestClass < TestBase r.insert(RBA::Box::new(0, 10000, 2000, 12000)) assert_equal(r.with_bbox_width(1000, false).to_s, "(0,0;0,5000;1000,5000;1000,0)") + assert_equal(r.split_with_bbox_width(1000)[0].to_s, "(0,0;0,5000;1000,5000;1000,0)") assert_equal(csort(r.with_bbox_width(1000, true).to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,10000;0,12000;2000,12000;2000,10000)")) + assert_equal(csort(r.split_with_bbox_width(1000)[1].to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,10000;0,12000;2000,12000;2000,10000)")) assert_equal(csort(r.with_bbox_width(1000, 2001, false).to_s), csort("(0,0;0,5000;1000,5000;1000,0);(0,10000;0,12000;2000,12000;2000,10000)")) assert_equal(r.with_bbox_width(1000, 2000, false).to_s, "(0,0;0,5000;1000,5000;1000,0)") assert_equal(r.with_bbox_width(1000, 2001, true).to_s, "(3000,0;3000,1000;7000,1000;7000,0)") assert_equal(r.with_bbox_height(5000, false).to_s, "(0,0;0,5000;1000,5000;1000,0)") + assert_equal(r.split_with_bbox_height(5000)[0].to_s, "(0,0;0,5000;1000,5000;1000,0)") assert_equal(csort(r.with_bbox_height(5000, true).to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,10000;0,12000;2000,12000;2000,10000)")) + assert_equal(csort(r.split_with_bbox_height(5000)[1].to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,10000;0,12000;2000,12000;2000,10000)")) assert_equal(csort(r.with_bbox_height(1000, 2001, false).to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,10000;0,12000;2000,12000;2000,10000)")) assert_equal(r.with_bbox_height(1000, 1001, false).to_s, "(3000,0;3000,1000;7000,1000;7000,0)") assert_equal(csort(r.with_bbox_height(1000, 1001, true).to_s), csort("(0,0;0,5000;1000,5000;1000,0);(0,10000;0,12000;2000,12000;2000,10000)")) assert_equal(r.with_bbox_aspect_ratio(1.0, false).to_s, "(0,10000;0,12000;2000,12000;2000,10000)") + assert_equal(r.split_with_bbox_aspect_ratio(1.0)[0].to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(csort(r.with_bbox_aspect_ratio(1.0, true).to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0)")) + assert_equal(csort(r.split_with_bbox_aspect_ratio(1.0)[1].to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0)")) assert_equal(r.with_bbox_aspect_ratio(0.9, 1.0, false).to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(r.with_bbox_aspect_ratio(1.0, 1.1, false).to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(r.with_bbox_aspect_ratio(0.9, 0.95, false).to_s, "") @@ -1208,7 +1244,9 @@ class DBRegion_TestClass < TestBase assert_equal(r.with_bbox_aspect_ratio(1.0, 1.1, false, false, true).to_s, "") assert_equal(r.with_relative_height(1.0, false).to_s, "(0,10000;0,12000;2000,12000;2000,10000)") + assert_equal(r.split_with_relative_height(1.0)[0].to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(csort(r.with_relative_height(1.0, true).to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0)")) + assert_equal(csort(r.split_with_relative_height(1.0)[1].to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0)")) assert_equal(r.with_relative_height(0.9, 1.0, false).to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(r.with_relative_height(1.0, 1.1, false).to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(r.with_relative_height(0.9, 0.95, false).to_s, "") @@ -1216,9 +1254,13 @@ class DBRegion_TestClass < TestBase assert_equal(r.with_relative_height(1.0, 1.1, false, false, true).to_s, "") assert_equal(csort(r.rectangles.to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0);(0,10000;0,12000;2000,12000;2000,10000)")) + assert_equal(csort(r.split_rectangles[0].to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0);(0,10000;0,12000;2000,12000;2000,10000)")) assert_equal(r.non_rectangles.to_s, "") + assert_equal(r.split_rectangles[1].to_s, "") assert_equal(r.squares.to_s, "(0,10000;0,12000;2000,12000;2000,10000)") + assert_equal(r.split_squares[0].to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(csort(r.non_squares.to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0)")) + assert_equal(csort(r.split_squares[1].to_s), csort("(3000,0;3000,1000;7000,1000;7000,0);(0,0;0,5000;1000,5000;1000,0)")) r = RBA::Region::new r.insert(RBA::Box::new(0, 0, 1000, 2000)) @@ -1226,7 +1268,9 @@ class DBRegion_TestClass < TestBase r.insert(RBA::Box::new(0, 10000, 2000, 12000)) assert_equal(r.with_area_ratio(1.0, false).to_s, "(0,10000;0,12000;2000,12000;2000,10000)") + assert_equal(r.split_with_area_ratio(1.0)[0].to_s, "(0,10000;0,12000;2000,12000;2000,10000)") assert_equal(r.with_area_ratio(1.0, true).to_s, "(0,0;0,2000;1000,2000;1000,1000;2000,1000;2000,0)") + assert_equal(r.split_with_area_ratio(1.0)[1].to_s, "(0,0;0,2000;1000,2000;1000,1000;2000,1000;2000,0)") assert_equal(r.with_area_ratio(4.0 / 3.0, false).to_s, "(0,0;0,2000;1000,2000;1000,1000;2000,1000;2000,0)") assert_equal(r.with_area_ratio(1.3, 1.4, false).to_s, "(0,0;0,2000;1000,2000;1000,1000;2000,1000;2000,0)") assert_equal(r.with_area_ratio(1.3, 4.0 / 3.0, false, false, true).to_s, "(0,0;0,2000;1000,2000;1000,1000;2000,1000;2000,0)") @@ -1247,11 +1291,17 @@ class DBRegion_TestClass < TestBase r -= rr assert_equal(r.with_holes(0, false).to_s, "") + assert_equal(r.split_with_holes(0)[0].to_s, "") assert_equal(r.with_holes(0, true).to_s, "(0,0;0,200;100,200;100,0/10,10;20,10;20,20;10,20/30,30;40,30;40,40;30,40)") + assert_equal(r.split_with_holes(0)[1].to_s, "(0,0;0,200;100,200;100,0/10,10;20,10;20,20;10,20/30,30;40,30;40,40;30,40)") assert_equal(rr.with_holes(0, false).to_s, "(10,10;10,20;20,20;20,10);(30,30;30,40;40,40;40,30)") + assert_equal(rr.split_with_holes(0)[0].to_s, "(10,10;10,20;20,20;20,10);(30,30;30,40;40,40;40,30)") assert_equal(rr.with_holes(0, true).to_s, "") + assert_equal(rr.split_with_holes(0)[1].to_s, "") assert_equal(rr.with_holes(2, false).to_s, "") + assert_equal(rr.split_with_holes(2)[0].to_s, "") assert_equal(r.with_holes(1, 3, false).to_s, "(0,0;0,200;100,200;100,0/10,10;20,10;20,20;10,20/30,30;40,30;40,40;30,40)") + assert_equal(r.split_with_holes(1, 3)[0].to_s, "(0,0;0,200;100,200;100,0/10,10;20,10;20,20;10,20/30,30;40,30;40,40;30,40)") assert_equal(r.with_holes(2, 3, false).to_s, "(0,0;0,200;100,200;100,0/10,10;20,10;20,20;10,20/30,30;40,30;40,40;30,40)") assert_equal(r.with_holes(1, 2, false).to_s, "") @@ -1349,6 +1399,8 @@ class DBRegion_TestClass < TestBase region.insert(RBA::Box::new(200, 0, 300, 100)) assert_equal(region.filtered(TriangleFilter::new).to_s, "(0,0;100,100;100,0)") + assert_equal(region.split_filter(TriangleFilter::new)[0].to_s, "(0,0;100,100;100,0)") + assert_equal(region.split_filter(TriangleFilter::new)[1].to_s, "(200,0;200,100;300,100;300,0)") assert_equal(region.to_s, "(0,0;100,100;100,0);(200,0;200,100;300,100;300,0)") region.filter(TriangleFilter::new) assert_equal(region.to_s, "(0,0;100,100;100,0)") diff --git a/testdata/ruby/dbTextsTest.rb b/testdata/ruby/dbTextsTest.rb index 813fe29ad..492fa96f3 100644 --- a/testdata/ruby/dbTextsTest.rb +++ b/testdata/ruby/dbTextsTest.rb @@ -179,9 +179,13 @@ class DBTexts_TestClass < TestBase r1 = RBA::Texts::new([ text1, text2 ]) assert_equal(csort(r1.to_s), csort("('abc',r0 100,-200);('uvm',r0 110,210)")) assert_equal(r1.with_text("abc", false).to_s, "('abc',r0 100,-200)") + assert_equal(r1.split_with_text("abc")[0].to_s, "('abc',r0 100,-200)") assert_equal(r1.with_text("abc", true).to_s, "('uvm',r0 110,210)") + assert_equal(r1.split_with_text("abc")[1].to_s, "('uvm',r0 110,210)") assert_equal(r1.with_match("*b*", false).to_s, "('abc',r0 100,-200)") + assert_equal(r1.split_with_match("*b*")[0].to_s, "('abc',r0 100,-200)") assert_equal(r1.with_match("*b*", true).to_s, "('uvm',r0 110,210)") + assert_equal(r1.split_with_match("*b*")[1].to_s, "('uvm',r0 110,210)") r1 = RBA::Texts::new(text1) assert_equal(r1.to_s, "('abc',r0 100,-200)") @@ -394,6 +398,8 @@ class DBTexts_TestClass < TestBase texts.insert(RBA::Text::new("00", [ RBA::Trans::R90, 0, 20 ])) assert_equal(texts.filtered(f).to_s, "('tla',r0 0,0)") + assert_equal(texts.split_filter(f)[0].to_s, "('tla',r0 0,0)") + assert_equal(texts.split_filter(f)[1].to_s, "('long',m45 10,0);('00',r90 0,20)") assert_equal(texts.to_s, "('long',m45 10,0);('tla',r0 0,0);('00',r90 0,20)") texts.filter(f) assert_equal(texts.to_s, "('tla',r0 0,0)") From 1372a7d04ef1d6746959df2ad58f151f3c247923 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 9 Feb 2025 22:44:34 +0100 Subject: [PATCH 11/29] [consider merging] Bugfix: fixing a crash when editing PCell parameters (QR code PCell in this case) while the macro editor is open --- src/edt/edt/edtPCellParametersPage.cc | 7 +++++++ src/edt/edt/edtPCellParametersPage.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/edt/edt/edtPCellParametersPage.cc b/src/edt/edt/edtPCellParametersPage.cc index d68c0b319..afbf327f6 100644 --- a/src/edt/edt/edtPCellParametersPage.cc +++ b/src/edt/edt/edtPCellParametersPage.cc @@ -706,6 +706,13 @@ PCellParametersPage::parameter_changed () dm_parameter_changed (); } +void +PCellParametersPage::deleteLater () +{ + dm_parameter_changed.cancel (); + QFrame::deleteLater (); +} + void PCellParametersPage::do_parameter_changed () { diff --git a/src/edt/edt/edtPCellParametersPage.h b/src/edt/edt/edtPCellParametersPage.h index a6c862452..c976dc254 100644 --- a/src/edt/edt/edtPCellParametersPage.h +++ b/src/edt/edt/edtPCellParametersPage.h @@ -139,6 +139,11 @@ public: */ void set_parameters (const std::vector &values); + /** + * @brief Reimplementation of deleteLater + */ + void deleteLater (); + signals: void edited (); From b434eb3239458cf296c668a410376965ef2a5da1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 25 Feb 2025 21:16:49 +0100 Subject: [PATCH 12/29] [consider merging] Fixing two problems with layer mapping 1. Mapping "[*/*] 100/0:0/0" (for example) created 0/0 two times when the input contains 100/0 and 0/0. Now it is a single layer only 2. The mapping table generated from strings now uses layer indexes from a range that should not collide with existing layer indexes. --- src/db/db/dbStreamLayers.cc | 19 ++++++++++-- src/db/unit_tests/dbStreamLayerTests.cc | 30 +++++++++++++++++++ .../gds2/unit_tests/dbGDS2ReaderTests.cc | 3 +- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/db/db/dbStreamLayers.cc b/src/db/db/dbStreamLayers.cc index c8b1b0f92..c4038549b 100644 --- a/src/db/db/dbStreamLayers.cc +++ b/src/db/db/dbStreamLayers.cc @@ -236,7 +236,19 @@ LayerMap::substitute_placeholder (const db::LayerProperties &p, const std::set::max (); + for (std::map::const_iterator t = m_target_layers.begin (); t != m_target_layers.end (); ++t) { + if (t->second.log_equal (lp_new) && layout.is_valid_layer (t->first)) { + l_new = t->first; + break; + } + } + + if (l_new == std::numeric_limits::max ()) { + l_new = layout.insert_layer (lp_new); + } + map (p, l_new, lp_new); res.insert (l_new); @@ -929,7 +941,10 @@ db::LayerMap LayerMap::from_string_file_format (const std::string &s) { db::LayerMap lm; - unsigned int l = 0; + // NOTE: this should be outside the normal layer index range of a Layout and below + // the space reserved for placeholders. With numbers like this we don't get messed + // up with existing layers. + unsigned int l = std::numeric_limits::max () / 2; int lnr = 0; diff --git a/src/db/unit_tests/dbStreamLayerTests.cc b/src/db/unit_tests/dbStreamLayerTests.cc index 3e3287aee..fc4da9fce 100644 --- a/src/db/unit_tests/dbStreamLayerTests.cc +++ b/src/db/unit_tests/dbStreamLayerTests.cc @@ -577,3 +577,33 @@ TEST(8) EXPECT_EQ (db::LayerMap::from_string_file_format (lm.to_string_file_format ()).to_string (), lm.to_string ()); } +// mapping of relative target to real target +TEST(9) +{ + db::Layout ly; + db::LayerMap lm; + + EXPECT_EQ (layers_to_string (ly), ""); + unsigned int l0 = ly.insert_layer (db::LayerProperties (0, 0)); + unsigned int l101 = ly.insert_layer (db::LayerProperties (101, 0)); + + unsigned int n = std::numeric_limits::max () / 2; + lm.map_expr ("*/* : */*", n++); + lm.map_expr ("100/0 : 0/0", n++); + + lm.prepare (ly); + + std::pair p; + p = lm.first_logical (db::LayerProperties (100, 0), ly); + EXPECT_EQ (p.first, true); + EXPECT_EQ (p.second, l0); + + p = lm.first_logical (db::LayerProperties (101, 0), ly); + EXPECT_EQ (p.first, true); + EXPECT_EQ (p.second, l101); + + // maps to the target 0/0 + p = lm.first_logical (db::LayerProperties (0, 0), ly); + EXPECT_EQ (p.first, true); + EXPECT_EQ (p.second, l0); +} diff --git a/src/plugins/streamers/gds2/unit_tests/dbGDS2ReaderTests.cc b/src/plugins/streamers/gds2/unit_tests/dbGDS2ReaderTests.cc index 5552c8d3b..d65f9f3a4 100644 --- a/src/plugins/streamers/gds2/unit_tests/dbGDS2ReaderTests.cc +++ b/src/plugins/streamers/gds2/unit_tests/dbGDS2ReaderTests.cc @@ -417,9 +417,8 @@ TEST(3_AdvancedMapping) } EXPECT_EQ (lm_read.to_string_file_format (), - "1/10 : 1/0\n" + "1/0,10 : 1/0\n" "2/0-1 : 2/0\n" - "1/0 : 1/0\n" "1/1 : 1/1\n" "1/20 : 1/1020\n" "1/21 : 1/1021\n" From 3185a7aeb2d8bf3980d029e16b12b19d489d171f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 25 Feb 2025 22:06:56 +0100 Subject: [PATCH 13/29] [consider merging] fixed a potential crash on 'save all' --- src/lay/lay/layMainWindow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index cda9b8057..7b52b97b9 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -2365,7 +2365,7 @@ MainWindow::cm_save_all () } view (view_index)->save_as (cv_index, fn, om, options, true, m_keep_backups); - add_mru (fn, current_view ()->cellview (cv_index)->tech_name ()); + add_mru (fn, cv->tech_name ()); } From 01cc54ba49dbf09923e2b96009b01fa550204111 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 25 Feb 2025 23:22:06 +0100 Subject: [PATCH 14/29] [consider merging] avoid a crash during certain queries This query used to crash: "instances of cell .*.* where inst.trans.rot == 2" on a layout with 1 hierarchy level and some cells with rot 180 degree --- src/db/db/dbLayoutQuery.cc | 14 +++++++++----- src/db/unit_tests/dbLayoutQueryTests.cc | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/db/db/dbLayoutQuery.cc b/src/db/db/dbLayoutQuery.cc index d2753b617..c5989b5bb 100644 --- a/src/db/db/dbLayoutQuery.cc +++ b/src/db/db/dbLayoutQuery.cc @@ -1006,15 +1006,19 @@ public: db::Instance inst; if (m_reading) { - inst = mp_parent->sorted_inst_ptr (std::distance (mp_parent->begin_sorted_insts (), m_inst)); + if (mp_parent) { + inst = mp_parent->sorted_inst_ptr (std::distance (mp_parent->begin_sorted_insts (), m_inst)); + } } else { inst = m_i; } - if (m_instance_mode == ArrayInstances) { - v.push (tl::Variant (db::InstElement (inst))); - } else { - v.push (tl::Variant (db::InstElement (inst, m_array_iter))); + if (! inst.is_null ()) { + if (m_instance_mode == ArrayInstances) { + v.push (tl::Variant (db::InstElement (inst))); + } else { + v.push (tl::Variant (db::InstElement (inst, m_array_iter))); + } } return true; diff --git a/src/db/unit_tests/dbLayoutQueryTests.cc b/src/db/unit_tests/dbLayoutQueryTests.cc index 06e9cf811..08d2587c5 100644 --- a/src/db/unit_tests/dbLayoutQueryTests.cc +++ b/src/db/unit_tests/dbLayoutQueryTests.cc @@ -1578,3 +1578,20 @@ TEST(64) EXPECT_EQ (s, "0.01,-0.02,-0.01,0.02,-0.01,0.02,-0.01,0.02,0.01,-0.02,-0.01,0.02"); } } + +TEST(65) +{ + db::Layout g; + init_layout (g); + + { + db::LayoutQuery q ("instances of cell .*.* where inst.trans.rot == 0"); + db::LayoutQueryIterator iq (q, &g); + std::string s = q2s_var (iq, "data"); + EXPECT_EQ (s, "nil,nil"); + s = q2s_var (iq, "cell_name"); + EXPECT_EQ (s, "c1,c5x"); + s = q2s_var (iq, "inst_elements"); + EXPECT_EQ (s, "(cell_index=0 r0 *1 10,-20),(cell_index=4 r0 *1 10,-20)"); + } +} From 32fe65adc0bd6813d34960aba4b63ba67991db7a Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 1 Mar 2025 23:18:29 +0100 Subject: [PATCH 15/29] [consider merging] Fixed a bug when returning a Region into a layout with cells unselected. --- src/db/db/dbCellMapping.cc | 16 ++- src/db/db/dbCellMapping.h | 5 + src/db/db/dbDeepShapeStore.cc | 122 +++++++++++++-------- src/db/unit_tests/dbDeepShapeStoreTests.cc | 35 ++++++ testdata/algo/dss_bug.gds | Bin 0 -> 920 bytes testdata/algo/dss_bug_au.gds | Bin 0 -> 1208 bytes 6 files changed, 130 insertions(+), 48 deletions(-) create mode 100644 testdata/algo/dss_bug.gds create mode 100644 testdata/algo/dss_bug_au.gds diff --git a/src/db/db/dbCellMapping.cc b/src/db/db/dbCellMapping.cc index 90d9d6f97..3e0d30e37 100644 --- a/src/db/db/dbCellMapping.cc +++ b/src/db/db/dbCellMapping.cc @@ -284,8 +284,17 @@ std::vector CellMapping::source_cells () const return s; } +std::vector CellMapping::target_cells () const +{ + std::vector s; + s.reserve (m_b2a_mapping.size ()); + for (iterator m = begin (); m != end (); ++m) { + s.push_back (m->second); + } + return s; +} -void +void CellMapping::create_single_mapping (const db::Layout & /*layout_a*/, db::cell_index_type cell_index_a, const db::Layout & /*layout_b*/, db::cell_index_type cell_index_b) { clear (); @@ -374,7 +383,7 @@ CellMapping::do_create_missing_mapping (db::Layout &layout_a, const db::Layout & db::PropertyMapper pm (&layout_a, &layout_b); // Note: this avoids frequent cell index table rebuilds if source and target layout are identical - layout_a.start_changes (); + db::LayoutLocker locker (&layout_a); // Create instances for the new cells in layout A according to their instantiation in layout B double mag = layout_b.dbu () / layout_a.dbu (); @@ -405,9 +414,6 @@ CellMapping::do_create_missing_mapping (db::Layout &layout_a, const db::Layout & } - // Note: must be there because of start_changes - layout_a.end_changes (); - } } diff --git a/src/db/db/dbCellMapping.h b/src/db/db/dbCellMapping.h index 42e28fab6..4686e5f16 100644 --- a/src/db/db/dbCellMapping.h +++ b/src/db/db/dbCellMapping.h @@ -206,6 +206,11 @@ public: */ std::vector source_cells () const; + /** + * @brief Gets the target cells + */ + std::vector target_cells () const; + /** * @brief Access to the mapping table */ diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index a01df20c5..23a28ef30 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -1172,62 +1172,69 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout DeliveryMappingCacheKey key (layout_index, tl::id_of (into_layout), into_cell); std::map::iterator cm = m_delivery_mapping_cache.find (key); - if (cm == m_delivery_mapping_cache.end () || ! cm->second.is_valid (*into_layout, *source_layout)) { + if (cm != m_delivery_mapping_cache.end () && cm->second.is_valid (*into_layout, *source_layout)) { + return cm->second; + } - cm = m_delivery_mapping_cache.insert (std::make_pair (key, CellMappingWithGenerationIds ())).first; - cm->second.clear (); + cm = m_delivery_mapping_cache.insert (std::make_pair (key, CellMappingWithGenerationIds ())).first; + cm->second.clear (); - // collects the cell mappings we skip because they are variants (variant building or box variants) - std::map cm_skipped_variants; + // Not found in cache - compute a fresh mapping - if (into_layout == original_builder.source ().layout () && &into_layout->cell (into_cell) == original_builder.source ().top_cell () && original_builder.source ().global_trans ().is_unity ()) { + // collects the cell mappings we skip because they are variants (variant building or box variants) + std::map cm_skipped_variants; - // This is the case of mapping back to the original. In this case we can use the information - // provided inside the original hierarchy builders. They list the source cells and the target cells - // create from them. We need to consider however, that the hierarchy builder is allowed to create - // variants which we cannot map. + if (into_layout == original_builder.source ().layout () && &into_layout->cell (into_cell) == original_builder.source ().top_cell () && original_builder.source ().global_trans ().is_unity ()) { - for (HierarchyBuilder::cell_map_type::const_iterator m = original_builder.begin_cell_map (); m != original_builder.end_cell_map (); ) { + // This is the case of mapping back to the original. In this case we can use the information + // provided inside the original hierarchy builders. They list the source cells and the target cells + // create from them. We need to consider however, that the hierarchy builder is allowed to create + // variants which we cannot map. - HierarchyBuilder::cell_map_type::const_iterator mm = m; + for (HierarchyBuilder::cell_map_type::const_iterator m = original_builder.begin_cell_map (); m != original_builder.end_cell_map (); ) { + + HierarchyBuilder::cell_map_type::const_iterator mm = m; + ++mm; + bool skip = original_builder.is_variant (m->second); // skip variant cells + while (mm != original_builder.end_cell_map () && mm->first.original_cell == m->first.original_cell) { + // we have cell (box) variants and cannot simply map ++mm; - bool skip = original_builder.is_variant (m->second); // skip variant cells - while (mm != original_builder.end_cell_map () && mm->first.original_cell == m->first.original_cell) { - // we have cell (box) variants and cannot simply map - ++mm; - skip = true; - } - - if (! skip) { - cm->second.map (m->second, m->first.original_cell); - } else { - for (HierarchyBuilder::cell_map_type::const_iterator n = m; n != mm; ++n) { - tl_assert (cm_skipped_variants.find (n->second) == cm_skipped_variants.end ()); - cm_skipped_variants [n->second] = n->first; - } - } - - m = mm; - + skip = true; } - } else if (into_layout->cells () == 1) { + if (! skip) { + cm->second.map (m->second, m->first.original_cell); + } else { + for (HierarchyBuilder::cell_map_type::const_iterator n = m; n != mm; ++n) { + tl_assert (cm_skipped_variants.find (n->second) == cm_skipped_variants.end ()); + cm_skipped_variants [n->second] = n->first; + } + } - // Another simple case is mapping into an empty (or single-top-cell-only) layout, where we can use "create_from_single_full". - cm->second.create_single_mapping (*into_layout, into_cell, *source_layout, source_top); - - } else { - - cm->second.create_from_geometry (*into_layout, into_cell, *source_layout, source_top); + m = mm; } - // Add new cells for the variants and (possible) devices which are cells added during the device - // extraction process - std::vector > new_pairs = cm->second.create_missing_mapping2 (*into_layout, *source_layout, source_top, excluded_cells, included_cells); + } else if (into_layout->cells () == 1) { + + // Another simple case is mapping into an empty (or single-top-cell-only) layout, where we can use "create_from_single_full". + cm->second.create_single_mapping (*into_layout, into_cell, *source_layout, source_top); + + } else { + + cm->second.create_from_geometry (*into_layout, into_cell, *source_layout, source_top); + + } + + // Add new cells for the variants and (possible) devices which are cells added during the device + // extraction process + std::vector > new_pairs = cm->second.create_missing_mapping2 (*into_layout, *source_layout, source_top, excluded_cells, included_cells); + + if (! new_pairs.empty ()) { // the variant's originals we are going to delete std::set cells_to_delete; + std::vector > new_variants; // We now need to fix the cell map from the hierarchy builder, so we can import back from the modified layout. // This is in particular important if we created new cells for known variants. @@ -1240,6 +1247,7 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout // create the variant clone in the original layout too and delete this cell VariantsCollectorBase::copy_shapes (*into_layout, np->second, icm->second.original_cell); + new_variants.push_back (std::make_pair (np->second, icm->second.original_cell)); cells_to_delete.insert (icm->second.original_cell); // forget the original cell (now separated into variants) and map the variants back into the @@ -1259,15 +1267,43 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout } - // delete the variant's original cell + if (! new_variants.empty ()) { + + // copy cell instances for the new variants + + // collect the cells that are handled during cell mapping - + // we do not need to take care of them when creating variants, + // but there may be others inside "into_layout" which are + // not present in the DSS and for which we need to copy the + // instances. + std::vector mapped = cm->second.target_cells (); + std::sort (mapped.begin (), mapped.end ()); + + // Copy the variant instances - but only those for cells which are not going to be + // deleted and those not handled by the cell mapping object. + for (auto vv = new_variants.begin (); vv != new_variants.end (); ++vv) { + const db::Cell &from = into_layout->cell (vv->second); + db::Cell &to = into_layout->cell (vv->first); + for (db::Cell::const_iterator i = from.begin (); ! i.at_end (); ++i) { + if (cells_to_delete.find (i->cell_index ()) == cells_to_delete.end ()) { + auto m = std::lower_bound (mapped.begin (), mapped.end (), i->cell_index ()); + if (m == mapped.end () || *m != i->cell_index ()) { + to.insert (*i); + } + } + } + } + + } + if (! cells_to_delete.empty ()) { + // delete the variant original cells into_layout->delete_cells (cells_to_delete); } - cm->second.set_generation_ids (*into_layout, *source_layout); - } + cm->second.set_generation_ids (*into_layout, *source_layout); return cm->second; } diff --git a/src/db/unit_tests/dbDeepShapeStoreTests.cc b/src/db/unit_tests/dbDeepShapeStoreTests.cc index 0acce3658..c0a56db08 100644 --- a/src/db/unit_tests/dbDeepShapeStoreTests.cc +++ b/src/db/unit_tests/dbDeepShapeStoreTests.cc @@ -24,6 +24,8 @@ #include "dbDeepShapeStore.h" #include "dbRegion.h" #include "dbDeepRegion.h" +#include "dbReader.h" +#include "dbTestSupport.h" #include "tlUnitTest.h" #include "tlStream.h" @@ -266,3 +268,36 @@ TEST(5_State) EXPECT_EQ (store.breakout_cells (0)->find (5) != store.breakout_cells (0)->end (), true); EXPECT_EQ (store.breakout_cells (0)->find (3) != store.breakout_cells (0)->end (), true); } + +TEST(6_RestoreWithCellSelection) +{ + db::Layout ly; + + { + std::string fn (tl::testdata ()); + fn += "/algo/dss_bug.gds"; + tl::InputStream stream (fn); + db::Reader reader (stream); + reader.read (ly); + } + + unsigned int l1 = ly.get_layer (db::LayerProperties (1, 0)); + + db::Cell &top_cell = ly.cell (*ly.begin_top_down ()); + + db::RecursiveShapeIterator in_it (ly, top_cell, l1); + + std::set us; + us.insert (ly.cell_by_name ("X").second); + in_it.unselect_cells (us); + + db::DeepShapeStore dss; + + db::Region in_region (in_it, dss); + ly.clear_layer (l1); + + in_region.insert_into (&ly, top_cell.cell_index (), l1); + + db::compare_layouts (_this, ly, tl::testdata () + "/algo/dss_bug_au.gds"); +} + diff --git a/testdata/algo/dss_bug.gds b/testdata/algo/dss_bug.gds new file mode 100644 index 0000000000000000000000000000000000000000..4b55407481498e6a9f0efe859237c496a4e41444 GIT binary patch literal 920 zcmb7CJud`77=Ctkc5dU2;I0tagbK+?i2Fbz=V*kWxZj##L@oifbCuhNXHJ^C^S?F;wrLJo@^-SZa_XTl4&t$)Cw;L^$6 z!QH_@H^Egnzq`ws48{fo53aAdOTKsS-S;5C*Z`r!3U6@Xpn_G@(*NNzaoFns71!I{ zyV^Q<7`^Xw$LqJ(XMKcT_IE;v{Y`Km5Hk!6VwM4@&AIdoDL)q#n&G}$wCfuAJirV1 zl_emSXra)em3$ zQU4b=n&3s_Mg+0s41rSUb?#zKewl$&M}_2*vrU_7+_W{=XRSMSw4of8Piyo>acpjc zst4q?x!*r9Oz9zYv#qIGR63Lv+z(YBN%>ec{bZiMPweXx*E1Z+RVD5uC&`S;gPm~~ zPb}K?+?gT014>rxdsF)^}bJe^2A);~T;Dzr=%j;cuoQ=3?HO3If2&2&mq+JNP@ Wl+P1`A1}bghLjfVI-xxq=lBAUv7J-^ literal 0 HcmV?d00001 From 414a06c70febf61e1f760b5fbf317ba6d1cc566e Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 2 Mar 2025 20:54:00 +0100 Subject: [PATCH 16/29] Bugfix: tab title was not updated when current cell is renamed --- .../laybasic/gsiDeclLayLayoutViewBase.cc | 2 +- src/laybasic/laybasic/layLayoutViewBase.cc | 99 ++++++++++--------- src/laybasic/laybasic/layLayoutViewBase.h | 7 +- 3 files changed, 57 insertions(+), 51 deletions(-) diff --git a/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc b/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc index da561762c..15925208b 100644 --- a/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc +++ b/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc @@ -607,7 +607,7 @@ LAYBASIC_PUBLIC Class decl_LayoutViewBase ("lay", "LayoutVi "\n" "See \\set_title and \\title for a description about how titles are handled." ) + - gsi::method ("title", static_cast (&lay::LayoutViewBase::title), + gsi::method ("title", static_cast (&lay::LayoutViewBase::title), "@brief Returns the view's title string\n" "\n" "@return The title string\n" diff --git a/src/laybasic/laybasic/layLayoutViewBase.cc b/src/laybasic/laybasic/layLayoutViewBase.cc index 38fa9ab69..cd9534e00 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.cc +++ b/src/laybasic/laybasic/layLayoutViewBase.cc @@ -539,7 +539,7 @@ void LayoutViewBase::update_event_handlers () cellview (i)->layout ().dbu_changed_event.add (this, &LayoutViewBase::signal_bboxes_changed); cellview (i)->layout ().prop_ids_changed_event.add (this, &LayoutViewBase::signal_prop_ids_changed); cellview (i)->layout ().layer_properties_changed_event.add (this, &LayoutViewBase::signal_layer_properties_changed); - cellview (i)->layout ().cell_name_changed_event.add (this, &LayoutViewBase::signal_cell_name_changed); + cellview (i)->layout ().cell_name_changed_event.add (this, &LayoutViewBase::signal_cell_name_changed, i); cellview (i)->apply_technology_with_sender_event.add (this, &LayoutViewBase::signal_apply_technology); } @@ -685,13 +685,30 @@ LayoutViewBase::is_dirty () const return m_dirty; } -std::string +const std::string & LayoutViewBase::title () const +{ + return m_current_title; +} + +void +LayoutViewBase::update_title () { if (! m_title.empty ()) { - return m_title; + + if (m_title != m_current_title) { + m_current_title = m_title; + emit_title_changed (); + } + } else if (cellviews () == 0) { - return tl::to_string (tr ("")); + + static std::string empty_title = tl::to_string (tr ("")); + if (m_current_title != empty_title) { + m_current_title = empty_title; + emit_title_changed (); + } + } else { int cv_index = active_cellview_index (); @@ -714,27 +731,25 @@ LayoutViewBase::title () const t += " ..."; } - return t; - + if (t != m_current_title) { + m_current_title = t; + emit_title_changed (); + } } } void LayoutViewBase::set_title (const std::string &t) { - if (m_title != t) { - m_title = t; - emit_title_changed (); - } + m_title = t; + update_title (); } void LayoutViewBase::reset_title () { - if (! m_title.empty ()) { - m_title = ""; - emit_title_changed (); - } + m_title.clear (); + update_title (); } bool @@ -1977,9 +1992,9 @@ LayoutViewBase::replace_layer_node (unsigned int index, const LayerPropertiesCon manager ()->clear (); } - if (index == current_layer_list ()) { - begin_layer_updates (); - } + if (index == current_layer_list ()) { + begin_layer_updates (); + } LayerPropertiesIterator non_const_iter (get_properties (index), iter.uint ()); *non_const_iter = node; @@ -2342,9 +2357,13 @@ LayoutViewBase::signal_bboxes_changed () } void -LayoutViewBase::signal_cell_name_changed () +LayoutViewBase::signal_cell_name_changed (unsigned int cv_index) { - cell_visibility_changed_event (); // HINT: that is not what actually is intended, but it serves the function ... + cellview_changed_event (int (cv_index)); + + // Because the title reflects the active cell, emit a title changed event + update_title (); + redraw_later (); // needs redraw } @@ -2489,10 +2508,7 @@ LayoutViewBase::erase_cellview (unsigned int index) finish_cellviews_changed (); update_content (); - - if (m_title.empty ()) { - emit_title_changed (); - } + update_title (); } void @@ -2522,9 +2538,7 @@ LayoutViewBase::clear_cellviews () finish_cellviews_changed (); - if (m_title.empty ()) { - emit_title_changed (); - } + update_title (); } const CellView & @@ -2592,9 +2606,7 @@ LayoutViewBase::set_layout (const lay::CellView &cv, unsigned int cvindex) // the layouts are released as far as possible. This is important for reload () for example. update_content_for_cv (cvindex); - if (m_title.empty ()) { - emit_title_changed (); - } + update_title (); } void @@ -4866,9 +4878,7 @@ LayoutViewBase::cellview_changed (unsigned int index) cellview_changed_event (index); - if (m_title.empty ()) { - emit_title_changed (); - } + update_title (); } const lay::CellView & @@ -4961,10 +4971,8 @@ LayoutViewBase::enable_active_cellview_changed_event (bool enable, bool silent) active_cellview_changed_with_index_event (*i); } - // Because the title reflects the active one, emit a title changed event - if (title_string ().empty ()) { - emit_title_changed (); - } + // Because the title reflects the active cell, emit a title changed event + update_title (); } @@ -4987,10 +4995,8 @@ LayoutViewBase::active_cellview_changed (int index) active_cellview_changed_event (); active_cellview_changed_with_index_event (index); - // Because the title reflects the active one, emit a title changed event - if (title_string ().empty ()) { - emit_title_changed (); - } + // Because the title reflects the active cell, emit a title changed event + update_title (); } else { m_active_cellview_changed_events.insert (index); @@ -5936,14 +5942,11 @@ LayoutViewBase::update_content_for_cv (int /*cellview_index*/) void LayoutViewBase::rename_cellview (const std::string &name, int cellview_index) { - if (cellview_index >= 0 && cellview_index < int (m_cellviews.size ())) { - if ((*cellview_iter (cellview_index))->name () != name) { - (*cellview_iter (cellview_index))->rename (name); - update_content_for_cv (cellview_index); - if (m_title.empty ()) { - emit_title_changed (); - } - } + if (cellview_index >= 0 && cellview_index < int (m_cellviews.size ()) && + (*cellview_iter (cellview_index))->name () != name) { + (*cellview_iter (cellview_index))->rename (name); + update_content_for_cv (cellview_index); + update_title (); } } diff --git a/src/laybasic/laybasic/layLayoutViewBase.h b/src/laybasic/laybasic/layLayoutViewBase.h index 51531e9be..ee40f9f85 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.h +++ b/src/laybasic/laybasic/layLayoutViewBase.h @@ -2614,7 +2614,7 @@ public: /** * @brief Gets the window title of the view */ - std::string title () const; + const std::string &title () const; /** * @brief Sets the window title to an explicit string @@ -2837,7 +2837,7 @@ private: void signal_bboxes_changed (); void signal_prop_ids_changed (); void signal_layer_properties_changed (); - void signal_cell_name_changed (); + void signal_cell_name_changed (unsigned int cv_index); void signal_annotations_changed (); void signal_plugin_enabled_changed (); void signal_apply_technology (lay::LayoutHandle *layout_handle); @@ -2853,6 +2853,7 @@ private: lay::AnnotationShapes m_annotation_shapes; std::vector > m_hidden_cells; std::string m_title; + std::string m_current_title; tl::vector m_rdbs; tl::vector m_l2ndbs; std::string m_def_lyp_file; @@ -3005,6 +3006,8 @@ private: void init_layer_properties (LayerProperties &props, const LayerPropertiesList &lp_list) const; void merge_dither_pattern (lay::LayerPropertiesList &props); + void update_title (); + protected: /** * @brief Constructor for calling from a LayoutView From 2e150980d53819cfa6b2dad8fdd0f1a635cc32bf Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 2 Mar 2025 22:12:18 +0100 Subject: [PATCH 17/29] Bugfix: 'Save all' was not updating the dirty state in the panel tabs --- src/laybasic/laybasic/layLayoutViewBase.cc | 26 +++++++++++++--------- src/layview/layview/layLayoutView_qt.cc | 2 -- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/laybasic/laybasic/layLayoutViewBase.cc b/src/laybasic/laybasic/layLayoutViewBase.cc index cd9534e00..79ec6acaa 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.cc +++ b/src/laybasic/laybasic/layLayoutViewBase.cc @@ -3788,21 +3788,25 @@ LayoutViewBase::timer () emit_dirty_changed (); } - if (m_prop_changed) { - do_prop_changed (); - m_prop_changed = false; - } + if (is_activated ()) { - tl::Clock current_time = tl::Clock::current (); - if ((current_time - m_last_checked).seconds () > animation_interval) { - m_last_checked = current_time; - if (m_animated) { - set_view_ops (); - do_set_phase (int (m_phase)); + if (m_prop_changed) { + do_prop_changed (); + m_prop_changed = false; + } + + tl::Clock current_time = tl::Clock::current (); + if ((current_time - m_last_checked).seconds () > animation_interval) { + m_last_checked = current_time; if (m_animated) { - ++m_phase; + set_view_ops (); + do_set_phase (int (m_phase)); + if (m_animated) { + ++m_phase; + } } } + } } diff --git a/src/layview/layview/layLayoutView_qt.cc b/src/layview/layview/layLayoutView_qt.cc index bc4df652f..d361b4601 100644 --- a/src/layview/layview/layLayoutView_qt.cc +++ b/src/layview/layview/layLayoutView_qt.cc @@ -1459,7 +1459,6 @@ LayoutView::activate () (*p)->browser_interface ()->show (); } } - mp_timer->start (timer_interval); m_activated = true; update_content (); } @@ -1479,7 +1478,6 @@ LayoutView::deactivate () } free_resources (); - mp_timer->stop (); m_activated = false; } From ab10c920b1a841695c453a264709f566cfbb9392 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 2 Mar 2025 22:17:43 +0100 Subject: [PATCH 18/29] Preparations for 0.29.12. --- COPYRIGHT | 5 ++--- Changelog | 19 +++++++++++++++++++ Changelog.Debian | 7 +++++++ version.sh | 4 ++-- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 8af0ce071..d01b4e3df 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,12 +1,11 @@ -klayout is packaged by Peter C.S. Scholtens -and Matthias Köfferlein +klayout is packaged by Matthias Köfferlein and was obtained from https://www.klayout.org/downloads/source/klayout-%VERSION%.tar.gz Authors: Matthias Köfferlein Copyright: - Copyright (C) 2006-2022 by Matthias Köfferlein. + Copyright (C) 2006-2025 by Matthias Köfferlein. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/Changelog b/Changelog index 6bfd1f1b2..41d3e9a7c 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,22 @@ +0.29.12 (2025-03-02): +* Bug: %GITHUB%/issues/1976 Crash on cross mode, lw > 1 and oversampling +* Bug: %GITHUB%/issues/1987 Build failure against Qt6.8 +* Enhancement: %GITHUB%/issues/1989 API enhancements: several new split_... methods + on Edges, Region, EdgePairs and Texts, delivering a pair of containers with + selected and unselected objects. +* Bugfix: 'Save All' was not updating the dirty flag in the inactive tabs +* Bugfix: Fixing a crash when editing PCell parameters while the macro editor is open +* Bugfix: Fixed a potential Crash on "save all" +* Bugfix: Fixed a bug when returning a Region into a layout with cells unselected +* Bugfix: Tab title were not updated on cell rename +* Bugfix: Fixed a crash on certain layout queries + - For example "instances of cell .*.* where inst.trans.rot == 2" was crashing +* Bugfix: Fixing two problems with layer mapping + - Mapping "[*/*] 100/0:0/0" (for example) created 0/0 two times when the input contains 100/0 and 0/0. Now + it is a single layer only + - The mapping table generated from strings now uses layer indexes from a range that should not collide + with existing layer indexes. + 0.29.11 (2025-01-17): * Bug: %GITHUB%/issues/1948 Crash by instantiate a Cell in a Library-Cell * Bug: %GITHUB%/issues/1953 Callback_impl & coerce_parameters_impl parameter display issue diff --git a/Changelog.Debian b/Changelog.Debian index dd2ebb144..85f58621a 100644 --- a/Changelog.Debian +++ b/Changelog.Debian @@ -1,3 +1,10 @@ +klayout (0.29.12-1) unstable; urgency=low + + * New features and bugfixes + - See changelog + + -- Matthias Köfferlein Sun, 02 Mar 2025 21:16:41 +0100 + klayout (0.29.11-1) unstable; urgency=low * New features and bugfixes diff --git a/version.sh b/version.sh index 48d9e093d..bfa5bd2dd 100644 --- a/version.sh +++ b/version.sh @@ -2,10 +2,10 @@ # This script is sourced to define the main version parameters # The main version -KLAYOUT_VERSION="0.29.11" +KLAYOUT_VERSION="0.29.12" # The version used for PyPI (don't use variables here!) -KLAYOUT_PYPI_VERSION="0.29.11" +KLAYOUT_PYPI_VERSION="0.29.12" # The build date KLAYOUT_VERSION_DATE=$(date "+%Y-%m-%d") From fb9e0c4602276e2708ceae36a1f8fe6e99ee4626 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 2 Mar 2025 22:24:04 +0100 Subject: [PATCH 19/29] Fixed a compile issue --- src/db/db/dbEdgePairs.h | 2 +- src/db/db/dbEdges.h | 2 +- src/db/db/dbRegion.h | 2 +- src/db/db/dbTexts.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/db/db/dbEdgePairs.h b/src/db/db/dbEdgePairs.h index 36b8960f8..691140cb6 100644 --- a/src/db/db/dbEdgePairs.h +++ b/src/db/db/dbEdgePairs.h @@ -355,7 +355,7 @@ public: std::pair split_filter (const EdgePairFilterBase &filter) const { std::pair p = mp_delegate->filtered_pair (filter); - return std::pair (EdgePairs (p.first), EdgePairs (p.second)); + return std::make_pair (EdgePairs (p.first), EdgePairs (p.second)); } /** diff --git a/src/db/db/dbEdges.h b/src/db/db/dbEdges.h index bb57ada29..5469cb649 100644 --- a/src/db/db/dbEdges.h +++ b/src/db/db/dbEdges.h @@ -477,7 +477,7 @@ public: std::pair split_filter (const EdgeFilterBase &filter) const { std::pair p = mp_delegate->filtered_pair (filter); - return std::pair (Edges (p.first), Edges (p.second)); + return std::make_pair (Edges (p.first), Edges (p.second)); } /** diff --git a/src/db/db/dbRegion.h b/src/db/db/dbRegion.h index 893931949..1548c65ab 100644 --- a/src/db/db/dbRegion.h +++ b/src/db/db/dbRegion.h @@ -581,7 +581,7 @@ public: std::pair split_filter (const PolygonFilterBase &filter) const { std::pair p = mp_delegate->filtered_pair (filter); - return std::pair (Region (p.first), Region (p.second)); + return std::make_pair (Region (p.first), Region (p.second)); } /** diff --git a/src/db/db/dbTexts.h b/src/db/db/dbTexts.h index 03594f1fd..283538d24 100644 --- a/src/db/db/dbTexts.h +++ b/src/db/db/dbTexts.h @@ -342,7 +342,7 @@ public: std::pair split_filter (const TextFilterBase &filter) const { std::pair p = mp_delegate->filtered_pair (filter); - return std::pair (Texts (p.first), Texts (p.second)); + return std::make_pair (Texts (p.first), Texts (p.second)); } /** From 20111ce08d83b0498750991e6b866adf0de00704 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 3 Mar 2025 01:05:04 +0100 Subject: [PATCH 20/29] Fixed issue #1993 ('with_area' modifies result of 'join') Root cause was a held layout lock inside the TilingProcessor. As that object was not always released inside the Ruby DRC script, the lock was held sometimes longer than needed and messed with the hierarchy system. --- src/db/db/dbOriginalLayerEdgePairs.cc | 2 +- src/db/db/dbOriginalLayerEdges.cc | 2 +- src/db/db/dbOriginalLayerRegion.cc | 6 +----- src/db/db/dbOriginalLayerTexts.cc | 2 +- src/db/db/dbRecursiveShapeIterator.cc | 7 +++++++ src/db/db/dbRecursiveShapeIterator.h | 10 ++++++++++ src/db/db/dbTilingProcessor.cc | 2 +- src/db/unit_tests/dbTilingProcessorTests.cc | 2 ++ src/drc/drc/built-in-macros/_drc_layer.rb | 2 ++ 9 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/db/db/dbOriginalLayerEdgePairs.cc b/src/db/db/dbOriginalLayerEdgePairs.cc index cf9b99c27..3544512fe 100644 --- a/src/db/db/dbOriginalLayerEdgePairs.cc +++ b/src/db/db/dbOriginalLayerEdgePairs.cc @@ -181,7 +181,7 @@ OriginalLayerEdgePairs::begin_iter () const bool OriginalLayerEdgePairs::empty () const { - return m_iter.at_end (); + return m_iter.at_end_no_lock (); } const db::EdgePair * diff --git a/src/db/db/dbOriginalLayerEdges.cc b/src/db/db/dbOriginalLayerEdges.cc index 1cb19d028..da181c17d 100644 --- a/src/db/db/dbOriginalLayerEdges.cc +++ b/src/db/db/dbOriginalLayerEdges.cc @@ -218,7 +218,7 @@ OriginalLayerEdges::begin_merged_iter () const bool OriginalLayerEdges::empty () const { - return m_iter.at_end (); + return m_iter.at_end_no_lock (); } bool diff --git a/src/db/db/dbOriginalLayerRegion.cc b/src/db/db/dbOriginalLayerRegion.cc index d089f4001..d5ba1cf13 100644 --- a/src/db/db/dbOriginalLayerRegion.cc +++ b/src/db/db/dbOriginalLayerRegion.cc @@ -330,11 +330,7 @@ OriginalLayerRegion::begin_merged_iter () const bool OriginalLayerRegion::empty () const { - // NOTE: we should to make sure the iterator isn't validated as this would spoil the usability or OriginalLayerRegion upon - // layout changes - db::RecursiveShapeIterator iter = m_iter; - - return iter.at_end (); + return m_iter.at_end_no_lock (); } bool diff --git a/src/db/db/dbOriginalLayerTexts.cc b/src/db/db/dbOriginalLayerTexts.cc index 6555eb4dc..9d8622f43 100644 --- a/src/db/db/dbOriginalLayerTexts.cc +++ b/src/db/db/dbOriginalLayerTexts.cc @@ -181,7 +181,7 @@ OriginalLayerTexts::begin_iter () const bool OriginalLayerTexts::empty () const { - return m_iter.at_end (); + return m_iter.at_end_no_lock (); } const db::Text * diff --git a/src/db/db/dbRecursiveShapeIterator.cc b/src/db/db/dbRecursiveShapeIterator.cc index fda051d39..c92cd4bc4 100644 --- a/src/db/db/dbRecursiveShapeIterator.cc +++ b/src/db/db/dbRecursiveShapeIterator.cc @@ -598,6 +598,13 @@ RecursiveShapeIterator::at_end () const return m_shape.at_end () || is_inactive (); } +bool +RecursiveShapeIterator::at_end_no_lock () const +{ + RecursiveShapeIterator copy (*this); + return copy.at_end (); +} + std::vector RecursiveShapeIterator::path () const { diff --git a/src/db/db/dbRecursiveShapeIterator.h b/src/db/db/dbRecursiveShapeIterator.h index ae337a29e..26ee32b7e 100644 --- a/src/db/db/dbRecursiveShapeIterator.h +++ b/src/db/db/dbRecursiveShapeIterator.h @@ -709,6 +709,16 @@ public: */ bool at_end () const; + /** + * @brief End of iterator predicate + * + * Returns true, if the iterator is at the end of the sequence + * + * This version does not lock the layout and can be used after initialization + * to detect empty sequences. + */ + bool at_end_no_lock () const; + /** * @brief Gets the translated property ID * diff --git a/src/db/db/dbTilingProcessor.cc b/src/db/db/dbTilingProcessor.cc index b25ce543a..131c3bb4f 100644 --- a/src/db/db/dbTilingProcessor.cc +++ b/src/db/db/dbTilingProcessor.cc @@ -876,7 +876,7 @@ TilingProcessor::execute (const std::string &desc) if (tot_box.empty ()) { for (std::vector::const_iterator i = m_inputs.begin (); i != m_inputs.end (); ++i) { - if (! i->iter.at_end ()) { + if (! i->iter.at_end_no_lock ()) { if (scale_to_dbu ()) { double dbu_value = i->iter.layout () ? i->iter.layout ()->dbu () : dbu (); tot_box += i->iter.bbox ().transformed (db::CplxTrans (dbu_value) * db::CplxTrans (i->trans)); diff --git a/src/db/unit_tests/dbTilingProcessorTests.cc b/src/db/unit_tests/dbTilingProcessorTests.cc index e31a885e5..18a741fce 100644 --- a/src/db/unit_tests/dbTilingProcessorTests.cc +++ b/src/db/unit_tests/dbTilingProcessorTests.cc @@ -148,7 +148,9 @@ TEST(2) tp.queue ("_output(o1, _tile ? (i1 & i2 & _tile) : (i1 & i2), false)"); tp.queue ("!_tile && _output(o2, i1.outside(i2), false)"); tp.queue ("_tile && _output(o3, _tile, false)"); + EXPECT_EQ (ly.under_construction (), false); tp.execute ("test"); + EXPECT_EQ (ly.under_construction (), false); EXPECT_EQ (to_s (ly, top, o1), "box (60,10;70,20);box (10,10;30,30)"); EXPECT_EQ (to_s (ly, top, o2), "box (50,40;80,70)"); diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb index c384d82c6..25f47c22d 100644 --- a/src/drc/drc/built-in-macros/_drc_layer.rb +++ b/src/drc/drc/built-in-macros/_drc_layer.rb @@ -4624,6 +4624,8 @@ TP_SCRIPT res end + tp._destroy + DRCLayer::new(@engine, res) end From 7a2fc402fe2d92fc490b0fd48c4a991c1c0730ac Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 3 Mar 2025 01:18:53 +0100 Subject: [PATCH 21/29] Trying to fix github actions --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de811ab93..79a5ae3bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,6 +78,7 @@ jobs: ccache -s - uses: actions/upload-artifact@v4 with: + name: artifact-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl # The following was taken from https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/ @@ -92,15 +93,16 @@ jobs: - uses: actions/upload-artifact@v4 with: + name: artifact-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ strategy.job-index }} path: dist/*.tar.gz upload_to_test_pypy: needs: [build, make_sdist] runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: artifact + name: artifact-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ strategy.job-index }} path: dist - uses: pypa/gh-action-pypi-publish@v1.12.4 @@ -115,9 +117,9 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: artifact + name: artifact-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ strategy.job-index }} path: dist - uses: pypa/gh-action-pypi-publish@v1.12.4 From f7a76033bb3abc52fff5a758214a90b284dab86a Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 3 Mar 2025 18:04:01 +0100 Subject: [PATCH 22/29] Updated changelog --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index 41d3e9a7c..7af49841b 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,7 @@ * Enhancement: %GITHUB%/issues/1989 API enhancements: several new split_... methods on Edges, Region, EdgePairs and Texts, delivering a pair of containers with selected and unselected objects. +* Bug: %GITHUB%/issues/1993 Tiling processor kept layout locks, causing DRC issues with "with_density" * Bugfix: 'Save All' was not updating the dirty flag in the inactive tabs * Bugfix: Fixing a crash when editing PCell parameters while the macro editor is open * Bugfix: Fixed a potential Crash on "save all" From ac1c656bc05e8cc0753fbcc14ff8d65496be6c98 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 3 Mar 2025 18:34:43 +0100 Subject: [PATCH 23/29] Fixed unit tests --- src/db/unit_tests/dbLayoutQueryTests.cc | 2 +- testdata/algo/dss_bug_au.gds | Bin 1208 -> 996 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/unit_tests/dbLayoutQueryTests.cc b/src/db/unit_tests/dbLayoutQueryTests.cc index 08d2587c5..ae09ecb57 100644 --- a/src/db/unit_tests/dbLayoutQueryTests.cc +++ b/src/db/unit_tests/dbLayoutQueryTests.cc @@ -1592,6 +1592,6 @@ TEST(65) s = q2s_var (iq, "cell_name"); EXPECT_EQ (s, "c1,c5x"); s = q2s_var (iq, "inst_elements"); - EXPECT_EQ (s, "(cell_index=0 r0 *1 10,-20),(cell_index=4 r0 *1 10,-20)"); + EXPECT_EQ (s, "cell_index=0 r0 *1 10,-20,cell_index=4 r0 *1 10,-20"); } } diff --git a/testdata/algo/dss_bug_au.gds b/testdata/algo/dss_bug_au.gds index 528f82c7c5564b45bfe8e88384e1c65edf29cb0b..c8a1f3215941734fbf49ed72cc21a23a04024f9d 100644 GIT binary patch delta 277 zcmdnN`Gj4GfsKKQDS|(8CIOOGH`&+F$9?+iOUqz$xTf8IAzTy`!P?(=Jd&5n02v= Io3OM10J7gB1^@s6 delta 338 zcmaFDzJpVVfsKKQDS|3=A@?I32~n0k*~vVu>;?b4(dnxEUDOgn-sf jmSVD*{Dm4wQWGPHB1w+`FpYgvo2Qg1m+e1oEa`- From 7b4e8a346299545daa02668ae5589c04950d6fd2 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 4 Mar 2025 19:50:33 +0100 Subject: [PATCH 24/29] Refined solution for DSS remapping bug --- src/db/db/dbDeepShapeStore.cc | 58 ++++++++++++++++----- src/db/unit_tests/dbDeepShapeStoreTests.cc | 40 ++++++++++++++ testdata/algo/dss_bug2.gds | Bin 0 -> 852 bytes testdata/algo/dss_bug2_au.gds | Bin 0 -> 1072 bytes 4 files changed, 85 insertions(+), 13 deletions(-) create mode 100644 testdata/algo/dss_bug2.gds create mode 100644 testdata/algo/dss_bug2_au.gds diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index 23a28ef30..c6bbb6aee 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -1233,7 +1233,6 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout if (! new_pairs.empty ()) { // the variant's originals we are going to delete - std::set cells_to_delete; std::vector > new_variants; // We now need to fix the cell map from the hierarchy builder, so we can import back from the modified layout. @@ -1248,7 +1247,6 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout // create the variant clone in the original layout too and delete this cell VariantsCollectorBase::copy_shapes (*into_layout, np->second, icm->second.original_cell); new_variants.push_back (std::make_pair (np->second, icm->second.original_cell)); - cells_to_delete.insert (icm->second.original_cell); // forget the original cell (now separated into variants) and map the variants back into the // DSS layout @@ -1279,26 +1277,60 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout std::vector mapped = cm->second.target_cells (); std::sort (mapped.begin (), mapped.end ()); - // Copy the variant instances - but only those for cells which are not going to be - // deleted and those not handled by the cell mapping object. + // Copy the variant instances - but only those for cells which are not handled by the cell mapping object. for (auto vv = new_variants.begin (); vv != new_variants.end (); ++vv) { + const db::Cell &from = into_layout->cell (vv->second); db::Cell &to = into_layout->cell (vv->first); for (db::Cell::const_iterator i = from.begin (); ! i.at_end (); ++i) { - if (cells_to_delete.find (i->cell_index ()) == cells_to_delete.end ()) { - auto m = std::lower_bound (mapped.begin (), mapped.end (), i->cell_index ()); - if (m == mapped.end () || *m != i->cell_index ()) { - to.insert (*i); - } + auto m = std::lower_bound (mapped.begin (), mapped.end (), i->cell_index ()); + if (m == mapped.end () || *m != i->cell_index ()) { + to.insert (*i); } } + + } + + // clean up instances of variant original cells + + std::map > delete_instances_of; + + into_layout->force_update (); + + for (auto vv = new_variants.begin (); vv != new_variants.end (); ++vv) { + const db::Cell &to = into_layout->cell (vv->first); + for (auto p = to.begin_parent_cells (); p != to.end_parent_cells (); ++p) { + delete_instances_of [*p].insert (vv->second); + } } - } + std::vector insts_to_delete; + for (auto di = delete_instances_of.begin (); di != delete_instances_of.end (); ++di) { + db::Cell &in = into_layout->cell (di->first); + insts_to_delete.clear (); + for (auto i = in.begin (); ! i.at_end (); ++i) { + if (di->second.find (i->cell_index ()) != di->second.end ()) { + insts_to_delete.push_back (*i); + } + } + in.erase_insts (insts_to_delete); + } + + // remove variant original cells unless they are still used + + into_layout->force_update (); + + std::set cells_to_delete; + for (auto vv = new_variants.begin (); vv != new_variants.end (); ++vv) { + if (into_layout->cell (vv->second).parent_cells () == 0) { + cells_to_delete.insert (vv->second); + } + } + + if (! cells_to_delete.empty ()) { + into_layout->delete_cells (cells_to_delete); + } - if (! cells_to_delete.empty ()) { - // delete the variant original cells - into_layout->delete_cells (cells_to_delete); } } diff --git a/src/db/unit_tests/dbDeepShapeStoreTests.cc b/src/db/unit_tests/dbDeepShapeStoreTests.cc index c0a56db08..4a01e194c 100644 --- a/src/db/unit_tests/dbDeepShapeStoreTests.cc +++ b/src/db/unit_tests/dbDeepShapeStoreTests.cc @@ -301,3 +301,43 @@ TEST(6_RestoreWithCellSelection) db::compare_layouts (_this, ly, tl::testdata () + "/algo/dss_bug_au.gds"); } +TEST(7_RestoreWithCellSelection2) +{ + db::Layout ly; + + { + std::string fn (tl::testdata ()); + fn += "/algo/dss_bug2.gds"; + tl::InputStream stream (fn); + db::Reader reader (stream); + reader.read (ly); + } + + unsigned int l2 = ly.get_layer (db::LayerProperties (2, 0)); + + db::Cell &top_cell = ly.cell (*ly.begin_top_down ()); + + db::RecursiveShapeIterator in_it (ly, top_cell, l2); + db::RecursiveShapeIterator other_it (ly, top_cell, l2); + + std::set us; + us.insert (ly.cell_by_name ("X").second); + in_it.unselect_cells (us); + + std::set us2; + us2.insert (top_cell.cell_index ()); + other_it.unselect_cells (us2); + other_it.select_cells (us); + + db::DeepShapeStore dss; + + db::Region in_region (in_it, dss); + db::Region other_region (other_it, dss); + in_region += other_region; + + ly.clear_layer (l2); + in_region.insert_into (&ly, top_cell.cell_index (), l2); + + db::compare_layouts (_this, ly, tl::testdata () + "/algo/dss_bug2_au.gds"); +} + diff --git a/testdata/algo/dss_bug2.gds b/testdata/algo/dss_bug2.gds new file mode 100644 index 0000000000000000000000000000000000000000..1c4b8c47be0aa6b1c8fa10bf93cd744935bd29a8 GIT binary patch literal 852 zcma)4u}%U(5Pi41H*63MB9*zy+Qb|&8WTez*cgdgT!DOuA7G~+Kx1QPYm9}ZmGKKK zEGdX~v?4gp-Ejh^!d)_Xm)Y!__udW&N;Tm*D)$ZzgFGzClmD=a8V5C?tljF~#rEOT zO>bxaVdMI$6~J?6+#_oEn}D$ZEh;#mB?Vx;sG0dTDe3g2x(O!z5Mh?(ehxF|5K-NS zSpaM)o@iIXX%4)i7S>&<`(K!qx$++~^YD!M^Er*N=83Oil-0v`lI6PwhdK+WX z?{~6#Zb~xZnMzczfL0xGSn%9hOECPVGEkR*n+H-DWiaCK=W*yN;Jg4S%$Vb8tTuU} zIeKv}vjTB3jnS;Xl4V&>v}I!i)t%g38)MQ(J5#cjC^$Y5wGx+PE4mBe7U@C69w~@V RB!4+!{&v@T>fBe%d4LnY`;oWoY@4Y}nsX78nWnN*!K^_Gx55B`wx>_j#^R`>u zKHb>8zie-oZ&xnP8#M&(-}`*6tKr&GxpD|N9-yZcEa({ppfGET$W^jfX>&a%n$(TL zndANp{`K-AugUvliI&Eb{&^sxhxG-fEC{cU`2@ z5;5A_6Zv@QYf|sDQt>wF!YG{=r2__%@f5eXZhmN*lVs;3(&gOQcy6-R3l@9%fm>=& z%`@zF0$4Rxhc$Bhjf3zqqshBPRoC3R*w>_vW?ByQIIYf^^BR*>odIr^Zo?WS<;12( yIIf3XWa39)MANY4UsBsYU|vR`7diX0Ham4A7Ey=z3uodNk+(bEkf(1Fj)PBU7U2H? literal 0 HcmV?d00001 From 465f13adc63ebc5fb04bc779213f37dd6c161c22 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 4 Mar 2025 19:50:52 +0100 Subject: [PATCH 25/29] Corrected naming of artifacts in build action --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94fe97524..9b7295218 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,14 +22,18 @@ jobs: include: - os: "macos-13" # intel runner cibuild: "*macosx*" + cibw_arch: "macos_x86_64" macos-arch: "x86_64" - os: "macos-14" # M1 runner cibuild: "*macosx*" + cibw_arch: "macos_arm64" macos-arch: "arm64" - os: "ubuntu-latest" cibuild: "*manylinux*" + cibw_arch: "manylinux" - os: "ubuntu-latest" cibuild: "*musllinux*" + cibw_arch: "musllinux" steps: - name: Free Disk Space (Ubuntu) if: matrix.os == 'ubuntu-latest' From 70af6bd7c9987ce2ed113d7f564b8b49590bd494 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 4 Mar 2025 20:37:58 +0100 Subject: [PATCH 26/29] Another refinement for DSS bug solution --- src/db/db/dbDeepShapeStore.cc | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index c6bbb6aee..9a2cd9599 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -1320,10 +1320,28 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout into_layout->force_update (); - std::set cells_to_delete; + std::set vars; for (auto vv = new_variants.begin (); vv != new_variants.end (); ++vv) { - if (into_layout->cell (vv->second).parent_cells () == 0) { - cells_to_delete.insert (vv->second); + vars.insert (vv->second); + } + + std::set cells_to_delete; + + bool more = true; + while (more) { + more = false; + for (auto v = vars.begin (); v != vars.end (); ++v) { + if (cells_to_delete.find (*v) == cells_to_delete.end ()) { + const db::Cell &vc = into_layout->cell (*v); + bool used = false; + for (auto p = vc.begin_parent_cells (); p != vc.end_parent_cells () && ! used; ++p) { + used = (cells_to_delete.find (*p) == cells_to_delete.end ()); + } + if (! used) { + cells_to_delete.insert (*v); + more = true; + } + } } } From 605fa44ca67c217ddf308dd839145e97f587e1eb Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 5 Mar 2025 10:26:45 +0100 Subject: [PATCH 27/29] Another refinement for DSS bug fix. --- src/db/db/dbDeepShapeStore.cc | 34 +++++++++++------ src/db/unit_tests/dbDeepShapeStoreTests.cc | 41 +++++++++++++++++++++ testdata/algo/dss_bug3.gds | Bin 0 -> 926 bytes testdata/algo/dss_bug3_au.gds | Bin 0 -> 1026 bytes 4 files changed, 63 insertions(+), 12 deletions(-) create mode 100644 testdata/algo/dss_bug3.gds create mode 100644 testdata/algo/dss_bug3_au.gds diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index 9a2cd9599..687008b9c 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -1244,7 +1244,7 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout std::map::const_iterator icm = cm_skipped_variants.find (var_org); if (icm != cm_skipped_variants.end ()) { - // create the variant clone in the original layout too and delete this cell + // create the variant clone in the original layout too VariantsCollectorBase::copy_shapes (*into_layout, np->second, icm->second.original_cell); new_variants.push_back (std::make_pair (np->second, icm->second.original_cell)); @@ -1269,22 +1269,32 @@ DeepShapeStore::cell_mapping_to_original (unsigned int layout_index, db::Layout // copy cell instances for the new variants - // collect the cells that are handled during cell mapping - - // we do not need to take care of them when creating variants, - // but there may be others inside "into_layout" which are - // not present in the DSS and for which we need to copy the - // instances. - std::vector mapped = cm->second.target_cells (); - std::sort (mapped.begin (), mapped.end ()); + std::map variant_to_org; + for (auto vv = new_variants.begin (); vv != new_variants.end (); ++vv) { + variant_to_org.insert (std::make_pair (vv->first, vv->second)); + } // Copy the variant instances - but only those for cells which are not handled by the cell mapping object. for (auto vv = new_variants.begin (); vv != new_variants.end (); ++vv) { - const db::Cell &from = into_layout->cell (vv->second); - db::Cell &to = into_layout->cell (vv->first); + const db::Cell &from = into_layout->cell (vv->second); // original + db::Cell &to = into_layout->cell (vv->first); // variant + + // Collect and copy the cells which are not mapped already. + // Skip variant original cells if their variants are included. + std::set dont_copy; + + for (auto c = to.begin_child_cells (); ! c.at_end (); ++c) { + auto v2o = variant_to_org.find (*c); + if (v2o != variant_to_org.end ()) { + dont_copy.insert (v2o->second); + } else { + dont_copy.insert (*c); + } + } + for (db::Cell::const_iterator i = from.begin (); ! i.at_end (); ++i) { - auto m = std::lower_bound (mapped.begin (), mapped.end (), i->cell_index ()); - if (m == mapped.end () || *m != i->cell_index ()) { + if (dont_copy.find (i->cell_index ()) == dont_copy.end ()) { to.insert (*i); } } diff --git a/src/db/unit_tests/dbDeepShapeStoreTests.cc b/src/db/unit_tests/dbDeepShapeStoreTests.cc index 4a01e194c..d14be57fe 100644 --- a/src/db/unit_tests/dbDeepShapeStoreTests.cc +++ b/src/db/unit_tests/dbDeepShapeStoreTests.cc @@ -341,3 +341,44 @@ TEST(7_RestoreWithCellSelection2) db::compare_layouts (_this, ly, tl::testdata () + "/algo/dss_bug2_au.gds"); } +TEST(8_RestoreWithCellSelection3) +{ + db::Layout ly; + + { + std::string fn (tl::testdata ()); + fn += "/algo/dss_bug3.gds"; + tl::InputStream stream (fn); + db::Reader reader (stream); + reader.read (ly); + } + + unsigned int l2 = ly.get_layer (db::LayerProperties (2, 0)); + + db::Cell &top_cell = ly.cell (*ly.begin_top_down ()); + + db::RecursiveShapeIterator in_it (ly, top_cell, l2); + db::RecursiveShapeIterator other_it (ly, top_cell, l2); + + std::set us; + us.insert (ly.cell_by_name ("X").second); + us.insert (ly.cell_by_name ("C3").second); + in_it.unselect_cells (us); + + std::set us2; + us2.insert (top_cell.cell_index ()); + other_it.unselect_cells (us2); + other_it.select_cells (us); + + db::DeepShapeStore dss; + + db::Region in_region (in_it, dss); + db::Region other_region (other_it, dss); + in_region += other_region; + + ly.clear_layer (l2); + in_region.insert_into (&ly, top_cell.cell_index (), l2); + + db::compare_layouts (_this, ly, tl::testdata () + "/algo/dss_bug3_au.gds"); +} + diff --git a/testdata/algo/dss_bug3.gds b/testdata/algo/dss_bug3.gds new file mode 100644 index 0000000000000000000000000000000000000000..39c289ac5c4cd031cad63edc79dd6e2f9bbcf6d5 GIT binary patch literal 926 zcmbW0KQ9D97{;HO*_oST$>Aa)TdO2;rw|H>qaY*{TO74q)S^&{LPH^#BV0w5AE6vVU2WTq2x^}s= z{rvF0yz#Vfe|Hcf(8c?VG3$%)EMUeY1kAVuFyBy76rC{69075}2s38$j_@V`uZGer zZFr;1GU@W!DVIwiXeeeoWW4-hd~T{s4(l59n71EAgC3wR7}puIdB@7STK~~iUT>GK zr1iF7W(Di>1KoKf-IsGfUIFzF;0I#|(lgp+XQ)>|H|a#41uiBc^l3tWj(a)In9Y+F zySx8~YAyR^j%h)jg-T_RsC2B~Qsv4w-AcM%MX5C=+})$rk@zN3wV&K{`nH+Wnyj#U U?Adv~XZ)8Bj2?@dFJC+lpVU2ctpET3 literal 0 HcmV?d00001 diff --git a/testdata/algo/dss_bug3_au.gds b/testdata/algo/dss_bug3_au.gds new file mode 100644 index 0000000000000000000000000000000000000000..45c7459465a4b3dc0aba46c97a8eeda0cbcd074c GIT binary patch literal 1026 zcmcIju}Z^G6g}@Hd40xKs@6p^7AHYc2hl;WcCaWY*r7U0aTW(Bad6Q=#I+7?{(ysD zAby3ro0DVXxk;l9r8Wo#ZqDPrX^|=G0h9Yod(^|{eYlfknh{PrD|`w;*&*W*<8=u0)V6W$@EA4Uj2zEPsUwKE_1?U7GrmZdj)im6cL=b zW8t+Ql%4*5p6RgHcG9a%y*92>=MC^GbS8^26ZQJBUO7i&6zgkt{K-zUI8w2w^3LQ< zwF}8Q#WYXMqnPKhwYx{netgn7sbX@QsA?;zknGSGs<_C`jo Date: Wed, 5 Mar 2025 18:41:28 +0100 Subject: [PATCH 28/29] Updating doc, py includes --- src/doc/doc/images/drc_textpoly1.png | Bin 3343 -> 5631 bytes src/doc/doc/images/drc_textpoly2.png | Bin 3343 -> 5600 bytes src/pymod/distutils_src/klayout/dbcore.pyi | 591 +++++++++++++++++++-- 3 files changed, 550 insertions(+), 41 deletions(-) diff --git a/src/doc/doc/images/drc_textpoly1.png b/src/doc/doc/images/drc_textpoly1.png index 3e6df4d40ec153b40f5c9a2bc5553d0fb2c6f43a..487cfcc9ca818fc3947998e6294cada21108eca8 100644 GIT binary patch literal 5631 zcmd5=X;f2Z8V)i_>#5M86|}MqN?q6#lr4~mAiJoDMT!y>G}Tc+5($t^hdK;JjaUHz zA$3$z8Cw*rOxVIyL1g<$K=e zdA~1vM|j|p#h)xjp-@YLgZv{>ra!@n@g)+Vm{S5N#jaNV~ ziCgy&{SF>Ix&alreMjKY=U(7T8|Y=k!FVESjiZaxru7~U;A8!I7qo}dMo$+94<}Dg zkF{yOK7lCI(&S)&-^jGfBmFxs@B;ETKZ*==zL_t)ei&b5vd#6kRrU)*90s;{tQOwO zxc0a2Lz-Pb4X%0sxJGNjrkt~{c5q8|8)! zKb31Ky%Xl1p$TA40?jf>!3HV+sjZGcZ2T+-{jlQip8d*AN$wr=%8gicY!X1-M$$Io zhJCnHW)%>HTSgJ9u$`OlV(Im3RyzNg??Tg+8S{sKux@#3YnOW_cWrjUnTS^PF>HRH z3oz767e5+Psal=u6^b8*_B8MOVDH1j=MGA>Qz|9X`>89Agx2IA3fz#qjm^~^-@i?^ zXgPr1!qzr*lk&oFFUE3iT4#v+Hz|B7bPX7?f}1bs9jOMQd!DHmXg(LEt%(>HEl=_c z&DLxTC|h-5gUf6L?=@fI_mU`7TGm_rz0-Koka#Z3 z*3RYATz!mCRv~t9FpX$phi>KEMvHF<-XE{c-H;9CrLV-!bq4T z1ZAHIzV@%xgTLGRgm{z=aGU&iOt#3cJn}|F-t;d1sf^EDh1U_g%sNJtdLiB_})%l5rv2z<6 z4ZI%s&4&eIT}y`fK+4#|DZEs5e%% zC2LGI|LMiVf2sRt<5~O<6~3@pkNaLvpF^(Xc@7Iyj0gXdpy(B2-=!f!QeoEG^j0|zATaM}}f$LL_kVhYlHFaGM2H6r&t9@j_lPk9eJr@x! zcGz{VJ(YLX=%%osBrqR6TI49pS3i2{?lJ+tV4<6K}Z)@j-8zJlDDi* zJ%I^!tmLB$!dSoi>~5X&kD8z4Eh$E^gj!;8ag%10J!H(f(|~q$hYDhrRW20fu#VrF zA>K+~TV|6-NJT<`Fn8z)T!Qh5u92f=@_VA(A>+D3>XIV1XYwa2O!l-pqpSH>XP5v? z?eTuygi%V+_U9kfdNHq=MN3OU%XTfWuMVxg^{6cq4x#Ebw+4rEmmDZ9d6|57C<$0% zs&Z(~O}DF(zfAuqXP2wHQF#2I!QWH|MfvE)L$*8jcj!Mw1cWF1xq)Z}1)vgqnW0&|YFzFa zBDx^H*!WYk;b(Gg$4ahcTKini@2&k#*3s7Ps8AH28^JH>%6)YU<_CznGrxw!ciKY1M+>K|dqtDQw0T2z1j-pAoTas3+^m_}1{K zh2%B-6-5OiaM-vw*WQ1#8YJmTkGOgv#fyb0$7`n_l!C>U?R6sTVRjZpQbrEPo|dluzI#m=S8|Ckx;S{4=RLYanSum1o5oq>b&kB*E5$D%>M^@LVp zNZe4W*vzdcJsAe@FC@HB2nF$MM-QJew$aA1(zmS&ZYNl7(=)_U4h%z=iiFhI{pTDM zNGFYujtGT~hmU&4ZQ{VK_$!i~qvBg+rg)wzwyO2DqT94@tLD|ogOBJTTnXWh;XoSL zl;gLXAaCkEd8cL3hRzO0lE-ycK_Y&J5@w13`oVcIC}x8#Ab#kl)A0z95y-=<#5^(I zPa9$nbrfop>3-ufptv+StWQddt-+S6R9`-5)e4k-=H6av(99mP>Vd}Ju;q+U zjre=u#TmnGBz*TGV7MSjVAE~#yz#6X@X`3-X=djN^2^@&@h5z!CW0hYM9H*wGwRBn zQz|lK4;VdkqfsK8H4RX}a*lq&rPdI86++22MO25mLKyXUI0wI_Xh=t7^MdiV^^74k)xmY!k>VkV zu-m>+vV?Xz>e9?U?l~^P)H^>D*ZO)DlK|DkV);Tk24sbb=(?pTS?>O3e5ZaE>qBOJ zFWI90cxo~BNims;PF^6XbtMqEmf?qwe|sdcA?*_*$;`a6V%2!`nX3~ahZ4Y4kSgn2 z5{AlM!HvRVLs4>{qLJdp(QdZ&In5r@(YjkZW~K5(c^Sz)p#0qQFWo6PW+s-F%M$%; z4d?`sHS{mWCYg({G(m-Ky4xh-xDG=V2qZv#1wf`dakP_Ib!{n45@nsiHTT@Nl)?_J z$C0_3F(B`7s??JtGGBx6aM*R zgfynmn;<=Mv$|D;ONH3#SUT=YXhm`)!rCddL`J_21AAUr#yf`57Wf-Y&3+7Zsdpv+ zRIh{a?)G-`?S@^pEAD%PtotexFkT?V1ZzbVYX$|($+Wob&-2=J_HAehLIP=xM`(TN z32eiP89sn;&%4g!I|#EnXS*kXO1jIVjB%FVk$aD4?!#JtMFnXSTJ!FGj)uGmXVty~f^1&X9fxQ^juXuzG@Uppp(HLadEYZ;oG& zk4S+%A5XSrKJHPi`aw@(*^uh@HmU;>q`j%xp{cKzI$I`e^C1O zUoA93R1EQaZ>=Lz*ul7&aXulFPqWEV5HYvyT^Rc8^$Y>GKAh~S?#FOVVJRJ={$3bW z`Z9o#E}zs)e@xD8S6SVU7J6JmJ%DK7J0=RPwk%$)#yMI2s%!JHj>!A2hC`%dh{c-m zLa>!90A+~ynS`!US1n^z027MJd%g7Oc#5V0P1g$4gmiVUbtg?(ftkp6PN`Y<_#UEI z{jZ=7WZhXA01=32M+2I7tieOnpRSu=90E$klbMEO+ZpCQIMcG{&H8MFeNes=`f&iF za2VcOW_T0aiQdA%*w*1!(ngpP#vXgFnFl^aAv4djukWUoVs(!!x?HKIeW!f%} zd+cP7rV{2fuG+S(!W)`|kN|ks$-|4XDQ5BbC$FFn7Cm@?daa;{GPGO*p{)?uVCgoe z&zh<3f8VkC#@2t!A+PNwd|U&ij(6+{IKZ^n7naO2cig-7QBOsc+VGK3k+rpTE*yex z^^K96uzVjx#x6K~eY&sC(oZiUny%(i)k>vOr&W*izPuV(7cbpmxC)NXooWhedN zQq`$f?l5NVlcKd#oDVQM(NwRDVW`{(_;?N6r&)<96iOJ~Ao=frg=O+8$ueb3J)TW6 zwsXtZcn7I!+O6hVs<3WiSIlKLeaak_Rm;EK#^m3M5i~~c9b4FQI1otb6_f&6HA!tb zkQ7&Jh$lWWkK`1+em~NR<1&_kyT3+qd7uC57Z!C_pEEGy)$+{WM$;E<{s(Rxqi6}4 zOhVf{O94)=Yh1cVilSfP9AgI>2fTIg4p`!HOfd-R1|LtA{0)r!Dsa)+wP#SK~Ut|2mg{qd>EZqFpolYh`XgX&jLV5~5 zE_3?a>(l0a_v)Xg%dHGr>J|FxqWEe^Y)(4Yg*{KuH3c(JJx}PpIOB{X1wS}$o%Z|s z^n97U|IeMb0S3p^RaX}4hk;Vuht|@zdDs&-1D*_s$1h^&6HOVT{>r{F=pZXaPPj+Eguw?Ti?3E++ z-GRG#N7tN0USq80#Qr??m=9HFetms?eJfwXj&tAsFIS!aS$>z2ya%Kmh-jnLgx3F@ zeem@EKOet-E@Y^`TA#;Wlepj4N?%|9xH!Z0zrV{4_{JSSQ2zDI>Al8Ydp1AWuK09* z^=5aw35b>+q?Ps4%kIm{y&HG_->=WG?swtlGxvWs-hD0oL#ytQen@}$m-+i%|KIWd z`ug~L?-}klZnyj(`u9Toihq~UTWdeJ)c{-n3=Wa$yF1VtWp6qs?ff+7?VG*(f>A}B#Zm;%)&^#KA3 zM1>Gt3Mg8mV95#y!KX|m5KB~y2?QAuBa#pTgpldofrz!}57t}#k(ImdS@-OH_WsWI z?Y&QJ^}!m>`(_>h0EU}AJ^TP*)(G_b=mYSL#~sg3@bBXzo+bKItc3UD zuLK2J_I`cVx}p&@0d(JSb8|cGGfv7`@by{G&CBp=Hn=P=z& z7L6XF%>I+xbk0M+;rTP34J-2CO#$gclqzf5#Xz~-+=Qwwrs-m_NxM?WN%gXaR2#*h zC9Wzo%h@hrqH~-m$}Y=6ZOjPG*fQzxW&h!196_YD(>0Vg3LdRft|oQVUDlZ`9{NR9 zKQhRpm(K5G8?#BHqk^8m96@bTLgGPJs&-7(LDlBd#xnsmW7I}8Nalp!*Cfj5Q6vpL zLH!-`rS7<(BdVg4aetFq^djZAMTCpEqxdS3p_EqpglAGxo!o6VR@7h1=IX9TeOf!B zW;BPoWHEkT)CqoI8-b@@#te#NUsi|5~f01NV=2+bPFnGFfk97LPV{sRAlrsua}O`L!h7n9?{* zSL*8bVM1Jpgt=286xM}rAx9oQe$L#D&VQaOvFq$UuojaT$+*9=)3#HHJY$nWle^qN zn3mU~d57JS+>KrlC$JSHc38u6l5M)^)eU@ejMtw1N3R}=td097dl7eukjv;dDjgYV zAB)3egIRcggk-R-4S<(Q1dzvLn9G*lt5E;q99z)0`-TkqvNFn%48hW}N&C2QTVuU(d z-dX^eCx$X+(}?lnSV#S*D#`^0YAHeu%?-1k46rPyPai9n|K1cW4Y8*z*ufpfe=ZCx z!sergF7S$Zd~0DE+lJs&Jlc7l0iEWKlmGe+IG4=hlh$(#7bvY8w#8dH*k@TQ+AKLM zQ}as6kzo~JFyS-sq>oswshp>Ab%&C{c$hs##5+RC_;s<+m$@`;#KZ0Ob@}E)de5V) zV?Hryb#a2f9;kM}!)Jagtl&1V%)8XYC}>u zI!Cix7jUsqCJ!qaAIVq4XL)@t#Z`ppLz4)Vyu0$CjGVu2(zEq3KT)=BiB0*ptO_^{ z;$j{b4hi@vEFhsO$}@7C1-0JEURSU+OLxMf7K0Tdp@feN=U_6b!IC3hbZnXiD~}rbsUDw0)lLiqojlN;;@r&-wCEDG8S~fARQ) zg4vo$vL&e}nDNgzf|l#^Yx+0&1b^TwxERujwF4|p1Y2BMV&W}#p{w%rlK%|eS z=%N(_Vy8Vd!bIm%x3Vyewy{V)^Yq(m$ZiH>F-5)wI;rJX80>)p{%9pv!9r@rr|=9u(e#gBK*AoG*aFmF^yZm)CPr?ljF^ z%WkvLXRl9OT&E-DUa3VFp65(o6g~g z(A`0tpnEHx8V-*ehDTO)3MsyR>3Rr5a7T=rmR%^YE1G*{ljE;M7)Y))G3bJN^$?6@ z7=#hb?W%TSU&U8gA%&$yv(N+Y%zt4sJFLXY^l@bc+gl-0NCixtT1ljiv2~qAYkrXE z8gMn;ToH%fBUj0lC&a;zUXgnF(OEAc*)7RvwA99Qkd8H^mQ+`a&SeV5(*sqpqTD(+Sq>(8(H!-*51HznsBid~~ zu4)4=s_J?x?H1RVePUgUMjTD&M#*u9htea)>d!81jV6Uie0}%bWN;hrFI8#ecB4iP zD5!#HjuLF$#b&PP-N2Yn_f^4Ln*Slg4C_txVm@>v5&%Pn-Z>a#461Gf9FcqGNgh#7dc)a9x)4&)crgS9FhLhv1!mGI?h+LuzJ~R0@bT65Mjqt|Dj}ej~KoeC1Sz!Wopm}^tdg0A^W492J zB!KDC`}k(n0s0HKAs`nII^qiD5*HF&{ETStrMl{syBw(v3_a5$K9hq{1~0`lwFlgJ zOx7OK(Ach@PU}h624nnFaz9MFU|d@D!nG6O|80|1OV8G0Y-P{c%Ge@|_D|DxholAE zDHq;X_DtQZ%afA_(BSR+F2g|?7IL2hqQyeJ3WC=Eoq52l5Uzs$UinORfQHeklcrr9 z5P$EZBLkm(y|b<>_lqDx%crKVVGd8>FOn>|ZL%D6fI@u3JS=#y?fOe)3}sLF#+@*# zUl)+WBki4}lEm}QQMWY+5Wd1(N571@?Ks!`F|OeYm)Fb8gefs1_>a`Wx)=saiKT+X!F zo9RSi#zTjWEmmj+GsNYN=6r(N6)$i=aLq1h&zDfI2W)Le!P+v-G;HWh6xP7BTf1fe z40GBs-~m{(lY-0Hq=#QBPrfmRKt==2K^htJQ#b8V)qtXLmiihvMb87ba!6AKsqD^wIi*KLrn%d#ug&ZxffU zZNoITVY)o?#Sn4s#(TJ7yd)>@r66|WgMRHN0V%6*@n>njBk`iMOf%jZ6b_wy`Gbh% z>i0niA2)pRkO=1h0G~Z!96del&=9mg(<#zB8g%Xa0p0EDGd8=+q3mtmg4p`!HOfd-R1|LtA{0)r!Dsa)+wP#SK~Ut|2mg{qd>EZqFpolYh`XgX&jLV5~5 zE_3?a>(l0a_v)Xg%dHGr>J|FxqWEe^Y)(4Yg*{KuH3c(JJx}PpIOB{X1wS}$o%Z|s z^n97U|IeMb0S3p^RaX}4hk;Vuht|@zdDs&-1D*_s$1h^&6HOVT{>r{F=pZXaPPj+Eguw?Ti?3E++ z-GRG#N7tN0USq80#Qr??m=9HFetms?eJfwXj&tAsFIS!aS$>z2ya%Kmh-jnLgx3F@ zeem@EKOet-E@Y^`TA#;Wlepj4N?%|9xH!Z0zrV{4_{JSSQ2zDI>Al8Ydp1AWuK09* z^=5aw35b>+q?Ps4%kIm{y&HG_->=WG?swtlGxvWs-hD0oL#ytQen@}$m-+i%|KIWd z`ug~L?-}klZnyj(`u9Toihq~UTWdeJ)c{-n3=Wa$yF1VtWp6qs?f EdgePairs: + def filtered(self, filter: EdgePairFilter) -> EdgePairs: r""" @brief Applies a generic filter and returns a filtered copy See \EdgePairFilter for a description of this feature. @@ -22596,6 +22597,14 @@ class EdgePairs(ShapeCollection): Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ ... + def split_filter(self, filter: EdgePairFilter) -> List[EdgePairs]: + r""" + @brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones + See \EdgePairFilter for a description of this feature. + + This method has been introduced in version 0.29.12. + """ + ... def split_inside(self, other: Region) -> List[EdgePairs]: r""" @brief Selects the edge pairs from this edge pair collection which are and are not inside (completely covered by) polygons from the other region @@ -22635,6 +22644,200 @@ class EdgePairs(ShapeCollection): This method has been introduced in version 0.29.6 """ ... + @overload + def split_with_abs_angle(self, angle: float, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_abs_angle, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_abs_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> List[EdgePairs]: + r""" + @brief Like \with_abs_angle, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_abs_angle_both(self, angle: float, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_abs_angle_both, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_abs_angle_both(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> List[EdgePairs]: + r""" + @brief Like \with_abs_angle_both, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle(self, angle: float, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_angle, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> List[EdgePairs]: + r""" + @brief Like \with_angle, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle(self, type: Edges.EdgeType, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_angle, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle_both(self, angle: float, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_angle_both, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle_both(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> List[EdgePairs]: + r""" + @brief Like \with_angle_both, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle_both(self, type: Edges.EdgeType, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_angle_both, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_area(self, area: int) -> List[EdgePairs]: + r""" + @brief Like \with_area, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_area(self, min_area: int, max_area: int) -> List[EdgePairs]: + r""" + @brief Like \with_area, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_distance(self, distance: int) -> List[EdgePairs]: + r""" + @brief Like \with_distance, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_distance(self, min_distance: Any, max_distance: Any) -> List[EdgePairs]: + r""" + @brief Like \with_distance, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_internal_angle(self, angle: float) -> List[EdgePairs]: + r""" + @brief Like \with_internal_angle, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_internal_angle(self, min_angle: float, max_angle: float, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> List[EdgePairs]: + r""" + @brief Like \with_internal_angle, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_length(self, length: int, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_length, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_length(self, min_length: Any, max_length: Any, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_length, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_length_both(self, length: int, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_length_both, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_length_both(self, min_length: Any, max_length: Any, inverse: bool) -> List[EdgePairs]: + r""" + @brief Like \with_length_both, but returning two edge pair collections + The first edge pair collection will contain all matching shapes, the other the non-matching ones. + Note that 'inverse' controls the way each edge is checked, not overall. + + This method has been introduced in version 0.29.12. + """ + ... def swap(self, other: EdgePairs) -> None: r""" @brief Swap the contents of this collection with the contents of another collection @@ -25741,7 +25944,7 @@ class Edges(ShapeCollection): This method has been introduced in version 0.28.4. """ ... - def filtered(self, filtered: EdgeFilter) -> Edges: + def filtered(self, filter: EdgeFilter) -> Edges: r""" @brief Applies a generic filter and returns a filtered copy See \EdgeFilter for a description of this feature. @@ -26678,6 +26881,14 @@ class Edges(ShapeCollection): 'zero_distance_mode' has been added in version 0.29. """ ... + def split_filter(self, filter: EdgeFilter) -> List[Edges]: + r""" + @brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones + See \EdgeFilter for a description of this feature. + + This method has been introduced in version 0.29.12. + """ + ... @overload def split_inside(self, other: Edges) -> List[Edges]: r""" @@ -26740,6 +26951,69 @@ class Edges(ShapeCollection): This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28. """ ... + @overload + def split_with_abs_angle(self, angle: float) -> List[Edges]: + r""" + @brief Like \with_abs_angle, but returning two edge collections + The first edge collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_abs_angle(self, min_angle: float, max_angle: float, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> List[Edges]: + r""" + @brief Like \with_abs_angle, but returning two edge collections + The first edge collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle(self, angle: float) -> List[Edges]: + r""" + @brief Like \with_angle, but returning two edge collections + The first edge collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle(self, min_angle: float, max_angle: float, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> List[Edges]: + r""" + @brief Like \with_angle, but returning two edge collections + The first edge collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_angle(self, type: Edges.EdgeType) -> List[Edges]: + r""" + @brief Like \with_angle, but returning two edge collections + The first edge collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_length(self, length: int) -> List[Edges]: + r""" + @brief Like \with_length, but returning two edge collections + The first edge collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_length(self, min_length: Any, max_length: Any) -> List[Edges]: + r""" + @brief Like \with_length, but returning two edge collections + The first edge collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... def start_segments(self, length: int, fraction: float) -> Edges: r""" @brief Returns edges representing a part of the edge after the start point @@ -30301,10 +30575,10 @@ class Instance: Getter: @brief Gets the basic \CellInstArray object associated with this instance reference. Setter: - @brief Changes the \CellInstArray object to the given one. - This method replaces the instance by the given CellInstArray object. + @brief Returns the basic cell instance array object by giving a micrometer unit object. + This method replaces the instance by the given CellInstArray object and it internally transformed into database units. - This method has been introduced in version 0.22 + This method has been introduced in version 0.25 """ cplx_trans: ICplxTrans r""" @@ -30312,9 +30586,10 @@ class Instance: @brief Gets the complex transformation of the instance or the first instance in the array This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well. Setter: - @brief Sets the complex transformation of the instance or the first instance in the array + @brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) + This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. - This method has been introduced in version 0.23. + This method has been introduced in version 0.25. """ da: DVector r""" @@ -30443,10 +30718,9 @@ class Instance: @brief Gets the transformation of the instance or the first instance in the array The transformation returned is only valid if the array does not represent a complex transformation array Setter: - @brief Sets the transformation of the instance or the first instance in the array (in micrometer units) - This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. + @brief Sets the transformation of the instance or the first instance in the array - This method has been introduced in version 0.25. + This method has been introduced in version 0.23. """ @classmethod def new(cls) -> Instance: @@ -41403,15 +41677,15 @@ class NetPinRef: @overload def net(self) -> Net: r""" - @brief Gets the net this pin reference is attached to (non-const version). - - This constness variant has been introduced in version 0.26.8 + @brief Gets the net this pin reference is attached to. """ ... @overload def net(self) -> Net: r""" - @brief Gets the net this pin reference is attached to. + @brief Gets the net this pin reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 """ ... def pin(self) -> Pin: @@ -41701,17 +41975,17 @@ class NetTerminalRef: @overload def device(self) -> Device: r""" - @brief Gets the device reference. + @brief Gets the device reference (non-const version). Gets the device object that this connection is made to. + + This constness variant has been introduced in version 0.26.8 """ ... @overload def device(self) -> Device: r""" - @brief Gets the device reference (non-const version). + @brief Gets the device reference. Gets the device object that this connection is made to. - - This constness variant has been introduced in version 0.26.8 """ ... def device_class(self) -> DeviceClass: @@ -53329,7 +53603,7 @@ class Region(ShapeCollection): This method has been introduced in version 0.28.4. """ ... - def filtered(self, filtered: PolygonFilter) -> Region: + def filtered(self, filter: PolygonFilter) -> Region: r""" @brief Applies a generic filter and returns a filtered copy See \PolygonFilter for a description of this feature. @@ -55005,6 +55279,14 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ ... + def split_filter(self, filter: PolygonFilter) -> List[Region]: + r""" + @brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones + See \PolygonFilter for a description of this feature. + + This method has been introduced in version 0.29.12. + """ + ... def split_inside(self, other: Region) -> List[Region]: r""" @brief Returns the polygons of this region which are completely inside polygons from the other region and the ones which are not at the same time @@ -55080,6 +55362,210 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ ... + def split_rectangles(self) -> List[Region]: + r""" + @brief Combined results of \rectangles and \non_rectangles + This method returns a list with two Regions, the first is the result of \rectangles, the second the result of \non_rectangles. Using this method is faster when you need both. + + This method has been introduced in version 0.29.12. + """ + ... + def split_rectilinear(self) -> List[Region]: + r""" + @brief Combined results of \rectilinear and \non_rectilinear + This method returns a list with two Regions, the first is the result of \rectilinear, the second the result of \non_rectilinear. Using this method is faster when you need both. + + This method has been introduced in version 0.29.12. + """ + ... + def split_squares(self) -> List[Region]: + r""" + @brief Combined results of \squares and \non_squares + This method returns a list with two Regions, the first is the result of \squares, the second the result of \non_squares. Using this method is faster when you need both. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_area(self, area: int) -> List[Region]: + r""" + @brief Like \with_area, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_area(self, min_area: Any, max_area: Any) -> List[Region]: + r""" + @brief Like \with_area, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_area_ratio(self, min_ratio: Any, max_ratio: Any, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> List[Region]: + r""" + @brief Like \with_area_ratio, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_area_ratio(self, ratio: float) -> List[Region]: + r""" + @brief Like \with_area_ratio, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_aspect_ratio(self, min_ratio: Any, max_ratio: Any, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> List[Region]: + r""" + @brief Like \with_bbox_aspect_ratio, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_aspect_ratio(self, ratio: float) -> List[Region]: + r""" + @brief Like \with_bbox_aspect_ratio, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_height(self, height: int) -> List[Region]: + r""" + @brief Like \with_bbox_height, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_height(self, min_height: Any, max_height: Any) -> List[Region]: + r""" + @brief Like \with_bbox_height, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_max(self, dim: int) -> List[Region]: + r""" + @brief Like \with_bbox_max, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_max(self, min_dim: Any, max_dim: Any) -> List[Region]: + r""" + @brief Like \with_bbox_max, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_min(self, dim: int) -> List[Region]: + r""" + @brief Like \with_bbox_min, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_min(self, min_dim: Any, max_dim: Any) -> List[Region]: + r""" + @brief Like \with_bbox_min, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_width(self, min_width: Any, max_width: Any) -> List[Region]: + r""" + @brief Like \with_bbox_width, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_bbox_width(self, width: int) -> List[Region]: + r""" + @brief Like \with_bbox_width, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_holes(self, min_nholes: Any, max_nholes: Any) -> List[Region]: + r""" + @brief Like \with_holes, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_holes(self, nholes: int) -> List[Region]: + r""" + @brief Like \with_holes, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_perimeter(self, min_perimeter: Any, max_perimeter: Any) -> List[Region]: + r""" + @brief Like \with_perimeter, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_perimeter(self, perimeter: int) -> List[Region]: + r""" + @brief Like \with_perimeter, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_relative_height(self, min_ratio: Any, max_ratio: Any, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> List[Region]: + r""" + @brief Like \with_relative_height, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + @overload + def split_with_relative_height(self, ratio: float) -> List[Region]: + r""" + @brief Like \with_relative_height, but returning two regions + The first region will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... def squares(self) -> Region: r""" @brief Returns all polygons which are squares @@ -55487,7 +55973,7 @@ class Region(ShapeCollection): """ ... @overload - def with_holes(self, min_bholes: Any, max_nholes: Any, inverse: bool) -> Region: + def with_holes(self, min_nholes: Any, max_nholes: Any, inverse: bool) -> Region: r""" @brief Filter the polygons by their number of holes Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have a hole count larger or equal to "min_nholes" and less than "max_nholes" are returned. If "inverse" is true, polygons having a hole count less than "min_nholes" or larger or equal than "max_nholes" are returned. @@ -56911,11 +57397,10 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent an edge. Setter: - @brief Replaces the shape by the given edge - This method replaces the shape by the given edge. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + @brief Replaces the shape by the given edge (in micrometer units) + This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. - This method has been introduced in version 0.22. + This method has been introduced in version 0.25. """ edge_pair: Any r""" @@ -56964,11 +57449,10 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent a path. Setter: - @brief Replaces the shape by the given path object - This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + @brief Replaces the shape by the given path (in micrometer units) + This method replaces the shape by the given path, like \path= with a \Path argument does. This version translates the path from micrometer units to database units internally. - This method has been introduced in version 0.22. + This method has been introduced in version 0.25. """ path_bgnext: int r""" @@ -60872,15 +61356,6 @@ class SubCircuit(NetlistObject): """ ... @overload - def circuit(self) -> Circuit: - r""" - @brief Gets the circuit the subcircuit lives in (non-const version). - This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. - - This constness variant has been introduced in version 0.26.8 - """ - ... - @overload def circuit(self) -> Circuit: r""" @brief Gets the circuit the subcircuit lives in. @@ -60888,9 +61363,12 @@ class SubCircuit(NetlistObject): """ ... @overload - def circuit_ref(self) -> Circuit: + def circuit(self) -> Circuit: r""" - @brief Gets the circuit referenced by the subcircuit. + @brief Gets the circuit the subcircuit lives in (non-const version). + This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. + + This constness variant has been introduced in version 0.26.8 """ ... @overload @@ -60903,6 +61381,12 @@ class SubCircuit(NetlistObject): """ ... @overload + def circuit_ref(self) -> Circuit: + r""" + @brief Gets the circuit referenced by the subcircuit. + """ + ... + @overload def connect_pin(self, pin: Pin, net: Net) -> None: r""" @brief Connects the given pin to the specified net. @@ -61569,7 +62053,8 @@ class Text: Setter: @brief Sets the horizontal alignment - This is the version accepting integer values. It's provided for backward compatibility. + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. """ size: int r""" @@ -63548,6 +64033,30 @@ class Texts(ShapeCollection): Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ ... + def split_filter(self, filter: TextFilter) -> List[Texts]: + r""" + @brief Applies a generic filter and returns a copy with all matching shapes and one with the non-matching ones + See \TextFilter for a description of this feature. + + This method has been introduced in version 0.29.12. + """ + ... + def split_with_match(self, pattern: str) -> List[Texts]: + r""" + @brief Like \with_match, but returning two text collections + The first text collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... + def split_with_text(self, text: str) -> List[Texts]: + r""" + @brief Like \with_text, but returning two text collections + The first text collection will contain all matching shapes, the other the non-matching ones. + + This method has been introduced in version 0.29.12. + """ + ... def swap(self, other: Texts) -> None: r""" @brief Swap the contents of this collection with the contents of another collection From e06498763a5265f4b328afb7685d41c0733cc7da Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 5 Mar 2025 19:12:38 +0100 Subject: [PATCH 29/29] Fixing issue #1997. --- Changelog | 1 + src/tl/tl/tlString.cc | 3 ++- src/tl/unit_tests/tlStringTests.cc | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 7af49841b..fdab73e4d 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,7 @@ on Edges, Region, EdgePairs and Texts, delivering a pair of containers with selected and unselected objects. * Bug: %GITHUB%/issues/1993 Tiling processor kept layout locks, causing DRC issues with "with_density" +* Bug: %GITHUB%/issues/1997 Can not find a file in Open Recent menu (a string unescaping bug) * Bugfix: 'Save All' was not updating the dirty flag in the inactive tabs * Bugfix: Fixing a crash when editing PCell parameters while the macro editor is open * Bugfix: Fixed a potential Crash on "save all" diff --git a/src/tl/tl/tlString.cc b/src/tl/tl/tlString.cc index 28e597464..d57dee236 100644 --- a/src/tl/tl/tlString.cc +++ b/src/tl/tl/tlString.cc @@ -702,7 +702,8 @@ inline char unescape_char (const char * &cp) { if (safe_isdigit (*cp)) { int c = 0; - while (*cp && safe_isdigit (*cp)) { + unsigned int n = 0; + while (*cp && safe_isdigit (*cp) && n++ < 3) { c = c * 8 + int (*cp - '0'); ++cp; } diff --git a/src/tl/unit_tests/tlStringTests.cc b/src/tl/unit_tests/tlStringTests.cc index 3697ed4f1..634b38e6e 100644 --- a/src/tl/unit_tests/tlStringTests.cc +++ b/src/tl/unit_tests/tlStringTests.cc @@ -504,6 +504,7 @@ TEST(10) EXPECT_EQ (escape_string ("'a\n\003"), "'a\\n\\003"); EXPECT_EQ (escape_string ("'a\n\003"), "'a\\n\\003"); EXPECT_EQ (unescape_string (escape_string ("'a\n\003")), "'a\n\003"); + EXPECT_EQ (unescape_string (escape_string ("'a\n\0031")), "'a\n\0031"); } TEST(11)