diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index 08437b037dc..f6bbe77946c 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -6,7 +6,7 @@ on: # but only for the branches specified branches: # Push events on develop branch - - develop + - 'develop' # Push events on ci-test branch (uncomment if needed for testing purposes) # - ci-test paths-ignore: @@ -44,7 +44,7 @@ env: # emscripten EM_VERSION: latest EM_CACHE_FOLDER: "emsdk-cache" - EM_CACHE_ID: 2 + EM_CACHE_ID: 3 # gh-pages GH_PAGES_REPO: ${{ github.repository_owner }}/verovio.org # works from rism-digital and from forks @@ -74,10 +74,6 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - compiler: g++ - version: "9" - - os: ubuntu-20.04 compiler: g++ version: "10" @@ -86,13 +82,17 @@ jobs: compiler: g++ version: "11" + - os: ubuntu-22.04 + compiler: g++ + version: "12" + - os: ubuntu-20.04 compiler: clang - version: "6.0" + version: "10" - os: ubuntu-20.04 compiler: clang - version: "9" + version: "11" - os: ubuntu-20.04 compiler: clang diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b095c12dbf..2a415ca506a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [unreleased] +* Support for `fTrem@unitdur` (@eNote-GmbH) ## [4.1.0] - 2023-12-15 * Support for staves ordered by `scoreDef` diff --git a/Verovio.xcodeproj/project.pbxproj b/Verovio.xcodeproj/project.pbxproj index b129cb6e9af..111c13c9f03 100644 --- a/Verovio.xcodeproj/project.pbxproj +++ b/Verovio.xcodeproj/project.pbxproj @@ -800,6 +800,12 @@ 4DE96E3B21C4373200CB85BE /* bracketspan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DE96E3A21C4373200CB85BE /* bracketspan.cpp */; }; 4DE96E3C21C4373200CB85BE /* bracketspan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DE96E3A21C4373200CB85BE /* bracketspan.cpp */; }; 4DE96E3D21C4373200CB85BE /* bracketspan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DE96E3A21C4373200CB85BE /* bracketspan.cpp */; }; + 4DEBE6E12B36E78900B67DFB /* facsimilefunctor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DEBE6E02B36E78900B67DFB /* facsimilefunctor.h */; }; + 4DEBE6E22B36E78900B67DFB /* facsimilefunctor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DEBE6E02B36E78900B67DFB /* facsimilefunctor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4DEBE6E42B36E79600B67DFB /* facsimilefunctor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEBE6E32B36E79600B67DFB /* facsimilefunctor.cpp */; }; + 4DEBE6E52B36E79600B67DFB /* facsimilefunctor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEBE6E32B36E79600B67DFB /* facsimilefunctor.cpp */; }; + 4DEBE6E62B36E9B300B67DFB /* facsimilefunctor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEBE6E32B36E79600B67DFB /* facsimilefunctor.cpp */; }; + 4DEBE6E72B36E9B400B67DFB /* facsimilefunctor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEBE6E32B36E79600B67DFB /* facsimilefunctor.cpp */; }; 4DEC4D5A21C800A000D1D273 /* abbr.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DEC4D5921C8009600D1D273 /* abbr.h */; }; 4DEC4D7A21C8048700D1D273 /* abbr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEC4D7921C8048700D1D273 /* abbr.cpp */; }; 4DEC4D7B21C8048700D1D273 /* abbr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DEC4D7921C8048700D1D273 /* abbr.cpp */; }; @@ -2014,6 +2020,8 @@ 4DE644F41EDBEA01002FBE6C /* breath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = breath.cpp; path = src/breath.cpp; sourceTree = ""; }; 4DE96E3821C4370E00CB85BE /* bracketspan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bracketspan.h; path = include/vrv/bracketspan.h; sourceTree = ""; }; 4DE96E3A21C4373200CB85BE /* bracketspan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bracketspan.cpp; path = src/bracketspan.cpp; sourceTree = ""; }; + 4DEBE6E02B36E78900B67DFB /* facsimilefunctor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = facsimilefunctor.h; path = include/vrv/facsimilefunctor.h; sourceTree = ""; }; + 4DEBE6E32B36E79600B67DFB /* facsimilefunctor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = facsimilefunctor.cpp; path = src/facsimilefunctor.cpp; sourceTree = ""; }; 4DEC4D5921C8009600D1D273 /* abbr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = abbr.h; path = include/vrv/abbr.h; sourceTree = ""; }; 4DEC4D7921C8048700D1D273 /* abbr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = abbr.cpp; path = src/abbr.cpp; sourceTree = ""; }; 4DEC4D7D21C804C500D1D273 /* add.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = add.cpp; path = src/add.cpp; sourceTree = ""; }; @@ -3012,6 +3020,8 @@ E7265E6D29DC6FD200D11F41 /* castofffunctor.h */, E763EF4129E939FB0029E56D /* convertfunctor.cpp */, E763EF3E29E939C00029E56D /* convertfunctor.h */, + 4DEBE6E32B36E79600B67DFB /* facsimilefunctor.cpp */, + 4DEBE6E02B36E78900B67DFB /* facsimilefunctor.h */, E74A806028BC9111005274E7 /* findfunctor.cpp */, E74A806528BC97D5005274E7 /* findfunctor.h */, E722106528F856C4002CD6E9 /* findlayerelementsfunctor.cpp */, @@ -3384,6 +3394,7 @@ 40DA9C3720905CEB006BED92 /* ioabc.h in Headers */, 4DB3D8CD1F83D11100B5FC2B /* harm.h in Headers */, 40D45EC2204EEAFB009C1EC9 /* instrdef.h in Headers */, + 4DEBE6E12B36E78900B67DFB /* facsimilefunctor.h in Headers */, 4D94E0E22995411100F49F89 /* meibasic.h in Headers */, BD2E4D9B2875882200B04350 /* stem.h in Headers */, 4DACC9EA2990F29A00B55913 /* attmodule.h in Headers */, @@ -3441,6 +3452,7 @@ E7908EA0298582090004C1F9 /* alignfunctor.h in Headers */, BB4C4B9822A932E5001F6AF0 /* durationinterface.h in Headers */, BB4C4BB722A932F6001F6AF0 /* jsonxx.h in Headers */, + 4DEBE6E22B36E78900B67DFB /* facsimilefunctor.h in Headers */, BB4C4B1622A932C8001F6AF0 /* systemelement.h in Headers */, BB4C4AC622A932B6001F6AF0 /* measure.h in Headers */, E741AD00299A3D3500854426 /* calcslurdirectionfunctor.h in Headers */, @@ -3926,6 +3938,7 @@ E7F39C6229A62B430055DBE0 /* adjustclefchangesfunctor.cpp in Sources */, E79320682991454000D80975 /* calcstemfunctor.cpp in Sources */, 4DED4F18294733140073E504 /* altsyminterface.cpp in Sources */, + 4DEBE6E72B36E9B400B67DFB /* facsimilefunctor.cpp in Sources */, 4DEF8A6521B7AAF90093A76B /* f.cpp in Sources */, 4D2073F922A3BCE000E0765F /* tabdursym.cpp in Sources */, 4D16940B1E3A44F300569BF4 /* keysig.cpp in Sources */, @@ -4206,6 +4219,7 @@ 8F086EF1188539540037FD8E /* keysig.cpp in Sources */, E74A806C28BC98B2005274E7 /* functorinterface.cpp in Sources */, E7870357299CF06D00156DC4 /* adjustarpegfunctor.cpp in Sources */, + 4DEBE6E62B36E9B300B67DFB /* facsimilefunctor.cpp in Sources */, 4DEC4D9E21C81E9400D1D273 /* orig.cpp in Sources */, 4DDBBB5D1C7AE45900054AFF /* hairpin.cpp in Sources */, 4D43C30C1A9BB22A00EA28F3 /* view_mensural.cpp in Sources */, @@ -4489,6 +4503,7 @@ 4DB3D8D51F83D12B00B5FC2B /* tempo.cpp in Sources */, 4DEC4DA021C81E9400D1D273 /* orig.cpp in Sources */, E7F39C6329A62B440055DBE0 /* adjustclefchangesfunctor.cpp in Sources */, + 4DEBE6E42B36E79600B67DFB /* facsimilefunctor.cpp in Sources */, E79320692991454000D80975 /* calcstemfunctor.cpp in Sources */, 8F3DD33E18854B2E0051330C /* beam.cpp in Sources */, 4DED4F19294733140073E504 /* altsyminterface.cpp in Sources */, @@ -4771,6 +4786,7 @@ E793206A2991454100D80975 /* calcstemfunctor.cpp in Sources */, BB4C4AD722A932B6001F6AF0 /* staff.cpp in Sources */, 4DED4F1A294733140073E504 /* altsyminterface.cpp in Sources */, + 4DEBE6E52B36E79600B67DFB /* facsimilefunctor.cpp in Sources */, BB4C4B9F22A932E5001F6AF0 /* positioninterface.cpp in Sources */, BB4C4B5322A932D7001F6AF0 /* halfmrpt.cpp in Sources */, BB4C4B8722A932DF001F6AF0 /* num.cpp in Sources */, @@ -5008,7 +5024,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; @@ -5067,7 +5083,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LANGUAGE_STANDARD = "c++20"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5cddd3ed514..0c865ce37df 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -48,7 +48,7 @@ if(MSVC) add_definitions(/wd4244) # suppress warning of possible loss of precision add_definitions(-DNO_PAE_SUPPORT) # regex is working differently under Windows so PAE is not supported (yet) add_definitions(-DUSE_PAE_OLD_PARSER) - add_definitions(/std:c++17) + add_definitions(/std:c++20) include_directories(../include/win32) else() if(CMAKE_BUILD_TYPE MATCHES Debug) @@ -60,7 +60,7 @@ else() # jsonxx raises -Wdollar-in-identifier-extension # gcc 8.3.1 does not like -Wdollar-in-identifier-extension option. add_definitions(-Wall -W -pedantic -Wno-unused-parameter -Wno-dollar-in-identifier-extension) - add_definitions(-std=c++17) + add_definitions(-std=c++20) # extra warnings similar to Xcode compiling settings (most probably covered by -Wall): # https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/DiagnosticGroups.td diff --git a/emscripten/buildToolkit b/emscripten/buildToolkit index b6f20e5a7ae..afde9dd2b76 100755 --- a/emscripten/buildToolkit +++ b/emscripten/buildToolkit @@ -55,7 +55,7 @@ my ($lightQ, $version, $chattyQ, $helpQ, $exclusion, $wasmQ, $makeQ, $modularize my ($nopae, $nohumdrum, $nomusicxml, $nodarms); my ($FLAGS_NAME, $VERSION, $CHATTY); -my $cpp = 17; # c++ version to compile (11, 14, 17) +my $cpp = 20; # c++ version to compile (11, 14, 17) my $VEROVIO_ROOT = ".."; Getopt::Long::Configure("bundling"); diff --git a/fonts/poetry.lock b/fonts/poetry.lock index 7c516f071b4..bd9153bf74d 100644 --- a/fonts/poetry.lock +++ b/fonts/poetry.lock @@ -1,25 +1,14 @@ # This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. -[[package]] -name = "appnope" -version = "0.1.3" -description = "Disable App Nap on macOS >= 10.9" -optional = false -python-versions = "*" -files = [ - {file = "appnope-0.1.3-py2.py3-none-any.whl", hash = "sha256:265a455292d0bd8a72453494fa24df5a11eb18373a60c7c0430889f22548605e"}, - {file = "appnope-0.1.3.tar.gz", hash = "sha256:02bd91c4de869fbb1e1c50aafc4098827a7a54ab2f39d9dcba6c9547ed920e24"}, -] - [[package]] name = "astroid" -version = "2.14.2" +version = "2.15.8" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.7.2" files = [ - {file = "astroid-2.14.2-py3-none-any.whl", hash = "sha256:0e0e3709d64fbffd3037e4ff403580550f14471fd3eaae9fa11cc9a5c7901153"}, - {file = "astroid-2.14.2.tar.gz", hash = "sha256:a3cf9f02c53dd259144a7e8f3ccd75d67c9a8c716ef183e0c1f291bc5d7bb3cf"}, + {file = "astroid-2.15.8-py3-none-any.whl", hash = "sha256:1aa149fc5c6589e3d0ece885b4491acd80af4f087baafa3fb5203b113e68cd3c"}, + {file = "astroid-2.15.8.tar.gz", hash = "sha256:6c107453dffee9055899705de3c9ead36e74119cee151e5a9aaf7f0b0e020a6a"}, ] [package.dependencies] @@ -32,31 +21,21 @@ wrapt = [ [[package]] name = "asttokens" -version = "2.2.1" +version = "2.4.1" description = "Annotate AST trees with source code positions" optional = false python-versions = "*" files = [ - {file = "asttokens-2.2.1-py2.py3-none-any.whl", hash = "sha256:6b0ac9e93fb0335014d382b8fa9b3afa7df546984258005da0b9e7095b3deb1c"}, - {file = "asttokens-2.2.1.tar.gz", hash = "sha256:4622110b2a6f30b77e1473affaa97e711bc2f07d3f10848420ff1898edbe94f3"}, + {file = "asttokens-2.4.1-py2.py3-none-any.whl", hash = "sha256:051ed49c3dcae8913ea7cd08e46a606dba30b79993209636c4875bc1d637bc24"}, + {file = "asttokens-2.4.1.tar.gz", hash = "sha256:b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0"}, ] [package.dependencies] -six = "*" +six = ">=1.12.0" [package.extras] -test = ["astroid", "pytest"] - -[[package]] -name = "backcall" -version = "0.2.0" -description = "Specifications for callback functions passed in to an API" -optional = false -python-versions = "*" -files = [ - {file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"}, - {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, -] +astroid = ["astroid (>=1,<2)", "astroid (>=2,<4)"] +test = ["astroid (>=1,<2)", "astroid (>=2,<4)", "pytest"] [[package]] name = "black" @@ -95,13 +74,13 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "click" -version = "8.1.3" +version = "8.1.7" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" files = [ - {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, - {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, ] [package.dependencies] @@ -131,149 +110,160 @@ files = [ [[package]] name = "dill" -version = "0.3.6" -description = "serialize all of python" +version = "0.3.7" +description = "serialize all of Python" optional = false python-versions = ">=3.7" files = [ - {file = "dill-0.3.6-py3-none-any.whl", hash = "sha256:a07ffd2351b8c678dfc4a856a3005f8067aea51d6ba6c700796a4d9e280f39f0"}, - {file = "dill-0.3.6.tar.gz", hash = "sha256:e5db55f3687856d8fbdab002ed78544e1c4559a130302693d839dfe8f93f2373"}, + {file = "dill-0.3.7-py3-none-any.whl", hash = "sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e"}, + {file = "dill-0.3.7.tar.gz", hash = "sha256:cc1c8b182eb3013e24bd475ff2e9295af86c1a38eb1aff128dac8962a9ce3c03"}, ] [package.extras] graph = ["objgraph (>=1.7.2)"] [[package]] -name = "executing" +name = "exceptiongroup" version = "1.2.0" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, + {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "executing" +version = "2.0.1" description = "Get the currently executing AST node of a frame, and other information" optional = false -python-versions = "*" +python-versions = ">=3.5" files = [ - {file = "executing-1.2.0-py2.py3-none-any.whl", hash = "sha256:0314a69e37426e3608aada02473b4161d4caf5a4b244d1d0c48072b8fee7bacc"}, - {file = "executing-1.2.0.tar.gz", hash = "sha256:19da64c18d2d851112f09c287f8d3dbbdf725ab0e569077efb6cdcbd3497c107"}, + {file = "executing-2.0.1-py2.py3-none-any.whl", hash = "sha256:eac49ca94516ccc753f9fb5ce82603156e590b27525a8bc32cce8ae302eb61bc"}, + {file = "executing-2.0.1.tar.gz", hash = "sha256:35afe2ce3affba8ee97f2d69927fa823b08b472b7b994e36a52a964b93d16147"}, ] [package.extras] -tests = ["asttokens", "littleutils", "pytest", "rich"] +tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich"] [[package]] name = "ipython" -version = "8.10.0" +version = "8.18.1" description = "IPython: Productive Interactive Computing" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "ipython-8.10.0-py3-none-any.whl", hash = "sha256:b38c31e8fc7eff642fc7c597061fff462537cf2314e3225a19c906b7b0d8a345"}, - {file = "ipython-8.10.0.tar.gz", hash = "sha256:b13a1d6c1f5818bd388db53b7107d17454129a70de2b87481d555daede5eb49e"}, + {file = "ipython-8.18.1-py3-none-any.whl", hash = "sha256:e8267419d72d81955ec1177f8a29aaa90ac80ad647499201119e2f05e99aa397"}, + {file = "ipython-8.18.1.tar.gz", hash = "sha256:ca6f079bb33457c66e233e4580ebfc4128855b4cf6370dddd73842a9563e8a27"}, ] [package.dependencies] -appnope = {version = "*", markers = "sys_platform == \"darwin\""} -backcall = "*" colorama = {version = "*", markers = "sys_platform == \"win32\""} decorator = "*" +exceptiongroup = {version = "*", markers = "python_version < \"3.11\""} jedi = ">=0.16" matplotlib-inline = "*" pexpect = {version = ">4.3", markers = "sys_platform != \"win32\""} -pickleshare = "*" -prompt-toolkit = ">=3.0.30,<3.1.0" +prompt-toolkit = ">=3.0.41,<3.1.0" pygments = ">=2.4.0" stack-data = "*" traitlets = ">=5" +typing-extensions = {version = "*", markers = "python_version < \"3.10\""} [package.extras] -all = ["black", "curio", "docrepr", "ipykernel", "ipyparallel", "ipywidgets", "matplotlib", "matplotlib (!=3.2.0)", "nbconvert", "nbformat", "notebook", "numpy (>=1.21)", "pandas", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio", "qtconsole", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "trio", "typing-extensions"] +all = ["black", "curio", "docrepr", "exceptiongroup", "ipykernel", "ipyparallel", "ipywidgets", "matplotlib", "matplotlib (!=3.2.0)", "nbconvert", "nbformat", "notebook", "numpy (>=1.22)", "pandas", "pickleshare", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio (<0.22)", "qtconsole", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "trio", "typing-extensions"] black = ["black"] -doc = ["docrepr", "ipykernel", "matplotlib", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "typing-extensions"] +doc = ["docrepr", "exceptiongroup", "ipykernel", "matplotlib", "pickleshare", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio (<0.22)", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "typing-extensions"] kernel = ["ipykernel"] nbconvert = ["nbconvert"] nbformat = ["nbformat"] notebook = ["ipywidgets", "notebook"] parallel = ["ipyparallel"] qtconsole = ["qtconsole"] -test = ["pytest (<7.1)", "pytest-asyncio", "testpath"] -test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.21)", "pandas", "pytest (<7.1)", "pytest-asyncio", "testpath", "trio"] +test = ["pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath"] +test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.22)", "pandas", "pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath", "trio"] [[package]] name = "isort" -version = "5.12.0" +version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" files = [ - {file = "isort-5.12.0-py3-none-any.whl", hash = "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6"}, - {file = "isort-5.12.0.tar.gz", hash = "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504"}, + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, ] [package.extras] -colors = ["colorama (>=0.4.3)"] -pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] -plugins = ["setuptools"] -requirements-deprecated-finder = ["pip-api", "pipreqs"] +colors = ["colorama (>=0.4.6)"] [[package]] name = "jedi" -version = "0.18.2" +version = "0.19.1" description = "An autocompletion tool for Python that can be used for text editors." optional = false python-versions = ">=3.6" files = [ - {file = "jedi-0.18.2-py2.py3-none-any.whl", hash = "sha256:203c1fd9d969ab8f2119ec0a3342e0b49910045abe6af0a3ae83a5764d54639e"}, - {file = "jedi-0.18.2.tar.gz", hash = "sha256:bae794c30d07f6d910d32a7048af09b5a39ed740918da923c6b780790ebac612"}, + {file = "jedi-0.19.1-py2.py3-none-any.whl", hash = "sha256:e983c654fe5c02867aef4cdfce5a2fbb4a50adc0af145f70504238f18ef5e7e0"}, + {file = "jedi-0.19.1.tar.gz", hash = "sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd"}, ] [package.dependencies] -parso = ">=0.8.0,<0.9.0" +parso = ">=0.8.3,<0.9.0" [package.extras] docs = ["Jinja2 (==2.11.3)", "MarkupSafe (==1.1.1)", "Pygments (==2.8.1)", "alabaster (==0.7.12)", "babel (==2.9.1)", "chardet (==4.0.0)", "commonmark (==0.8.1)", "docutils (==0.17.1)", "future (==0.18.2)", "idna (==2.10)", "imagesize (==1.2.0)", "mock (==1.0.1)", "packaging (==20.9)", "pyparsing (==2.4.7)", "pytz (==2021.1)", "readthedocs-sphinx-ext (==2.1.4)", "recommonmark (==0.5.0)", "requests (==2.25.1)", "six (==1.15.0)", "snowballstemmer (==2.1.0)", "sphinx (==1.8.5)", "sphinx-rtd-theme (==0.4.3)", "sphinxcontrib-serializinghtml (==1.1.4)", "sphinxcontrib-websupport (==1.2.4)", "urllib3 (==1.26.4)"] -qa = ["flake8 (==3.8.3)", "mypy (==0.782)"] -testing = ["Django (<3.1)", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] +qa = ["flake8 (==5.0.4)", "mypy (==0.971)", "types-setuptools (==67.2.0.1)"] +testing = ["Django", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] [[package]] name = "lazy-object-proxy" -version = "1.9.0" +version = "1.10.0" description = "A fast and thorough lazy object proxy." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "lazy-object-proxy-1.9.0.tar.gz", hash = "sha256:659fb5809fa4629b8a1ac5106f669cfc7bef26fbb389dda53b3e010d1ac4ebae"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b40387277b0ed2d0602b8293b94d7257e17d1479e257b4de114ea11a8cb7f2d7"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8c6cfb338b133fbdbc5cfaa10fe3c6aeea827db80c978dbd13bc9dd8526b7d4"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:721532711daa7db0d8b779b0bb0318fa87af1c10d7fe5e52ef30f8eff254d0cd"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:66a3de4a3ec06cd8af3f61b8e1ec67614fbb7c995d02fa224813cb7afefee701"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1aa3de4088c89a1b69f8ec0dcc169aa725b0ff017899ac568fe44ddc1396df46"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-win32.whl", hash = "sha256:f0705c376533ed2a9e5e97aacdbfe04cecd71e0aa84c7c0595d02ef93b6e4455"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:ea806fd4c37bf7e7ad82537b0757999264d5f70c45468447bb2b91afdbe73a6e"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:946d27deaff6cf8452ed0dba83ba38839a87f4f7a9732e8f9fd4107b21e6ff07"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79a31b086e7e68b24b99b23d57723ef7e2c6d81ed21007b6281ebcd1688acb0a"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f699ac1c768270c9e384e4cbd268d6e67aebcfae6cd623b4d7c3bfde5a35db59"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bfb38f9ffb53b942f2b5954e0f610f1e721ccebe9cce9025a38c8ccf4a5183a4"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:189bbd5d41ae7a498397287c408617fe5c48633e7755287b21d741f7db2706a9"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-win32.whl", hash = "sha256:81fc4d08b062b535d95c9ea70dbe8a335c45c04029878e62d744bdced5141586"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:f2457189d8257dd41ae9b434ba33298aec198e30adf2dcdaaa3a28b9994f6adb"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d9e25ef10a39e8afe59a5c348a4dbf29b4868ab76269f81ce1674494e2565a6e"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cbf9b082426036e19c6924a9ce90c740a9861e2bdc27a4834fd0a910742ac1e8"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f5fa4a61ce2438267163891961cfd5e32ec97a2c444e5b842d574251ade27d2"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:8fa02eaab317b1e9e03f69aab1f91e120e7899b392c4fc19807a8278a07a97e8"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e7c21c95cae3c05c14aafffe2865bbd5e377cfc1348c4f7751d9dc9a48ca4bda"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win32.whl", hash = "sha256:f12ad7126ae0c98d601a7ee504c1122bcef553d1d5e0c3bfa77b16b3968d2734"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win_amd64.whl", hash = "sha256:edd20c5a55acb67c7ed471fa2b5fb66cb17f61430b7a6b9c3b4a1e40293b1671"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0daa332786cf3bb49e10dc6a17a52f6a8f9601b4cf5c295a4f85854d61de63"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cd077f3d04a58e83d04b20e334f678c2b0ff9879b9375ed107d5d07ff160171"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:660c94ea760b3ce47d1855a30984c78327500493d396eac4dfd8bd82041b22be"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:212774e4dfa851e74d393a2370871e174d7ff0ebc980907723bb67d25c8a7c30"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f0117049dd1d5635bbff65444496c90e0baa48ea405125c088e93d9cf4525b11"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-win32.whl", hash = "sha256:0a891e4e41b54fd5b8313b96399f8b0e173bbbfc03c7631f01efbe29bb0bcf82"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:9990d8e71b9f6488e91ad25f322898c136b008d87bf852ff65391b004da5e17b"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9e7551208b2aded9c1447453ee366f1c4070602b3d932ace044715d89666899b"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f83ac4d83ef0ab017683d715ed356e30dd48a93746309c8f3517e1287523ef4"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7322c3d6f1766d4ef1e51a465f47955f1e8123caee67dd641e67d539a534d006"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:18b78ec83edbbeb69efdc0e9c1cb41a3b1b1ed11ddd8ded602464c3fc6020494"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:09763491ce220c0299688940f8dc2c5d05fd1f45af1e42e636b2e8b2303e4382"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-win32.whl", hash = "sha256:9090d8e53235aa280fc9239a86ae3ea8ac58eff66a705fa6aa2ec4968b95c821"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:db1c1722726f47e10e0b5fdbf15ac3b8adb58c091d12b3ab713965795036985f"}, + {file = "lazy-object-proxy-1.10.0.tar.gz", hash = "sha256:78247b6d45f43a52ef35c25b5581459e85117225408a4128a3daf8bf9648ac69"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:855e068b0358ab916454464a884779c7ffa312b8925c6f7401e952dcf3b89977"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab7004cf2e59f7c2e4345604a3e6ea0d92ac44e1c2375527d56492014e690c3"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc0d2fc424e54c70c4bc06787e4072c4f3b1aa2f897dfdc34ce1013cf3ceef05"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e2adb09778797da09d2b5ebdbceebf7dd32e2c96f79da9052b2e87b6ea495895"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b1f711e2c6dcd4edd372cf5dec5c5a30d23bba06ee012093267b3376c079ec83"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-win32.whl", hash = "sha256:76a095cfe6045c7d0ca77db9934e8f7b71b14645f0094ffcd842349ada5c5fb9"}, + {file = "lazy_object_proxy-1.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:b4f87d4ed9064b2628da63830986c3d2dca7501e6018347798313fcf028e2fd4"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fec03caabbc6b59ea4a638bee5fce7117be8e99a4103d9d5ad77f15d6f81020c"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02c83f957782cbbe8136bee26416686a6ae998c7b6191711a04da776dc9e47d4"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:009e6bb1f1935a62889ddc8541514b6a9e1fcf302667dcb049a0be5c8f613e56"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:75fc59fc450050b1b3c203c35020bc41bd2695ed692a392924c6ce180c6f1dc9"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:782e2c9b2aab1708ffb07d4bf377d12901d7a1d99e5e410d648d892f8967ab1f"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-win32.whl", hash = "sha256:edb45bb8278574710e68a6b021599a10ce730d156e5b254941754a9cc0b17d03"}, + {file = "lazy_object_proxy-1.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:e271058822765ad5e3bca7f05f2ace0de58a3f4e62045a8c90a0dfd2f8ad8cc6"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e98c8af98d5707dcdecc9ab0863c0ea6e88545d42ca7c3feffb6b4d1e370c7ba"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:952c81d415b9b80ea261d2372d2a4a2332a3890c2b83e0535f263ddfe43f0d43"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80b39d3a151309efc8cc48675918891b865bdf742a8616a337cb0090791a0de9"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e221060b701e2aa2ea991542900dd13907a5c90fa80e199dbf5a03359019e7a3"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:92f09ff65ecff3108e56526f9e2481b8116c0b9e1425325e13245abfd79bdb1b"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-win32.whl", hash = "sha256:3ad54b9ddbe20ae9f7c1b29e52f123120772b06dbb18ec6be9101369d63a4074"}, + {file = "lazy_object_proxy-1.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:127a789c75151db6af398b8972178afe6bda7d6f68730c057fbbc2e96b08d282"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9e4ed0518a14dd26092614412936920ad081a424bdcb54cc13349a8e2c6d106a"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5ad9e6ed739285919aa9661a5bbed0aaf410aa60231373c5579c6b4801bd883c"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2fc0a92c02fa1ca1e84fc60fa258458e5bf89d90a1ddaeb8ed9cc3147f417255"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:0aefc7591920bbd360d57ea03c995cebc204b424524a5bd78406f6e1b8b2a5d8"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5faf03a7d8942bb4476e3b62fd0f4cf94eaf4618e304a19865abf89a35c0bbee"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-win32.whl", hash = "sha256:e333e2324307a7b5d86adfa835bb500ee70bfcd1447384a822e96495796b0ca4"}, + {file = "lazy_object_proxy-1.10.0-cp38-cp38-win_amd64.whl", hash = "sha256:cb73507defd385b7705c599a94474b1d5222a508e502553ef94114a143ec6696"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:366c32fe5355ef5fc8a232c5436f4cc66e9d3e8967c01fb2e6302fd6627e3d94"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2297f08f08a2bb0d32a4265e98a006643cd7233fb7983032bd61ac7a02956b3b"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18dd842b49456aaa9a7cf535b04ca4571a302ff72ed8740d06b5adcd41fe0757"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:217138197c170a2a74ca0e05bddcd5f1796c735c37d0eee33e43259b192aa424"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9a3a87cf1e133e5b1994144c12ca4aa3d9698517fe1e2ca82977781b16955658"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-win32.whl", hash = "sha256:30b339b2a743c5288405aa79a69e706a06e02958eab31859f7f3c04980853b70"}, + {file = "lazy_object_proxy-1.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:a899b10e17743683b293a729d3a11f2f399e8a90c73b089e29f5d0fe3509f0dd"}, + {file = "lazy_object_proxy-1.10.0-pp310.pp311.pp312.pp38.pp39-none-any.whl", hash = "sha256:80fa48bd89c8f2f456fc0765c11c23bf5af827febacd2f523ca5bc1893fcc09d"}, ] [[package]] @@ -356,39 +346,47 @@ files = [ [[package]] name = "numpy" -version = "1.24.2" +version = "1.26.2" description = "Fundamental package for array computing in Python" optional = false -python-versions = ">=3.8" -files = [ - {file = "numpy-1.24.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:eef70b4fc1e872ebddc38cddacc87c19a3709c0e3e5d20bf3954c147b1dd941d"}, - {file = "numpy-1.24.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e8d2859428712785e8a8b7d2b3ef0a1d1565892367b32f915c4a4df44d0e64f5"}, - {file = "numpy-1.24.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6524630f71631be2dabe0c541e7675db82651eb998496bbe16bc4f77f0772253"}, - {file = "numpy-1.24.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a51725a815a6188c662fb66fb32077709a9ca38053f0274640293a14fdd22978"}, - {file = "numpy-1.24.2-cp310-cp310-win32.whl", hash = "sha256:2620e8592136e073bd12ee4536149380695fbe9ebeae845b81237f986479ffc9"}, - {file = "numpy-1.24.2-cp310-cp310-win_amd64.whl", hash = "sha256:97cf27e51fa078078c649a51d7ade3c92d9e709ba2bfb97493007103c741f1d0"}, - {file = "numpy-1.24.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7de8fdde0003f4294655aa5d5f0a89c26b9f22c0a58790c38fae1ed392d44a5a"}, - {file = "numpy-1.24.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4173bde9fa2a005c2c6e2ea8ac1618e2ed2c1c6ec8a7657237854d42094123a0"}, - {file = "numpy-1.24.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4cecaed30dc14123020f77b03601559fff3e6cd0c048f8b5289f4eeabb0eb281"}, - {file = "numpy-1.24.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a23f8440561a633204a67fb44617ce2a299beecf3295f0d13c495518908e910"}, - {file = "numpy-1.24.2-cp311-cp311-win32.whl", hash = "sha256:e428c4fbfa085f947b536706a2fc349245d7baa8334f0c5723c56a10595f9b95"}, - {file = "numpy-1.24.2-cp311-cp311-win_amd64.whl", hash = "sha256:557d42778a6869c2162deb40ad82612645e21d79e11c1dc62c6e82a2220ffb04"}, - {file = "numpy-1.24.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d0a2db9d20117bf523dde15858398e7c0858aadca7c0f088ac0d6edd360e9ad2"}, - {file = "numpy-1.24.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c72a6b2f4af1adfe193f7beb91ddf708ff867a3f977ef2ec53c0ffb8283ab9f5"}, - {file = "numpy-1.24.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c29e6bd0ec49a44d7690ecb623a8eac5ab8a923bce0bea6293953992edf3a76a"}, - {file = "numpy-1.24.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2eabd64ddb96a1239791da78fa5f4e1693ae2dadc82a76bc76a14cbb2b966e96"}, - {file = "numpy-1.24.2-cp38-cp38-win32.whl", hash = "sha256:e3ab5d32784e843fc0dd3ab6dcafc67ef806e6b6828dc6af2f689be0eb4d781d"}, - {file = "numpy-1.24.2-cp38-cp38-win_amd64.whl", hash = "sha256:76807b4063f0002c8532cfeac47a3068a69561e9c8715efdad3c642eb27c0756"}, - {file = "numpy-1.24.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4199e7cfc307a778f72d293372736223e39ec9ac096ff0a2e64853b866a8e18a"}, - {file = "numpy-1.24.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:adbdce121896fd3a17a77ab0b0b5eedf05a9834a18699db6829a64e1dfccca7f"}, - {file = "numpy-1.24.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:889b2cc88b837d86eda1b17008ebeb679d82875022200c6e8e4ce6cf549b7acb"}, - {file = "numpy-1.24.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f64bb98ac59b3ea3bf74b02f13836eb2e24e48e0ab0145bbda646295769bd780"}, - {file = "numpy-1.24.2-cp39-cp39-win32.whl", hash = "sha256:63e45511ee4d9d976637d11e6c9864eae50e12dc9598f531c035265991910468"}, - {file = "numpy-1.24.2-cp39-cp39-win_amd64.whl", hash = "sha256:a77d3e1163a7770164404607b7ba3967fb49b24782a6ef85d9b5f54126cc39e5"}, - {file = "numpy-1.24.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:92011118955724465fb6853def593cf397b4a1367495e0b59a7e69d40c4eb71d"}, - {file = "numpy-1.24.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f9006288bcf4895917d02583cf3411f98631275bc67cce355a7f39f8c14338fa"}, - {file = "numpy-1.24.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:150947adbdfeceec4e5926d956a06865c1c690f2fd902efede4ca6fe2e657c3f"}, - {file = "numpy-1.24.2.tar.gz", hash = "sha256:003a9f530e880cb2cd177cba1af7220b9aa42def9c4afc2a2fc3ee6be7eb2b22"}, +python-versions = ">=3.9" +files = [ + {file = "numpy-1.26.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3703fc9258a4a122d17043e57b35e5ef1c5a5837c3db8be396c82e04c1cf9b0f"}, + {file = "numpy-1.26.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cc392fdcbd21d4be6ae1bb4475a03ce3b025cd49a9be5345d76d7585aea69440"}, + {file = "numpy-1.26.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:36340109af8da8805d8851ef1d74761b3b88e81a9bd80b290bbfed61bd2b4f75"}, + {file = "numpy-1.26.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bcc008217145b3d77abd3e4d5ef586e3bdfba8fe17940769f8aa09b99e856c00"}, + {file = "numpy-1.26.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3ced40d4e9e18242f70dd02d739e44698df3dcb010d31f495ff00a31ef6014fe"}, + {file = "numpy-1.26.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b272d4cecc32c9e19911891446b72e986157e6a1809b7b56518b4f3755267523"}, + {file = "numpy-1.26.2-cp310-cp310-win32.whl", hash = "sha256:22f8fc02fdbc829e7a8c578dd8d2e15a9074b630d4da29cda483337e300e3ee9"}, + {file = "numpy-1.26.2-cp310-cp310-win_amd64.whl", hash = "sha256:26c9d33f8e8b846d5a65dd068c14e04018d05533b348d9eaeef6c1bd787f9919"}, + {file = "numpy-1.26.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b96e7b9c624ef3ae2ae0e04fa9b460f6b9f17ad8b4bec6d7756510f1f6c0c841"}, + {file = "numpy-1.26.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aa18428111fb9a591d7a9cc1b48150097ba6a7e8299fb56bdf574df650e7d1f1"}, + {file = "numpy-1.26.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:06fa1ed84aa60ea6ef9f91ba57b5ed963c3729534e6e54055fc151fad0423f0a"}, + {file = "numpy-1.26.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96ca5482c3dbdd051bcd1fce8034603d6ebfc125a7bd59f55b40d8f5d246832b"}, + {file = "numpy-1.26.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:854ab91a2906ef29dc3925a064fcd365c7b4da743f84b123002f6139bcb3f8a7"}, + {file = "numpy-1.26.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f43740ab089277d403aa07567be138fc2a89d4d9892d113b76153e0e412409f8"}, + {file = "numpy-1.26.2-cp311-cp311-win32.whl", hash = "sha256:a2bbc29fcb1771cd7b7425f98b05307776a6baf43035d3b80c4b0f29e9545186"}, + {file = "numpy-1.26.2-cp311-cp311-win_amd64.whl", hash = "sha256:2b3fca8a5b00184828d12b073af4d0fc5fdd94b1632c2477526f6bd7842d700d"}, + {file = "numpy-1.26.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:a4cd6ed4a339c21f1d1b0fdf13426cb3b284555c27ac2f156dfdaaa7e16bfab0"}, + {file = "numpy-1.26.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5d5244aabd6ed7f312268b9247be47343a654ebea52a60f002dc70c769048e75"}, + {file = "numpy-1.26.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a3cdb4d9c70e6b8c0814239ead47da00934666f668426fc6e94cce869e13fd7"}, + {file = "numpy-1.26.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa317b2325f7aa0a9471663e6093c210cb2ae9c0ad824732b307d2c51983d5b6"}, + {file = "numpy-1.26.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:174a8880739c16c925799c018f3f55b8130c1f7c8e75ab0a6fa9d41cab092fd6"}, + {file = "numpy-1.26.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f79b231bf5c16b1f39c7f4875e1ded36abee1591e98742b05d8a0fb55d8a3eec"}, + {file = "numpy-1.26.2-cp312-cp312-win32.whl", hash = "sha256:4a06263321dfd3598cacb252f51e521a8cb4b6df471bb12a7ee5cbab20ea9167"}, + {file = "numpy-1.26.2-cp312-cp312-win_amd64.whl", hash = "sha256:b04f5dc6b3efdaab541f7857351aac359e6ae3c126e2edb376929bd3b7f92d7e"}, + {file = "numpy-1.26.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4eb8df4bf8d3d90d091e0146f6c28492b0be84da3e409ebef54349f71ed271ef"}, + {file = "numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1a13860fdcd95de7cf58bd6f8bc5a5ef81c0b0625eb2c9a783948847abbef2c2"}, + {file = "numpy-1.26.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64308ebc366a8ed63fd0bf426b6a9468060962f1a4339ab1074c228fa6ade8e3"}, + {file = "numpy-1.26.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baf8aab04a2c0e859da118f0b38617e5ee65d75b83795055fb66c0d5e9e9b818"}, + {file = "numpy-1.26.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d73a3abcac238250091b11caef9ad12413dab01669511779bc9b29261dd50210"}, + {file = "numpy-1.26.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b361d369fc7e5e1714cf827b731ca32bff8d411212fccd29ad98ad622449cc36"}, + {file = "numpy-1.26.2-cp39-cp39-win32.whl", hash = "sha256:bd3f0091e845164a20bd5a326860c840fe2af79fa12e0469a12768a3ec578d80"}, + {file = "numpy-1.26.2-cp39-cp39-win_amd64.whl", hash = "sha256:2beef57fb031dcc0dc8fa4fe297a742027b954949cabb52a2a376c144e5e6060"}, + {file = "numpy-1.26.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:1cc3d5029a30fb5f06704ad6b23b35e11309491c999838c31f124fee32107c79"}, + {file = "numpy-1.26.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94cc3c222bb9fb5a12e334d0479b97bb2df446fbe622b470928f5284ffca3f8d"}, + {file = "numpy-1.26.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:fe6b44fb8fcdf7eda4ef4461b97b3f63c466b27ab151bec2366db8b197387841"}, + {file = "numpy-1.26.2.tar.gz", hash = "sha256:f65738447676ab5777f11e6bbbdb8ce11b785e105f690bc45966574816b6d3ea"}, ] [[package]] @@ -408,64 +406,53 @@ testing = ["docopt", "pytest (<6.0.0)"] [[package]] name = "pathspec" -version = "0.11.0" +version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pathspec-0.11.0-py3-none-any.whl", hash = "sha256:3a66eb970cbac598f9e5ccb5b2cf58930cd8e3ed86d393d541eaf2d8b1705229"}, - {file = "pathspec-0.11.0.tar.gz", hash = "sha256:64d338d4e0914e91c1792321e6907b5a593f1ab1851de7fc269557a21b30ebbc"}, + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, ] [[package]] name = "pexpect" -version = "4.8.0" +version = "4.9.0" description = "Pexpect allows easy control of interactive console applications." optional = false python-versions = "*" files = [ - {file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"}, - {file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"}, + {file = "pexpect-4.9.0-py2.py3-none-any.whl", hash = "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523"}, + {file = "pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f"}, ] [package.dependencies] ptyprocess = ">=0.5" -[[package]] -name = "pickleshare" -version = "0.7.5" -description = "Tiny 'shelve'-like database with concurrency support" -optional = false -python-versions = "*" -files = [ - {file = "pickleshare-0.7.5-py2.py3-none-any.whl", hash = "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"}, - {file = "pickleshare-0.7.5.tar.gz", hash = "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca"}, -] - [[package]] name = "platformdirs" -version = "3.0.0" +version = "4.1.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "platformdirs-3.0.0-py3-none-any.whl", hash = "sha256:b1d5eb14f221506f50d6604a561f4c5786d9e80355219694a1b244bcd96f4567"}, - {file = "platformdirs-3.0.0.tar.gz", hash = "sha256:8a1228abb1ef82d788f74139988b137e78692984ec7b08eaa6c65f1723af28f9"}, + {file = "platformdirs-4.1.0-py3-none-any.whl", hash = "sha256:11c8f37bcca40db96d8144522d925583bdb7a31f7b0e37e3ed4318400a8e2380"}, + {file = "platformdirs-4.1.0.tar.gz", hash = "sha256:906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] [[package]] name = "prompt-toolkit" -version = "3.0.36" +version = "3.0.43" description = "Library for building powerful interactive command lines in Python" optional = false -python-versions = ">=3.6.2" +python-versions = ">=3.7.0" files = [ - {file = "prompt_toolkit-3.0.36-py3-none-any.whl", hash = "sha256:aa64ad242a462c5ff0363a7b9cfe696c20d55d9fc60c11fd8e632d064804d305"}, - {file = "prompt_toolkit-3.0.36.tar.gz", hash = "sha256:3e163f254bef5a03b146397d7c1963bd3e2812f0964bb9a24e6ec761fd28db63"}, + {file = "prompt_toolkit-3.0.43-py3-none-any.whl", hash = "sha256:a11a29cb3bf0a28a387fe5122cdb649816a957cd9261dcedf8c9f1fef33eacf6"}, + {file = "prompt_toolkit-3.0.43.tar.gz", hash = "sha256:3527b7af26106cbc65a040bcc84839a3566ec1b051bb0bfe953631e704b0ff7d"}, ] [package.dependencies] @@ -498,31 +485,32 @@ tests = ["pytest"] [[package]] name = "pygments" -version = "2.15.0" +version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.7" files = [ - {file = "Pygments-2.15.0-py3-none-any.whl", hash = "sha256:77a3299119af881904cd5ecd1ac6a66214b6e9bed1f2db16993b54adede64094"}, - {file = "Pygments-2.15.0.tar.gz", hash = "sha256:f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500"}, + {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, + {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, ] [package.extras] plugins = ["importlib-metadata"] +windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pylint" -version = "2.16.2" +version = "2.17.7" description = "python code static checker" optional = false python-versions = ">=3.7.2" files = [ - {file = "pylint-2.16.2-py3-none-any.whl", hash = "sha256:ff22dde9c2128cd257c145cfd51adeff0be7df4d80d669055f24a962b351bbe4"}, - {file = "pylint-2.16.2.tar.gz", hash = "sha256:13b2c805a404a9bf57d002cd5f054ca4d40b0b87542bdaba5e05321ae8262c84"}, + {file = "pylint-2.17.7-py3-none-any.whl", hash = "sha256:27a8d4c7ddc8c2f8c18aa0050148f89ffc09838142193fdbe98f172781a3ff87"}, + {file = "pylint-2.17.7.tar.gz", hash = "sha256:f4fcac7ae74cfe36bc8451e931d8438e4a476c20314b1101c458ad0f05191fad"}, ] [package.dependencies] -astroid = ">=2.14.2,<=2.16.0-dev0" +astroid = ">=2.15.8,<=2.17.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, @@ -541,41 +529,45 @@ testutils = ["gitpython (>3)"] [[package]] name = "scipy" -version = "1.9.3" +version = "1.11.4" description = "Fundamental algorithms for scientific computing in Python" optional = false -python-versions = ">=3.8" -files = [ - {file = "scipy-1.9.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1884b66a54887e21addf9c16fb588720a8309a57b2e258ae1c7986d4444d3bc0"}, - {file = "scipy-1.9.3-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:83b89e9586c62e787f5012e8475fbb12185bafb996a03257e9675cd73d3736dd"}, - {file = "scipy-1.9.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a72d885fa44247f92743fc20732ae55564ff2a519e8302fb7e18717c5355a8b"}, - {file = "scipy-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d01e1dd7b15bd2449c8bfc6b7cc67d630700ed655654f0dfcf121600bad205c9"}, - {file = "scipy-1.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:68239b6aa6f9c593da8be1509a05cb7f9efe98b80f43a5861cd24c7557e98523"}, - {file = "scipy-1.9.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b41bc822679ad1c9a5f023bc93f6d0543129ca0f37c1ce294dd9d386f0a21096"}, - {file = "scipy-1.9.3-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:90453d2b93ea82a9f434e4e1cba043e779ff67b92f7a0e85d05d286a3625df3c"}, - {file = "scipy-1.9.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83c06e62a390a9167da60bedd4575a14c1f58ca9dfde59830fc42e5197283dab"}, - {file = "scipy-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:abaf921531b5aeaafced90157db505e10345e45038c39e5d9b6c7922d68085cb"}, - {file = "scipy-1.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:06d2e1b4c491dc7d8eacea139a1b0b295f74e1a1a0f704c375028f8320d16e31"}, - {file = "scipy-1.9.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5a04cd7d0d3eff6ea4719371cbc44df31411862b9646db617c99718ff68d4840"}, - {file = "scipy-1.9.3-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:545c83ffb518094d8c9d83cce216c0c32f8c04aaf28b92cc8283eda0685162d5"}, - {file = "scipy-1.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d54222d7a3ba6022fdf5773931b5d7c56efe41ede7f7128c7b1637700409108"}, - {file = "scipy-1.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cff3a5295234037e39500d35316a4c5794739433528310e117b8a9a0c76d20fc"}, - {file = "scipy-1.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:2318bef588acc7a574f5bfdff9c172d0b1bf2c8143d9582e05f878e580a3781e"}, - {file = "scipy-1.9.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d644a64e174c16cb4b2e41dfea6af722053e83d066da7343f333a54dae9bc31c"}, - {file = "scipy-1.9.3-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:da8245491d73ed0a994ed9c2e380fd058ce2fa8a18da204681f2fe1f57f98f95"}, - {file = "scipy-1.9.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4db5b30849606a95dcf519763dd3ab6fe9bd91df49eba517359e450a7d80ce2e"}, - {file = "scipy-1.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c68db6b290cbd4049012990d7fe71a2abd9ffbe82c0056ebe0f01df8be5436b0"}, - {file = "scipy-1.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:5b88e6d91ad9d59478fafe92a7c757d00c59e3bdc3331be8ada76a4f8d683f58"}, - {file = "scipy-1.9.3.tar.gz", hash = "sha256:fbc5c05c85c1a02be77b1ff591087c83bc44579c6d2bd9fb798bb64ea5e1a027"}, +python-versions = ">=3.9" +files = [ + {file = "scipy-1.11.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bc9a714581f561af0848e6b69947fda0614915f072dfd14142ed1bfe1b806710"}, + {file = "scipy-1.11.4-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:cf00bd2b1b0211888d4dc75656c0412213a8b25e80d73898083f402b50f47e41"}, + {file = "scipy-1.11.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9999c008ccf00e8fbcce1236f85ade5c569d13144f77a1946bef8863e8f6eb4"}, + {file = "scipy-1.11.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:933baf588daa8dc9a92c20a0be32f56d43faf3d1a60ab11b3f08c356430f6e56"}, + {file = "scipy-1.11.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8fce70f39076a5aa62e92e69a7f62349f9574d8405c0a5de6ed3ef72de07f446"}, + {file = "scipy-1.11.4-cp310-cp310-win_amd64.whl", hash = "sha256:6550466fbeec7453d7465e74d4f4b19f905642c89a7525571ee91dd7adabb5a3"}, + {file = "scipy-1.11.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f313b39a7e94f296025e3cffc2c567618174c0b1dde173960cf23808f9fae4be"}, + {file = "scipy-1.11.4-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:1b7c3dca977f30a739e0409fb001056484661cb2541a01aba0bb0029f7b68db8"}, + {file = "scipy-1.11.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:00150c5eae7b610c32589dda259eacc7c4f1665aedf25d921907f4d08a951b1c"}, + {file = "scipy-1.11.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:530f9ad26440e85766509dbf78edcfe13ffd0ab7fec2560ee5c36ff74d6269ff"}, + {file = "scipy-1.11.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5e347b14fe01003d3b78e196e84bd3f48ffe4c8a7b8a1afbcb8f5505cb710993"}, + {file = "scipy-1.11.4-cp311-cp311-win_amd64.whl", hash = "sha256:acf8ed278cc03f5aff035e69cb511741e0418681d25fbbb86ca65429c4f4d9cd"}, + {file = "scipy-1.11.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:028eccd22e654b3ea01ee63705681ee79933652b2d8f873e7949898dda6d11b6"}, + {file = "scipy-1.11.4-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:2c6ff6ef9cc27f9b3db93a6f8b38f97387e6e0591600369a297a50a8e96e835d"}, + {file = "scipy-1.11.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b030c6674b9230d37c5c60ab456e2cf12f6784596d15ce8da9365e70896effc4"}, + {file = "scipy-1.11.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad669df80528aeca5f557712102538f4f37e503f0c5b9541655016dd0932ca79"}, + {file = "scipy-1.11.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ce7fff2e23ab2cc81ff452a9444c215c28e6305f396b2ba88343a567feec9660"}, + {file = "scipy-1.11.4-cp312-cp312-win_amd64.whl", hash = "sha256:36750b7733d960d7994888f0d148d31ea3017ac15eef664194b4ef68d36a4a97"}, + {file = "scipy-1.11.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6e619aba2df228a9b34718efb023966da781e89dd3d21637b27f2e54db0410d7"}, + {file = "scipy-1.11.4-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:f3cd9e7b3c2c1ec26364856f9fbe78695fe631150f94cd1c22228456404cf1ec"}, + {file = "scipy-1.11.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d10e45a6c50211fe256da61a11c34927c68f277e03138777bdebedd933712fea"}, + {file = "scipy-1.11.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91af76a68eeae0064887a48e25c4e616fa519fa0d38602eda7e0f97d65d57937"}, + {file = "scipy-1.11.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6df1468153a31cf55ed5ed39647279beb9cfb5d3f84369453b49e4b8502394fd"}, + {file = "scipy-1.11.4-cp39-cp39-win_amd64.whl", hash = "sha256:ee410e6de8f88fd5cf6eadd73c135020bfbbbdfcd0f6162c36a7638a1ea8cc65"}, + {file = "scipy-1.11.4.tar.gz", hash = "sha256:90a2b78e7f5733b9de748f589f09225013685f9b218275257f8a8168ededaeaa"}, ] [package.dependencies] -numpy = ">=1.18.5,<1.26.0" +numpy = ">=1.21.6,<1.28.0" [package.extras] -dev = ["flake8", "mypy", "pycodestyle", "typing_extensions"] -doc = ["matplotlib (>2)", "numpydoc", "pydata-sphinx-theme (==0.9.0)", "sphinx (!=4.1.0)", "sphinx-panels (>=0.5.2)", "sphinx-tabs"] -test = ["asv", "gmpy2", "mpmath", "pytest", "pytest-cov", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +dev = ["click", "cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy", "pycodestyle", "pydevtool", "rich-click", "ruff", "types-psutil", "typing_extensions"] +doc = ["jupytext", "matplotlib (>2)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (==0.9.0)", "sphinx (!=4.1.0)", "sphinx-design (>=0.2.0)"] +test = ["asv", "gmpy2", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] [[package]] name = "six" @@ -590,13 +582,13 @@ files = [ [[package]] name = "stack-data" -version = "0.6.2" +version = "0.6.3" description = "Extract data from python stack frames and tracebacks for informative displays" optional = false python-versions = "*" files = [ - {file = "stack_data-0.6.2-py3-none-any.whl", hash = "sha256:cbb2a53eb64e5785878201a97ed7c7b94883f48b87bfb0bbe8b623c74679e4a8"}, - {file = "stack_data-0.6.2.tar.gz", hash = "sha256:32d2dd0376772d01b6cb9fc996f3c8b57a357089dec328ed4b6553d037eaf815"}, + {file = "stack_data-0.6.3-py3-none-any.whl", hash = "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695"}, + {file = "stack_data-0.6.3.tar.gz", hash = "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9"}, ] [package.dependencies] @@ -609,13 +601,13 @@ tests = ["cython", "littleutils", "pygments", "pytest", "typeguard"] [[package]] name = "svgpathtools" -version = "1.6.0" +version = "1.6.1" description = "A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves." optional = false python-versions = "*" files = [ - {file = "svgpathtools-1.6.0-py2.py3-none-any.whl", hash = "sha256:b046301769de58fe3d35a3f633914455b5bafba52dddfe0a41ec57ac1bcb9439"}, - {file = "svgpathtools-1.6.0.tar.gz", hash = "sha256:c0b934eed29acaeb09988afb4d15c5984366847236e21b80c079d8edb5ac0c4e"}, + {file = "svgpathtools-1.6.1-py2.py3-none-any.whl", hash = "sha256:39967f9a817b8a12cc6dd1646fc162d522fca6c3fd5f8c94913c15ee4cb3a906"}, + {file = "svgpathtools-1.6.1.tar.gz", hash = "sha256:7054e6de1953e295bf565d535d585695453b09f8db4a2f7c4853348732097a3e"}, ] [package.dependencies] @@ -647,123 +639,129 @@ files = [ [[package]] name = "tomlkit" -version = "0.11.6" +version = "0.12.3" description = "Style preserving TOML library" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "tomlkit-0.11.6-py3-none-any.whl", hash = "sha256:07de26b0d8cfc18f871aec595fda24d95b08fef89d147caa861939f37230bf4b"}, - {file = "tomlkit-0.11.6.tar.gz", hash = "sha256:71b952e5721688937fb02cf9d354dbcf0785066149d2855e44531ebdd2b65d73"}, + {file = "tomlkit-0.12.3-py3-none-any.whl", hash = "sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba"}, + {file = "tomlkit-0.12.3.tar.gz", hash = "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4"}, ] [[package]] name = "traitlets" -version = "5.9.0" +version = "5.14.0" description = "Traitlets Python configuration system" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "traitlets-5.9.0-py3-none-any.whl", hash = "sha256:9e6ec080259b9a5940c797d58b613b5e31441c2257b87c2e795c5228ae80d2d8"}, - {file = "traitlets-5.9.0.tar.gz", hash = "sha256:f6cde21a9c68cf756af02035f72d5a723bf607e862e7be33ece505abf4a3bad9"}, + {file = "traitlets-5.14.0-py3-none-any.whl", hash = "sha256:f14949d23829023013c47df20b4a76ccd1a85effb786dc060f34de7948361b33"}, + {file = "traitlets-5.14.0.tar.gz", hash = "sha256:fcdaa8ac49c04dfa0ed3ee3384ef6dfdb5d6f3741502be247279407679296772"}, ] [package.extras] docs = ["myst-parser", "pydata-sphinx-theme", "sphinx"] -test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"] +test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0,<7.5)", "pytest-mock", "pytest-mypy-testing"] [[package]] name = "typing-extensions" -version = "4.5.0" -description = "Backported and Experimental Type Hints for Python 3.7+" +version = "4.9.0" +description = "Backported and Experimental Type Hints for Python 3.8+" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.5.0-py3-none-any.whl", hash = "sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4"}, - {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, + {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, + {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, ] [[package]] name = "wcwidth" -version = "0.2.6" +version = "0.2.12" description = "Measures the displayed width of unicode strings in a terminal" optional = false python-versions = "*" files = [ - {file = "wcwidth-0.2.6-py2.py3-none-any.whl", hash = "sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e"}, - {file = "wcwidth-0.2.6.tar.gz", hash = "sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0"}, + {file = "wcwidth-0.2.12-py2.py3-none-any.whl", hash = "sha256:f26ec43d96c8cbfed76a5075dac87680124fa84e0855195a6184da9c187f133c"}, + {file = "wcwidth-0.2.12.tar.gz", hash = "sha256:f01c104efdf57971bcb756f054dd58ddec5204dd15fa31d6503ea57947d97c02"}, ] [[package]] name = "wrapt" -version = "1.14.1" +version = "1.16.0" description = "Module for decorators, wrappers and monkey patching." optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -files = [ - {file = "wrapt-1.14.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:1b376b3f4896e7930f1f772ac4b064ac12598d1c38d04907e696cc4d794b43d3"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:903500616422a40a98a5a3c4ff4ed9d0066f3b4c951fa286018ecdf0750194ef"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5a9a0d155deafd9448baff28c08e150d9b24ff010e899311ddd63c45c2445e28"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:ddaea91abf8b0d13443f6dac52e89051a5063c7d014710dcb4d4abb2ff811a59"}, - {file = "wrapt-1.14.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:36f582d0c6bc99d5f39cd3ac2a9062e57f3cf606ade29a0a0d6b323462f4dd87"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:7ef58fb89674095bfc57c4069e95d7a31cfdc0939e2a579882ac7d55aadfd2a1"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:e2f83e18fe2f4c9e7db597e988f72712c0c3676d337d8b101f6758107c42425b"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:ee2b1b1769f6707a8a445162ea16dddf74285c3964f605877a20e38545c3c462"}, - {file = "wrapt-1.14.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:833b58d5d0b7e5b9832869f039203389ac7cbf01765639c7309fd50ef619e0b1"}, - {file = "wrapt-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:80bb5c256f1415f747011dc3604b59bc1f91c6e7150bd7db03b19170ee06b320"}, - {file = "wrapt-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:07f7a7d0f388028b2df1d916e94bbb40624c59b48ecc6cbc232546706fac74c2"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:02b41b633c6261feff8ddd8d11c711df6842aba629fdd3da10249a53211a72c4"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fe803deacd09a233e4762a1adcea5db5d31e6be577a43352936179d14d90069"}, - {file = "wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:257fd78c513e0fb5cdbe058c27a0624c9884e735bbd131935fd49e9fe719d310"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4fcc4649dc762cddacd193e6b55bc02edca674067f5f98166d7713b193932b7f"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:11871514607b15cfeb87c547a49bca19fde402f32e2b1c24a632506c0a756656"}, - {file = "wrapt-1.14.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8ad85f7f4e20964db4daadcab70b47ab05c7c1cf2a7c1e51087bfaa83831854c"}, - {file = "wrapt-1.14.1-cp310-cp310-win32.whl", hash = "sha256:a9a52172be0b5aae932bef82a79ec0a0ce87288c7d132946d645eba03f0ad8a8"}, - {file = "wrapt-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:6d323e1554b3d22cfc03cd3243b5bb815a51f5249fdcbb86fda4bf62bab9e164"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:43ca3bbbe97af00f49efb06e352eae40434ca9d915906f77def219b88e85d907"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:6b1a564e6cb69922c7fe3a678b9f9a3c54e72b469875aa8018f18b4d1dd1adf3"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:00b6d4ea20a906c0ca56d84f93065b398ab74b927a7a3dbd470f6fc503f95dc3"}, - {file = "wrapt-1.14.1-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:a85d2b46be66a71bedde836d9e41859879cc54a2a04fad1191eb50c2066f6e9d"}, - {file = "wrapt-1.14.1-cp35-cp35m-win32.whl", hash = "sha256:dbcda74c67263139358f4d188ae5faae95c30929281bc6866d00573783c422b7"}, - {file = "wrapt-1.14.1-cp35-cp35m-win_amd64.whl", hash = "sha256:b21bb4c09ffabfa0e85e3a6b623e19b80e7acd709b9f91452b8297ace2a8ab00"}, - {file = "wrapt-1.14.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:9e0fd32e0148dd5dea6af5fee42beb949098564cc23211a88d799e434255a1f4"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9736af4641846491aedb3c3f56b9bc5568d92b0692303b5a305301a95dfd38b1"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b02d65b9ccf0ef6c34cba6cf5bf2aab1bb2f49c6090bafeecc9cd81ad4ea1c1"}, - {file = "wrapt-1.14.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21ac0156c4b089b330b7666db40feee30a5d52634cc4560e1905d6529a3897ff"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:9f3e6f9e05148ff90002b884fbc2a86bd303ae847e472f44ecc06c2cd2fcdb2d"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:6e743de5e9c3d1b7185870f480587b75b1cb604832e380d64f9504a0535912d1"}, - {file = "wrapt-1.14.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:d79d7d5dc8a32b7093e81e97dad755127ff77bcc899e845f41bf71747af0c569"}, - {file = "wrapt-1.14.1-cp36-cp36m-win32.whl", hash = "sha256:81b19725065dcb43df02b37e03278c011a09e49757287dca60c5aecdd5a0b8ed"}, - {file = "wrapt-1.14.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b014c23646a467558be7da3d6b9fa409b2c567d2110599b7cf9a0c5992b3b471"}, - {file = "wrapt-1.14.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:88bd7b6bd70a5b6803c1abf6bca012f7ed963e58c68d76ee20b9d751c74a3248"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5901a312f4d14c59918c221323068fad0540e34324925c8475263841dbdfe68"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d77c85fedff92cf788face9bfa3ebaa364448ebb1d765302e9af11bf449ca36d"}, - {file = "wrapt-1.14.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d649d616e5c6a678b26d15ece345354f7c2286acd6db868e65fcc5ff7c24a77"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7d2872609603cb35ca513d7404a94d6d608fc13211563571117046c9d2bcc3d7"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ee6acae74a2b91865910eef5e7de37dc6895ad96fa23603d1d27ea69df545015"}, - {file = "wrapt-1.14.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2b39d38039a1fdad98c87279b48bc5dce2c0ca0d73483b12cb72aa9609278e8a"}, - {file = "wrapt-1.14.1-cp37-cp37m-win32.whl", hash = "sha256:60db23fa423575eeb65ea430cee741acb7c26a1365d103f7b0f6ec412b893853"}, - {file = "wrapt-1.14.1-cp37-cp37m-win_amd64.whl", hash = "sha256:709fe01086a55cf79d20f741f39325018f4df051ef39fe921b1ebe780a66184c"}, - {file = "wrapt-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8c0ce1e99116d5ab21355d8ebe53d9460366704ea38ae4d9f6933188f327b456"}, - {file = "wrapt-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e3fb1677c720409d5f671e39bac6c9e0e422584e5f518bfd50aa4cbbea02433f"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:642c2e7a804fcf18c222e1060df25fc210b9c58db7c91416fb055897fc27e8cc"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b7c050ae976e286906dd3f26009e117eb000fb2cf3533398c5ad9ccc86867b1"}, - {file = "wrapt-1.14.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef3f72c9666bba2bab70d2a8b79f2c6d2c1a42a7f7e2b0ec83bb2f9e383950af"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:01c205616a89d09827986bc4e859bcabd64f5a0662a7fe95e0d359424e0e071b"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5a0f54ce2c092aaf439813735584b9537cad479575a09892b8352fea5e988dc0"}, - {file = "wrapt-1.14.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2cf71233a0ed05ccdabe209c606fe0bac7379fdcf687f39b944420d2a09fdb57"}, - {file = "wrapt-1.14.1-cp38-cp38-win32.whl", hash = "sha256:aa31fdcc33fef9eb2552cbcbfee7773d5a6792c137b359e82879c101e98584c5"}, - {file = "wrapt-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:d1967f46ea8f2db647c786e78d8cc7e4313dbd1b0aca360592d8027b8508e24d"}, - {file = "wrapt-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3232822c7d98d23895ccc443bbdf57c7412c5a65996c30442ebe6ed3df335383"}, - {file = "wrapt-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:988635d122aaf2bdcef9e795435662bcd65b02f4f4c1ae37fbee7401c440b3a7"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cca3c2cdadb362116235fdbd411735de4328c61425b0aa9f872fd76d02c4e86"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d52a25136894c63de15a35bc0bdc5adb4b0e173b9c0d07a2be9d3ca64a332735"}, - {file = "wrapt-1.14.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:40e7bc81c9e2b2734ea4bc1aceb8a8f0ceaac7c5299bc5d69e37c44d9081d43b"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b9b7a708dd92306328117d8c4b62e2194d00c365f18eff11a9b53c6f923b01e3"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6a9a25751acb379b466ff6be78a315e2b439d4c94c1e99cb7266d40a537995d3"}, - {file = "wrapt-1.14.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:34aa51c45f28ba7f12accd624225e2b1e5a3a45206aa191f6f9aac931d9d56fe"}, - {file = "wrapt-1.14.1-cp39-cp39-win32.whl", hash = "sha256:dee0ce50c6a2dd9056c20db781e9c1cfd33e77d2d569f5d1d9321c641bb903d5"}, - {file = "wrapt-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:dee60e1de1898bde3b238f18340eec6148986da0455d8ba7848d50470a7a32fb"}, - {file = "wrapt-1.14.1.tar.gz", hash = "sha256:380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d"}, +python-versions = ">=3.6" +files = [ + {file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"}, + {file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"}, + {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440"}, + {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487"}, + {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf"}, + {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72"}, + {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0"}, + {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136"}, + {file = "wrapt-1.16.0-cp310-cp310-win32.whl", hash = "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d"}, + {file = "wrapt-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2"}, + {file = "wrapt-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09"}, + {file = "wrapt-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d"}, + {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389"}, + {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060"}, + {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1"}, + {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3"}, + {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956"}, + {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d"}, + {file = "wrapt-1.16.0-cp311-cp311-win32.whl", hash = "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362"}, + {file = "wrapt-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89"}, + {file = "wrapt-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b"}, + {file = "wrapt-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36"}, + {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73"}, + {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809"}, + {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b"}, + {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81"}, + {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9"}, + {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c"}, + {file = "wrapt-1.16.0-cp312-cp312-win32.whl", hash = "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc"}, + {file = "wrapt-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8"}, + {file = "wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8"}, + {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39"}, + {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c"}, + {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40"}, + {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc"}, + {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e"}, + {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465"}, + {file = "wrapt-1.16.0-cp36-cp36m-win32.whl", hash = "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e"}, + {file = "wrapt-1.16.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966"}, + {file = "wrapt-1.16.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593"}, + {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292"}, + {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5"}, + {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf"}, + {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228"}, + {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f"}, + {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c"}, + {file = "wrapt-1.16.0-cp37-cp37m-win32.whl", hash = "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c"}, + {file = "wrapt-1.16.0-cp37-cp37m-win_amd64.whl", hash = "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00"}, + {file = "wrapt-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0"}, + {file = "wrapt-1.16.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202"}, + {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0"}, + {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e"}, + {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f"}, + {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267"}, + {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca"}, + {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6"}, + {file = "wrapt-1.16.0-cp38-cp38-win32.whl", hash = "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b"}, + {file = "wrapt-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41"}, + {file = "wrapt-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2"}, + {file = "wrapt-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb"}, + {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8"}, + {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c"}, + {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a"}, + {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664"}, + {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f"}, + {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537"}, + {file = "wrapt-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3"}, + {file = "wrapt-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35"}, + {file = "wrapt-1.16.0-py3-none-any.whl", hash = "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1"}, + {file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"}, ] [metadata] diff --git a/include/vrv/doc.h b/include/vrv/doc.h index d32fd434a3b..687f6f068e2 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -109,11 +109,14 @@ class Doc : public Object { /** * Getter and setter for the DocType. - * The setter resets the document. */ ///@{ DocType GetType() const { return m_type; } void SetType(DocType type); + bool IsFacs() const { return (m_type == Facs); } + bool IsRaw() const { return (m_type == Raw); } + bool IsRendering() const { return (m_type == Rendering); } + bool IsTranscription() const { return (m_type == Transcription); } ///@} /** @@ -159,6 +162,9 @@ class Doc : public Object { ///@{ Score *GetCorrespondingScore(const Object *object); const Score *GetCorrespondingScore(const Object *object) const; + // Generic version that does not necessarily rely on precalculated visible scores + Score *GetCorrespondingScore(const Object *object, const std::list &scores); + const Score *GetCorrespondingScore(const Object *object, const std::list &scores) const; ///@} /** @@ -366,6 +372,18 @@ class Doc : public Object { */ void ConvertMarkupDoc(bool permanent = true); + /** + * Sync the coordinate provided trought to m_drawingFacsX/Y. + * Call the SyncToFacsimile functor. + */ + void SyncFromFacsimileDoc(); + + /** + * Sync the coordinate provided in rendering to a . + * The document must have encoded layout and the option --break encoded must have enabled. + */ + void SyncToFacsimileDoc(); + /** * Transpose the content of the doc. */ @@ -383,6 +401,11 @@ class Doc : public Object { */ Page *SetDrawingPage(int pageIdx); + /** + * Update the drawing page sizes when a page is set as drawing page. + */ + void UpdatePageDrawingSizes(); + /** * Reset drawing page to NULL. * This might be necessary if we have replaced a page in the document. diff --git a/include/vrv/durationinterface.h b/include/vrv/durationinterface.h index 67bf2caab43..17d0ec0cc22 100644 --- a/include/vrv/durationinterface.h +++ b/include/vrv/durationinterface.h @@ -16,7 +16,6 @@ namespace vrv { -class FunctorParams; class Mensur; class Object; diff --git a/include/vrv/editortoolkit_neume.h b/include/vrv/editortoolkit_neume.h index dfeb65043e5..11828f083cb 100644 --- a/include/vrv/editortoolkit_neume.h +++ b/include/vrv/editortoolkit_neume.h @@ -31,8 +31,8 @@ namespace vrv { class EditorToolkitNeume : public EditorToolkit { public: EditorToolkitNeume(Doc *doc, View *view) : EditorToolkit(doc, view) {} - bool ParseEditorAction(const std::string &json_editorAction); - virtual std::string EditInfo() { return m_infoObject.json(); }; + bool ParseEditorAction(const std::string &json_editorAction) override; + std::string EditInfo() override; /** * Experimental editor functions. @@ -44,6 +44,7 @@ class EditorToolkitNeume : public EditorToolkit { bool Insert(std::string elementType, std::string staffId, int ulx, int uly, int lrx, int lry, std::vector> attributes); bool InsertToSyllable(std::string elementId); + bool MatchHeight(std::string elementId); bool Merge(std::vector elementIds); bool MoveOutsideSyllable(std::string elementId); bool Set(std::string elementId, std::string attrType, std::string attrValue); @@ -54,6 +55,7 @@ class EditorToolkitNeume : public EditorToolkit { bool Remove(std::string elementId); bool Resize(std::string elementId, int ulx, int uly, int lrx, int lry, float resize = NAN); bool Group(std::string groupType, std::vector elementIds); + void UnlinkSyllable(Syllable *syllable); bool Ungroup(std::string groupType, std::vector elementIds); bool ChangeGroup(std::string elementId, std::string contour); bool ToggleLigature(std::vector elementIds); @@ -72,6 +74,7 @@ class EditorToolkitNeume : public EditorToolkit { bool ParseInsertAction(jsonxx::Object param, std::string *elementType, std::string *staffId, int *ulx, int *uly, int *lrx, int *lry, std::vector> *attributes); bool ParseInsertToSyllableAction(jsonxx::Object param, std::string *elementId); + bool ParseMatchHeightAction(jsonxx::Object param, std::string *elementId); bool ParseMergeAction(jsonxx::Object param, std::vector *elementIds); bool ParseMoveOutsideSyllableAction(jsonxx::Object param, std::string *elementId); bool ParseSetAction(jsonxx::Object param, std::string *elementId, std::string *attrType, std::string *attrValue); @@ -98,9 +101,6 @@ class EditorToolkitNeume : public EditorToolkit { bool AdjustPitchFromPosition(Object *obj, Clef *clef = NULL); bool AdjustClefLineFromPosition(Clef *clef, Staff *staff = NULL); ///@} - -private: - jsonxx::Object m_infoObject; }; //-------------------------------------------------------------------------------- diff --git a/include/vrv/facsimilefunctor.h b/include/vrv/facsimilefunctor.h new file mode 100644 index 00000000000..1273343626c --- /dev/null +++ b/include/vrv/facsimilefunctor.h @@ -0,0 +1,136 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: facsimilefunctor.h +// Author: Laurent Pugin +// Created: 2023 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + +#ifndef __VRV_FACSIMILEFUNCTOR_H__ +#define __VRV_FACSIMILEFUNCTOR_H__ + +#include "functor.h" +#include "view.h" + +namespace vrv { + +class LayerElement; +class Measure; +class Page; +class Pb; +class Sb; +class Staff; +class Surface; +class System; + +//---------------------------------------------------------------------------- +// SyncFromFacsimileFunctor +//---------------------------------------------------------------------------- + +/** + * This class sync the layout encoded in the facsimile to m_Abs members + */ +class SyncFromFacsimileFunctor : public Functor { +public: + /** + * @name Constructors, destructors + */ + ///@{ + SyncFromFacsimileFunctor(Doc *doc); + virtual ~SyncFromFacsimileFunctor() = default; + ///@} + + /* + * Abstract base implementation + */ + bool ImplementsEndInterface() const override { return false; } + + /* + * Functor interface + */ + ///@{ + FunctorCode VisitLayerElement(LayerElement *layerElement) override; + FunctorCode VisitMeasure(Measure *measure) override; + FunctorCode VisitPage(Page *page) override; + FunctorCode VisitPb(Pb *pb) override; + FunctorCode VisitSb(Sb *sb) override; + FunctorCode VisitStaff(Staff *staff) override; + FunctorCode VisitSystem(System *system) override; + ///@} + +protected: + // +private: + // +public: + // +private: + /** The doc */ + Doc *m_doc; + // + View m_view; + // + Page *m_currentPage; + System *m_currentSystem; +}; + +//---------------------------------------------------------------------------- +// SyncToFacsimileFunctor +//---------------------------------------------------------------------------- + +/** + * This class sync the layout calculated to the facsimile + */ +class SyncToFacsimileFunctor : public Functor { +public: + /** + * @name Constructors, destructors + */ + ///@{ + SyncToFacsimileFunctor(Doc *doc); + virtual ~SyncToFacsimileFunctor() = default; + ///@} + + /* + * Abstract base implementation + */ + bool ImplementsEndInterface() const override { return false; } + + /* + * Functor interface + */ + ///@{ + FunctorCode VisitLayerElement(LayerElement *layerElement) override; + FunctorCode VisitMeasure(Measure *measure) override; + FunctorCode VisitPage(Page *page) override; + FunctorCode VisitPb(Pb *pb) override; + FunctorCode VisitSb(Sb *sb) override; + FunctorCode VisitStaff(Staff *staff) override; + FunctorCode VisitSystem(System *system) override; + ///@} + +protected: + // +private: + /** Create zone if not exist */ + Zone *GetZone(FacsimileInterface *interface, std::string type); + +public: + // +private: + /** The doc */ + Doc *m_doc; + // + View m_view; + /** The surface we are going to add / update zone */ + Surface *m_surface; + // + Page *m_currentPage; + System *m_currentSystem; + // + int m_pageMarginTop; + int m_pageMarginLeft; +}; + +} // namespace vrv + +#endif // __VRV_FACSIMILEFUNCTOR_H__ diff --git a/include/vrv/facsimileinterface.h b/include/vrv/facsimileinterface.h index cbc46f7ddb3..7afafef144b 100644 --- a/include/vrv/facsimileinterface.h +++ b/include/vrv/facsimileinterface.h @@ -13,8 +13,11 @@ #include "interface.h" namespace vrv { -class FunctorParams; -class View; + +class Facsimile; +class PrepareFacsimileFunctor; +class ResetDataFunctor; +class Surface; class Zone; //---------------------------------------------------------------------------- @@ -56,8 +59,23 @@ class FacsimileInterface : public Interface, public AttFacsimile { const Zone *GetZone() const { return m_zone; } ///@} + //-----------------// + // Pseudo functors // + //-----------------// + + /** + * We have functor code in the interface for avoiding code duplication in each implementation class. + * Since we are in an interface, we need to pass the object (implementation) to + * the pseudo functor method. + */ + ///@{ + FunctorCode InterfacePrepareFacsimile(PrepareFacsimileFunctor &functor, Object *object); + FunctorCode InterfaceResetData(ResetDataFunctor &functor, Object *object); + ///@} + private: - Zone *m_zone = NULL; + Zone *m_zone; + Surface *m_surface; }; } // namespace vrv #endif diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index af0917a61d7..085fa811845 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -386,7 +386,7 @@ class LayerElement : public Object, public: /** Absolute position X. This is used for facsimile (transcription) encoding */ - int m_xAbs; + int m_drawingFacsX; /** * This stores a pointer to the cross-staff (if any) and the appropriate layer * See PrepareCrossStaffFunctor diff --git a/include/vrv/measure.h b/include/vrv/measure.h index e9fe0cef9ca..49ab432a0d7 100644 --- a/include/vrv/measure.h +++ b/include/vrv/measure.h @@ -11,6 +11,7 @@ #include "atts_cmn.h" #include "atts_shared.h" #include "barline.h" +#include "facsimileinterface.h" #include "horizontalaligner.h" #include "object.h" @@ -34,6 +35,7 @@ class TimestampAttr; * For internally simplication of processing, unmeasured music is contained in one single measure object */ class Measure : public Object, + public FacsimileInterface, public AttBarring, public AttCoordX1, public AttCoordX2, @@ -63,6 +65,17 @@ class Measure : public Object, */ void CloneReset() override; + /** + * @name Getter to interfaces + */ + ///@{ + FacsimileInterface *GetFacsimileInterface() override { return vrv_cast(this); } + const FacsimileInterface *GetFacsimileInterface() const override + { + return vrv_cast(this); + } + ///@} + /** * Return true if measured music (otherwise we have fake measures) */ @@ -358,8 +371,8 @@ class Measure : public Object, * This is the left and right position of the measure. */ ///@{ - int m_xAbs; - int m_xAbs2; + int m_drawingFacsX1; + int m_drawingFacsX2; ///@} /** diff --git a/include/vrv/object.h b/include/vrv/object.h index 1cb3f41ff41..31bbf863f95 100644 --- a/include/vrv/object.h +++ b/include/vrv/object.h @@ -31,7 +31,6 @@ class EditorialElement; class Output; class Filters; class Functor; -class FunctorParams; class Functor; class ConstFunctor; class LinkingInterface; diff --git a/include/vrv/pb.h b/include/vrv/pb.h index 92cecf39fd6..11f66ab2b0a 100644 --- a/include/vrv/pb.h +++ b/include/vrv/pb.h @@ -9,6 +9,7 @@ #define __VRV_PB_H__ #include "atts_shared.h" +#include "facsimileinterface.h" #include "systemelement.h" namespace vrv { @@ -21,7 +22,7 @@ namespace vrv { * This class represents a MEI pb in score-based MEI. * In page-based MEI, it remains as is as. Actual pages are represented by Page objects. */ -class Pb : public SystemElement, public AttNNumberLike { +class Pb : public SystemElement, public FacsimileInterface, public AttNNumberLike { public: /** * @name Constructors, destructors, and other standard methods @@ -35,6 +36,16 @@ class Pb : public SystemElement, public AttNNumberLike { std::string GetClassName() const override { return "Pb"; } ///@} + /** + * @name Getter to interfaces + */ + ///@{ + FacsimileInterface *GetFacsimileInterface() override { return vrv_cast(this); } + const FacsimileInterface *GetFacsimileInterface() const override + { + return vrv_cast(this); + } + //----------// // Functors // //----------// diff --git a/include/vrv/preparedatafunctor.h b/include/vrv/preparedatafunctor.h index 412ef9f3918..793d1e66c0e 100644 --- a/include/vrv/preparedatafunctor.h +++ b/include/vrv/preparedatafunctor.h @@ -218,6 +218,11 @@ class PrepareFacsimileFunctor : public Functor { */ const ListOfObjects &GetZonelessSyls() const { return m_zonelessSyls; } + /* + * Getter for the facsimile + */ + Facsimile *GetFacsimile() const { return m_facsimile; } + /* * Functor interface */ diff --git a/include/vrv/resetfunctor.h b/include/vrv/resetfunctor.h index 2e681f1d877..f8f4d5c1032 100644 --- a/include/vrv/resetfunctor.h +++ b/include/vrv/resetfunctor.h @@ -62,6 +62,7 @@ class ResetDataFunctor : public Functor { FunctorCode VisitMeasure(Measure *measure) override; FunctorCode VisitMRest(MRest *mRest) override; FunctorCode VisitNote(Note *note) override; + FunctorCode VisitObject(Object *object) override; FunctorCode VisitRepeatMark(RepeatMark *repeatMark) override; FunctorCode VisitRest(Rest *rest) override; FunctorCode VisitSection(Section *section) override; diff --git a/include/vrv/sb.h b/include/vrv/sb.h index 83d4812dd7a..f1d43319e0e 100644 --- a/include/vrv/sb.h +++ b/include/vrv/sb.h @@ -9,6 +9,7 @@ #define __VRV_SB_H__ #include "atts_shared.h" +#include "facsimileinterface.h" #include "systemelement.h" namespace vrv { @@ -21,7 +22,7 @@ namespace vrv { * This class represents a MEI sb in score-based MEI. * In page-based MEI, it remains as it is. Actual systems are represented by System objects. */ -class Sb : public SystemElement, public AttNNumberLike { +class Sb : public SystemElement, public FacsimileInterface, public AttNNumberLike { public: /** * @name Constructors, destructors, and other standard methods @@ -35,6 +36,16 @@ class Sb : public SystemElement, public AttNNumberLike { std::string GetClassName() const override { return "Sb"; } ///@} + /** + * @name Getter to interfaces + */ + ///@{ + FacsimileInterface *GetFacsimileInterface() override { return vrv_cast(this); } + const FacsimileInterface *GetFacsimileInterface() const override + { + return vrv_cast(this); + } + //----------// // Functors // //----------// diff --git a/include/vrv/setscoredeffunctor.h b/include/vrv/setscoredeffunctor.h index 5d4d417c455..60e3d9af41d 100644 --- a/include/vrv/setscoredeffunctor.h +++ b/include/vrv/setscoredeffunctor.h @@ -88,6 +88,7 @@ class ScoreDefSetCurrentPageFunctor : public DocFunctor { */ ///@{ FunctorCode VisitPageEnd(Page *page) override; + FunctorCode VisitScore(Score *score) override; ///@} protected: @@ -97,7 +98,8 @@ class ScoreDefSetCurrentPageFunctor : public DocFunctor { public: // private: - // + // The list of all scores + std::list m_scores; }; //---------------------------------------------------------------------------- diff --git a/include/vrv/staff.h b/include/vrv/staff.h index db2edc25618..cd68fe3eaa4 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -23,6 +23,49 @@ class Syl; class TimeSpanningInterface; class Tuning; +//---------------------------------------------------------------------------- +// LedgerLine +//---------------------------------------------------------------------------- + +/** + * This is a class with no MEI equivalent for representing legder lines. + * A ledger line is represented by a list of dashes. + * Each dash is represented by a pair of points (left - right). + */ +class LedgerLine { +public: + /** + * @name Constructors, destructors, reset methods + * Reset method reset all attribute classes + */ + ///@{ + LedgerLine(); + virtual ~LedgerLine(); + virtual void Reset(); + ///@} + + /** + * Add a dash to the ledger line object. + * If necessary merges overlapping dashes. + */ + void AddDash(int left, int right, int extension); + +protected: + // +private: + // +public: + /** + * A list of dashes relative to the staff position. + */ + std::list> m_dashes; + +protected: + // +private: + // +}; + //---------------------------------------------------------------------------- // Staff //---------------------------------------------------------------------------- @@ -226,7 +269,7 @@ class Staff : public Object, * The Y absolute position of the staff for facsimile (transcription) encodings. * This is the top left corner of the staff (the X position is the position of the system). */ - int m_yAbs; + int m_drawingFacsY; StaffDef *m_drawingStaffDef; @@ -249,49 +292,6 @@ class Staff : public Object, ///@} }; -//---------------------------------------------------------------------------- -// LedgerLine -//---------------------------------------------------------------------------- - -/** - * This is a class with no MEI equivalent for representing legder lines. - * A ledger line is represented by a list of dashes. - * Each dash is represented by a pair of points (left - right). - */ -class LedgerLine { -public: - /** - * @name Constructors, destructors, reset methods - * Reset method reset all attribute classes - */ - ///@{ - LedgerLine(); - virtual ~LedgerLine(); - virtual void Reset(); - ///@} - - /** - * Add a dash to the ledger line object. - * If necessary merges overlapping dashes. - */ - void AddDash(int left, int right, int extension); - -protected: - // -private: - // -public: - /** - * A list of dashes relative to the staff position. - */ - std::list> m_dashes; - -protected: - // -private: - // -}; - } // namespace vrv #endif diff --git a/include/vrv/system.h b/include/vrv/system.h index a8900f2a9c5..7485e2abfbe 100644 --- a/include/vrv/system.h +++ b/include/vrv/system.h @@ -191,12 +191,12 @@ class System : public Object, public DrawingListInterface, public AttTyped { * The Y absolute position of the staff for facsimile (transcription) encodings. * This is the top left corner of the system. */ - int m_yAbs; + int m_drawingFacsY; /** * The x absolute position of the system for facsimile layouts. * This is the top left corner of the system. */ - int m_xAbs; + int m_drawingFacsX; /** * The width used by the abbreviated labels at the left of the system. * It is used internally when calculating the layout and it is not stored in the file. diff --git a/include/vrv/vrvdef.h b/include/vrv/vrvdef.h index 86ead543896..eb3644af011 100644 --- a/include/vrv/vrvdef.h +++ b/include/vrv/vrvdef.h @@ -61,11 +61,8 @@ namespace vrv { #ifdef VRV_DYNAMIC_CAST // To be used for all cases where type is cheched through Object::m_type #define vrv_cast dynamic_cast -// To be used for all FunctorParams casts within Functors -#define vrv_params_cast dynamic_cast #else #define vrv_cast static_cast -#define vrv_params_cast static_cast #endif //---------------------------------------------------------------------------- diff --git a/setup.py b/setup.py index fc1f38b2709..a310909ee60 100644 --- a/setup.py +++ b/setup.py @@ -83,10 +83,10 @@ def get_version() -> str: # extra compile arguments EXTRA_COMPILE_ARGS = ['-DPYTHON_BINDING'] if platform.system() != 'Windows': - EXTRA_COMPILE_ARGS += ['-std=c++17', + EXTRA_COMPILE_ARGS += ['-std=c++20', '-Wno-write-strings', '-Wno-overloaded-virtual', '-g0'] else: - EXTRA_COMPILE_ARGS += ['/std:c++17', + EXTRA_COMPILE_ARGS += ['/std:c++20', '-DNO_PAE_SUPPORT'] verovio_module = Extension('verovio._verovio', diff --git a/src/adjustxrelfortranscriptionfunctor.cpp b/src/adjustxrelfortranscriptionfunctor.cpp index c4e4c1f20d4..be005259ec4 100644 --- a/src/adjustxrelfortranscriptionfunctor.cpp +++ b/src/adjustxrelfortranscriptionfunctor.cpp @@ -21,7 +21,7 @@ AdjustXRelForTranscriptionFunctor::AdjustXRelForTranscriptionFunctor() : Functor FunctorCode AdjustXRelForTranscriptionFunctor::VisitLayerElement(LayerElement *layerElement) { - if (layerElement->m_xAbs == VRV_UNSET) return FUNCTOR_CONTINUE; + if (layerElement->m_drawingFacsX == VRV_UNSET) return FUNCTOR_CONTINUE; if (layerElement->IsScoreDefElement()) return FUNCTOR_SIBLINGS; diff --git a/src/beam.cpp b/src/beam.cpp index 335d7c536fb..775ccb9f55a 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -19,6 +19,7 @@ #include "btrem.h" #include "doc.h" #include "editorial.h" +#include "ftrem.h" #include "functor.h" #include "gracegrp.h" #include "layer.h" @@ -1634,6 +1635,9 @@ bool Beam::IsSupportedChild(Object *child) else if (child->Is(CLEF)) { assert(dynamic_cast(child)); } + else if (child->Is(FTREM)) { + assert(dynamic_cast(child)); + } else if (child->Is(GRACEGRP)) { assert(dynamic_cast(child)); } diff --git a/src/doc.cpp b/src/doc.cpp index e79a92b74b0..e6c4313ba15 100644 --- a/src/doc.cpp +++ b/src/doc.cpp @@ -23,6 +23,7 @@ #include "convertfunctor.h" #include "docselection.h" #include "expansion.h" +#include "facsimilefunctor.h" #include "featureextractor.h" #include "functor.h" #include "glyph.h" @@ -58,6 +59,7 @@ #include "staff.h" #include "staffdef.h" #include "staffgrp.h" +#include "surface.h" #include "syl.h" #include "syllable.h" #include "system.h" @@ -869,7 +871,7 @@ void Doc::PrepareData() } /************ Resolve @facs ************/ - if (this->GetType() == Facs) { + if (this->IsFacs()) { // Associate zones with elements PrepareFacsimileFunctor prepareFacsimile(this->GetFacsimile()); this->Process(prepareFacsimile); @@ -1281,10 +1283,10 @@ void Doc::ConvertToCastOffMensuralDoc(bool castOff) if (!m_isMensuralMusicOnly) return; // Do not convert transcription files - if (this->GetType() == Transcription) return; + if (this->IsTranscription()) return; // Do not convert facs files - if (this->GetType() == Facs) return; + if (this->IsFacs()) return; // We are converting to measure music in a definite way if (this->GetOptions()->m_mensuralToMeasure.GetValue()) { @@ -1388,6 +1390,32 @@ void Doc::ConvertMarkupDoc(bool permanent) } } +void Doc::SyncFromFacsimileDoc() +{ + PrepareFacsimileFunctor prepareFacsimile(this->GetFacsimile()); + this->Process(prepareFacsimile); + + SyncFromFacsimileFunctor syncFromFacsimileFunctor(this); + this->Process(syncFromFacsimileFunctor); +} + +void Doc::SyncToFacsimileDoc() +{ + // Create a new facsimile object if we do not have one already + if (!this->HasFacsimile()) { + Facsimile *facsimile = new Facsimile(); + this->SetFacsimile(facsimile); + } + if (!m_facsimile->FindDescendantByType(SURFACE)) { + m_facsimile->AddChild(new Surface()); + } + m_facsimile->SetType("transcription"); + m_facsimile->ClearChildren(); + + SyncToFacsimileFunctor syncToFacimileFunctor(this); + this->Process(syncToFacimileFunctor); +} + void Doc::TransposeDoc() { Transposer transposer; @@ -1523,10 +1551,20 @@ Score *Doc::GetCorrespondingScore(const Object *object) const Score *Doc::GetCorrespondingScore(const Object *object) const { - assert(!m_visibleScores.empty()); + return this->GetCorrespondingScore(object, m_visibleScores); +} + +Score *Doc::GetCorrespondingScore(const Object *object, const std::list &scores) +{ + return const_cast(std::as_const(*this).GetCorrespondingScore(object, scores)); +} - const Score *correspondingScore = m_visibleScores.front(); - for (Score *score : m_visibleScores) { +const Score *Doc::GetCorrespondingScore(const Object *object, const std::list &scores) const +{ + assert(!scores.empty()); + + const Score *correspondingScore = scores.front(); + for (Score *score : scores) { if ((score == object) || Object::IsPreOrdered(score, object)) { correspondingScore = score; } @@ -2007,6 +2045,15 @@ Page *Doc::SetDrawingPage(int pageIdx) m_drawingPage = vrv_cast(pages->GetChild(pageIdx)); assert(m_drawingPage); + UpdatePageDrawingSizes(); + + return m_drawingPage; +} + +void Doc::UpdatePageDrawingSizes() +{ + assert(m_drawingPage); + int glyph_size; // we use the page members only if set (!= -1) @@ -2072,8 +2119,6 @@ Page *Doc::SetDrawingPage(int pageIdx) glyph_size = this->GetGlyphWidth(SMUFL_E0A2_noteheadWhole, 100, 0); m_drawingBrevisWidth = (int)((glyph_size * 0.8) / 2); - - return m_drawingPage; } int Doc::CalcMusicFontSize() @@ -2085,7 +2130,7 @@ int Doc::GetAdjustedDrawingPageHeight() const { assert(m_drawingPage); - if ((this->GetType() == Transcription) || (this->GetType() == Facs)) { + if (this->IsTranscription() || this->IsFacs()) { return m_drawingPage->m_pageHeight / DEFINITION_FACTOR; } @@ -2097,7 +2142,7 @@ int Doc::GetAdjustedDrawingPageWidth() const { assert(m_drawingPage); - if ((this->GetType() == Transcription) || (this->GetType() == Facs)) { + if (this->IsTranscription() || this->IsFacs()) { return m_drawingPage->m_pageWidth / DEFINITION_FACTOR; } diff --git a/src/editortoolkit_neume.cpp b/src/editortoolkit_neume.cpp index e355c23fd64..2b1d30f6dc8 100644 --- a/src/editortoolkit_neume.cpp +++ b/src/editortoolkit_neume.cpp @@ -41,25 +41,29 @@ //-------------------------------------------------------------------------------- namespace vrv { +std::string EditorToolkitNeume::EditInfo() +{ + return m_editInfo.json(); +} bool EditorToolkitNeume::ParseEditorAction(const std::string &json_editorAction) { jsonxx::Object json; - m_infoObject.reset(); + m_editInfo.reset(); // Read JSON actions if (!json.parse(json_editorAction)) { LogError("Cannot parse JSON std::string."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Cannot parse JSON from std::string " + json_editorAction); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Cannot parse JSON from std::string " + json_editorAction); return false; } if (!json.has("action") || (!json.has("param") && !json.has("param"))) { LogWarning("Incorrectly formatted JSON action"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "JSON action misformatted."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "JSON action misformatted."); return false; } @@ -67,8 +71,8 @@ bool EditorToolkitNeume::ParseEditorAction(const std::string &json_editorAction) if (action != "chain" && json.has("param")) { LogWarning("Only 'chain' uses 'param' as an array."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "'param' can only be an array for a chain action."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "'param' can only be an array for a chain action."); return false; } @@ -184,6 +188,13 @@ bool EditorToolkitNeume::ParseEditorAction(const std::string &json_editorAction) return this->SplitNeume(elementId, ncId); } } + else if (action == "matchHeight") { + std::string elementId; + if (this->ParseMatchHeightAction(json.get("param"), &elementId)) { + return this->MatchHeight(elementId); + } + LogWarning("Could not parse the insert action"); + } else if (action == "merge") { std::vector elementIds; if (this->ParseMergeAction(json.get("param"), &elementIds)) { @@ -232,8 +243,8 @@ bool EditorToolkitNeume::ParseEditorAction(const std::string &json_editorAction) else { LogWarning("Unknown action type '%s'.", action.c_str()); } - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Action " + action + " could not be parsed or is unknown."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Action " + action + " could not be parsed or is unknown."); return false; } @@ -245,15 +256,15 @@ bool EditorToolkitNeume::Chain(jsonxx::Array actions) for (int i = 0; i < (int)actions.size(); i++) { if (!actions.has(0)) { LogError("Action %d was not an object", i); - m_infoObject.reset(); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Action " + std::to_string(i) + " was not an object."); + m_editInfo.reset(); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Action " + std::to_string(i) + " was not an object."); return false; } status |= this->ParseEditorAction(actions.get(i).json()); - results.import(std::to_string(i), m_infoObject); + results.import(std::to_string(i), m_editInfo); } - m_infoObject = results; + m_editInfo = results; return status; } @@ -474,8 +485,8 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) std::string status = "OK", message = ""; if (!m_doc->GetDrawingPage()) { LogError("Could not get drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get drawing page."); return false; } @@ -507,8 +518,8 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) Layer *layer = dynamic_cast(element->GetFirstAncestor(LAYER)); if (!layer) { LogError("Element does not have Layer parent. This should not happen."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Element does not have Layer parent."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element does not have Layer parent."); return false; } @@ -587,8 +598,8 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) Clef *clef = dynamic_cast(element); if (!clef->HasFacs()) { LogError("Clef dragging is only supported for clefs with facsimiles!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Clef dragging is only supported for clefs with facsimiles."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Clef dragging is only supported for clefs with facsimiles."); return false; } FacsimileInterface *fi = (*clef).GetFacsimileInterface(); @@ -639,8 +650,8 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) Staff *staff = vrv_cast(element); if (!staff->HasFacs()) { LogError("Staff dragging is only supported for staves with facsimiles!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Staff dragging is only supported for staves with facsimiles."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Staff dragging is only supported for staves with facsimiles."); return false; } @@ -668,8 +679,8 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) Syl *syl = dynamic_cast(element); if (!syl->HasFacs()) { LogError("Syl (boundingbox) dragging is only supported for syls with facsimiles!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Syl dragging is only supported for syls with facsimiles."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Syl dragging is only supported for syls with facsimiles."); return false; } FacsimileInterface *fi = (*syl).GetFacsimileInterface(); @@ -682,8 +693,8 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) Accid *accid = dynamic_cast(element); if (!accid->HasFacs()) { LogError("Accid dragging is only supported for accid with facsimiles!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Accid dragging is only supported for accid with facsimiles."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Accid dragging is only supported for accid with facsimiles."); return false; } FacsimileInterface *fi = (*accid).GetFacsimileInterface(); @@ -699,8 +710,8 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) DivLine *divLine = dynamic_cast(element); if (!divLine->HasFacs()) { LogError("DivLine dragging is only supported for divLine with facsimiles!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "DivLine dragging is only supported for divLine with facsimiles."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "DivLine dragging is only supported for divLine with facsimiles."); return false; } FacsimileInterface *fi = (*divLine).GetFacsimileInterface(); @@ -714,14 +725,14 @@ bool EditorToolkitNeume::Drag(std::string elementId, int x, int y) } else { LogWarning("Unsupported element for dragging."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Unsupported element for dragging."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Unsupported element for dragging."); return false; } Layer *layer = vrv_cast(element->GetFirstAncestor(LAYER)); layer->ReorderByXPos(); // Reflect position order of elements internally (and in the resulting output file) - m_infoObject.import("status", status); - m_infoObject.import("message", message); + m_editInfo.import("status", status); + m_editInfo.import("message", message); return true; } @@ -730,14 +741,14 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in { if (!m_doc->GetDrawingPage()) { LogError("Could not get drawing page"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get drawing page."); return false; } if (m_doc->GetType() != Facs) { LogError("Drawing page without facsimile"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Drawing page without facsimile is unsupported."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Drawing page without facsimile is unsupported."); return false; } @@ -772,10 +783,12 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in if (elementType == "staff") { Object *parent; Staff *newStaff; + std::string columnValue; // Use closest existing staff (if there is one) if (staff) { parent = staff->GetParent(); assert(parent); + columnValue = staff->GetType(); int n = parent->GetChildCount() + 1; newStaff = new Staff(n); newStaff->m_drawingStaffDef = staff->m_drawingStaffDef; @@ -800,43 +813,43 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in assert(surface); surface->AddChild(zone); newStaff->AttachZone(zone); + if (columnValue.length()) newStaff->SetType(columnValue); Layer *newLayer = new Layer(); newStaff->AddChild(newLayer); - // Find index to insert new staff - ListOfObjects staves = parent->FindAllDescendantsByType(STAFF, false); - std::vector stavesVector(staves.begin(), staves.end()); - stavesVector.push_back(newStaff); - StaffSort staffSort; - std::stable_sort(stavesVector.begin(), stavesVector.end(), staffSort); - for (int i = 0; i < (int)staves.size(); ++i) { - if (stavesVector.at(i) == newStaff) { - parent->InsertChild(newStaff, i); - parent->Modify(); - - m_infoObject.import("uuid", newStaff->GetID()); - m_infoObject.import("status", status); - m_infoObject.import("message", message); - - return true; + if (staff) { + // Find index to insert new staff + ListOfObjects staves = parent->FindAllDescendantsByType(STAFF, false); + std::vector stavesVector(staves.begin(), staves.end()); + stavesVector.push_back(newStaff); + StaffSort staffSort; + std::stable_sort(stavesVector.begin(), stavesVector.end(), staffSort); + for (int i = 0; i < (int)staves.size(); ++i) { + if (stavesVector.at(i) == newStaff) { + parent->InsertChild(newStaff, i); + parent->Modify(); + + m_editInfo.import("uuid", newStaff->GetID()); + m_editInfo.import("status", status); + m_editInfo.import("message", message); + + return true; + } } } - LogWarning("Failed to insert newStaff into staff"); - message += "Failed to insert newStaff into staves."; parent->AddChild(newStaff); - parent->Modify(); - m_infoObject.import("uuid", newStaff->GetID()); - m_infoObject.import("status", status); - m_infoObject.import("message", message); + m_editInfo.import("uuid", newStaff->GetID()); + m_editInfo.import("status", status); + m_editInfo.import("message", message); return true; } if (staff == NULL) { LogError("A staff must exist in the page to add a non-staff element."); delete zone; - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "A staff must exist in the page to add a non-staff element."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "A staff must exist in the page to add a non-staff element."); return false; } Layer *layer = vrv_cast(staff->FindDescendantByType(LAYER)); @@ -847,12 +860,12 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in Syl *syl = new Syl(); Neume *neume = new Neume(); Nc *nc = new Nc(); + Zone *sylZone; std::string contour = ""; nc->AttachZone(zone); Surface *surface = vrv_cast(facsimile->FindDescendantByType(SURFACE)); surface->AddChild(zone); - zone->SetUlx(ulx); Text *text = new Text(); std::u32string str = U""; @@ -864,59 +877,46 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in syllable->AddChild(syl); layer->AddChild(syllable); + const int noteHeight + = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_HEIGHT_TO_STAFF_SIZE_RATIO); + const int noteWidth + = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_WIDTH_TO_STAFF_SIZE_RATIO); + + // Set up facsimile + zone->SetUlx(ulx); + zone->SetUly(uly); + zone->SetLrx(ulx + noteWidth); + zone->SetLry(uly + noteHeight); + // add syl bounding box if Facs if (m_doc->GetType() == Facs) { FacsimileInterface *fi = vrv_cast(syl->GetFacsimileInterface()); assert(fi); - Text *text = new Text(); - syl->AddChild(text); - Zone *sylZone = new Zone(); + sylZone = new Zone(); + + int staffLry = staff->GetFacsimileInterface()->GetZone()->GetLry(); - // calculate bboxUlx and bboxUly wrt rotation using sine rule - int draw_w = staff->GetWidth(); - int draw_h = staff->GetHeight(); - double theta = staff->GetDrawingRotate(); - int staffUly = staff->GetDrawingY(); - int x = ulx - staff->GetDrawingX(); - - int bboxUlx = ulx; - int bboxUly; - // if staff rotates downward to the right - if (theta > 0) { - int y = (int)((draw_w - x) * tan(theta * M_PI / 180.0)); - bboxUly = staffUly + draw_h - y; - } - // if staff rotates upwards to the right - else { - int y = (int)(x * tan(-theta * M_PI / 180.0)); - int h = (int)(draw_w * tan(-theta * M_PI / 180.0)); - bboxUly = staffUly + (draw_h - h) - y; - } // width height and offset can be adjusted - int bboxWidth = 225; int bboxHeight = 175; int bboxOffsetX = 50; - sylZone->SetUlx(bboxUlx - bboxOffsetX); - sylZone->SetUly(bboxUly); - sylZone->SetLrx(bboxUlx + bboxWidth - bboxOffsetX); - sylZone->SetLry(bboxUly + bboxHeight); + // calculate staff rotation offset + double theta = staff->GetDrawingRotate(); + int offsetY = 0; + if (theta) { + double factor = 1.3; + offsetY = (int)((ulx - staff->GetFacsimileInterface()->GetZone()->GetUlx()) * tan(theta * M_PI / 180.0) + / factor); + } + + sylZone->SetUlx(ulx); + sylZone->SetUly(staffLry + offsetY); + sylZone->SetLrx(ulx + noteWidth + bboxOffsetX); + sylZone->SetLry(staffLry + offsetY + bboxHeight); surface->AddChild(sylZone); fi->AttachZone(sylZone); } - const int noteHeight - = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_HEIGHT_TO_STAFF_SIZE_RATIO); - const int noteWidth - = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_WIDTH_TO_STAFF_SIZE_RATIO); - ulx -= noteWidth / 2; - // uly -= noteHeight / 2; - // Set up facsimile - zone->SetUlx(ulx); - zone->SetUly(uly); - zone->SetLrx(ulx + noteWidth); - zone->SetLry(uly + noteHeight); - layer->ReorderByXPos(); if (!AdjustPitchFromPosition(syllable)) { @@ -925,8 +925,8 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in delete nc; LogError("Failed to set pitch."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to set pitch."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to set pitch."); return false; } @@ -988,8 +988,8 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in LogError("Unsupported character in contour."); delete newNc; delete newZone; - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Unsupported character in contour."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Unsupported character in contour."); return false; } @@ -997,12 +997,13 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in newUly += (newUlx - ulx) * tan(-staff->GetDrawingRotate() * M_PI / 180.0); newZone->SetUlx(newUlx); newZone->SetUly(newUly); - ; newZone->SetLrx(newUlx + noteWidth); newZone->SetLry(newUly + noteHeight); newNc->AttachZone(newZone); + if (sylZone) sylZone->SetLrx(newUlx + noteWidth); + assert(surface); surface->AddChild(newZone); @@ -1014,10 +1015,10 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in } } if (elementType == "nc") { - m_infoObject.import("uuid", nc->GetID()); + m_editInfo.import("uuid", nc->GetID()); } else { - m_infoObject.import("uuid", neume->GetID()); + m_editInfo.import("uuid", neume->GetID()); } } else if (elementType == "clef") { @@ -1042,8 +1043,8 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in LogError("A clef shape must be specified."); delete clef; - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "A clef shape must be specified."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "A clef shape must be specified."); return false; } clef->SetShape(clefShape); @@ -1064,7 +1065,7 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in assert(surface); surface->AddChild(zone); layer->AddChild(clef); - m_infoObject.import("uuid", clef->GetID()); + m_editInfo.import("uuid", clef->GetID()); layer->ReorderByXPos(); // ensure pitched elements associated with this clef keep their x,y positions @@ -1115,11 +1116,11 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in if (!AdjustPitchFromPosition(custos)) { LogError("Failed to set pitch."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to set pitch."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to set pitch."); return false; } - m_infoObject.import("uuid", custos->GetID()); + m_editInfo.import("uuid", custos->GetID()); } else if (elementType == "accid") { Accid *accid = new Accid(); @@ -1140,8 +1141,8 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in LogError("A accid type must be specified."); delete accid; - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "A accid type must be specified."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "A accid type must be specified."); return false; } @@ -1166,7 +1167,7 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in zone->SetLry(uly + noteHeight); layer->ReorderByXPos(); - m_infoObject.import("uuid", accid->GetID()); + m_editInfo.import("uuid", accid->GetID()); } else if (elementType == "divLine") { DivLine *divLine = new DivLine(); @@ -1204,8 +1205,8 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in LogError("A divLine type must be specified."); delete divLine; - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "A divLine type must be specified."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "A divLine type must be specified."); return false; } @@ -1230,18 +1231,18 @@ bool EditorToolkitNeume::Insert(std::string elementType, std::string staffId, in zone->SetLry(uly + noteHeight); layer->ReorderByXPos(); - m_infoObject.import("uuid", divLine->GetID()); + m_editInfo.import("uuid", divLine->GetID()); } else { delete zone; LogError("Unsupported type '%s' for insertion", elementType.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Unsupported type '" + elementType + "' for insertion."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Unsupported type '" + elementType + "' for insertion."); return false; } layer->ReorderByXPos(); - m_infoObject.import("status", status); - m_infoObject.import("message", message); + m_editInfo.import("status", status); + m_editInfo.import("message", message); return true; } @@ -1249,14 +1250,14 @@ bool EditorToolkitNeume::InsertToSyllable(std::string elementId) { if (!m_doc->GetDrawingPage()) { LogError("Could not get drawing page"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get drawing page."); return false; } if (m_doc->GetType() != Facs) { LogError("Drawing page without facsimile"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Drawing page without facsimile is unsupported."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Drawing page without facsimile is unsupported."); return false; } @@ -1267,23 +1268,23 @@ bool EditorToolkitNeume::InsertToSyllable(std::string elementId) if (element == NULL) { LogError("No element exists with ID '%s'.", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "No element exists with ID" + elementId + "."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No element exists with ID" + elementId + "."); return false; } if (!(element->Is(DIVLINE) || element->Is(ACCID) || element->Is(CLEF))) { LogError("Element is of type %s, but only Divlines and Accids can be inserted into syllables.", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element is of type " + element->GetClassName() + ", but only DivLines, Accids, and Clefs can be inserted into syllables."); return false; } if (!parent->Is(LAYER)) { LogError("The selected %s is not a child of layer.", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "The selected " + element->GetClassName() + "is not a child of layer."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "The selected " + element->GetClassName() + "is not a child of layer."); return false; } @@ -1296,8 +1297,8 @@ bool EditorToolkitNeume::InsertToSyllable(std::string elementId) } else { LogError("Selected '%s' without facsimile", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Selected '" + element->GetClassName() + "' without facsimile is unsupported."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Selected '" + element->GetClassName() + "' without facsimile is unsupported."); return false; } @@ -1311,8 +1312,8 @@ bool EditorToolkitNeume::InsertToSyllable(std::string elementId) if (neumes.empty()) { LogError("A syllable must exist in the staff to insert a '%s' into.", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import( + m_editInfo.import("status", "FAILURE"); + m_editInfo.import( "message", "A syllable must exist in the staff to insert a '" + element->GetClassName() + "' into."); return false; } @@ -1390,8 +1391,8 @@ bool EditorToolkitNeume::InsertToSyllable(std::string elementId) } } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); return true; } @@ -1399,14 +1400,14 @@ bool EditorToolkitNeume::MoveOutsideSyllable(std::string elementId) { if (!m_doc->GetDrawingPage()) { LogError("Could not get drawing page"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get drawing page."); return false; } if (m_doc->GetType() != Facs) { LogError("Drawing page without facsimile"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Drawing page without facsimile is unsupported."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Drawing page without facsimile is unsupported."); return false; } @@ -1417,23 +1418,23 @@ bool EditorToolkitNeume::MoveOutsideSyllable(std::string elementId) if (element == NULL) { LogError("No element exists with ID '%s'.", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "No element exists with ID" + elementId + "."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No element exists with ID" + elementId + "."); return false; } if (!(element->Is(DIVLINE) || element->Is(ACCID) || element->Is(CLEF))) { LogError("Element is of type %s, but only Divlines, Accids, and Clefs can be moved out of syllables.", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element is of type " + element->GetClassName() + ", but only DivLines and Accids can be inserted into syllables."); return false; } if (!parent->Is(SYLLABLE)) { LogError("The selected %s is not a child of syllable.", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "The selected " + element->GetClassName() + "is not a child of syllable."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "The selected " + element->GetClassName() + "is not a child of syllable."); return false; } @@ -1513,8 +1514,8 @@ bool EditorToolkitNeume::MoveOutsideSyllable(std::string elementId) // INSIDE do nothing } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); return true; } @@ -1522,15 +1523,15 @@ bool EditorToolkitNeume::DisplaceClefOctave(std::string elementId, std::string d { if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } if (direction != "above" && direction != "below") { LogError("Direction can only be either \"above\" or \"below\"."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Direction can only be either \"above\" or \"below\"."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Direction can only be either \"above\" or \"below\"."); return false; } @@ -1538,8 +1539,8 @@ bool EditorToolkitNeume::DisplaceClefOctave(std::string elementId, std::string d Object *obj = page->FindDescendantByID(elementId); if (obj == NULL || !obj->Is(CLEF)) { LogError("This action can only be done on clefs!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "This action can only be done on clefs!"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "This action can only be done on clefs!"); return false; } @@ -1554,8 +1555,8 @@ bool EditorToolkitNeume::DisplaceClefOctave(std::string elementId, std::string d if (octaveDis > 3 || octaveDis < -3) { LogError("Clefs can only be displaced 3 octaves."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Clefs can only be displaced 3 octaves."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Clefs can only be displaced 3 octaves."); return false; } @@ -1590,8 +1591,99 @@ bool EditorToolkitNeume::DisplaceClefOctave(std::string elementId, std::string d nc->SetOct(nc->GetOct() + move); }); - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); + return true; +} + +bool EditorToolkitNeume::MatchHeight(std::string elementId) +{ + if (!m_doc->GetDrawingPage()) { + LogError("Could not get drawing page"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get drawing page."); + return false; + } + if (m_doc->GetType() != Facs) { + LogError("Drawing page without facsimile"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Drawing page without facsimile is unsupported."); + return false; + } + + Object *element = m_doc->GetDrawingPage()->FindDescendantByID(elementId); + assert(element); + Object *staffParent = element->GetFirstAncestor(STAFF); + if (element == NULL) { + LogError("No element exists with ID '%s'.", elementId.c_str()); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No element exists with ID" + elementId + "."); + return false; + } + if (!element->Is(SYL)) { + LogError("Element is of type %s, but only element can match height.", element->GetClassName().c_str()); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import( + "message", "Element is of type " + element->GetClassName() + ", but only element can match height."); + return false; + } + + // get the position of the selected bbox + int ulx; + int uly; + int height; + if (dynamic_cast(element)->HasFacs()) { + ulx = element->GetFacsimileInterface()->GetZone()->GetUlx(); + uly = element->GetFacsimileInterface()->GetZone()->GetUly(); + height = element->GetFacsimileInterface()->GetZone()->GetLry() - uly; + } + else { + LogError("Selected '%s' without facsimile", element->GetClassName().c_str()); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Selected '" + element->GetClassName() + "' without facsimile is unsupported."); + return false; + } + + // find all syls in staff + ListOfObjects syls; + ClassIdComparison ac(SYL); + staffParent->FindAllDescendantsByComparison(&syls, &ac); + Syl *syl; + Zone *zone; + int itUlx; + // int itLrx; + int offsetY; + // int rightMost = -1; + double theta = staffParent->GetFacsimileInterface()->GetZone()->GetRotate(); + + for (auto it = syls.begin(); it != syls.end(); ++it) { + syl = dynamic_cast(*it); + zone = syl->GetFacsimileInterface()->GetZone(); + assert(zone); + + // // adjust x-axis first + // itUlx = zone->GetUlx(); + // itLrx = zone->GetLrx(); + // if (itLrx > rightMost) { + // // correct overlap + // if (itUlx < rightMost) zone->SetUlx(rightMost); + // // Update right most point if needed + // rightMost = itLrx; + // } + + offsetY = 0; + itUlx = zone->GetUlx(); + if (theta) { + double factor = 1.3; + offsetY = (int)((itUlx - ulx) * tan(theta * M_PI / 180.0) / factor); + } + + zone->SetUly(uly + offsetY); + zone->SetLry(uly + offsetY + height); + } + + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); return true; } @@ -1608,15 +1700,15 @@ bool EditorToolkitNeume::Merge(std::vector elementIds) } else { LogError("Staff with ID '%s' does not exist!", it->c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Staff with ID '" + *it + "' does not exist."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Staff with ID '" + *it + "' does not exist."); return false; } } if (staves.size() < 2) { LogError("At least two staves must be provided."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "At least two staves must be provided."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "At least two staves must be provided."); return false; } @@ -1677,9 +1769,9 @@ bool EditorToolkitNeume::Merge(std::vector elementIds) fillLayer->ReorderByXPos(); - m_infoObject.import("uuid", fillStaff->GetID()); - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("uuid", fillStaff->GetID()); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); // TODO change zones for staff children @@ -1721,8 +1813,8 @@ bool EditorToolkitNeume::Set(std::string elementId, std::string attrType, std::s m_doc->PrepareData(); m_doc->GetDrawingPage()->LayOut(true); } - m_infoObject.import("status", success ? "OK" : "FAILURE"); - m_infoObject.import("message", success ? "" : "Could not set attribute '" + attrType + "' to '" + attrValue + "'."); + m_editInfo.import("status", success ? "OK" : "FAILURE"); + m_editInfo.import("message", success ? "" : "Could not set attribute '" + attrType + "' to '" + attrValue + "'."); return success; } @@ -1732,15 +1824,15 @@ bool EditorToolkitNeume::SetText(std::string elementId, const std::string &text) std::string status = "OK", message = ""; const std::u32string wtext = UTF8to32(text); if (!m_doc->GetDrawingPage()) { - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not find drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not find drawing page."); return false; } Object *element = m_doc->GetDrawingPage()->FindDescendantByID(elementId); if (element == NULL) { LogWarning("No element with ID '%s' exists", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "No element with ID '" + elementId + "' exists."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No element with ID '" + elementId + "' exists."); return false; } @@ -1824,12 +1916,12 @@ bool EditorToolkitNeume::SetText(std::string elementId, const std::string &text) } else { LogError("Element type '%s' is unsupported for SetText", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Element type '" + element->GetClassName() + "' is unsupported for SetText."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element type '" + element->GetClassName() + "' is unsupported for SetText."); return false; } - m_infoObject.import("status", success ? status : "FAILURE"); - m_infoObject.import("message", success ? message : "SetText method failed."); + m_editInfo.import("status", success ? status : "FAILURE"); + m_editInfo.import("message", success ? message : "SetText method failed."); return success; } @@ -1837,8 +1929,8 @@ bool EditorToolkitNeume::SetClef(std::string elementId, std::string shape) { if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } ListOfObjects objects; @@ -1861,8 +1953,8 @@ bool EditorToolkitNeume::SetClef(std::string elementId, std::string shape) success = AttModule::SetShared(clef, "shape", shape); if (!success) { LogError("Unable to set clef shape"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Unable to set clef shape."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Unable to set clef shape."); return false; } @@ -1889,8 +1981,8 @@ bool EditorToolkitNeume::SetClef(std::string elementId, std::string shape) m_doc->PrepareData(); m_doc->GetDrawingPage()->LayOut(true); } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); return true; } @@ -1898,23 +1990,23 @@ bool EditorToolkitNeume::Split(std::string elementId, int x) { if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } Staff *staff = dynamic_cast(m_doc->GetDrawingPage()->FindDescendantByID(elementId)); // Validate parameters if (staff == NULL) { LogError("Either no element exists with ID '%s' or it is not a staff.", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Either no element exists with ID '" + elementId + "' or it is not a staff."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Either no element exists with ID '" + elementId + "' or it is not a staff."); return false; } if (staff->GetZone()->GetUlx() > x || staff->GetZone()->GetLrx() < x) { LogError("The 'x' parameter is not within the bounds of the original staff."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "The 'x' parameter is not within bounds of the original staff."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "The 'x' parameter is not within bounds of the original staff."); return false; } @@ -1928,19 +2020,19 @@ bool EditorToolkitNeume::Split(std::string elementId, int x) if (!this->Insert("staff", "auto", newUlx, newUly, newLrx, newLry, v)) { LogError("Failed to create a second staff."); - m_infoObject.reset(); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to create a second staff."); + m_editInfo.reset(); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to create a second staff."); return false; } Staff *splitStaff - = dynamic_cast(m_doc->GetDrawingPage()->FindDescendantByID(m_infoObject.get("uuid"))); + = dynamic_cast(m_doc->GetDrawingPage()->FindDescendantByID(m_editInfo.get("uuid"))); assert(splitStaff); if (splitStaff == NULL) { LogError("Split staff is null"); - m_infoObject.reset(); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Split staff is null."); + m_editInfo.reset(); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Split staff is null."); return false; } @@ -1982,30 +2074,83 @@ bool EditorToolkitNeume::Split(std::string elementId, int x) } } layer->ClearRelinquishedChildren(); - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); - m_infoObject.import("uuid", splitStaff->GetID()); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); + m_editInfo.import("uuid", splitStaff->GetID()); return true; } +void EditorToolkitNeume::UnlinkSyllable(Syllable *syllable) +{ + if (!m_doc->GetDrawingPage()) { + LogError("Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); + return; + } + + assert(syllable); + + std::string linkedID = (syllable->HasPrecedes() ? syllable->GetPrecedes() : syllable->GetFollows()); + if (linkedID.compare(0, 1, "#") == 0) linkedID.erase(0, 1); + Syllable *linkedSyllable = dynamic_cast(m_doc->GetDrawingPage()->FindDescendantByID(linkedID)); + if (linkedSyllable != NULL) { + if (linkedSyllable->HasPrecedes()) linkedSyllable->SetPrecedes(""); + if (linkedSyllable->HasFollows()) { + linkedSyllable->SetFollows(""); + + // Create an empty syl for the second part + Syl *syl = new Syl(); + Text *text = new Text(); + std::u32string str = U""; + text->SetText(str); + syl->AddChild(text); + linkedSyllable->AddChild(syl); + + // Create default bounding box if facs + if (m_doc->GetType() == Facs) { + Zone *zone = new Zone(); + + zone->SetUlx( + linkedSyllable->GetFirst(NEUME)->GetFirst(NC)->GetFacsimileInterface()->GetZone()->GetUlx()); + zone->SetUly(linkedSyllable->GetAncestorStaff()->GetFacsimileInterface()->GetZone()->GetLry()); + zone->SetLrx(linkedSyllable->GetLast(NEUME)->GetLast(NC)->GetFacsimileInterface()->GetZone()->GetLrx()); + zone->SetLry(zone->GetUly() + 100); + + // Make bbox larger if it has less than 2 ncs + if (linkedSyllable->GetChildCount(NC, 2) <= 2) { + zone->SetLrx(zone->GetLrx() + 50); + } + + assert(m_doc->GetFacsimile()); + m_doc->GetFacsimile()->FindDescendantByType(SURFACE)->AddChild(zone); + FacsimileInterface *fi = syl->GetFacsimileInterface(); + assert(fi); + fi->AttachZone(zone); + } + } + } +} + bool EditorToolkitNeume::Remove(std::string elementId) { if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } Object *obj = m_doc->GetDrawingPage()->FindDescendantByID(elementId); assert(obj); bool result = false; - bool isNeumeOrNc, isNc, isClef; + bool isNeumeOrNc, isNc, isClef, isSyllable; isNeumeOrNc = (obj->Is(NC) || obj->Is(NEUME)); isNc = obj->Is(NC); isClef = obj->Is(CLEF); + isSyllable = obj->Is(SYLLABLE); Object *parent = obj->GetParent(); assert(parent); - m_infoObject.import("uuid", elementId); + m_editInfo.import("uuid", elementId); // Remove Zone for element (if any) InterfaceComparison ic(INTERFACE_FACSIMILE); ListOfObjects fiChildren; @@ -2046,9 +2191,9 @@ bool EditorToolkitNeume::Remove(std::string elementId) if (!result) { LogError("Failed to delete the desired element (%s)", elementId.c_str()); - m_infoObject.reset(); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to delete the desired element (" + elementId + ")."); + m_editInfo.reset(); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to delete the desired element (" + elementId + ")."); return false; } @@ -2059,6 +2204,13 @@ bool EditorToolkitNeume::Remove(std::string elementId) pi->AdjustPitchForNewClef(clef, previousClef); } } + else if (isSyllable) { + Syllable *syllable = dynamic_cast(obj); + assert(syllable); + if (syllable->HasPrecedes() || syllable->HasFollows()) { + UnlinkSyllable(syllable); + } + } if (!result) { result = parent->DeleteChild(obj); @@ -2066,9 +2218,9 @@ bool EditorToolkitNeume::Remove(std::string elementId) if (!result) { LogError("Failed to delete the desired element (%s)", elementId.c_str()); - m_infoObject.reset(); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to delete the desired element (" + elementId + ")."); + m_editInfo.reset(); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to delete the desired element (" + elementId + ")."); return false; } // Check if this leaves any containers empty and delete them @@ -2082,9 +2234,9 @@ bool EditorToolkitNeume::Remove(std::string elementId) result &= parent->DeleteChild(obj); if (!result) { LogError("Failed to delete empty neume (%s)", neumeId.c_str()); - m_infoObject.reset(); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to delete empty neume (" + neumeId + ")."); + m_editInfo.reset(); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to delete empty neume (" + neumeId + ")."); return false; } } @@ -2098,30 +2250,23 @@ bool EditorToolkitNeume::Remove(std::string elementId) Syllable *li = dynamic_cast(obj); assert(li); if (li->HasPrecedes() || li->HasFollows()) { - std::string linkedID = (li->HasPrecedes() ? li->GetPrecedes() : li->GetFollows()); - if (linkedID.compare(0, 1, "#") == 0) linkedID.erase(0, 1); - Syllable *linkedSyllable - = dynamic_cast(m_doc->GetDrawingPage()->FindDescendantByID(linkedID)); - if (linkedSyllable != NULL) { - if (linkedSyllable->HasPrecedes()) linkedSyllable->SetPrecedes(""); - if (linkedSyllable->HasFollows()) linkedSyllable->SetFollows(""); - } + UnlinkSyllable(li); } // Delete the syllable empty of neumes std::string syllableId = obj->GetID(); result &= parent->DeleteChild(obj); if (!result) { LogError("Failed to delete empty syllable (%s)", syllableId.c_str()); - m_infoObject.reset(); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to delete empty syllable (" + syllableId + ")."); + m_editInfo.reset(); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to delete empty syllable (" + syllableId + ")."); return false; } } } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); return true; } @@ -2129,22 +2274,22 @@ bool EditorToolkitNeume::Resize(std::string elementId, int ulx, int uly, int lrx { if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } if (m_doc->GetType() != Facs) { LogWarning("Resizing is only available in facsimile mode."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Resizing is only available in facsimile mode."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Resizing is only available in facsimile mode."); return false; } Object *obj = m_doc->GetDrawingPage()->FindDescendantByID(elementId); if (obj == NULL) { LogError("Object with ID '%s' not found.", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Object with ID '" + elementId + "' could not be found."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Object with ID '" + elementId + "' could not be found."); return false; } if (obj->Is(STAFF)) { @@ -2152,8 +2297,8 @@ bool EditorToolkitNeume::Resize(std::string elementId, int ulx, int uly, int lrx assert(staff); if (!staff->HasFacs()) { LogError("This staff does not have a facsimile."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "This staff does not have a facsimile."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "This staff does not have a facsimile."); return false; } Zone *zone = staff->GetZone(); @@ -2173,8 +2318,8 @@ bool EditorToolkitNeume::Resize(std::string elementId, int ulx, int uly, int lrx assert(syl); if (!syl->HasFacs()) { LogError("This syl (bounding box) does not have a facsimile"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "This syl does not have a facsimile."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "This syl does not have a facsimile."); return false; } Zone *zone = syl->GetZone(); @@ -2204,21 +2349,20 @@ bool EditorToolkitNeume::Resize(std::string elementId, int ulx, int uly, int lrx } else { LogError("Element of type '%s' is unsupported.", obj->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Element of type '" + obj->GetClassName() + "' is unsupported."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element of type '" + obj->GetClassName() + "' is unsupported."); return false; } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); return true; } bool EditorToolkitNeume::Group(std::string groupType, std::vector elementIds) { - Object *parent = NULL, *doubleParent = NULL; + Object *parent = NULL, *secondParent = NULL; std::map parents; - std::set elements; - std::vector sortedElements; + ListOfObjects elements; std::vector fullParents; std::map clefsBefore; @@ -2227,16 +2371,16 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e // Get the current drawing page if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } if (elementIds.size() == 0) { LogWarning("No element IDs to group!"); status = "WARNING"; message = "No element IDs to group!"; - m_infoObject.import("status", status); - m_infoObject.import("message", message); + m_editInfo.import("status", status); + m_editInfo.import("message", message); return true; } ClassId elementClass; @@ -2248,8 +2392,8 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e } else { LogError("Invalid groupType: %s", groupType.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Invalid groupType: " + groupType); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Invalid groupType: " + groupType); return false; } @@ -2259,15 +2403,15 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e Object *el = m_doc->GetDrawingPage()->FindDescendantByID(*it); if (el == NULL) { LogError("Could not get element with ID %s", it->c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get element with ID " + *it); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get element with ID " + *it); return false; } if (el->GetClassId() != elementClass) { LogError("Element %s was of class %s. Expected class %s", el->GetID().c_str(), el->GetClassName().c_str(), groupType.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element " + el->GetID() + " was of class " + el->GetClassName() + " but expected class " + groupType + "."); return false; @@ -2277,8 +2421,8 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e Object *par = el->GetParent(); if (par == NULL) { LogError("Parent of %s is null!", el->GetID().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Parent of " + el->GetID() + " is null."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Parent of " + el->GetID() + " is null."); return false; } @@ -2301,25 +2445,22 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e std::string resultId0; std::string resultId1; - // LogMessage("%s", chainArray.get(0).json().c_str()); - // for_each(elementIds.begin(), elementIds.begin()+idx,[](std::string s){LogMessage("%s", s.c_str());}); - std::vector elementIds0 = { elementIds.begin(), elementIds.begin() + idx }; Group("neume", elementIds0); - if (m_infoObject.get("status") == "FAILURE") { + if (m_editInfo.get("status") == "FAILURE") { resultId0 = linkedID; } else { - resultId0 = m_infoObject.get("uuid"); + resultId0 = m_editInfo.get("uuid"); } std::vector elementIds1 = { elementIds.begin() + idx, elementIds.end() }; Group("neume", elementIds1); - if (m_infoObject.get("status") == "FAILURE") { + if (m_editInfo.get("status") == "FAILURE") { resultId1 = par->GetID(); } else { - resultId1 = m_infoObject.get("uuid"); + resultId1 = m_editInfo.get("uuid"); par = m_doc->GetDrawingPage()->FindDescendantByID(resultId1); } @@ -2335,91 +2476,53 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e uuidArray << resultId0; uuidArray << resultId1; - m_infoObject.import("uuid", uuidArray); - m_infoObject.import("status", status); - m_infoObject.import("message", message); + m_editInfo.import("uuid", uuidArray); + m_editInfo.import("status", status); + m_editInfo.import("message", message); return true; } } - if (doubleParent == NULL) { - doubleParent = par->GetParent(); - if (doubleParent == NULL) { - LogError("No second level parent!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "No second level parent."); - return false; - } - } - else { - if (par->GetParent() != doubleParent) { - LogError("No shared second level parent!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "No shared second level parent."); - return false; - } - } - auto possibleEntry = parents.find(el->GetParent()); - if (possibleEntry == parents.end()) { - parents.emplace(el->GetParent(), 1); - } - else { - possibleEntry->second += 1; - } - elements.insert(el); + parents[par]++; + elements.push_back(el); } if (parents.size() == 0) { LogError("Could not get the parent."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the parent."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the parent."); return false; } else if (parents.size() == 1) { LogError("The selected elements are already grouped."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "The selected elements are already grouped."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "The selected elements are already grouped."); return false; } - // auto it = elementIds.begin(); - // Object *el = m_doc->GetDrawingPage()->FindDescendantByID(*it); - // Layer *layer = dynamic_cast(el->GetFirstAncestor(LAYER)); - // if (!layer) { - // LogError("Elements does not have Layer parent. This should not happen."); - // m_infoObject.import("status", "FAILURE"); - // m_infoObject.import("message", "Elements does not have Layer parent."); - // return false; - // } - - std::copy(elements.begin(), elements.end(), std::back_inserter(sortedElements)); - std::stable_sort(sortedElements.begin(), sortedElements.end(), Object::sortByUlx); - ListOfObjects clefs; - std::set syllables; - ListOfObjects sortedSyllables; + ListOfObjects syllables; ClassIdComparison clefComp(CLEF); InterfaceComparison pitchComp(INTERFACE_PITCH); Clef *newClef = NULL; - m_doc->GetDrawingPage()->FindAllDescendantsBetween(&clefs, &clefComp, - sortedElements.front()->GetFirstAncestor(SYLLABLE), sortedElements.back()->GetFirstAncestor(SYLLABLE)); + m_doc->GetDrawingPage()->FindAllDescendantsBetween( + &clefs, &clefComp, elements.front()->GetFirstAncestor(SYLLABLE), elements.back()->GetFirstAncestor(SYLLABLE)); // if there are clefs between the elements getting grouped // some elements will need their pitch adjusted for the new clef // clefsBefore maps the syllable parent to its clef before the group // so we can reassociate any pitched children from their old clef to the new one if (clefs.size() != 0) { - for (auto it = sortedElements.begin(); it != sortedElements.end(); ++it) { + for (auto it = elements.begin(); it != elements.end(); ++it) { if ((*it)->Is(SYLLABLE)) { - syllables.insert(dynamic_cast(*it)); + syllables.push_back(dynamic_cast(*it)); } else { - syllables.insert((*it)->GetFirstAncestor(SYLLABLE)); + syllables.push_back((*it)->GetFirstAncestor(SYLLABLE)); } } - std::copy(syllables.begin(), syllables.end(), std::back_inserter(sortedSyllables)); - for (auto it = sortedSyllables.begin(); it != sortedSyllables.end(); ++it) { + for (auto it = syllables.begin(); it != syllables.end(); ++it) { Clef *tempClef = dynamic_cast(m_doc->GetDrawingPage()->FindPreviousChild(&clefComp, (*it))); if (tempClef == NULL) { Layer *layer = vrv_cast((*it)->GetFirstAncestor(LAYER)); @@ -2427,14 +2530,28 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e } clefsBefore.insert(std::pair(dynamic_cast(*it), tempClef)); } - newClef = clefsBefore[dynamic_cast(sortedSyllables.front())]; + newClef = clefsBefore[dynamic_cast(syllables.front())]; } + // check if share second level parent + secondParent = (*parents.begin()).first->GetParent(); + if (secondParent == NULL) { + LogError("No second level parent!"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No second level parent."); + return false; + } // find parents where all of their children are being grouped for (auto it = parents.begin(); it != parents.end(); ++it) { auto parentPair = *it; Object *par = parentPair.first; int expected; + if (par->GetParent() != secondParent) { + LogError("No shared second level parent!"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No shared second level parent."); + return false; + } if (par->GetClassId() == SYLLABLE) { expected = par->GetChildCount(NEUME); } @@ -2445,6 +2562,7 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e fullParents.push_back(parentPair.first); } } + // if there are no full parents we need to make a new one to attach everything to if (fullParents.empty()) { if (elementClass == NC) { @@ -2452,9 +2570,10 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e } else if (elementClass == NEUME) { parent = new Syllable(); + Object *oldSyl = (*elements.begin())->GetFirstAncestor(SYLLABLE)->GetFirst(SYL); for (auto it = elements.begin(); it != elements.end(); ++it) { - if ((*it)->GetParent() != parent && !(*it)->Is(SYL)) { + if (!(*it)->Is(SYL)) { (*it)->MoveItselfTo(parent); } } @@ -2471,64 +2590,25 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e if (m_doc->GetType() == Facs) { Zone *zone = new Zone(); - // if it's syllable parent has position values just use those - FacsimileInterface *syllableFi = NULL; - if (syl->GetFirstAncestor(SYLLABLE)->GetFacsimileInterface()->HasFacs()) { - syllableFi = syl->GetFirstAncestor(SYLLABLE)->GetFacsimileInterface(); - Zone *tempZone = dynamic_cast(syllableFi->GetZone()); - zone->SetUlx(tempZone->GetUlx()); - zone->SetUly(tempZone->GetUly()); - zone->SetLrx(tempZone->GetLrx()); - zone->SetLry(tempZone->GetLry()); - } - // otherwise get a boundingbox that comprises all the neumes in the syllable - else { - ListOfObjects children; - InterfaceComparison comp(INTERFACE_FACSIMILE); - syl->GetFirstAncestor(SYLLABLE)->FindAllDescendantsByComparison(&children, &comp); - for (auto iter2 = children.begin(); iter2 != children.end(); ++iter2) { - FacsimileInterface *temp = (*iter2)->GetFacsimileInterface(); - assert(temp); - Zone *tempZone = vrv_cast(temp->GetZone()); - assert(tempZone); - if (temp->HasFacs()) { - zone->SetUlx(tempZone->GetUlx()); - zone->SetUly(tempZone->GetUly()); - zone->SetLrx(tempZone->GetLrx()); - zone->SetLry(tempZone->GetLry()); - } - } - } - - // make the bounding box a little bigger and lower so it's easier to edit - const int offSetUly = 100; - const int offSetLrx = 100; - const int offSetLry = 200; + zone->SetUlx(parent->GetFirst(NEUME)->GetFirst(NC)->GetFacsimileInterface()->GetZone()->GetUlx()); + zone->SetUly(oldSyl->GetFacsimileInterface()->GetZone()->GetUly()); + zone->SetLrx(parent->GetLast(NEUME)->GetLast(NC)->GetFacsimileInterface()->GetZone()->GetLrx()); + zone->SetLry(oldSyl->GetFacsimileInterface()->GetZone()->GetLry()); - zone->SetUly(zone->GetUly() + offSetUly); - zone->SetLrx(zone->GetLrx() + offSetLrx); - zone->SetLry(zone->GetLry() + offSetLry); + // Make bbox larger if it has less than 2 ncs + if (parent->GetChildCount(NC, 2) <= 2) { + zone->SetLrx(zone->GetLrx() + 50); + } assert(m_doc->GetFacsimile()); m_doc->GetFacsimile()->FindDescendantByType(SURFACE)->AddChild(zone); - FacsimileInterface *fi = vrv_cast((*syl).GetFacsimileInterface()); + FacsimileInterface *fi = syl->GetFacsimileInterface(); assert(fi); fi->AttachZone(zone); - - // syl->ResetFacsimile(); - // syl->SetFacs(zone->GetID()); } } - parent->ReorderByXPos(); - if (doubleParent == NULL) { - return false; - } - doubleParent->AddChild(parent); - - Layer *layer = vrv_cast(parent->GetFirstAncestor(LAYER)); - assert(layer); - layer->ReorderByXPos(); + secondParent->AddChild(parent); } // if there's only one full parent we just add the other elements to it @@ -2541,7 +2621,6 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e (*it)->MoveItselfTo(parent); } } - parent->ReorderByXPos(); } // if there is more than 1 full parent we need to concat syl's @@ -2549,39 +2628,32 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e // also in this case we need to make sure that the facsimile of the resulting syl is correct else { if (elementClass == NC) { - if (doubleParent) { - parent = new Neume(); - for (auto it = elements.begin(); it != elements.end(); ++it) { - if ((*it)->GetParent() != parent && !(*it)->Is(SYL)) { - (*it)->MoveItselfTo(parent); - parent->ReorderByXPos(); - } + parent = new Neume(); + for (auto it = elements.begin(); it != elements.end(); ++it) { + if ((*it)->GetParent() != parent && !(*it)->Is(SYL)) { + (*it)->MoveItselfTo(parent); } - doubleParent->AddChild(parent); } - - Layer *layer = dynamic_cast(parent->GetFirstAncestor(LAYER)); - if (!layer) { - LogError("Elements does not have Layer parent. This should not happen."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Elements does not have Layer parent."); - return false; - } - - layer->ReorderByXPos(); + secondParent->AddChild(parent); } else { - std::sort(fullParents.begin(), fullParents.end(), Object::sortByUlx); - Syllable *fullSyllable = new Syllable(); + parent = new Syllable(); Syl *fullSyl = NULL; + int ulx, uly, lrx, lry; // construct concatenated string of all the syls std::u32string fullString = U""; for (auto it = fullParents.begin(); it != fullParents.end(); ++it) { Syl *syl = dynamic_cast((*it)->FindDescendantByType(SYL)); - if (syl != NULL) { + if (syl != NULL && m_doc->GetType() == Facs) { + Zone *zone = dynamic_cast(syl->GetFacsimileInterface()->GetZone()); + if (fullSyl == NULL) { fullSyl = syl; + ulx = zone->GetUlx(); + uly = zone->GetUly(); + lrx = zone->GetLrx(); + lry = zone->GetLry(); } Text *text = dynamic_cast(syl->FindDescendantByType(TEXT)); @@ -2589,84 +2661,41 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e std::u32string currentString = text->GetText(); fullString = fullString + currentString; } + + ulx = zone->GetUlx() < ulx ? zone->GetUlx() : ulx; + uly = zone->GetUly() < uly ? zone->GetUly() : uly; + lrx = zone->GetLrx() > lrx ? zone->GetLrx() : lrx; + lry = zone->GetLry() > lry ? zone->GetLry() : lry; } } - // find the new boundingbox comprising all of the text - int ulx = -1, uly = -1, lrx = -1, lry = -1; - for (auto it = fullParents.begin(); it != fullParents.end(); ++it) { - Object *par = vrv_cast(*it); - assert(par); - Syl *descSyl = vrv_cast(par->FindDescendantByType(SYL)); - assert(descSyl); - // FacsimileInterface *facsInter = dynamic_cast - // ((*it)->FindDescendantByType(SYL)->GetFacsimileInterface()); - if (descSyl != NULL) { - FacsimileInterface *facsInter - = dynamic_cast(descSyl->GetFacsimileInterface()); - - if (facsInter != NULL) { - if (ulx == -1 || ulx > facsInter->GetDrawingX()) { - ulx = facsInter->GetDrawingX(); - } - - if (lrx < facsInter->GetWidth() + facsInter->GetDrawingX()) { - lrx = facsInter->GetWidth() + facsInter->GetDrawingX(); - } - - if (uly == -1 || uly > facsInter->GetDrawingY()) { - uly = facsInter->GetDrawingY(); - } - if (lry < facsInter->GetHeight() + facsInter->GetDrawingY()) { - lry = facsInter->GetHeight() + facsInter->GetDrawingY(); - } - } - } - } - assert(fullSyl); - Text *text = vrv_cast(fullSyl->FindDescendantByType(TEXT)); - assert(text); - text->SetText(fullString); - assert(fullSyllable); - fullSyllable->AddChild(fullSyl); - // Move elements to the new group syllable for (auto it = elements.begin(); it != elements.end(); ++it) { - if ((*it)->GetParent() != fullSyllable && !(*it)->Is(SYL)) { - (*it)->MoveItselfTo(fullSyllable); + if ((*it)->GetParent() != parent && !(*it)->Is(SYL)) { + (*it)->MoveItselfTo(parent); } } - if (doubleParent == NULL) { - LogError("No second level parent!"); - return false; - } - doubleParent->AddChild(fullSyllable); - Layer *layer = vrv_cast(fullSyllable->GetFirstAncestor(LAYER)); - assert(layer); - if (ulx >= 0 && uly >= 0 && lrx >= 0 && lry >= 0) { - FacsimileInterface *facsInter = vrv_cast(fullSyl->GetFacsimileInterface()); - assert(facsInter); - Zone *zone = vrv_cast(facsInter->GetZone()); - assert(zone); - assert(ulx >= 0); + Text *fullText = dynamic_cast(fullSyl->FindDescendantByType(TEXT)); + fullText->SetText(fullString); + parent->AddChild(fullSyl); + + if (m_doc->GetType() == Facs) { + Zone *zone = dynamic_cast(fullSyl->GetFacsimileInterface()->GetZone()); zone->SetUlx(ulx); - assert(uly >= 0); zone->SetUly(uly); - assert(lrx >= 0); zone->SetLrx(lrx); - assert(lry >= 0); zone->SetLry(lry); } - layer->ReorderByXPos(); - parent = fullSyllable; + + secondParent->AddChild(parent); } } // change the pitch of any pitched elements whose clef may have changed assert(newClef); ListOfObjects pitchedChildren; - if (sortedSyllables.size()) { - for (auto it = sortedSyllables.begin(); it != sortedSyllables.end(); ++it) { + if (syllables.size()) { + for (auto it = syllables.begin(); it != syllables.end(); ++it) { Syllable *syllable = dynamic_cast(*it); if (clefsBefore[syllable] != newClef) { syllable->FindAllDescendantsByComparison(&pitchedChildren, &pitchComp); @@ -2682,11 +2711,7 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e Object *obj = (*it).first; obj->ClearRelinquishedChildren(); if (obj->GetChildCount() == 0) { - if (doubleParent == NULL) { - LogError("No second level parent!"); - return false; - } - doubleParent->DeleteChild(obj); + secondParent->DeleteChild(obj); } else if (obj->GetChildCount() == (obj->GetChildCount(SYL) + obj->GetChildCount(DIVLINE) + obj->GetChildCount(ACCID) @@ -2697,30 +2722,25 @@ bool EditorToolkitNeume::Group(std::string groupType, std::vector e } while ((leftover = obj->FindDescendantByType(DIVLINE)) != NULL) { leftover->MoveItselfTo(parent); - parent->ReorderByXPos(); obj->ClearRelinquishedChildren(); } while ((leftover = obj->FindDescendantByType(ACCID)) != NULL) { leftover->MoveItselfTo(parent); - parent->ReorderByXPos(); obj->ClearRelinquishedChildren(); } while ((leftover = obj->FindDescendantByType(CLEF)) != NULL) { leftover->MoveItselfTo(parent); - parent->ReorderByXPos(); obj->ClearRelinquishedChildren(); } - if (doubleParent == NULL) { - LogError("No second level parent!"); - return false; - } - doubleParent->DeleteChild(obj); + secondParent->DeleteChild(obj); } } - m_infoObject.import("uuid", parent->GetID()); - m_infoObject.import("status", status); - m_infoObject.import("message", message); + secondParent->ReorderByXPos(); + + m_editInfo.import("uuid", parent->GetID()); + m_editInfo.import("status", status); + m_editInfo.import("message", message); return true; } @@ -2745,6 +2765,7 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector int ligNum = 0; // for ligature in ungroupNcs int firstIsLig = false; bool firstIsSyl = false; + Zone *oldSylZone = NULL; Clef *oldClef = NULL; ClassIdComparison ac(CLEF); ListOfObjects syllables; // List of syllables used. groupType=neume only. @@ -2754,8 +2775,8 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector // Check if you can get drawing page if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } @@ -2817,8 +2838,8 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector } else { LogError("Unable to toggle ligature within ungroup ncs!"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Unable to toggle ligature within ungroup ncs."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Unable to toggle ligature within ungroup ncs."); return false; } } @@ -2832,14 +2853,21 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector sparent->ReorderByXPos(); fparent->ClearRelinquishedChildren(); fparent->ReorderByXPos(); + uuidArray << (*it); + it = elementIds.erase(it); + if (it == elementIds.end()) break; + el = m_doc->GetDrawingPage()->FindDescendantByID(*it); } - continue; } if (elementIds.begin() == it || firstIsSyl) { // if the element is a syl we want it to stay attached to the first element // we'll still need to initialize all the parents, thus the bool if (el->Is(SYL)) { firstIsSyl = true; + oldSylZone = dynamic_cast(el->GetFacsimileInterface()->GetZone()); + if (oldSylZone) { + oldSylZone->SetLrx(oldSylZone->GetUlx() + 100); + } continue; } else if (groupType == "nc") { @@ -2847,7 +2875,6 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector Nc *nc = dynamic_cast(el); assert(nc); if (nc->HasLigated() && nc->GetLigated() == BOOLEAN_true) { - // ligNum++; firstIsLig = true; } @@ -2875,12 +2902,17 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector if (oldClef == NULL) { oldClef = dynamic_cast(sparent)->GetCurrentClef(); } + + // Get orginal syl zone + if (!oldSylZone) { + oldSylZone = dynamic_cast(currentParent->GetFirst(SYL)->GetFacsimileInterface()->GetZone()); + } } else { LogError("Invalid groupType for ungrouping"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Invalid groupType for ungrouping."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Invalid groupType for ungrouping."); return false; } } @@ -2888,19 +2920,15 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector // if the element is a syl then we want to keep it attached to the first node if (el->Is(SYL)) { + if (oldSylZone) { + oldSylZone->SetLrx(oldSylZone->GetUlx() + 100); + } continue; } - // if (el->Is(DIVLINE) || el->Is(ACCID)) { - // el->MoveItselfTo(sparent); - // fparent->ClearRelinquishedChildren(); - // continue; - // } - if (groupType == "nc") { Nc *nc = dynamic_cast(el); assert(nc); - // if (nc->HasLigated()) continue; if (firstIsLig) { // if 1st is ligature, neglect 2nd, go to the next nc @@ -2935,70 +2963,26 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector if (m_doc->GetType() == Facs) { Zone *zone = new Zone(); - // Use syllable parent positions if possible - FacsimileInterface *syllableFi = NULL; - if (syl->GetFirstAncestor(SYLLABLE)->GetFacsimileInterface()->HasFacs()) { - syllableFi = syl->GetFirstAncestor(SYLLABLE)->GetFacsimileInterface(); - Zone *tempZone = dynamic_cast(syllableFi->GetZone()); - zone->SetUlx(tempZone->GetUlx()); - zone->SetUly(tempZone->GetUly()); - zone->SetLrx(tempZone->GetLrx()); - zone->SetLry(tempZone->GetLry()); - } - // otherwise get a boundingbox that comprises all the neumes in the syllable - else { - ListOfObjects children; - InterfaceComparison comp(INTERFACE_FACSIMILE); - syl->GetFirstAncestor(SYLLABLE)->FindAllDescendantsByComparison(&children, &comp); - for (auto iter2 = children.begin(); iter2 != children.end(); ++iter2) { - FacsimileInterface *temp = (*iter2)->GetFacsimileInterface(); - assert(temp); - Zone *tempZone = vrv_cast(temp->GetZone()); - assert(tempZone); - if (temp->HasFacs()) { - if (syllableFi == NULL) { - zone->SetUlx(tempZone->GetUlx()); - zone->SetUly(tempZone->GetUly()); - zone->SetLrx(tempZone->GetLrx()); - zone->SetLry(tempZone->GetLry()); - } - else { - if (tempZone->GetUlx() < zone->GetUlx()) { - zone->SetUlx(tempZone->GetUlx()); - } - if (tempZone->GetUly() < zone->GetUly()) { - zone->SetUly(tempZone->GetUly()); - } - if (tempZone->GetLrx() > zone->GetLrx()) { - zone->SetLrx(tempZone->GetLrx()); - } - if (tempZone->GetLry() > zone->GetLry()) { - zone->SetLry(tempZone->GetLry()); - } - } - } - } - } + zone->SetUlx(el->GetFirst(NC)->GetFacsimileInterface()->GetZone()->GetUlx()); + zone->SetUly(oldSylZone->GetUly()); + zone->SetLrx(el->GetLast(NC)->GetFacsimileInterface()->GetZone()->GetLrx()); + zone->SetLry(oldSylZone->GetLry()); - // make the bounding box a little bigger and lower so it's easier to edit - zone->SetUly(zone->GetUly() + 100); - zone->SetLrx(zone->GetLrx() + 100); - zone->SetLry(zone->GetLry() + 200); + // Make bbox larger if it has less than 2 ncs + if (newParent->GetChildCount(NC, 2) <= 2) { + zone->SetLrx(zone->GetLrx() + 50); + } assert(m_doc->GetFacsimile()); m_doc->GetFacsimile()->FindDescendantByType(SURFACE)->AddChild(zone); FacsimileInterface *fi = syl->GetFacsimileInterface(); assert(fi); fi->AttachZone(zone); - - // syl->ResetFacsimile(); - // syl->SetFacs(zone->GetID()); } } if (ligNum != 1) { // if not 1st nc in ligature, add child - uuidArray << newParent->GetID(); sparent->AddChild(newParent); @@ -3030,9 +3014,9 @@ bool EditorToolkitNeume::Ungroup(std::string groupType, std::vector } } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); - m_infoObject.import("uuid", uuidArray); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); + m_editInfo.import("uuid", uuidArray); return true; } @@ -3041,8 +3025,8 @@ bool EditorToolkitNeume::SplitNeume(std::string neumeId, std::string ncId) // Check if you can get drawing page if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } @@ -3064,8 +3048,8 @@ bool EditorToolkitNeume::SplitNeume(std::string neumeId, std::string ncId) int nLen = fparent->GetChildCount(); if (nLen == 0) { LogError("The selected neume has no children."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "The selected neume has no children."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "The selected neume has no children."); return false; } @@ -3073,8 +3057,8 @@ bool EditorToolkitNeume::SplitNeume(std::string neumeId, std::string ncId) int fIdx = fparent->GetChildIndex(elNc); if (fIdx == -1) { LogError("The selected neume component is not a child of the selected neume."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "The selected neume component is not a child of the selected neume."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "The selected neume component is not a child of the selected neume."); return false; } // if click on a ligature, ncId point to the second nc in the ligature, thus minus 1 @@ -3108,9 +3092,9 @@ bool EditorToolkitNeume::SplitNeume(std::string neumeId, std::string ncId) // insert newParent to sparent sparent->InsertAfter(fparent, newParent); - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); - m_infoObject.import("uuid", uuidArray); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); + m_editInfo.import("uuid", uuidArray); return true; } @@ -3119,15 +3103,15 @@ bool EditorToolkitNeume::ChangeGroup(std::string elementId, std::string contour) // Check if you can get drawing page if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } Neume *el = dynamic_cast(m_doc->GetDrawingPage()->FindDescendantByID(elementId)); if (el == NULL) { LogError("Unable to find neume with id %s", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Unable to find neume with id " + elementId + "."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Unable to find neume with id " + elementId + "."); return false; } Nc *firstChild = NULL; @@ -3191,8 +3175,8 @@ bool EditorToolkitNeume::ChangeGroup(std::string elementId, std::string contour) LogError("Unsupported character in contour."); delete newNc; delete zone; - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Unsupported character in contour."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Unsupported character in contour."); return false; } zone->SetUlx(newUlx); @@ -3215,9 +3199,9 @@ bool EditorToolkitNeume::ChangeGroup(std::string elementId, std::string contour) initialLry = newLry; prevNc = newNc; } - m_infoObject.import("uuid", el->GetID()); - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("uuid", el->GetID()); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); return true; } @@ -3235,8 +3219,8 @@ bool EditorToolkitNeume::ToggleLigature(std::vector elementIds) // Check if you can get drawing page if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } @@ -3250,8 +3234,8 @@ bool EditorToolkitNeume::ToggleLigature(std::vector elementIds) int secondIdx = secondNc->GetIdx(); if (std::abs(firstIdx - secondIdx) != 1) { LogError("The selected ncs are not adjacent."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "The selected ncs are not adjacent."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "The selected ncs are not adjacent."); return false; } @@ -3309,20 +3293,20 @@ bool EditorToolkitNeume::ToggleLigature(std::vector elementIds) } // else { // LogError("isLigature is invalid!"); - // m_infoObject.import("status", "FAILURE"); - // m_infoObject.import("message", "isLigature value '" + isLigature + "' is invalid."); + // m_editInfo.import("status", "FAILURE"); + // m_editInfo.import("message", "isLigature value '" + isLigature + "' is invalid."); // return false; // } if (success1 && success2 && m_doc->GetType() != Facs) { m_doc->PrepareData(); m_doc->GetDrawingPage()->LayOut(true); } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); if (!(success1 && success2)) { LogWarning("Unable to update ligature attribute"); - m_infoObject.import("message", "Unable to update ligature attribute."); - m_infoObject.import("status", "WARNING"); + m_editInfo.import("message", "Unable to update ligature attribute."); + m_editInfo.import("status", "WARNING"); } surface->AddChild(zone); @@ -3333,15 +3317,15 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) { if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } if (m_doc->GetType() != Facs) { LogWarning("Staff re-association is only available in facsimile mode."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Staff re-association is only available in facsimile mode."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Staff re-association is only available in facsimile mode."); return false; } @@ -3349,8 +3333,8 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) assert(element); if (element == NULL) { LogError("No element exists with ID '%s'.", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "No element exists with ID" + elementId + "."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No element exists with ID" + elementId + "."); return false; } @@ -3358,8 +3342,8 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) || element->Is(ACCID))) { LogError("Element is of type %s, but only Syllables, Custos, Clefs, Divlines, and Accids can change staves.", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element is of type " + element->GetClassName() + ", but only Syllables, Custos, Clefs, DivLines, and Accids can change staves."); return false; @@ -3380,8 +3364,8 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) LayerElement *layerElement = dynamic_cast(element); if (!layerElement->GenerateZoneBounds(&ulx, &uly, &lrx, &lry)) { LogError("Couldn't generate bounding box for syllable."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Couldn't generate bounding box for syllable."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Couldn't generate bounding box for syllable."); return false; } comp.x = (lrx + ulx) / 2; @@ -3389,8 +3373,8 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) } else { LogError("This element does not have a facsimile."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "This element does not have a facsimile."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "This element does not have a facsimile."); return false; } @@ -3403,8 +3387,8 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) } else { LogError("Could not find any staves. This should not happen"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not find any staves. This should not happen"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not find any staves. This should not happen"); return false; } @@ -3413,8 +3397,8 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) assert(parent); if (parent == NULL || sParent == NULL) { LogError("Couldn't find staff parent of element with id '%s'", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Couldn't find staff parent of element with id " + elementId); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Couldn't find staff parent of element with id " + elementId); return false; } @@ -3422,16 +3406,16 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) assert(LAYER); if (layer == NULL) { LogError("Couldn't find layer child of staff. This should not happen"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Couldn't find layer child of staff. This should not happen"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Couldn't find layer child of staff. This should not happen"); return false; } if (layer == parent) { - m_infoObject.import("status", "WARNING"); - m_infoObject.import("message", "Moving to the same staff as before."); - m_infoObject.import("elementId", elementId); - m_infoObject.import("newStaffId", staff->GetID()); + m_editInfo.import("status", "WARNING"); + m_editInfo.import("message", "Moving to the same staff as before."); + m_editInfo.import("elementId", elementId); + m_editInfo.import("newStaffId", staff->GetID()); return true; } @@ -3489,8 +3473,8 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) // Adjust clefline if (!AdjustClefLineFromPosition(dynamic_cast(element), staff)) { LogError("Could not adjust clef line of %s", element->GetID().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to set clef line from facsimile."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to set clef line from facsimile."); return false; } @@ -3518,19 +3502,19 @@ bool EditorToolkitNeume::ChangeStaff(std::string elementId) if (!(element->Is(ACCID) || element->Is(DIVLINE))) { if (!AdjustPitchFromPosition(element)) { LogError("Could not adjust pitch of %s", element->GetID().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to properly set pitch."); - m_infoObject.import("elementId", element->GetID()); - m_infoObject.import("newStaffId", staff->GetID()); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to properly set pitch."); + m_editInfo.import("elementId", element->GetID()); + m_editInfo.import("newStaffId", staff->GetID()); return false; } } } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); - m_infoObject.import("elementId", elementId); - m_infoObject.import("newStaffId", staff->GetID()); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); + m_editInfo.import("elementId", elementId); + m_editInfo.import("newStaffId", staff->GetID()); return true; } @@ -3538,15 +3522,15 @@ bool EditorToolkitNeume::ChangeStaffTo(std::string elementId, std::string staffI { if (!m_doc->GetDrawingPage()) { LogError("Could not get the drawing page"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not get the drawing page."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not get the drawing page."); return false; } if (m_doc->GetType() != Facs) { LogWarning("Staff re-association is only available in facsimile mode."); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Staff re-association is only available in facsimile mode."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Staff re-association is only available in facsimile mode."); return false; } @@ -3554,16 +3538,16 @@ bool EditorToolkitNeume::ChangeStaffTo(std::string elementId, std::string staffI assert(element); if (element == NULL) { LogError("No element exists with ID '%s'.", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "No element exists with ID" + elementId + "."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "No element exists with ID" + elementId + "."); return false; } if (!(element->Is(CLEF) || element->Is(DIVLINE) || element->Is(ACCID))) { LogError("Element is of type %s, but only Clefs, Divlines, and Accids can change to a specified staff.", element->GetClassName().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Element is of type " + element->GetClassName() + ", but only Clefs, Divlines, and Accids can change to a specified staff."); return false; @@ -3573,8 +3557,8 @@ bool EditorToolkitNeume::ChangeStaffTo(std::string elementId, std::string staffI if (!staff) { LogError("Could not find any staves. This should not happen"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Could not find any staves. This should not happen"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Could not find any staves. This should not happen"); return false; } @@ -3583,8 +3567,8 @@ bool EditorToolkitNeume::ChangeStaffTo(std::string elementId, std::string staffI assert(parent); if (parent == NULL || sParent == NULL) { LogError("Couldn't find staff parent of element with id '%s'", elementId.c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Couldn't find staff parent of element with id " + elementId); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Couldn't find staff parent of element with id " + elementId); return false; } @@ -3592,16 +3576,16 @@ bool EditorToolkitNeume::ChangeStaffTo(std::string elementId, std::string staffI assert(LAYER); if (layer == NULL) { LogError("Couldn't find layer child of staff. This should not happen"); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Couldn't find layer child of staff. This should not happen"); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Couldn't find layer child of staff. This should not happen"); return false; } if (layer == parent) { - m_infoObject.import("status", "WARNING"); - m_infoObject.import("message", "Moving to the same staff as before."); - m_infoObject.import("elementId", elementId); - m_infoObject.import("newStaffId", staff->GetID()); + m_editInfo.import("status", "WARNING"); + m_editInfo.import("message", "Moving to the same staff as before."); + m_editInfo.import("elementId", elementId); + m_editInfo.import("newStaffId", staff->GetID()); return true; } @@ -3659,8 +3643,8 @@ bool EditorToolkitNeume::ChangeStaffTo(std::string elementId, std::string staffI // Adjust clefline if (!AdjustClefLineFromPosition(dynamic_cast(element), staff)) { LogError("Could not adjust clef line of %s", element->GetID().c_str()); - m_infoObject.import("status", "FAILURE"); - m_infoObject.import("message", "Failed to set clef line from facsimile."); + m_editInfo.import("status", "FAILURE"); + m_editInfo.import("message", "Failed to set clef line from facsimile."); return false; } @@ -3687,10 +3671,10 @@ bool EditorToolkitNeume::ChangeStaffTo(std::string elementId, std::string staffI parent->ReorderByXPos(); } - m_infoObject.import("status", "OK"); - m_infoObject.import("message", ""); - m_infoObject.import("elementId", elementId); - m_infoObject.import("newStaffId", staff->GetID()); + m_editInfo.import("status", "OK"); + m_editInfo.import("message", ""); + m_editInfo.import("elementId", elementId); + m_editInfo.import("newStaffId", staff->GetID()); return true; } @@ -3776,6 +3760,13 @@ bool EditorToolkitNeume::ParseDisplaceClefAction(jsonxx::Object param, std::stri return true; } +bool EditorToolkitNeume::ParseMatchHeightAction(jsonxx::Object param, std::string *elementId) +{ + if (!param.has("elementId")) return false; + (*elementId) = param.get("elementId"); + return true; +} + bool EditorToolkitNeume::ParseMergeAction(jsonxx::Object param, std::vector *elementIds) { if (!param.has("elementIds")) return false; diff --git a/src/facsimilefunctor.cpp b/src/facsimilefunctor.cpp new file mode 100644 index 00000000000..73ec1ef23ca --- /dev/null +++ b/src/facsimilefunctor.cpp @@ -0,0 +1,229 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: facsimilefunctor.cpp +// Author: Laurent Pugin +// Created: 2023 +// Copyright (c) Authors and others. All rights reserved. +///////////////////////////////////////////////////////////////////////////// + +#include "facsimilefunctor.h" + +//---------------------------------------------------------------------------- + +#include "doc.h" +#include "layerelement.h" +#include "measure.h" +#include "page.h" +#include "pb.h" +#include "sb.h" +#include "staff.h" +#include "surface.h" +#include "system.h" +#include "vrv.h" +#include "zone.h" + +//---------------------------------------------------------------------------- + +namespace vrv { + +//---------------------------------------------------------------------------- +// SyncFromFacsimileFunctor +//---------------------------------------------------------------------------- + +SyncFromFacsimileFunctor::SyncFromFacsimileFunctor(Doc *doc) : Functor() +{ + m_doc = doc; + m_view.SetDoc(doc); + m_currentPage = NULL; + m_currentSystem = NULL; +} + +FunctorCode SyncFromFacsimileFunctor::VisitLayerElement(LayerElement *layerElement) +{ + if (!layerElement->Is({ NOTE, REST })) return FUNCTOR_CONTINUE; + + Zone *zone = layerElement->GetZone(); + assert(zone); + layerElement->m_drawingFacsX = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncFromFacsimileFunctor::VisitMeasure(Measure *measure) +{ + Zone *zone = measure->GetZone(); + assert(zone); + measure->m_drawingFacsX1 = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); + measure->m_drawingFacsX2 = m_view.ToLogicalX(zone->GetLrx() * DEFINITION_FACTOR); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncFromFacsimileFunctor::VisitPage(Page *page) +{ + m_currentPage = page; + m_doc->SetDrawingPage(m_currentPage->GetIdx()); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncFromFacsimileFunctor::VisitPb(Pb *pb) +{ + // This would happen if we run the functor on data not converted to page-based + assert(m_currentPage); + + Zone *zone = pb->GetZone(); + assert(zone && zone->GetParent()); + Surface *surface = (zone->GetParent()->Is(SURFACE)) ? vrv_cast(zone->GetParent()) : NULL; + // Use the parent surface attributes if given + if (surface && surface->HasLrx() && surface->HasLry()) { + m_currentPage->m_pageHeight = surface->GetLry() * DEFINITION_FACTOR; + m_currentPage->m_pageWidth = surface->GetLrx() * DEFINITION_FACTOR; + } + // Fallback on zone + else { + m_currentPage->m_pageHeight = zone->GetLry() * DEFINITION_FACTOR; + m_currentPage->m_pageWidth = zone->GetLrx() * DEFINITION_FACTOR; + } + // Update the page size to have to View::ToLogicalX/Y valid + m_doc->UpdatePageDrawingSizes(); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncFromFacsimileFunctor::VisitSb(Sb *sb) +{ + // This would happen if we run the functor on data not converted to page-based + assert(m_currentSystem); + + Zone *zone = sb->GetZone(); + assert(zone); + m_currentSystem->m_drawingFacsX = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); + m_currentSystem->m_drawingFacsY = m_view.ToLogicalY(zone->GetUly() * DEFINITION_FACTOR); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncFromFacsimileFunctor::VisitStaff(Staff *staff) +{ + Zone *zone = staff->GetZone(); + assert(zone); + staff->m_drawingFacsY = m_view.ToLogicalY(zone->GetUly() * DEFINITION_FACTOR); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncFromFacsimileFunctor::VisitSystem(System *system) +{ + m_currentSystem = system; + + return FUNCTOR_CONTINUE; +} + +//---------------------------------------------------------------------------- +// SyncToFacsimileFunctor +//---------------------------------------------------------------------------- + +SyncToFacsimileFunctor::SyncToFacsimileFunctor(Doc *doc) : Functor() +{ + m_doc = doc; + m_view.SetDoc(doc); + m_surface = NULL; + m_currentPage = NULL; + m_currentSystem = NULL; + m_pageMarginTop = 0; + m_pageMarginLeft = 0; +} + +FunctorCode SyncToFacsimileFunctor::VisitLayerElement(LayerElement *layerElement) +{ + if (!layerElement->Is({ NOTE, REST })) return FUNCTOR_CONTINUE; + + Zone *zone = this->GetZone(layerElement, layerElement->GetClassName()); + zone->SetUlx(m_view.ToDeviceContextX(layerElement->GetDrawingX()) / DEFINITION_FACTOR + m_pageMarginLeft); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncToFacsimileFunctor::VisitMeasure(Measure *measure) +{ + Zone *zone = this->GetZone(measure, measure->GetClassName()); + zone->SetUlx(m_view.ToDeviceContextX(measure->GetDrawingX()) / DEFINITION_FACTOR + m_pageMarginLeft); + zone->SetLrx( + m_view.ToDeviceContextX(measure->GetDrawingX() + measure->GetWidth()) / DEFINITION_FACTOR + m_pageMarginLeft); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncToFacsimileFunctor::VisitPage(Page *page) +{ + m_currentPage = page; + m_doc->SetDrawingPage(page->GetIdx()); + page->LayOut(); + // + m_surface = new Surface(); + assert(m_doc->GetFacsimile()); + m_doc->GetFacsimile()->AddChild(m_surface); + m_surface->SetLrx(m_doc->m_drawingPageWidth / DEFINITION_FACTOR); + m_surface->SetLry(m_doc->m_drawingPageHeight / DEFINITION_FACTOR); + // Because the facsimile output zone positions include the margins, we will add them to each zone + m_pageMarginTop = m_doc->m_drawingPageMarginTop / DEFINITION_FACTOR; + m_pageMarginLeft = m_doc->m_drawingPageMarginLeft / DEFINITION_FACTOR; + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncToFacsimileFunctor::VisitPb(Pb *pb) +{ + Zone *zone = this->GetZone(pb, pb->GetClassName()); + // The Pb zone values are currently not used in SyncFromFacsimileFunctor because the + // page sizes are synced from the parent Surface and zone positions include margins + zone->SetUlx(m_pageMarginLeft); + zone->SetUly(m_pageMarginTop); + zone->SetLrx(m_doc->m_drawingPageContentWidth / DEFINITION_FACTOR + m_pageMarginLeft); + zone->SetLry(m_doc->m_drawingPageContentHeight / DEFINITION_FACTOR + m_pageMarginTop); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncToFacsimileFunctor::VisitSb(Sb *sb) +{ + Zone *zone = this->GetZone(sb, sb->GetClassName()); + zone->SetUlx(m_view.ToDeviceContextX(m_currentSystem->GetDrawingX()) / DEFINITION_FACTOR + m_pageMarginLeft); + zone->SetUly(m_view.ToDeviceContextY(m_currentSystem->GetDrawingY()) / DEFINITION_FACTOR + m_pageMarginTop); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncToFacsimileFunctor::VisitStaff(Staff *staff) +{ + Zone *zone = this->GetZone(staff, staff->GetClassName()); + zone->SetUly(m_view.ToDeviceContextY(staff->GetDrawingY()) / DEFINITION_FACTOR + m_pageMarginTop); + + return FUNCTOR_CONTINUE; +} + +FunctorCode SyncToFacsimileFunctor::VisitSystem(System *system) +{ + m_currentSystem = system; + + return FUNCTOR_CONTINUE; +} + +Zone *SyncToFacsimileFunctor::GetZone(FacsimileInterface *interface, std::string type) +{ + if (interface->GetZone()) { + // Here we should probably check if the zone is a child of m_surface + return interface->GetZone(); + } + else { + Zone *zone = new Zone(); + std::transform(type.begin(), type.end(), type.begin(), ::tolower); + zone->SetType(type); + m_surface->AddChild(zone); + interface->SetFacs(StringFormat("#%s", zone->GetID().c_str())); + interface->AttachZone(zone); + return interface->GetZone(); + } +} + +} // namespace vrv diff --git a/src/facsimileinterface.cpp b/src/facsimileinterface.cpp index 6ef3a50b88a..93dd965da22 100644 --- a/src/facsimileinterface.cpp +++ b/src/facsimileinterface.cpp @@ -15,6 +15,7 @@ #include "doc.h" #include "facsimile.h" +#include "preparedatafunctor.h" #include "surface.h" #include "syllable.h" #include "view.h" @@ -34,7 +35,9 @@ FacsimileInterface::~FacsimileInterface() {} void FacsimileInterface::Reset() { this->ResetFacsimile(); - this->AttachZone(NULL); + + m_zone = NULL; + m_surface = NULL; } int FacsimileInterface::GetDrawingX() const @@ -79,12 +82,7 @@ int FacsimileInterface::GetSurfaceY() const assert(m_zone); Surface *surface = vrv_cast(m_zone->GetFirstAncestor(SURFACE)); assert(surface); - if (surface->HasLry()) { - return surface->GetLry(); - } - else { - return surface->GetMaxY(); - } + return surface->GetMaxY(); } void FacsimileInterface::AttachZone(Zone *zone) @@ -104,4 +102,39 @@ void FacsimileInterface::AttachZone(Zone *zone) } } +//---------------------------------------------------------------------------- +// Interface pseudo functor (redirected) +//---------------------------------------------------------------------------- + +FunctorCode FacsimileInterface::InterfacePrepareFacsimile(PrepareFacsimileFunctor &functor, Object *object) +{ + assert(functor.GetFacsimile()); + Facsimile *facsimile = functor.GetFacsimile(); + std::string facsID = ExtractIDFragment(this->GetFacs()); + Object *facsDescendant = facsimile->FindDescendantByID(facsID); + if (!facsDescendant) { + LogWarning("Could not find @facs '%s' in facsimile element", facsID.c_str()); + return FUNCTOR_CONTINUE; + } + + if (facsDescendant->Is(ZONE)) { + m_zone = vrv_cast(facsDescendant); + assert(m_zone); + } + else if (facsDescendant->Is(SURFACE)) { + m_surface = vrv_cast(facsDescendant); + assert(m_surface); + } + + return FUNCTOR_CONTINUE; +} + +FunctorCode FacsimileInterface::InterfaceResetData(ResetDataFunctor &functor, Object *object) +{ + m_zone = NULL; + m_surface = NULL; + + return FUNCTOR_CONTINUE; +} + } // namespace vrv diff --git a/src/iomei.cpp b/src/iomei.cpp index aaa69f00c64..1cac00367ae 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -1640,8 +1640,8 @@ void MEIOutput::WriteSystem(pugi::xml_node currentNode, System *system) currentNode.append_attribute("system.rightmar") = StringFormat("%d", system->m_systemRightMar / DEFINITION_FACTOR).c_str(); // y positions - if (system->m_yAbs != VRV_UNSET) { - currentNode.append_attribute("uly") = StringFormat("%d", system->m_yAbs / DEFINITION_FACTOR).c_str(); + if (system->m_drawingFacsY != VRV_UNSET) { + currentNode.append_attribute("uly") = StringFormat("%d", system->m_drawingFacsY / DEFINITION_FACTOR).c_str(); } system->WriteTyped(currentNode); } @@ -1698,6 +1698,7 @@ void MEIOutput::WritePb(pugi::xml_node currentNode, Pb *pb) assert(pb); this->WriteSystemElement(currentNode, pb); + this->WriteFacsimileInterface(currentNode, pb); pb->WriteNNumberLike(currentNode); } @@ -1706,6 +1707,7 @@ void MEIOutput::WriteSb(pugi::xml_node currentNode, Sb *sb) assert(sb); this->WriteSystemElement(currentNode, sb); + this->WriteFacsimileInterface(currentNode, sb); sb->WriteNNumberLike(currentNode); } @@ -1883,6 +1885,8 @@ void MEIOutput::WriteMeasure(pugi::xml_node currentNode, Measure *measure) assert(measure); this->WriteXmlId(currentNode, measure); + this->WriteFacsimileInterface(currentNode, measure); + measure->WriteBarring(currentNode); measure->WriteMeasureLog(currentNode); measure->WriteMeterConformanceBar(currentNode); @@ -1890,9 +1894,9 @@ void MEIOutput::WriteMeasure(pugi::xml_node currentNode, Measure *measure) measure->WritePointing(currentNode); measure->WriteTyped(currentNode); // For now we copy the adjusted value of coord.x1 and coord.x2 to xAbs and xAbs2 respectively - if ((measure->m_xAbs != VRV_UNSET) && (measure->m_xAbs2 != VRV_UNSET)) { - measure->SetCoordX1(measure->m_xAbs / DEFINITION_FACTOR); - measure->SetCoordX2(measure->m_xAbs2 / DEFINITION_FACTOR); + if ((measure->m_drawingFacsX1 != VRV_UNSET) && (measure->m_drawingFacsX2 != VRV_UNSET)) { + measure->SetCoordX1(measure->m_drawingFacsX1 / DEFINITION_FACTOR); + measure->SetCoordX2(measure->m_drawingFacsX2 / DEFINITION_FACTOR); measure->WriteCoordX1(currentNode); measure->WriteCoordX2(currentNode); } @@ -2216,14 +2220,14 @@ void MEIOutput::WriteStaff(pugi::xml_node currentNode, Staff *staff) assert(staff); this->WriteXmlId(currentNode, staff); - staff->WriteFacsimile(currentNode); + this->WriteFacsimileInterface(currentNode, staff); staff->WriteNInteger(currentNode); staff->WriteTyped(currentNode); staff->WriteVisibility(currentNode); // y position - if (staff->m_yAbs != VRV_UNSET) { - staff->SetCoordY1(staff->m_yAbs / DEFINITION_FACTOR); + if (staff->m_drawingFacsY != VRV_UNSET) { + staff->SetCoordY1(staff->m_drawingFacsY / DEFINITION_FACTOR); staff->WriteCoordY1(currentNode); } } @@ -2298,11 +2302,12 @@ void MEIOutput::WriteLayerElement(pugi::xml_node currentNode, LayerElement *elem assert(element); this->WriteXmlId(currentNode, element); + this->WriteFacsimileInterface(currentNode, element); this->WriteLinkingInterface(currentNode, element); element->WriteLabelled(currentNode); element->WriteTyped(currentNode); - if (element->m_xAbs != VRV_UNSET) { - element->SetCoordX1(element->m_xAbs / DEFINITION_FACTOR); + if (element->m_drawingFacsX != VRV_UNSET) { + element->SetCoordX1(element->m_drawingFacsX / DEFINITION_FACTOR); element->WriteCoordX1(currentNode); } } @@ -2320,7 +2325,6 @@ void MEIOutput::WriteAccid(pugi::xml_node currentNode, Accid *accid) } WriteLayerElement(currentNode, accid); - WriteFacsimileInterface(currentNode, accid); WritePositionInterface(currentNode, accid); accid->WriteAccidental(currentNode); accid->WriteAccidentalGes(currentNode); @@ -2433,7 +2437,6 @@ void MEIOutput::WriteClef(pugi::xml_node currentNode, Clef *clef) } this->WriteLayerElement(currentNode, clef); - this->WriteFacsimileInterface(currentNode, clef); clef->WriteClefLog(currentNode); clef->WriteClefShape(currentNode); clef->WriteColor(currentNode); @@ -2451,7 +2454,6 @@ void MEIOutput::WriteCustos(pugi::xml_node currentNode, Custos *custos) { assert(custos); - this->WriteFacsimileInterface(currentNode, custos); this->WritePitchInterface(currentNode, custos); this->WritePositionInterface(currentNode, custos); this->WriteLayerElement(currentNode, custos); @@ -2465,7 +2467,6 @@ void MEIOutput::WriteDivLine(pugi::xml_node currentNode, DivLine *divLine) assert(divLine); this->WriteLayerElement(currentNode, divLine); - this->WriteFacsimileInterface(currentNode, divLine); divLine->WriteDivLineLog(currentNode); divLine->WriteColor(currentNode); divLine->WriteVisibility(currentNode); @@ -2698,7 +2699,6 @@ void MEIOutput::WriteNc(pugi::xml_node currentNode, Nc *nc) this->WriteLayerElement(currentNode, nc); this->WriteDurationInterface(currentNode, nc); - this->WriteFacsimileInterface(currentNode, nc); this->WritePitchInterface(currentNode, nc); this->WritePositionInterface(currentNode, nc); nc->WriteColor(currentNode); @@ -2711,7 +2711,6 @@ void MEIOutput::WriteNeume(pugi::xml_node currentNode, Neume *neume) assert(neume); this->WriteLayerElement(currentNode, neume); - this->WriteFacsimileInterface(currentNode, neume); neume->WriteColor(currentNode); } @@ -2830,7 +2829,6 @@ void MEIOutput::WriteSyl(pugi::xml_node currentNode, Syl *syl) assert(syl); this->WriteLayerElement(currentNode, syl); - this->WriteFacsimileInterface(currentNode, syl); syl->WriteLang(currentNode); syl->WriteTypography(currentNode); syl->WriteSylLog(currentNode); @@ -2878,6 +2876,7 @@ void MEIOutput::WriteSurface(pugi::xml_node currentNode, Surface *surface) assert(surface); this->WriteXmlId(currentNode, surface); surface->WriteCoordinated(currentNode); + surface->WriteCoordinatedUl(currentNode); surface->WriteTyped(currentNode); for (Object *child = surface->GetFirst(); child != NULL; child = surface->GetNext()) { @@ -2900,6 +2899,7 @@ void MEIOutput::WriteZone(pugi::xml_node currentNode, Zone *zone) assert(zone); this->WriteXmlId(currentNode, zone); zone->WriteCoordinated(currentNode); + zone->WriteCoordinatedUl(currentNode); zone->WriteTyped(currentNode); } @@ -3532,6 +3532,9 @@ bool MEIInput::IsAllowed(std::string element, Object *filterParent) else if (element == "clef") { return true; } + else if (element == "fTrem") { + return true; + } else if (element == "graceGrp") { return true; } @@ -3905,6 +3908,11 @@ bool MEIInput::ReadDoc(pugi::xml_node root) m_doc->m_drawingPageHeight = m_doc->GetFacsimile()->GetMaxY(); m_doc->m_drawingPageWidth = m_doc->GetFacsimile()->GetMaxX(); } + // Temporary solution to set the document type to Transcription when using + else if (m_doc->HasFacsimile() && !m_doc->GetFacsimile()->GetType().empty()) { + m_doc->SetType(StrToDocType(m_doc->GetFacsimile()->GetType())); + // Facsimile data eventually sync with Doc::SyncFromFacsimileDoc below + } if (facsimile.next_sibling("facsimile")) { LogWarning("Only first is processed"); } @@ -4141,7 +4149,7 @@ bool MEIInput::ReadPage(Object *parent, pugi::xml_node page) Page *vrvPage = new Page(); this->SetMeiID(page, vrvPage); - if ((m_doc->GetType() == Transcription) && (m_meiversion == meiVersion_MEIVERSION_2013)) { + if (m_doc->IsTranscription() && (m_meiversion == meiVersion_MEIVERSION_2013)) { UpgradePageTo_3_0_0(vrvPage, m_doc); } @@ -4180,12 +4188,12 @@ bool MEIInput::ReadPage(Object *parent, pugi::xml_node page) parent->AddChild(vrvPage); bool success = this->ReadPageChildren(vrvPage, page); - if (success && (m_doc->GetType() == Transcription) && (vrvPage->GetPPUFactor() != 1.0)) { + if (success && m_doc->IsTranscription() && (vrvPage->GetPPUFactor() != 1.0)) { ApplyPPUFactorFunctor applyPPUFactor; vrvPage->Process(applyPPUFactor); } - if ((m_doc->GetType() == Transcription) && (m_meiversion == meiVersion_MEIVERSION_2013)) { + if (m_doc->IsTranscription() && (m_meiversion == meiVersion_MEIVERSION_2013)) { UpgradePageTo_5_0(vrvPage); } @@ -4472,6 +4480,13 @@ bool MEIInput::ReadSectionChildren(Object *parent, pugi::xml_node parentNode) LogWarning("Unsupported '<%s>' within
", current.name()); } } + + // New for blank files in neume notation + if (!unmeasured && parent->Is(SECTION) && (m_doc->m_notationType == NOTATIONTYPE_neume)) { + unmeasured = new Measure(false); + m_doc->SetMensuralMusicOnly(true); + parent->AddChild(unmeasured); + } return success; } @@ -4521,6 +4536,7 @@ bool MEIInput::ReadPb(Object *parent, pugi::xml_node pb) Pb *vrvPb = new Pb(); this->ReadSystemElement(pb, vrvPb); + this->ReadFacsimileInterface(pb, vrvPb); vrvPb->ReadNNumberLike(pb); @@ -4537,6 +4553,7 @@ bool MEIInput::ReadSb(Object *parent, pugi::xml_node sb) Sb *vrvSb = new Sb(); this->ReadSystemElement(sb, vrvSb); + this->ReadFacsimileInterface(sb, vrvSb); vrvSb->ReadNNumberLike(sb); @@ -4563,8 +4580,8 @@ bool MEIInput::ReadSystem(Object *parent, pugi::xml_node system) vrvSystem->m_systemRightMar = system.attribute("system.rightmar").as_int(); system.remove_attribute("system.rightmar"); } - if (system.attribute("uly") && (m_doc->GetType() == Transcription)) { - vrvSystem->m_yAbs = system.attribute("uly").as_int() * DEFINITION_FACTOR; + if (system.attribute("uly") && m_doc->IsTranscription()) { + vrvSystem->m_drawingFacsY = system.attribute("uly").as_int() * DEFINITION_FACTOR; system.remove_attribute("uly"); } @@ -4612,7 +4629,7 @@ bool MEIInput::ReadSystemChildren(Object *parent, pugi::xml_node parentNode) assert(system); unmeasured = new Measure(false); m_doc->SetMensuralMusicOnly(true); - if ((m_doc->GetType() == Transcription) && (m_meiversion == meiVersion_MEIVERSION_2013)) { + if (m_doc->IsTranscription() && (m_meiversion == meiVersion_MEIVERSION_2013)) { UpgradeMeasureTo_3_0_0(unmeasured, system); } system->AddChild(unmeasured); @@ -5340,6 +5357,7 @@ bool MEIInput::ReadMeasure(Object *parent, pugi::xml_node measure) m_doc->SetMensuralMusicOnly(false); } this->SetMeiID(measure, vrvMeasure); + this->ReadFacsimileInterface(measure, vrvMeasure); vrvMeasure->ReadBarring(measure); vrvMeasure->ReadMeasureLog(measure); @@ -5348,15 +5366,15 @@ bool MEIInput::ReadMeasure(Object *parent, pugi::xml_node measure) vrvMeasure->ReadPointing(measure); vrvMeasure->ReadTyped(measure); - if ((m_doc->GetType() == Transcription) && (m_meiversion == meiVersion_MEIVERSION_2013)) { + if (m_doc->IsTranscription() && (m_meiversion == meiVersion_MEIVERSION_2013)) { UpgradeMeasureTo_5_0(measure); } - if (measure.attribute("coord.x1") && measure.attribute("coord.x2") && (m_doc->GetType() == Transcription)) { + if (measure.attribute("coord.x1") && measure.attribute("coord.x2") && m_doc->IsTranscription()) { vrvMeasure->ReadCoordX1(measure); vrvMeasure->ReadCoordX2(measure); - vrvMeasure->m_xAbs = vrvMeasure->GetCoordX1() * DEFINITION_FACTOR; - vrvMeasure->m_xAbs2 = vrvMeasure->GetCoordX2() * DEFINITION_FACTOR; + vrvMeasure->m_drawingFacsX1 = vrvMeasure->GetCoordX1() * DEFINITION_FACTOR; + vrvMeasure->m_drawingFacsX2 = vrvMeasure->GetCoordX2() * DEFINITION_FACTOR; } parent->AddChild(vrvMeasure); @@ -6036,19 +6054,19 @@ bool MEIInput::ReadStaff(Object *parent, pugi::xml_node staff) { Staff *vrvStaff = new Staff(); this->SetMeiID(staff, vrvStaff); + this->ReadFacsimileInterface(staff, vrvStaff); - vrvStaff->ReadFacsimile(staff); vrvStaff->ReadNInteger(staff); vrvStaff->ReadTyped(staff); vrvStaff->ReadVisibility(staff); - if ((m_doc->GetType() == Transcription) && (m_meiversion == meiVersion_MEIVERSION_2013)) { + if (m_doc->IsTranscription() && (m_meiversion == meiVersion_MEIVERSION_2013)) { UpgradeStaffTo_5_0(staff); } - if (staff.attribute("coord.y1") && (m_doc->GetType() == Transcription)) { + if (staff.attribute("coord.y1") && m_doc->IsTranscription()) { vrvStaff->ReadCoordY1(staff); - vrvStaff->m_yAbs = vrvStaff->GetCoordY1() * DEFINITION_FACTOR; + vrvStaff->m_drawingFacsY = vrvStaff->GetCoordY1() * DEFINITION_FACTOR; } if (!vrvStaff->HasN() || (vrvStaff->GetN() == 0)) { @@ -6277,17 +6295,18 @@ bool MEIInput::ReadLayerChildren(Object *parent, pugi::xml_node parentNode, Obje bool MEIInput::ReadLayerElement(pugi::xml_node element, LayerElement *object) { this->SetMeiID(element, object); + this->ReadFacsimileInterface(element, object); this->ReadLinkingInterface(element, object); object->ReadLabelled(element); object->ReadTyped(element); - if ((m_doc->GetType() == Transcription) && (m_meiversion == meiVersion_MEIVERSION_2013)) { + if (m_doc->IsTranscription() && (m_meiversion == meiVersion_MEIVERSION_2013)) { UpgradeLayerElementTo_5_0(element); } - if (element.attribute("coord.x1") && (m_doc->GetType() == Transcription)) { + if (element.attribute("coord.x1") && m_doc->IsTranscription()) { object->ReadCoordX1(element); - object->m_xAbs = object->GetCoordX1() * DEFINITION_FACTOR; + object->m_drawingFacsX = object->GetCoordX1() * DEFINITION_FACTOR; } return true; @@ -6299,7 +6318,6 @@ bool MEIInput::ReadAccid(Object *parent, pugi::xml_node accid) this->ReadLayerElement(accid, vrvAccid); ReadPositionInterface(accid, vrvAccid); - ReadFacsimileInterface(accid, vrvAccid); vrvAccid->ReadAccidental(accid); vrvAccid->ReadAccidentalGes(accid); vrvAccid->ReadAccidLog(accid); @@ -6444,7 +6462,6 @@ bool MEIInput::ReadClef(Object *parent, pugi::xml_node clef) { Clef *vrvClef = new Clef(); this->ReadLayerElement(clef, vrvClef); - this->ReadFacsimileInterface(clef, vrvClef); vrvClef->ReadClefLog(clef); vrvClef->ReadClefShape(clef); @@ -6502,7 +6519,6 @@ bool MEIInput::ReadDivLine(Object *parent, pugi::xml_node divLine) DivLine *vrvDivLine = new DivLine(); this->ReadLayerElement(divLine, vrvDivLine); - this->ReadFacsimileInterface(divLine, vrvDivLine); vrvDivLine->ReadDivLineLog(divLine); vrvDivLine->ReadColor(divLine); vrvDivLine->ReadVisibility(divLine); @@ -6785,7 +6801,6 @@ bool MEIInput::ReadNc(Object *parent, pugi::xml_node nc) this->ReadLayerElement(nc, vrvNc); this->ReadDurationInterface(nc, vrvNc); - this->ReadFacsimileInterface(nc, vrvNc); this->ReadPitchInterface(nc, vrvNc); this->ReadPositionInterface(nc, vrvNc); vrvNc->ReadColor(nc); @@ -6800,7 +6815,6 @@ bool MEIInput::ReadNeume(Object *parent, pugi::xml_node neume) { Neume *vrvNeume = new Neume(); this->ReadLayerElement(neume, vrvNeume); - this->ReadFacsimileInterface(neume, vrvNeume); vrvNeume->ReadColor(neume); @@ -6940,7 +6954,7 @@ bool MEIInput::ReadStem(Object *parent, pugi::xml_node stem) bool MEIInput::ReadSyl(Object *parent, pugi::xml_node syl) { // Add empty text node for empty syl element for invisible bbox in neume notation - if (!syl.first_child() && (m_doc->GetType() == Facs) && (m_doc->m_notationType == NOTATIONTYPE_neume)) { + if (!syl.first_child() && m_doc->IsFacs() && (m_doc->m_notationType == NOTATIONTYPE_neume)) { syl.text().set(""); } Syl *vrvSyl = new Syl(); @@ -8460,14 +8474,14 @@ void MEIInput::UpgradeMeasureTo_3_0_0(Measure *measure, System *system) assert(system); assert(!measure->IsMeasuredMusic()); - if (system->m_yAbs == VRV_UNSET) return; + if (system->m_drawingFacsY == VRV_UNSET) return; if (system->m_systemRightMar == VRV_UNSET) return; if (system->m_systemRightMar == VRV_UNSET) return; Page *page = vrv_cast(system->GetFirstAncestor(PAGE)); assert(page); - measure->m_xAbs = system->m_systemLeftMar; - measure->m_xAbs2 = page->m_pageWidth - system->m_systemRightMar; + measure->m_drawingFacsX1 = system->m_systemLeftMar; + measure->m_drawingFacsX2 = page->m_pageWidth - system->m_systemRightMar; } void MEIInput::UpgradePageTo_3_0_0(Page *page, Doc *doc) @@ -8501,6 +8515,7 @@ bool MEIInput::ReadSurface(Facsimile *parent, pugi::xml_node surface) Surface *vrvSurface = new Surface(); this->SetMeiID(surface, vrvSurface); vrvSurface->ReadCoordinated(surface); + vrvSurface->ReadCoordinatedUl(surface); vrvSurface->ReadTyped(surface); for (pugi::xml_node child = surface.first_child(); child; child = child.next_sibling()) { @@ -8524,6 +8539,7 @@ bool MEIInput::ReadZone(Surface *parent, pugi::xml_node zone) Zone *vrvZone = new Zone(); this->SetMeiID(zone, vrvZone); vrvZone->ReadCoordinated(zone); + vrvZone->ReadCoordinatedUl(zone); vrvZone->ReadTyped(zone); parent->AddChild(vrvZone); return true; diff --git a/src/iomusxml.cpp b/src/iomusxml.cpp index 7fa4fb31d3c..e7501b40ae1 100644 --- a/src/iomusxml.cpp +++ b/src/iomusxml.cpp @@ -3695,8 +3695,11 @@ void MusicXmlInput::ReadMusicXmlPrint(pugi::xml_node node, Section *section) assert(section); if (node.attribute("new-page").as_bool()) { - Pb *pb = new Pb(); - section->AddChild(pb); + const int pageBreaks = node.attribute("blank-page").as_int() + 1; + for (int i = 0; i < pageBreaks; ++i) { + Pb *pb = new Pb(); + section->AddChild(pb); + } } if (node.attribute("new-system").as_bool()) { diff --git a/src/iopae.cpp b/src/iopae.cpp index 888dfb0b62d..306c96c4d6b 100644 --- a/src/iopae.cpp +++ b/src/iopae.cpp @@ -3438,6 +3438,13 @@ bool PAEInput::ConvertRepeatedFigure() figure.push_back(*token); } } + // We are starting a new figure to be repeated + else if (token->m_char == '!') { + token->m_char = 0; + figureToken = &(*token); + figure.clear(); + status = pae::FIGURE_START; + } // We have completed a figure and will be repeating it else if (status == pae::FIGURE_END || status == pae::FIGURE_REPEAT) { // Repeat the figure. That is simply add it to the map @@ -3452,8 +3459,8 @@ bool PAEInput::ConvertRepeatedFigure() --token; status = pae::FIGURE_REPEAT; } - // End of repetitions - this includes the end of a measure - else { + // End of repetitions - this does not include the end of a measure + else if (!this->Was(*token, pae::MEASURE)) { // Make sure we repeated the figure at least once (is this too pedantic?) if (status == pae::FIGURE_END) { LogPAE(ERR_010_REP_UNUSED, *figureToken); @@ -3464,13 +3471,6 @@ bool PAEInput::ConvertRepeatedFigure() figure.clear(); } } - // We are starting a new figure to be repeated - else if (token->m_char == '!') { - token->m_char = 0; - figureToken = &(*token); - figure.clear(); - status = pae::FIGURE_START; - } // We should not have a repeat sign not after a figure end else if (token->m_char == 'f') { LogPAE(ERR_011_REP_NO_FIGURE, *token); diff --git a/src/layer.cpp b/src/layer.cpp index a2ea2da1ba4..a05d48903f1 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -273,7 +273,7 @@ const Clef *Layer::GetClefFacs(const LayerElement *test) const { const Doc *doc = vrv_cast(this->GetFirstAncestor(DOC)); assert(doc); - if (doc->GetType() == Facs) { + if (doc->IsFacs()) { ListOfConstObjects clefs; ClassIdComparison ac(CLEF); doc->FindAllDescendantsBetween(&clefs, &ac, doc->GetFirst(CLEF), test); diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 589bc8e4dd9..459d4c505df 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -127,7 +127,7 @@ void LayerElement::Reset() this->ResetLabelled(); this->ResetTyped(); - m_xAbs = VRV_UNSET; + m_drawingFacsX = VRV_UNSET; m_drawingYRel = 0; m_drawingXRel = 0; m_drawingCueSize = false; @@ -400,13 +400,13 @@ int LayerElement::GetDrawingX() const if (this->HasFacs()) { const Doc *doc = vrv_cast(this->GetFirstAncestor(DOC)); assert(doc); - if (doc->GetType() == Facs) { + if (doc->IsFacs()) { return FacsimileInterface::GetDrawingX(); } } - // Since m_xAbs is the left position, we adjust the XRel accordingly in AdjustXRelForTranscription - if (m_xAbs != VRV_UNSET) return m_xAbs + this->GetDrawingXRel(); + // Since m_drawingFacsX is the left position, we adjust the XRel accordingly in AdjustXRelForTranscription + if (m_drawingFacsX != VRV_UNSET) return m_drawingFacsX + this->GetDrawingXRel(); if (m_cachedDrawingX != VRV_UNSET) return m_cachedDrawingX; @@ -448,7 +448,7 @@ int LayerElement::GetDrawingY() const if (this->HasFacs()) { const Doc *doc = vrv_cast(this->GetFirstAncestor(DOC)); assert(doc); - if (doc->GetType() == Facs) { + if (doc->IsFacs()) { return FacsimileInterface::GetDrawingY(); } } @@ -532,7 +532,7 @@ void LayerElement::CacheYRel(bool restore) void LayerElement::CenterDrawingX() { - if (m_xAbs != VRV_UNSET) return; + if (m_drawingFacsX != VRV_UNSET) return; this->SetDrawingXRel(0); diff --git a/src/measure.cpp b/src/measure.cpp index b6cff691a5a..4439fe36ce8 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -56,6 +56,7 @@ static const ClassRegistrar s_factory("measure", MEASURE); Measure::Measure(bool measureMusic, int logMeasureNb) : Object(MEASURE, "measure-") + , FacsimileInterface() , AttBarring() , AttCoordX1() , AttCoordX2() @@ -73,6 +74,7 @@ Measure::Measure(bool measureMusic, int logMeasureNb) this->RegisterAttClass(ATT_NNUMBERLIKE); this->RegisterAttClass(ATT_POINTING); this->RegisterAttClass(ATT_TYPED); + this->RegisterInterface(FacsimileInterface::GetAttClasses(), FacsimileInterface::IsInterface()); m_measuredMusic = measureMusic; @@ -121,6 +123,7 @@ void Measure::CloneReset() void Measure::Reset() { Object::Reset(); + FacsimileInterface::Reset(); this->ResetCoordX1(); this->ResetCoordX2(); this->ResetMeasureLog(); @@ -134,8 +137,8 @@ void Measure::Reset() this->ResetDrawingScoreDef(); m_timestampAligner.Reset(); - m_xAbs = VRV_UNSET; - m_xAbs2 = VRV_UNSET; + m_drawingFacsX1 = VRV_UNSET; + m_drawingFacsX2 = VRV_UNSET; m_drawingXRel = 0; m_cachedXRel = VRV_UNSET; @@ -147,8 +150,8 @@ void Measure::Reset() m_leftBarLine.SetForm(this->GetLeft()); if (!m_measuredMusic) { - m_xAbs = VRV_UNSET; - m_xAbs2 = VRV_UNSET; + m_drawingFacsX1 = VRV_UNSET; + m_drawingFacsX2 = VRV_UNSET; } m_drawingEnding = NULL; @@ -213,12 +216,12 @@ int Measure::GetDrawingX() const if (!this->IsMeasuredMusic()) { const System *system = vrv_cast(this->GetFirstAncestor(SYSTEM)); assert(system); - if (system->m_yAbs != VRV_UNSET) { + if (system->m_drawingFacsY != VRV_UNSET) { return (system->m_systemLeftMar); } } - if (m_xAbs != VRV_UNSET) return m_xAbs; + if (m_drawingFacsX1 != VRV_UNSET) return m_drawingFacsX1; if (m_cachedDrawingX != VRV_UNSET) return m_cachedDrawingX; @@ -353,7 +356,7 @@ int Measure::GetWidth() const if (!this->IsMeasuredMusic()) { const System *system = vrv_cast(this->GetFirstAncestor(SYSTEM)); assert(system); - if (system->m_yAbs != VRV_UNSET) { + if (system->m_drawingFacsY != VRV_UNSET) { const Page *page = vrv_cast(system->GetFirstAncestor(PAGE)); assert(page); // xAbs2 = page->m_pageWidth - system->m_systemRightMar; @@ -361,7 +364,7 @@ int Measure::GetWidth() const } } - if (m_xAbs2 != VRV_UNSET) return (m_xAbs2 - m_xAbs); + if (m_drawingFacsX2 != VRV_UNSET) return (m_drawingFacsX2 - m_drawingFacsX1); assert(m_measureAligner.GetRightAlignment()); return m_measureAligner.GetRightAlignment()->GetXRel(); diff --git a/src/miscfunctor.cpp b/src/miscfunctor.cpp index c592281c499..9c3677a2823 100644 --- a/src/miscfunctor.cpp +++ b/src/miscfunctor.cpp @@ -32,15 +32,15 @@ FunctorCode ApplyPPUFactorFunctor::VisitLayerElement(LayerElement *layerElement) { if (layerElement->IsScoreDefElement()) return FUNCTOR_SIBLINGS; - if (layerElement->m_xAbs != VRV_UNSET) layerElement->m_xAbs /= m_page->GetPPUFactor(); + if (layerElement->m_drawingFacsX != VRV_UNSET) layerElement->m_drawingFacsX /= m_page->GetPPUFactor(); return FUNCTOR_CONTINUE; } FunctorCode ApplyPPUFactorFunctor::VisitMeasure(Measure *measure) { - if (measure->m_xAbs != VRV_UNSET) measure->m_xAbs /= m_page->GetPPUFactor(); - if (measure->m_xAbs2 != VRV_UNSET) measure->m_xAbs2 /= m_page->GetPPUFactor(); + if (measure->m_drawingFacsX1 != VRV_UNSET) measure->m_drawingFacsX1 /= m_page->GetPPUFactor(); + if (measure->m_drawingFacsX2 != VRV_UNSET) measure->m_drawingFacsX2 /= m_page->GetPPUFactor(); return FUNCTOR_CONTINUE; } @@ -60,15 +60,15 @@ FunctorCode ApplyPPUFactorFunctor::VisitPage(Page *page) FunctorCode ApplyPPUFactorFunctor::VisitStaff(Staff *staff) { - if (staff->m_yAbs != VRV_UNSET) staff->m_yAbs /= m_page->GetPPUFactor(); + if (staff->m_drawingFacsY != VRV_UNSET) staff->m_drawingFacsY /= m_page->GetPPUFactor(); return FUNCTOR_CONTINUE; } FunctorCode ApplyPPUFactorFunctor::VisitSystem(System *system) { - if (system->m_xAbs != VRV_UNSET) system->m_xAbs /= m_page->GetPPUFactor(); - if (system->m_yAbs != VRV_UNSET) system->m_yAbs /= m_page->GetPPUFactor(); + if (system->m_drawingFacsX != VRV_UNSET) system->m_drawingFacsX /= m_page->GetPPUFactor(); + if (system->m_drawingFacsY != VRV_UNSET) system->m_drawingFacsY /= m_page->GetPPUFactor(); system->m_systemLeftMar *= m_page->GetPPUFactor(); system->m_systemRightMar *= m_page->GetPPUFactor(); diff --git a/src/object.cpp b/src/object.cpp index bd6a76b6c67..086e4589db2 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -1272,7 +1272,12 @@ bool Object::sortByUlx(Object *a, Object *b) if (a->Is(NC) && b->Is(NC)) { Nc *nca = dynamic_cast(a); Nc *ncb = dynamic_cast(b); - if (nca->HasLigated() && ncb->HasLigated() && (a->GetParent() == b->GetParent())) { + Zone *zonea = dynamic_cast(nca->GetFacsimileInterface()->GetZone()); + assert(zonea); + Zone *zoneb = dynamic_cast(ncb->GetFacsimileInterface()->GetZone()); + assert(zoneb); + if (nca->HasLigated() && ncb->HasLigated() && (a->GetParent() == b->GetParent()) + && (zonea->GetUlx() == zoneb->GetUlx())) { Object *parent = a->GetParent(); assert(parent); if (abs(parent->GetChildIndex(a) - parent->GetChildIndex(b)) == 1) { diff --git a/src/options.cpp b/src/options.cpp index 08aa84dad59..294837d2679 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -954,7 +954,7 @@ Options::Options() m_baseOptions.AddOption(&m_scale); m_outputTo.SetInfo("Output to", - "Select output format to: \"mei\", \"mei-pb\", \"mei-basic\", \"svg\", \"midi\", \"timemap\", " + "Select output format to: \"mei\", \"mei-pb\", \"mei-facs\", \"mei-basic\", \"svg\", \"midi\", \"timemap\", " "\"expansionmap\", \"humdrum\" or " "\"pae\""); m_outputTo.Init("svg"); diff --git a/src/pb.cpp b/src/pb.cpp index 9b7386736a8..10f68009081 100644 --- a/src/pb.cpp +++ b/src/pb.cpp @@ -29,9 +29,10 @@ namespace vrv { static const ClassRegistrar s_factory("pb", PB); -Pb::Pb() : SystemElement(PB, "pb-"), AttNNumberLike() +Pb::Pb() : SystemElement(PB, "pb-"), FacsimileInterface(), AttNNumberLike() { this->RegisterAttClass(ATT_NNUMBERLIKE); + this->RegisterInterface(FacsimileInterface::GetAttClasses(), FacsimileInterface::IsInterface()); this->Reset(); } @@ -41,6 +42,7 @@ Pb::~Pb() {} void Pb::Reset() { SystemElement::Reset(); + FacsimileInterface::Reset(); this->ResetNNumberLike(); } diff --git a/src/preparedatafunctor.cpp b/src/preparedatafunctor.cpp index e33f0daa2fd..98b7b07152e 100644 --- a/src/preparedatafunctor.cpp +++ b/src/preparedatafunctor.cpp @@ -380,12 +380,7 @@ FunctorCode PrepareFacsimileFunctor::VisitObject(Object *object) FacsimileInterface *interface = object->GetFacsimileInterface(); assert(interface); if (interface->HasFacs()) { - std::string facsID = ((interface->GetFacs().compare(0, 1, "#") == 0) ? interface->GetFacs().substr(1) - : interface->GetFacs()); - Zone *zone = m_facsimile->FindZoneByID(facsID); - if (zone != NULL) { - interface->AttachZone(zone); - } + interface->InterfacePrepareFacsimile(*this, object); } // Zoneless syl else if (object->Is(SYL)) { diff --git a/src/resetfunctor.cpp b/src/resetfunctor.cpp index 8a09f26fe80..6c53b73e881 100644 --- a/src/resetfunctor.cpp +++ b/src/resetfunctor.cpp @@ -63,10 +63,7 @@ FunctorCode ResetDataFunctor::VisitArpeg(Arpeg *arpeg) { // Call parent one too this->VisitControlElement(arpeg); - - PlistInterface *interface = arpeg->GetPlistInterface(); - assert(interface); - interface->InterfaceResetData(*this, arpeg); + arpeg->PlistInterface::InterfaceResetData(*this, arpeg); return FUNCTOR_CONTINUE; } @@ -184,6 +181,9 @@ FunctorCode ResetDataFunctor::VisitDots(Dots *dots) FunctorCode ResetDataFunctor::VisitEditorialElement(EditorialElement *editorialElement) { + // Call parent one too + this->VisitObject(editorialElement); + if (editorialElement->IsSystemMilestone()) { editorialElement->SystemMilestoneInterface::InterfaceResetData(*this); } @@ -194,7 +194,6 @@ FunctorCode ResetDataFunctor::VisitEditorialElement(EditorialElement *editorialE FunctorCode ResetDataFunctor::VisitEnding(Ending *ending) { this->VisitFloatingObject(ending); - ending->SystemMilestoneInterface::InterfaceResetData(*this); return FUNCTOR_CONTINUE; @@ -203,10 +202,7 @@ FunctorCode ResetDataFunctor::VisitEnding(Ending *ending) FunctorCode ResetDataFunctor::VisitF(F *f) { this->VisitTextElement(f); - - TimeSpanningInterface *interface = f->GetTimeSpanningInterface(); - assert(interface); - interface->InterfaceResetData(*this, f); + f->TimeSpanningInterface::InterfaceResetData(*this, f); return FUNCTOR_CONTINUE; } @@ -222,10 +218,19 @@ FunctorCode ResetDataFunctor::VisitFlag(Flag *flag) FunctorCode ResetDataFunctor::VisitFloatingObject(FloatingObject *floatingObject) { + // Call parent one too + this->VisitObject(floatingObject); + floatingObject->ResetDrawing(); floatingObject->SetDrawingGrpId(0); // Pass it to the pseudo functor of the interface + if (floatingObject->HasInterface(INTERFACE_FACSIMILE)) { + FacsimileInterface *interface = floatingObject->GetFacsimileInterface(); + assert(interface); + interface->InterfaceResetData(*this, floatingObject); + } + // else / else if because TimpeSpanningInterface::InterfaceResetData resets TimePointingInterface if (floatingObject->HasInterface(INTERFACE_TIME_SPANNING)) { TimeSpanningInterface *interface = floatingObject->GetTimeSpanningInterface(); assert(interface); @@ -265,6 +270,9 @@ FunctorCode ResetDataFunctor::VisitHairpin(Hairpin *hairpin) FunctorCode ResetDataFunctor::VisitLayer(Layer *layer) { + // Call parent one too + this->VisitObject(layer); + layer->SetCrossStaffFromAbove(false); layer->SetCrossStaffFromBelow(false); return FUNCTOR_CONTINUE; @@ -272,6 +280,10 @@ FunctorCode ResetDataFunctor::VisitLayer(Layer *layer) FunctorCode ResetDataFunctor::VisitLayerElement(LayerElement *layerElement) { + // Call parent one too + this->VisitObject(layerElement); + layerElement->FacsimileInterface::InterfaceResetData(*this, layerElement); + layerElement->SetIsInBeamSpan(false); layerElement->SetDrawingCueSize(false); layerElement->m_crossStaff = NULL; @@ -299,6 +311,10 @@ FunctorCode ResetDataFunctor::VisitLigature(Ligature *ligature) FunctorCode ResetDataFunctor::VisitMeasure(Measure *measure) { + // Call parent one too + this->VisitObject(measure); + measure->FacsimileInterface::InterfaceResetData(*this, measure); + measure->m_timestampAligner.Reset(); measure->SetDrawingEnding(NULL); return FUNCTOR_CONTINUE; @@ -327,6 +343,11 @@ FunctorCode ResetDataFunctor::VisitNote(Note *note) return FUNCTOR_CONTINUE; } +FunctorCode ResetDataFunctor::VisitObject(Object *object) +{ + return FUNCTOR_CONTINUE; +} + FunctorCode ResetDataFunctor::VisitRepeatMark(RepeatMark *repeatMark) { // Call parent one too @@ -348,6 +369,7 @@ FunctorCode ResetDataFunctor::VisitRest(Rest *rest) FunctorCode ResetDataFunctor::VisitSection(Section *section) { + // Call parent one too this->VisitFloatingObject(section); if (section->IsSystemMilestone()) { @@ -369,6 +391,10 @@ FunctorCode ResetDataFunctor::VisitSlur(Slur *slur) FunctorCode ResetDataFunctor::VisitStaff(Staff *staff) { + // Call parent one too + this->VisitObject(staff); + staff->FacsimileInterface::InterfaceResetData(*this, staff); + staff->m_timeSpanningElements.clear(); staff->ClearLedgerLines(); return FUNCTOR_CONTINUE; diff --git a/src/sb.cpp b/src/sb.cpp index 33a33c0bdf6..883f46a7e1c 100644 --- a/src/sb.cpp +++ b/src/sb.cpp @@ -29,9 +29,10 @@ namespace vrv { static const ClassRegistrar s_factory("sb", SB); -Sb::Sb() : SystemElement(SB, "sb-"), AttNNumberLike() +Sb::Sb() : SystemElement(SB, "sb-"), FacsimileInterface(), AttNNumberLike() { this->RegisterAttClass(ATT_NNUMBERLIKE); + this->RegisterInterface(FacsimileInterface::GetAttClasses(), FacsimileInterface::IsInterface()); this->Reset(); } @@ -41,6 +42,7 @@ Sb::~Sb() {} void Sb::Reset() { SystemElement::Reset(); + FacsimileInterface::Reset(); this->ResetNNumberLike(); } diff --git a/src/setscoredeffunctor.cpp b/src/setscoredeffunctor.cpp index 144bc4d3248..29f6548c8ce 100644 --- a/src/setscoredeffunctor.cpp +++ b/src/setscoredeffunctor.cpp @@ -68,11 +68,18 @@ FunctorCode ScoreDefSetCurrentPageFunctor::VisitPageEnd(Page *page) { const Object *firstSystem = page->GetFirst(SYSTEM); const Object *reference = firstSystem ? firstSystem : page; - page->m_score = m_doc->GetCorrespondingScore(reference); + page->m_score = m_doc->GetCorrespondingScore(reference, m_scores); const Object *lastSystem = page->GetLast(SYSTEM); reference = lastSystem ? lastSystem : page; - page->m_scoreEnd = m_doc->GetCorrespondingScore(reference); + page->m_scoreEnd = m_doc->GetCorrespondingScore(reference, m_scores); + + return FUNCTOR_CONTINUE; +} + +FunctorCode ScoreDefSetCurrentPageFunctor::VisitScore(Score *score) +{ + m_scores.push_back(score); return FUNCTOR_CONTINUE; } diff --git a/src/staff.cpp b/src/staff.cpp index 3d91195fea9..28b69219213 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -66,7 +66,7 @@ void Staff::Reset() this->ResetTyped(); this->ResetVisibility(); - m_yAbs = VRV_UNSET; + m_drawingFacsY = VRV_UNSET; m_drawingStaffSize = 100; m_drawingLines = 5; @@ -125,7 +125,7 @@ int Staff::GetDrawingX() const if (this->HasFacs()) { const Doc *doc = vrv_cast(this->GetFirstAncestor(DOC)); assert(doc); - if (doc->GetType() == Facs) { + if (doc->IsFacs()) { return FacsimileInterface::GetDrawingX(); } } @@ -137,12 +137,12 @@ int Staff::GetDrawingY() const if (this->HasFacs()) { const Doc *doc = vrv_cast(this->GetFirstAncestor(DOC)); assert(DOC); - if (doc->GetType() == Facs) { + if (doc->IsFacs()) { return FacsimileInterface::GetDrawingY(); } } - if (m_yAbs != VRV_UNSET) return m_yAbs; + if (m_drawingFacsY != VRV_UNSET) return m_drawingFacsY; if (!m_staffAlignment) return 0; @@ -160,7 +160,7 @@ double Staff::GetDrawingRotate() const if (this->HasFacs()) { const Doc *doc = vrv_cast(this->GetFirstAncestor(DOC)); assert(doc); - if (doc->GetType() == Facs) { + if (doc->IsFacs()) { return FacsimileInterface::GetDrawingRotate(); } } @@ -172,7 +172,7 @@ void Staff::AdjustDrawingStaffSize() if (this->HasFacs()) { Doc *doc = vrv_cast(this->GetFirstAncestor(DOC)); assert(doc); - if (doc->GetType() == Facs) { + if (doc->IsFacs()) { double rotate = this->GetDrawingRotate(); Zone *zone = this->GetZone(); assert(zone); diff --git a/src/system.cpp b/src/system.cpp index f7deae78600..2a070dba54f 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -74,9 +74,9 @@ void System::Reset() m_systemLeftMar = 0; m_systemRightMar = 0; - m_xAbs = VRV_UNSET; + m_drawingFacsX = VRV_UNSET; m_drawingXRel = 0; - m_yAbs = VRV_UNSET; + m_drawingFacsY = VRV_UNSET; m_drawingYRel = 0; m_drawingTotalWidth = 0; m_drawingJustifiableWidth = 0; @@ -111,7 +111,7 @@ bool System::IsSupportedChild(Object *child) int System::GetDrawingX() const { - if (m_xAbs != VRV_UNSET) return m_xAbs; + if (m_drawingFacsX != VRV_UNSET) return m_drawingFacsX; m_cachedDrawingX = 0; return m_drawingXRel; @@ -119,7 +119,7 @@ int System::GetDrawingX() const int System::GetDrawingY() const { - if (m_yAbs != VRV_UNSET) return m_yAbs; + if (m_drawingFacsY != VRV_UNSET) return m_drawingFacsY; m_cachedDrawingY = 0; return m_drawingYRel; diff --git a/src/toolkit.cpp b/src/toolkit.cpp index cb8fe6e8ada..4821605cf8b 100644 --- a/src/toolkit.cpp +++ b/src/toolkit.cpp @@ -152,6 +152,9 @@ bool Toolkit::SetOutputTo(std::string const &outputTo) else if (outputTo == "mei-pb") { m_outputTo = MEI; } + else if (outputTo == "mei-facs") { + m_outputTo = MEI; + } else if (outputTo == "midi") { m_outputTo = MIDI; } @@ -749,9 +752,14 @@ bool Toolkit::LoadData(const std::string &data) breaks = BREAKS_none; } - // Always set breaks to 'none' with Transcription or Facs rendering - rendering them differenty requires the MEI - // to be converted - if (m_doc.GetType() == Transcription || m_doc.GetType() == Facs) breaks = BREAKS_none; + // Always set breaks to 'none' with Facs rendering + if (m_doc.IsFacs()) breaks = BREAKS_none; + + // Always set breaks to 'none' or 'encoded' with Transcription rendering + // rendering them differenty requires the MEI + if (m_doc.IsTranscription()) { + breaks = (m_doc.HasFacsimile()) ? BREAKS_encoded : BREAKS_none; + } if (breaks != BREAKS_none) { if (input->GetLayoutInformation() == LAYOUT_ENCODED @@ -784,6 +792,10 @@ bool Toolkit::LoadData(const std::string &data) } } + if (m_doc.IsTranscription() && m_doc.HasFacsimile()) { + m_doc.SyncFromFacsimileDoc(); + } + delete input; m_view.SetDoc(&m_doc); @@ -816,6 +828,7 @@ std::string Toolkit::GetMEI(const std::string &jsonOptions) std::string firstMeasure; std::string lastMeasure; std::string mdiv; + bool generateFacs = false; jsonxx::Object json; @@ -838,6 +851,7 @@ std::string Toolkit::GetMEI(const std::string &jsonOptions) if (json.has("firstMeasure")) firstMeasure = json.get("firstMeasure"); if (json.has("lastMeasure")) lastMeasure = json.get("lastMeasure"); if (json.has("mdiv")) mdiv = json.get("mdiv"); + if (json.has("generateFacs")) generateFacs = json.get("generateFacs"); } } @@ -873,6 +887,16 @@ std::string Toolkit::GetMEI(const std::string &jsonOptions) if (!lastMeasure.empty()) meioutput.SetLastMeasure(lastMeasure); if (!mdiv.empty()) meioutput.SetMdiv(mdiv); + if (generateFacs) { + if (meioutput.HasFilter() || !scoreBased || (m_options->m_breaks.GetValue() != BREAKS_encoded) + || m_doc.HasSelection()) { + LogError("Generating facsimile is only possible with all pages, encoded breaks, score-based output and " + "without selection."); + return ""; + } + m_doc.SyncToFacsimileDoc(); + } + std::string output = meioutput.GetOutput(); if (hadSelection) m_doc.ReactivateSelection(false); @@ -1402,7 +1426,7 @@ void Toolkit::RedoLayout(const std::string &jsonOptions) this->ResetLogBuffer(); - if ((this->GetPageCount() == 0) || (m_doc.GetType() == Transcription) || (m_doc.GetType() == Facs)) { + if ((this->GetPageCount() == 0) || m_doc.IsTranscription() || m_doc.IsFacs()) { LogWarning("No data to re-layout"); return; } @@ -1465,7 +1489,7 @@ bool Toolkit::RenderToDeviceContext(int pageNo, DeviceContext *deviceContext) if (adjustWidth || (breaks == BREAKS_none)) width = m_doc.GetAdjustedDrawingPageWidth(); if (adjustHeight || (breaks == BREAKS_none)) height = m_doc.GetAdjustedDrawingPageHeight(); - if (m_doc.GetType() == Transcription) { + if (m_doc.IsTranscription()) { width = m_doc.GetAdjustedDrawingPageWidth(); height = m_doc.GetAdjustedDrawingPageHeight(); } @@ -1488,7 +1512,7 @@ bool Toolkit::RenderToDeviceContext(int pageNo, DeviceContext *deviceContext) deviceContext->SetWidth(width); deviceContext->SetHeight(height); - if (m_doc.GetType() == Facs) { + if (m_doc.IsFacs()) { deviceContext->SetWidth(m_doc.GetFacsimile()->GetMaxX()); deviceContext->SetHeight(m_doc.GetFacsimile()->GetMaxY()); } @@ -1524,7 +1548,7 @@ std::string Toolkit::RenderToSVG(int pageNo, bool xmlDeclaration) svg.SetMMOutput(true); } - if (m_doc.GetType() == Facs) { + if (m_doc.IsFacs()) { svg.SetFacsimile(true); } diff --git a/src/verticalaligner.cpp b/src/verticalaligner.cpp index 0bf5b3ed82e..60cbad6b3b7 100644 --- a/src/verticalaligner.cpp +++ b/src/verticalaligner.cpp @@ -48,7 +48,6 @@ void SystemAligner::Reset() m_spacingTypes.clear(); m_system = NULL; - ArrayOfObjects &children = this->GetChildrenForModification(); m_bottomAlignment = new StaffAlignment(); m_bottomAlignment->SetStaff(NULL, NULL, this->GetAboveSpacingType(NULL)); m_bottomAlignment->SetParentSystem(this->GetSystem()); diff --git a/src/view.cpp b/src/view.cpp index f9ee518f1eb..666db7ba544 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -74,7 +74,7 @@ void View::SetPage(int pageIdx, bool doLayout) m_doc->ScoreDefSetCurrentDoc(); // if we once deal with multiple views, it would be better // to redo the layout only when necessary? - if (m_doc->GetType() == Transcription || m_doc->GetType() == Facs) { + if (m_doc->IsTranscription() || m_doc->IsFacs()) { m_currentPage->LayOutTranscription(); } else { diff --git a/src/view_beam.cpp b/src/view_beam.cpp index 1be6bdbe31c..34d04de9f06 100644 --- a/src/view_beam.cpp +++ b/src/view_beam.cpp @@ -49,6 +49,14 @@ void View::DrawBeam(DeviceContext *dc, LayerElement *element, Layer *layer, Staf return; } + if (beam->GetFirst(FTREM)) { + // If there is a fTrem we ignore the beam and just handle its children + dc->StartGraphic(element, "", element->GetID()); + this->DrawLayerChildren(dc, beam, layer, staff, measure); + dc->EndGraphic(element, this); + return; + } + beam->m_beamSegment.InitCoordRefs(beam->GetElementCoords()); data_BEAMPLACE initialPlace = beam->GetPlace(); @@ -150,8 +158,8 @@ void View::DrawFTremSegment(DeviceContext *dc, Staff *staff, FTrem *fTrem) secondElement->m_x += (m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)) / 2; } - // Number of bars to draw - const int allBars = fTrem->GetBeams(); + // Number of beams to draw + const int allBars = fTrem->HasBeams() ? fTrem->GetBeams() : fTrem->GetUnitdur() - DURATION_4; int floatingBars = fTrem->HasBeamsFloat() ? fTrem->GetBeamsFloat() : 0; int fullBars = allBars - floatingBars; diff --git a/src/view_element.cpp b/src/view_element.cpp index c970d76b031..82ba0443207 100644 --- a/src/view_element.cpp +++ b/src/view_element.cpp @@ -301,12 +301,12 @@ void View::DrawAccid(DeviceContext *dc, LayerElement *element, Layer *layer, Sta if (notationType == NOTATIONTYPE_neume) { int rotateOffset = 0; - if ((m_doc->GetType() == Facs) && (staff->GetDrawingRotate() != 0)) { + if (m_doc->IsFacs() && (staff->GetDrawingRotate() != 0)) { double deg = staff->GetDrawingRotate(); int xDiff = x - staff->GetDrawingX(); rotateOffset = int(xDiff * tan(deg * M_PI / 180.0)); } - if (accid->HasFacs() && (m_doc->GetType() == Facs)) { + if (accid->HasFacs() && m_doc->IsFacs()) { y = ToLogicalY(y); } y -= rotateOffset; @@ -653,7 +653,7 @@ void View::DrawClef(DeviceContext *dc, LayerElement *element, Layer *layer, Staf } int x, y; - if (m_doc->GetType() == Facs && clef->HasFacs()) { + if (m_doc->IsFacs() && clef->HasFacs()) { y = ToLogicalY(staff->GetDrawingY()); x = clef->GetDrawingX(); } @@ -671,7 +671,7 @@ void View::DrawClef(DeviceContext *dc, LayerElement *element, Layer *layer, Staf if (clef->HasLine()) { y -= m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * (staff->m_drawingLines - clef->GetLine()); - if ((m_doc->GetType() == Facs) && (staff->GetDrawingRotate() != 0)) { + if (m_doc->IsFacs() && (staff->GetDrawingRotate() != 0)) { double deg = staff->GetDrawingRotate(); int xDiff = x - staff->GetDrawingX(); y -= int(xDiff * tan(deg * M_PI / 180.0)); @@ -689,7 +689,7 @@ void View::DrawClef(DeviceContext *dc, LayerElement *element, Layer *layer, Staf this->DrawSmuflCode(dc, x, y, sym, staff->m_drawingStaffSize, false); - if ((m_doc->GetType() == Facs) && element->HasFacs()) { + if (m_doc->IsFacs() && element->HasFacs()) { const int noteHeight = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_HEIGHT_TO_STAFF_SIZE_RATIO); const int noteWidth @@ -748,7 +748,7 @@ void View::DrawCustos(DeviceContext *dc, LayerElement *element, Layer *layer, St const int sym = custos->GetCustosGlyph(staff->m_drawingNotationType); int x, y; - if (custos->HasFacs() && m_doc->GetType() == Facs) { + if (custos->HasFacs() && m_doc->IsFacs()) { x = custos->GetDrawingX(); // Recalculate y from pitch to prevent visual/meaning mismatch Clef *clef = layer->GetClef(element); @@ -777,7 +777,7 @@ void View::DrawCustos(DeviceContext *dc, LayerElement *element, Layer *layer, St y -= m_doc->GetDrawingUnit(staff->m_drawingStaffSize); } - if ((m_doc->GetType() == Facs) && (staff->GetDrawingRotate() != 0)) { + if (m_doc->IsFacs() && (staff->GetDrawingRotate() != 0)) { double deg = staff->GetDrawingRotate(); int xDiff = x - staff->GetDrawingX(); y -= int(xDiff * tan(deg * M_PI / 180.0)); @@ -785,7 +785,7 @@ void View::DrawCustos(DeviceContext *dc, LayerElement *element, Layer *layer, St this->DrawSmuflCode(dc, x, y, sym, staff->m_drawingStaffSize, false, true); - if ((m_doc->GetType() == Facs) && element->HasFacs()) { + if (m_doc->IsFacs() && element->HasFacs()) { const int noteHeight = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 2); const int noteWidth = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / 1.4); @@ -1770,7 +1770,7 @@ void View::DrawSyl(DeviceContext *dc, LayerElement *element, Layer *layer, Staff TextDrawingParams params; params.m_x = syl->GetDrawingX(); params.m_y = syl->GetDrawingY(); - if (m_doc->GetType() == Facs) { + if (m_doc->IsFacs()) { params.m_width = syl->GetDrawingWidth(); params.m_height = syl->GetDrawingHeight(); } diff --git a/src/view_neume.cpp b/src/view_neume.cpp index cbdf0b8c624..eeeaed614b1 100644 --- a/src/view_neume.cpp +++ b/src/view_neume.cpp @@ -204,12 +204,12 @@ void View::DrawNc(DeviceContext *dc, LayerElement *element, Layer *layer, Staff = (int)(m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) / NOTE_WIDTH_TO_STAFF_SIZE_RATIO); int noteY, noteX; int yValue; - if (nc->HasFacs() && (m_doc->GetType() == Facs)) { + if (nc->HasFacs() && m_doc->IsFacs()) { noteY = ToLogicalY(staff->GetDrawingY()); noteX = nc->GetDrawingX(); params.at(0).xOffset = 0; } - else if (neume->HasFacs() && (m_doc->GetType() == Facs)) { + else if (neume->HasFacs() && m_doc->IsFacs()) { noteY = ToLogicalY(staff->GetDrawingY()); noteX = neume->GetDrawingX() + position * noteWidth; } @@ -229,7 +229,7 @@ void View::DrawNc(DeviceContext *dc, LayerElement *element, Layer *layer, Staff } int octaveOffset = (nc->GetOct() - clefOctave) * ((staffSize / 2) * 7); int rotateOffset; - if ((m_doc->GetType() == Facs) && (staff->GetDrawingRotate() != 0)) { + if (m_doc->IsFacs() && (staff->GetDrawingRotate() != 0)) { double deg = staff->GetDrawingRotate(); int xDiff = noteX - staff->GetDrawingX(); rotateOffset = int(xDiff * tan(deg * M_PI / 180.0)); @@ -265,7 +265,7 @@ void View::DrawNc(DeviceContext *dc, LayerElement *element, Layer *layer, Staff } // adjust facsimile values of element based on where it is rendered if necessary - if ((m_doc->GetType() == Facs) && element->HasFacs()) { + if (m_doc->IsFacs() && element->HasFacs()) { FacsimileInterface *fi = element->GetFacsimileInterface(); fi->GetZone()->SetUlx(noteX); fi->GetZone()->SetUly(ToDeviceContextY(yValue)); @@ -380,7 +380,7 @@ void View::DrawDivLine(DeviceContext *dc, LayerElement *element, Layer *layer, S } int x, y; - if ((m_doc->GetType() == Facs) && (divLine->HasFacs())) { + if (m_doc->IsFacs() && (divLine->HasFacs())) { x = divLine->GetDrawingX(); y = ToLogicalY(staff->GetDrawingY()); } @@ -393,7 +393,7 @@ void View::DrawDivLine(DeviceContext *dc, LayerElement *element, Layer *layer, S y -= (m_doc->GetDrawingUnit(staff->m_drawingStaffSize)) * 3; int rotateOffset; - if ((m_doc->GetType() == Facs) && (staff->GetDrawingRotate() != 0)) { + if (m_doc->IsFacs() && (staff->GetDrawingRotate() != 0)) { double deg = staff->GetDrawingRotate(); int xDiff = x - staff->GetDrawingX(); rotateOffset = int(xDiff * tan(deg * M_PI / 180.0)); diff --git a/src/view_page.cpp b/src/view_page.cpp index 7a49126257c..51d8b78be5c 100644 --- a/src/view_page.cpp +++ b/src/view_page.cpp @@ -1238,7 +1238,7 @@ void View::DrawStaff(DeviceContext *dc, Staff *staff, Measure *measure, System * dc->StartGraphic(staff, "", staff->GetID()); - if (m_doc->GetType() == Facs) { + if (m_doc->IsFacs()) { staff->SetFromFacsimile(m_doc); } @@ -1283,7 +1283,7 @@ void View::DrawStaffLines(DeviceContext *dc, Staff *staff, Measure *measure, Sys int j, x1, x2, y1, y2; - if (staff->HasFacs() && (m_doc->GetType() == Facs)) { + if (staff->HasFacs() && m_doc->IsFacs()) { double d = staff->GetDrawingRotate(); x1 = staff->GetDrawingX(); x2 = x1 + staff->GetWidth(); diff --git a/tools/main.cpp b/tools/main.cpp index 6f5aba3d793..c3eca7deec5 100644 --- a/tools/main.cpp +++ b/tools/main.cpp @@ -278,12 +278,12 @@ int main(int argc, char **argv) exit(1); } - if ((outformat != "svg") && (outformat != "mei") && (outformat != "mei-basic") && (outformat != "mei-pb") - && (outformat != "midi") && (outformat != "timemap") && (outformat != "expansionmap") - && (outformat != "humdrum") && (outformat != "hum") && (outformat != "pae")) { + const std::vector outformats = { "mei", "mei-basic", "mei-pb", "mei-facs", "svg", "midi", "timemap", + "expansionmap", "humdrum", "hum", "pae" }; + if (std::find(outformats.begin(), outformats.end(), outformat) == outformats.end()) { std::cerr << "Output format (" << outformat - << ") can only be 'mei', 'mei-basic', 'mei-pb', 'svg', 'midi', 'timemap', 'expansionmap', 'humdrum' " - "or 'pae'." + << ") can only be 'mei', 'mei-basic', 'mei-pb', mei-facs', 'svg', 'midi', 'timemap', 'expansionmap', " + "'humdrum', 'hum', or 'pae'." << std::endl; exit(1); } @@ -553,10 +553,12 @@ int main(int argc, char **argv) const char *scoreBased = (outformat == "mei-pb") ? "false" : "true"; const char *basic = (outformat == "mei-basic") ? "true" : "false"; const char *removeIds = (options->m_removeIds.GetValue()) ? "true" : "false"; + const char *generateFacs = (outformat == "mei-facs") ? "true" : "false"; outfile += ".mei"; if (all_pages) { std::string params - = vrv::StringFormat("{'scoreBased': %s, 'basic': %s, 'removeIds': %s}", scoreBased, basic, removeIds); + = vrv::StringFormat("{'scoreBased': %s, 'basic': %s, 'removeIds': %s, 'generateFacs': %s}", scoreBased, + basic, removeIds, generateFacs); if (std_output) { std::string output; std::cout << toolkit.GetMEI(params); @@ -570,7 +572,8 @@ int main(int argc, char **argv) } else { std::string params = vrv::StringFormat( - "{'scoreBased': %s, 'basic': %s, 'pageNo': %d, 'removeIds': %s}", scoreBased, basic, page, removeIds); + "{'scoreBased': %s, 'basic': %s, 'pageNo': %d, 'removeIds': %s, 'generateFacs': %s}", scoreBased, basic, + page, removeIds, generateFacs); if (std_output) { std::cout << toolkit.GetMEI(params); }