From 4fa276c9e20a1c5a9b329c9035fe92dffe936c90 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Wed, 27 Jun 2018 08:19:14 +0800 Subject: [PATCH] Remove g++-4.9 requirement --- .travis.yml | 71 ++++- ci/AppRun-patched-x86_64 | Bin 0 -> 14016 bytes ....dust3d.appdata.xml => dust3d.appdata.xml} | 2 +- ci/{org.dust3d.desktop => dust3d.desktop} | 1 + ci/exec-x86_64.so | Bin 0 -> 8712 bytes ci/upload-github-release-asset.sh | 2 +- src/ccdikresolver.cpp | 2 +- src/skeletondocumentwindow.cpp | 261 +++++++++--------- thirdparty/json/json.hpp | 2 +- 9 files changed, 191 insertions(+), 150 deletions(-) create mode 100644 ci/AppRun-patched-x86_64 rename ci/{org.dust3d.appdata.xml => dust3d.appdata.xml} (96%) rename ci/{org.dust3d.desktop => dust3d.desktop} (90%) create mode 100644 ci/exec-x86_64.so diff --git a/.travis.yml b/.travis.yml index cca2f3f4..d0ca4015 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,21 +16,26 @@ matrix: apt: sources: - ubuntu-toolchain-r-test - packages: - - gcc-4.9 - - g++-4.9 - os: osx compiler: clang osx_image: xcode8 install: + # (Mac) Install CGAL - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew reinstall cgal; fi + + # (Linux) Prepare build environment - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:beineri/opt-qt591-trusty; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gcc-4.9 g++-4.9; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libcgal-dev; fi + #- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gcc-4.9 g++-4.9; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install cmake; fi + + # (Linux) Install CGAL + # (Linux) First install a maybe old version CGAL to resolve dependencies + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libcgal-dev; fi + + # (Linux) Build from source - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.11.1/CGAL-4.11.1.zip; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unzip CGAL-4.11.1.zip; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd CGAL-4.11.1; fi @@ -40,15 +45,22 @@ install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo make install; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ../../; fi + + # (Mac) Install Qt5 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew reinstall qt5; fi + + # (Linux) Install Qt5 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install qt59base qt59tools --force-yes; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source /opt/qt59/bin/qt59-env.sh; fi + + # Install Rust - wget -O installrust.sh https://sh.rustup.rs - sh installrust.sh -y - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="$HOME/.cargo/bin:/usr/local/opt/qt/bin:$(brew --prefix)/bin:$PATH"; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH="~/.cargo/bin:$PATH"; fi script: + # Build Meshlite - git clone https://github.com/huxingyi/meshlite.git || travis_terminate 1 - cd meshlite - cargo build --release @@ -56,22 +68,51 @@ script: - cp meshlite/include/meshlite.h thirdparty/meshlite/meshlite.h || travis_terminate 1 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp meshlite/target/release/libmeshlite.dylib thirdparty/meshlite/libmeshlite.dylib || travis_terminate 1; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp meshlite/target/release/libmeshlite.so thirdparty/meshlite/libmeshlite.so || travis_terminate 1; fi + + # Build Dust3D - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then qmake -config release || travis_terminate 1; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then qmake -config release || travis_terminate 1; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make CXX="g++-4.9 -fext-numeric-literals" || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make CXX="g++ -fext-numeric-literals" || travis_terminate 1; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/thirdparty/meshlite || travis_terminate 1; fi + + # (Mac) Prepare dmg - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mv dust3d.app dust3d_unstable.app || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p dust3d_unstable/usr/share/metainfo || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir dust3d_unstable/usr/share/applications || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv ./dust3d dust3d_unstable/dust3d_unstable || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv ./ci/icon.png dust3d_unstable/icon.png || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv ./ci/org.dust3d.appdata.xml dust3d_unstable/usr/share/metainfo/org.dust3d.appdata.xml || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/org.dust3d.desktop dust3d_unstable/usr/share/applications/org.dust3d.desktop || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/org.dust3d.desktop dust3d_unstable/org.dust3d.desktop || travis_terminate 1; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then macdeployqt dust3d_unstable.app -dmg || travis_terminate 1; fi + + # (Linux) Prepare AppImage + # References: + # https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html + # https://packages.ubuntu.com/search?suite=trusty&arch=amd64&mode=exactfilename&searchon=contents&keywords=libstdc%2B%2B.so.6 + # https://github.com/darealshinji/AppImageKit-checkrt/issues/1 + # https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/AppRun-patched-x86_64 + # https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so + # https://github.com/probonopd/audacity/blob/AppImage/.travis.yml + # https://discourse.appimage.org/t/im-a-big-fan-of-this-but-graphics-driver-libstdc-conflict/171 + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/share/metainfo || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/share/applications || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/bin || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p appdir/usr/optional/libstdc++ || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ldd --version; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo ls /usr/lib/x86_64-linux-gnu/ | grep libstdc; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 appdir/usr/optional/libstdc++/libstdc++.so.6 || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/exec-x86_64.so appdir/usr/optional/exec.so || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/icon.png appdir/icon.png || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/dust3d.appdata.xml appdir/usr/share/metainfo/dust3d.appdata.xml || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./dust3d appdir/usr/bin/dust3d || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/dust3d.desktop appdir/usr/share/applications/dust3d.desktop || travis_terminate 1; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x ./ci/linuxdeployqt.AppImage || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/linuxdeployqt.AppImage dust3d_unstable/dust3d_unstable -appimage -bundle-non-qt-libs -verbose=2 || travis_terminate 1; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mv ./Dust3D-x86_64.AppImage ./dust3d_unstable-x86_64.AppImage || travis_terminate 1;fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unset QTDIR; unset QT_PLUGIN_PATH ; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/thirdparty/meshlite; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/linuxdeployqt.AppImage appdir/usr/share/applications/dust3d.desktop -bundle-non-qt-libs -verbose=2 || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then rm appdir/AppRun || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cp ./ci/AppRun-patched-x86_64 appdir/AppRun || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod a+x appdir/AppRun || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ci/linuxdeployqt.AppImage --appimage-extract || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$(readlink -f ./squashfs-root/usr/bin):$PATH || travis_terminate 1; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./squashfs-root/usr/bin/appimagetool -g ./appdir/ dust3d_unstable-x86_64.AppImage || travis_terminate 1; fi + + # Distribute + - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then echo "No distribution on pull request"; fi + - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then travis_terminate 0; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sh ci/upload-github-release-asset.sh github_api_token=${my_auth_token} branch=$TRAVIS_BRANCH owner=huxingyi repo=dust3d tag=unstable filename=dust3d_unstable.dmg; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash ci/upload-github-release-asset.sh github_api_token=${my_auth_token} branch=$TRAVIS_BRANCH owner=huxingyi repo=dust3d tag=unstable filename=dust3d_unstable-x86_64.AppImage; fi diff --git a/ci/AppRun-patched-x86_64 b/ci/AppRun-patched-x86_64 new file mode 100644 index 0000000000000000000000000000000000000000..46a9756942a43f52d0a24ac405d7b5a07f3371bd GIT binary patch literal 14016 zcmcIr4|G)3nSYZ%nnv{?Hbb-T3dDx@_T2qfU?T6DXWT90K>*EfVeQCgt5lKp-6-8=IV zGP~{BvzL?i-S4~Kzx&-&&0du&TOu#IvXK+G>Rj+V3Q^#OKFTz8DWG_{$ysE>)^K?`| zNs<|XUvkh8+3%mlok?S&Mh`qJ?EGjioK# zw(z#nZIz2k7cH~|eU|ym|3WCFF0QCq$5e}WOa?}_r{Ir5M(rJEXP)dXe$TSwXSZJc z;Ojf*t*-m~hlqa;{zUv)g^xPX7k?TRLk#TNvK=I{HNMn?FcJO3H1uO>=r_Z$iS#^~ zhM)Q&<8OTV1qc)Axg`z#2WjZVY3P}0{QP|y{@c>CJp_AH1w)8^jAQ?QTn3PW2r|? z!g|b$%eAG|*X9a_8Ui7gOTzSa(`;TOdA4~&QqUjpwuPFcCZFHaCIv%*fV(+Bu+8n? zF8KvDX-aFFZ$sD zy~W!qH9Z>ehCC9fA{$M-4`|1l<&hfPZci{s4nm7B0OQnY9)Z>dFZ$Ugx*hO%q!mub zvg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+94~IYG@TVO1arh>O?{j#L!>b(TPvZ7Dv~YM2hcz5- z;;@awT^#P=@P{1!l*2v_-{kOp4$pB&oyH=*L@vP%?;+uMTMTXh%;=q+14fgoLRWNaL9p$&Up0}1e&za>N_am&&Y@@&Ji2?*MJ zjSZm&$>M2tH3e|McQrRcR$!8a-gkm9sDnq`XoSv&R<9cdeNcmkh3VGyY{p$ji`&=Q ziamp+#Q*6*^OJHvIqx#8z)(1Wee~BU>?!7nAl-xt%|RhQGs6ljb?;qfSn83Ls%72fE&<8 zYns68`MOol<*g))GTwikDoKx^LNOKcVjb<~@?sqo_Q&_1QqU+b*5%_|UM%n=PkYUH z`CXtIApr&nU0uT8S)aT)t3rj8RkaV*l#^-6${RS#?gn z5tfJzh|3E(j!NG`#V9ZK&63$VN4{X>kYZ&lT|h`)xLG;d%9<;={C*KIMoqKVKEe>UUe zHD3O;aq@KYjmn963?%PO>)5sZ??Z#pK3#jGqH+20_QvA_;HBIX{)>HB{C^+u|9V7z z3VG45UqRMrU)6d=#CKz+es!=-s1Mp8HuP1 HIYIt!nf+Sr literal 0 HcmV?d00001 diff --git a/ci/org.dust3d.appdata.xml b/ci/dust3d.appdata.xml similarity index 96% rename from ci/org.dust3d.appdata.xml rename to ci/dust3d.appdata.xml index 072810a8..9c704e40 100644 --- a/ci/org.dust3d.appdata.xml +++ b/ci/dust3d.appdata.xml @@ -1,6 +1,6 @@ -​ org.dust3d.desktop +​ dust3d.desktopFSFAPMITDust3D diff --git a/ci/org.dust3d.desktop b/ci/dust3d.desktop similarity index 90% rename from ci/org.dust3d.desktop rename to ci/dust3d.desktop index 3bb100bc..f85028ab 100644 --- a/ci/org.dust3d.desktop +++ b/ci/dust3d.desktop @@ -2,5 +2,6 @@ Type=Application Name=Dust3D Icon=icon +Exec=dust3d Categories=Graphics; Comment=A quick 3D modeling tool diff --git a/ci/exec-x86_64.so b/ci/exec-x86_64.so new file mode 100644 index 0000000000000000000000000000000000000000..44ba29c152343bfe339b9db012f1fac7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8MiTAojlp{g zZQ@@*I>JRKY*T%G*p{aq&;J#qw9=I4c}r_76{fU)y2}hVgZfo?u-vEEp5JGt9ZDa+ z=49dbO0l926^eoF`F&@)Ng0w~(qVgk59@)E3fuGg!IakvsK`?K{xt!mcbDz?ePyaE zJC2|An6^VsYXS4T9xz?5>`UWUu;@aCWrXqi!<5$__FvlnjV1QHo-yV1kL>9cE4A+d zMmgd2mcQ3Au{0nMHBVo_&^o zb?M6cjCV@Ysjz>B??Q#_8x>$Hd!}`qcqQljakoCF?0Ni4zxUEU?k=VNhajZ3*nX3` z)Mc7rN2(F_&u!9oI8xy-`8zm&ALl%?eyRO8O6 0 && abs(distance2 - lastDistance2) <= m_distanceCeaseThreshold2) + if (lastDistance2 > 0 && fabs(distance2 - lastDistance2) <= m_distanceCeaseThreshold2) break; lastDistance2 = distance2; iterate(); diff --git a/src/skeletondocumentwindow.cpp b/src/skeletondocumentwindow.cpp index dec265d4..d3dc446f 100644 --- a/src/skeletondocumentwindow.cpp +++ b/src/skeletondocumentwindow.cpp @@ -36,7 +36,7 @@ int SkeletonDocumentWindow::m_skeletonRenderWidgetInitialX = SkeletonDocumentWin int SkeletonDocumentWindow::m_skeletonRenderWidgetInitialY = SkeletonDocumentWindow::m_modelRenderWidgetInitialY; int SkeletonDocumentWindow::m_skeletonRenderWidgetInitialSize = SkeletonDocumentWindow::m_modelRenderWidgetInitialSize; -QPointer g_logBrowser; +LogBrowser *g_logBrowser = nullptr; std::set g_documentWindows; QTextBrowser *g_acknowlegementsWidget = nullptr; AboutWidget *g_aboutWidget = nullptr; @@ -84,45 +84,45 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : g_logBrowser = new LogBrowser; qInstallMessageHandler(&outputMessage); } - + g_documentWindows.insert(this); - + m_document = new SkeletonDocument; - + QVBoxLayout *toolButtonLayout = new QVBoxLayout; toolButtonLayout->setSpacing(0); toolButtonLayout->setContentsMargins(5, 10, 4, 0); - + QPushButton *undoButton = new QPushButton(QChar(fa::undo)); initAwesomeButton(undoButton); - + QPushButton *addButton = new QPushButton(QChar(fa::plus)); initAwesomeButton(addButton); - + QPushButton *selectButton = new QPushButton(QChar(fa::mousepointer)); initAwesomeButton(selectButton); - + QPushButton *dragButton = new QPushButton(QChar(fa::handrocko)); initAwesomeButton(dragButton); - + QPushButton *zoomInButton = new QPushButton(QChar(fa::searchplus)); initAwesomeButton(zoomInButton); - + QPushButton *zoomOutButton = new QPushButton(QChar(fa::searchminus)); initAwesomeButton(zoomOutButton); - + m_xlockButton = new QPushButton(QChar('X')); initLockButton(m_xlockButton); updateXlockButtonState(); - + m_ylockButton = new QPushButton(QChar('Y')); initLockButton(m_ylockButton); updateYlockButtonState(); - + m_zlockButton = new QPushButton(QChar('Z')); initLockButton(m_zlockButton); updateZlockButtonState(); - + toolButtonLayout->addWidget(undoButton); toolButtonLayout->addSpacing(10); toolButtonLayout->addWidget(addButton); @@ -134,16 +134,16 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : toolButtonLayout->addWidget(m_xlockButton); toolButtonLayout->addWidget(m_ylockButton); toolButtonLayout->addWidget(m_zlockButton); - + QLabel *verticalLogoLabel = new QLabel; QImage verticalLogoImage; verticalLogoImage.load(":/resources/dust3d_vertical.png"); verticalLogoLabel->setPixmap(QPixmap::fromImage(verticalLogoImage)); - + QHBoxLayout *logoLayout = new QHBoxLayout; logoLayout->addWidget(verticalLogoLabel); logoLayout->setContentsMargins(0, 0, 0, 0); - + QVBoxLayout *mainLeftLayout = new QVBoxLayout; mainLeftLayout->setSpacing(0); mainLeftLayout->setContentsMargins(0, 0, 0, 0); @@ -151,10 +151,10 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : mainLeftLayout->addStretch(); mainLeftLayout->addLayout(logoLayout); mainLeftLayout->addSpacing(10); - + SkeletonGraphicsWidget *graphicsWidget = new SkeletonGraphicsWidget(m_document); m_graphicsWidget = graphicsWidget; - + SkeletonGraphicsContainerWidget *containerWidget = new SkeletonGraphicsContainerWidget; containerWidget->setGraphicsWidget(graphicsWidget); QGridLayout *containerLayout = new QGridLayout; @@ -163,38 +163,38 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : containerLayout->addWidget(graphicsWidget); containerWidget->setLayout(containerLayout); containerWidget->setMinimumSize(400, 400); - + m_modelRenderWidget = new ModelWidget(containerWidget); m_modelRenderWidget->setMinimumSize(SkeletonDocumentWindow::m_modelRenderWidgetInitialSize, SkeletonDocumentWindow::m_modelRenderWidgetInitialSize); m_modelRenderWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); m_modelRenderWidget->move(SkeletonDocumentWindow::m_modelRenderWidgetInitialX, SkeletonDocumentWindow::m_modelRenderWidgetInitialY); m_modelRenderWidget->setGraphicsFunctions(graphicsWidget); - + //m_skeletonRenderWidget = new ModelWidget(containerWidget); //m_skeletonRenderWidget->setMinimumSize(SkeletonDocumentWindow::m_skeletonRenderWidgetInitialSize, SkeletonDocumentWindow::m_skeletonRenderWidgetInitialSize); //m_skeletonRenderWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); //m_skeletonRenderWidget->move(SkeletonDocumentWindow::m_skeletonRenderWidgetInitialX, SkeletonDocumentWindow::m_skeletonRenderWidgetInitialY); //m_skeletonRenderWidget->setGraphicsFunctions(graphicsWidget); //m_skeletonRenderWidget->hide(); - + QDockWidget *partListDocker = new QDockWidget(QString(), this); partListDocker->setAllowedAreas(Qt::RightDockWidgetArea); - + SkeletonPartListWidget *partListWidget = new SkeletonPartListWidget(m_document, partListDocker); //partListWidget->setWindowFlags(Qt::Tool); //partListWidget->move(100, 200); //partListWidget->show(); - + partListDocker->setWidget(partListWidget); addDockWidget(Qt::RightDockWidgetArea, partListDocker); - + partListDocker->hide(); - + //QVBoxLayout *mainRightLayout = new QVBoxLayout; //mainRightLayout->setSpacing(0); //mainRightLayout->setContentsMargins(0, 0, 0, 0); //mainRightLayout->addWidget(partListWidget); - + QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->setSpacing(0); mainLayout->setContentsMargins(0, 0, 0, 0); @@ -202,164 +202,164 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : mainLayout->addWidget(containerWidget); mainLayout->addSpacing(3); //mainLayout->addLayout(mainRightLayout); - + QWidget *centralWidget = new QWidget; centralWidget->setLayout(mainLayout); - + setCentralWidget(centralWidget); setWindowTitle(tr("Dust3D")); - + m_fileMenu = menuBar()->addMenu(tr("File")); - + m_newWindowAction = new QAction(tr("New Window"), this); connect(m_newWindowAction, &QAction::triggered, this, &SkeletonDocumentWindow::newWindow, Qt::QueuedConnection); m_fileMenu->addAction(m_newWindowAction); - + m_newDocumentAction = new QAction(tr("New"), this); connect(m_newDocumentAction, &QAction::triggered, this, &SkeletonDocumentWindow::newDocument); m_fileMenu->addAction(m_newDocumentAction); - + m_openAction = new QAction(tr("Open..."), this); connect(m_openAction, &QAction::triggered, this, &SkeletonDocumentWindow::open, Qt::QueuedConnection); m_fileMenu->addAction(m_openAction); - + m_saveAction = new QAction(tr("Save"), this); connect(m_saveAction, &QAction::triggered, this, &SkeletonDocumentWindow::save, Qt::QueuedConnection); m_fileMenu->addAction(m_saveAction); - + m_saveAsAction = new QAction(tr("Save As..."), this); connect(m_saveAsAction, &QAction::triggered, this, &SkeletonDocumentWindow::saveAs, Qt::QueuedConnection); m_fileMenu->addAction(m_saveAsAction); - + m_saveAllAction = new QAction(tr("Save All"), this); connect(m_saveAllAction, &QAction::triggered, this, &SkeletonDocumentWindow::saveAll, Qt::QueuedConnection); m_fileMenu->addAction(m_saveAllAction); - + m_fileMenu->addSeparator(); - + m_exportMenu = m_fileMenu->addMenu(tr("Export")); - + m_exportModelAction = new QAction(tr("Wavefront (.obj)..."), this); connect(m_exportModelAction, &QAction::triggered, this, &SkeletonDocumentWindow::exportModelResult, Qt::QueuedConnection); m_exportMenu->addAction(m_exportModelAction); - + m_exportSkeletonAction = new QAction(tr("GL Transmission Format (.gltf)..."), this); connect(m_exportSkeletonAction, &QAction::triggered, this, &SkeletonDocumentWindow::showExportPreview, Qt::QueuedConnection); m_exportMenu->addAction(m_exportSkeletonAction); - + m_changeTurnaroundAction = new QAction(tr("Change Turnaround..."), this); connect(m_changeTurnaroundAction, &QAction::triggered, this, &SkeletonDocumentWindow::changeTurnaround, Qt::QueuedConnection); m_fileMenu->addAction(m_changeTurnaroundAction); - + connect(m_fileMenu, &QMenu::aboutToShow, [=]() { m_exportModelAction->setEnabled(m_graphicsWidget->hasItems()); m_exportSkeletonAction->setEnabled(m_graphicsWidget->hasItems()); }); - + m_editMenu = menuBar()->addMenu(tr("Edit")); - + m_addAction = new QAction(tr("Add..."), this); connect(m_addAction, &QAction::triggered, [=]() { m_document->setEditMode(SkeletonDocumentEditMode::Add); }); m_editMenu->addAction(m_addAction); - + m_undoAction = new QAction(tr("Undo"), this); connect(m_undoAction, &QAction::triggered, m_document, &SkeletonDocument::undo); m_editMenu->addAction(m_undoAction); - + m_redoAction = new QAction(tr("Redo"), this); connect(m_redoAction, &QAction::triggered, m_document, &SkeletonDocument::redo); m_editMenu->addAction(m_redoAction); - + m_deleteAction = new QAction(tr("Delete"), this); connect(m_deleteAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::deleteSelected); m_editMenu->addAction(m_deleteAction); - + m_breakAction = new QAction(tr("Break"), this); connect(m_breakAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::breakSelected); m_editMenu->addAction(m_breakAction); - + m_connectAction = new QAction(tr("Connect"), this); connect(m_connectAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::connectSelected); m_editMenu->addAction(m_connectAction); - + m_cutAction = new QAction(tr("Cut"), this); connect(m_cutAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::cut); m_editMenu->addAction(m_cutAction); - + m_copyAction = new QAction(tr("Copy"), this); connect(m_copyAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::copy); m_editMenu->addAction(m_copyAction); - + m_pasteAction = new QAction(tr("Paste"), this); connect(m_pasteAction, &QAction::triggered, m_document, &SkeletonDocument::paste); m_editMenu->addAction(m_pasteAction); - + m_flipHorizontallyAction = new QAction(tr("H Flip"), this); connect(m_flipHorizontallyAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::flipHorizontally); m_editMenu->addAction(m_flipHorizontallyAction); - + m_flipVerticallyAction = new QAction(tr("V Flip"), this); connect(m_flipVerticallyAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::flipVertically); m_editMenu->addAction(m_flipVerticallyAction); - + m_rotateClockwiseAction = new QAction(tr("Rotate 90D CW"), this); connect(m_rotateClockwiseAction, &QAction::triggered, [=] { m_graphicsWidget->rotateClockwise90Degree(); }); m_editMenu->addAction(m_rotateClockwiseAction); - + m_rotateCounterclockwiseAction = new QAction(tr("Rotate 90D CCW"), this); connect(m_rotateCounterclockwiseAction, &QAction::triggered, [=] { m_graphicsWidget->rotateCounterclockwise90Degree(); }); m_editMenu->addAction(m_rotateCounterclockwiseAction); - + m_switchXzAction = new QAction(tr("Switch XZ"), this); connect(m_switchXzAction, &QAction::triggered, [=] { m_graphicsWidget->switchSelectedXZ(); }); m_editMenu->addAction(m_switchXzAction); - + m_alignToMenu = new QMenu(tr("Align To")); - + m_alignToGlobalCenterAction = new QAction(tr("Global Center"), this); connect(m_alignToGlobalCenterAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::alignSelectedToGlobalCenter); m_alignToMenu->addAction(m_alignToGlobalCenterAction); - + m_alignToGlobalVerticalCenterAction = new QAction(tr("Global Vertical Center"), this); connect(m_alignToGlobalVerticalCenterAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::alignSelectedToGlobalVerticalCenter); m_alignToMenu->addAction(m_alignToGlobalVerticalCenterAction); - + m_alignToGlobalHorizontalCenterAction = new QAction(tr("Global Horizontal Center"), this); connect(m_alignToGlobalHorizontalCenterAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::alignSelectedToGlobalHorizontalCenter); m_alignToMenu->addAction(m_alignToGlobalHorizontalCenterAction); - + m_alignToLocalCenterAction = new QAction(tr("Local Center"), this); connect(m_alignToLocalCenterAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::alignSelectedToLocalCenter); m_alignToMenu->addAction(m_alignToLocalCenterAction); - + m_alignToLocalVerticalCenterAction = new QAction(tr("Local Vertical Center"), this); connect(m_alignToLocalVerticalCenterAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::alignSelectedToLocalVerticalCenter); m_alignToMenu->addAction(m_alignToLocalVerticalCenterAction); - + m_alignToLocalHorizontalCenterAction = new QAction(tr("Local Horizontal Center"), this); connect(m_alignToLocalHorizontalCenterAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::alignSelectedToLocalHorizontalCenter); m_alignToMenu->addAction(m_alignToLocalHorizontalCenterAction); - + m_editMenu->addMenu(m_alignToMenu); - + m_markAsMenu = new QMenu(tr("Mark As")); - + m_markAsNoneAction = new QAction(tr("None"), this); connect(m_markAsNoneAction, &QAction::triggered, [=]() { m_graphicsWidget->setSelectedNodesBoneMark(SkeletonBoneMark::None); }); m_markAsMenu->addAction(m_markAsNoneAction); - + m_markAsMenu->addSeparator(); - + for (int i = 0; i < SKELETON_BONE_MARK_TYPE_NUM; i++) { SkeletonBoneMark boneMark = (SkeletonBoneMark)(i + 1); m_markAsActions[i] = new QAction(MarkIconCreator::createIcon(boneMark), SkeletonBoneMarkToDispName(boneMark), this); @@ -368,21 +368,21 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : }); m_markAsMenu->addAction(m_markAsActions[i]); } - + m_editMenu->addMenu(m_markAsMenu); - + m_selectAllAction = new QAction(tr("Select All"), this); connect(m_selectAllAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::selectAll); m_editMenu->addAction(m_selectAllAction); - + m_selectPartAllAction = new QAction(tr("Select Part"), this); connect(m_selectPartAllAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::selectPartAll); m_editMenu->addAction(m_selectPartAllAction); - + m_unselectAllAction = new QAction(tr("Unselect All"), this); connect(m_unselectAllAction, &QAction::triggered, m_graphicsWidget, &SkeletonGraphicsWidget::unselectAll); m_editMenu->addAction(m_unselectAllAction); - + connect(m_editMenu, &QMenu::aboutToShow, [=]() { m_undoAction->setEnabled(m_document->undoable()); m_redoAction->setEnabled(m_document->redoable()); @@ -409,14 +409,14 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : m_selectPartAllAction->setEnabled(m_graphicsWidget->hasItems()); m_unselectAllAction->setEnabled(m_graphicsWidget->hasSelection()); }); - + m_viewMenu = menuBar()->addMenu(tr("View")); - + auto modelIsSitInVisibleArea = [](ModelWidget *modelWidget) { QRect parentRect = QRect(QPoint(0, 0), modelWidget->parentWidget()->size()); return parentRect.contains(modelWidget->geometry().center()); }; - + m_resetModelWidgetPosAction = new QAction(tr("Show Model"), this); connect(m_resetModelWidgetPosAction, &QAction::triggered, [=]() { if (!modelIsSitInVisibleArea(m_modelRenderWidget)) { @@ -424,95 +424,95 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : } }); m_viewMenu->addAction(m_resetModelWidgetPosAction); - + m_toggleWireframeAction = new QAction(tr("Toggle Wireframe"), this); connect(m_toggleWireframeAction, &QAction::triggered, [=]() { m_modelRenderWidget->toggleWireframe(); }); m_viewMenu->addAction(m_toggleWireframeAction); - + m_viewMenu->addSeparator(); - + m_showPartsListAction = new QAction(tr("Show Parts List"), this); connect(m_showPartsListAction, &QAction::triggered, [=]() { partListDocker->show(); }); m_viewMenu->addAction(m_showPartsListAction); - + m_viewMenu->addSeparator(); - + m_showAnimationPanelAction = new QAction(tr("Show Animation Panel"), this); connect(m_showAnimationPanelAction, &QAction::triggered, this, &SkeletonDocumentWindow::showAnimationPanel); m_viewMenu->addAction(m_showAnimationPanelAction); - + m_viewMenu->addSeparator(); - + m_showDebugDialogAction = new QAction(tr("Show Debug Dialog"), this); connect(m_showDebugDialogAction, &QAction::triggered, g_logBrowser, &LogBrowser::showDialog); m_viewMenu->addAction(m_showDebugDialogAction); - + connect(m_viewMenu, &QMenu::aboutToShow, [=]() { m_showPartsListAction->setEnabled(partListDocker->isHidden()); m_showAnimationPanelAction->setEnabled(nullptr == m_animationPanelWidget || m_animationPanelWidget->isHidden()); m_resetModelWidgetPosAction->setEnabled(!modelIsSitInVisibleArea(m_modelRenderWidget)); }); - + m_helpMenu = menuBar()->addMenu(tr("Help")); - + m_viewSourceAction = new QAction(tr("Fork me on GitHub"), this); connect(m_viewSourceAction, &QAction::triggered, this, &SkeletonDocumentWindow::viewSource); m_helpMenu->addAction(m_viewSourceAction); - + m_helpMenu->addSeparator(); - + m_seeReferenceGuideAction = new QAction(tr("Reference Guide"), this); connect(m_seeReferenceGuideAction, &QAction::triggered, this, &SkeletonDocumentWindow::seeReferenceGuide); m_helpMenu->addAction(m_seeReferenceGuideAction); - + m_helpMenu->addSeparator(); - + m_aboutAction = new QAction(tr("About"), this); connect(m_aboutAction, &QAction::triggered, this, &SkeletonDocumentWindow::about); m_helpMenu->addAction(m_aboutAction); - + m_reportIssuesAction = new QAction(tr("Report Issues"), this); connect(m_reportIssuesAction, &QAction::triggered, this, &SkeletonDocumentWindow::reportIssues); m_helpMenu->addAction(m_reportIssuesAction); - + m_seeAcknowlegementsAction = new QAction(tr("Acknowlegements"), this); connect(m_seeAcknowlegementsAction, &QAction::triggered, this, &SkeletonDocumentWindow::seeAcknowlegements); m_helpMenu->addAction(m_seeAcknowlegementsAction); - + connect(containerWidget, &SkeletonGraphicsContainerWidget::containerSizeChanged, graphicsWidget, &SkeletonGraphicsWidget::canvasResized); - + connect(m_document, &SkeletonDocument::turnaroundChanged, graphicsWidget, &SkeletonGraphicsWidget::turnaroundChanged); - + connect(undoButton, &QPushButton::clicked, [=]() { m_document->undo(); }); - + connect(addButton, &QPushButton::clicked, [=]() { m_document->setEditMode(SkeletonDocumentEditMode::Add); }); - + connect(selectButton, &QPushButton::clicked, [=]() { m_document->setEditMode(SkeletonDocumentEditMode::Select); }); - + connect(dragButton, &QPushButton::clicked, [=]() { m_document->setEditMode(SkeletonDocumentEditMode::Drag); }); - + connect(zoomInButton, &QPushButton::clicked, [=]() { m_document->setEditMode(SkeletonDocumentEditMode::ZoomIn); }); - + connect(zoomOutButton, &QPushButton::clicked, [=]() { m_document->setEditMode(SkeletonDocumentEditMode::ZoomOut); }); - + connect(m_xlockButton, &QPushButton::clicked, [=]() { m_document->setXlockState(!m_document->xlocked); }); @@ -522,7 +522,7 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : connect(m_zlockButton, &QPushButton::clicked, [=]() { m_document->setZlockState(!m_document->zlocked); }); - + m_partListDockerVisibleSwitchConnection = connect(m_document, &SkeletonDocument::skeletonChanged, [=]() { if (m_graphicsWidget->hasItems()) { if (partListDocker->isHidden()) @@ -530,11 +530,11 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : disconnect(m_partListDockerVisibleSwitchConnection); } }); - + connect(m_document, &SkeletonDocument::editModeChanged, graphicsWidget, &SkeletonGraphicsWidget::editModeChanged); - + connect(graphicsWidget, &SkeletonGraphicsWidget::zoomRenderedModelBy, m_modelRenderWidget, &ModelWidget::zoom); - + connect(graphicsWidget, &SkeletonGraphicsWidget::addNode, m_document, &SkeletonDocument::addNode); connect(graphicsWidget, &SkeletonGraphicsWidget::scaleNodeByAddRadius, m_document, &SkeletonDocument::scaleNodeByAddRadius); connect(graphicsWidget, &SkeletonGraphicsWidget::moveNodeBy, m_document, &SkeletonDocument::moveNodeBy); @@ -555,22 +555,22 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : connect(graphicsWidget, &SkeletonGraphicsWidget::partChecked, m_document, &SkeletonDocument::partChecked); connect(graphicsWidget, &SkeletonGraphicsWidget::partUnchecked, m_document, &SkeletonDocument::partUnchecked); connect(graphicsWidget, &SkeletonGraphicsWidget::switchNodeXZ, m_document, &SkeletonDocument::switchNodeXZ); - + connect(graphicsWidget, &SkeletonGraphicsWidget::setPartLockState, m_document, &SkeletonDocument::setPartLockState); connect(graphicsWidget, &SkeletonGraphicsWidget::setPartVisibleState, m_document, &SkeletonDocument::setPartVisibleState); connect(graphicsWidget, &SkeletonGraphicsWidget::setPartSubdivState, m_document, &SkeletonDocument::setPartSubdivState); connect(graphicsWidget, &SkeletonGraphicsWidget::setPartDisableState, m_document, &SkeletonDocument::setPartDisableState); connect(graphicsWidget, &SkeletonGraphicsWidget::setPartXmirrorState, m_document, &SkeletonDocument::setPartXmirrorState); connect(graphicsWidget, &SkeletonGraphicsWidget::setPartRoundState, m_document, &SkeletonDocument::setPartRoundState); - + connect(graphicsWidget, &SkeletonGraphicsWidget::setXlockState, m_document, &SkeletonDocument::setXlockState); connect(graphicsWidget, &SkeletonGraphicsWidget::setYlockState, m_document, &SkeletonDocument::setYlockState); connect(graphicsWidget, &SkeletonGraphicsWidget::setZlockState, m_document, &SkeletonDocument::setZlockState); - + connect(graphicsWidget, &SkeletonGraphicsWidget::changeTurnaround, this, &SkeletonDocumentWindow::changeTurnaround); connect(graphicsWidget, &SkeletonGraphicsWidget::save, this, &SkeletonDocumentWindow::save); connect(graphicsWidget, &SkeletonGraphicsWidget::open, this, &SkeletonDocumentWindow::open); - + connect(m_document, &SkeletonDocument::nodeAdded, graphicsWidget, &SkeletonGraphicsWidget::nodeAdded); connect(m_document, &SkeletonDocument::nodeRemoved, graphicsWidget, &SkeletonGraphicsWidget::nodeRemoved); connect(m_document, &SkeletonDocument::edgeAdded, graphicsWidget, &SkeletonGraphicsWidget::edgeAdded); @@ -588,7 +588,7 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : connect(m_document, &SkeletonDocument::uncheckAll, graphicsWidget, &SkeletonGraphicsWidget::unselectAll); connect(m_document, &SkeletonDocument::checkNode, graphicsWidget, &SkeletonGraphicsWidget::addSelectNode); connect(m_document, &SkeletonDocument::checkEdge, graphicsWidget, &SkeletonGraphicsWidget::addSelectEdge); - + connect(m_document, &SkeletonDocument::partListChanged, partListWidget, &SkeletonPartListWidget::partListChanged); connect(m_document, &SkeletonDocument::partPreviewChanged, partListWidget, &SkeletonPartListWidget::partPreviewChanged); connect(m_document, &SkeletonDocument::partLockStateChanged, partListWidget, &SkeletonPartListWidget::partLockStateChanged); @@ -603,7 +603,7 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : connect(m_document, &SkeletonDocument::cleanup, partListWidget, &SkeletonPartListWidget::partListChanged); connect(m_document, &SkeletonDocument::partChecked, partListWidget, &SkeletonPartListWidget::partChecked); connect(m_document, &SkeletonDocument::partUnchecked, partListWidget, &SkeletonPartListWidget::partUnchecked); - + connect(m_document, &SkeletonDocument::skeletonChanged, m_document, &SkeletonDocument::generateMesh); connect(m_document, &SkeletonDocument::resultMeshChanged, [=]() { if ((m_exportPreviewWidget && m_exportPreviewWidget->isVisible()) || @@ -615,30 +615,30 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : connect(m_document, &SkeletonDocument::postProcessedResultChanged, m_document, &SkeletonDocument::generateTexture); connect(m_document, &SkeletonDocument::resultTextureChanged, m_document, &SkeletonDocument::bakeAmbientOcclusionTexture); connect(m_document, &SkeletonDocument::postProcessedResultChanged, m_document, &SkeletonDocument::generateAllAnimationClips); - + connect(m_document, &SkeletonDocument::resultMeshChanged, [=]() { m_modelRenderWidget->updateMesh(m_document->takeResultMesh()); }); //connect(m_document, &SkeletonDocument::resultSkeletonChanged, [=]() { // m_skeletonRenderWidget->updateMesh(m_document->takeResultSkeletonMesh()); //}); - + connect(graphicsWidget, &SkeletonGraphicsWidget::cursorChanged, [=]() { m_modelRenderWidget->setCursor(graphicsWidget->cursor()); //m_skeletonRenderWidget->setCursor(graphicsWidget->cursor()); }); - + connect(m_document, &SkeletonDocument::skeletonChanged, this, &SkeletonDocumentWindow::documentChanged); connect(m_document, &SkeletonDocument::turnaroundChanged, this, &SkeletonDocumentWindow::documentChanged); - + connect(m_modelRenderWidget, &ModelWidget::customContextMenuRequested, [=](const QPoint &pos) { graphicsWidget->showContextMenu(graphicsWidget->mapFromGlobal(m_modelRenderWidget->mapToGlobal(pos))); }); - + connect(m_document, &SkeletonDocument::xlockStateChanged, this, &SkeletonDocumentWindow::updateXlockButtonState); connect(m_document, &SkeletonDocument::ylockStateChanged, this, &SkeletonDocumentWindow::updateYlockButtonState); connect(m_document, &SkeletonDocument::zlockStateChanged, this, &SkeletonDocumentWindow::updateZlockButtonState); - + connect(this, &SkeletonDocumentWindow::initialized, m_document, &SkeletonDocument::uiReady); } @@ -656,7 +656,7 @@ void SkeletonDocumentWindow::closeEvent(QCloseEvent *event) event->accept(); return; } - + QMessageBox::StandardButton answer = QMessageBox::question(this, APP_NAME, tr("Do you really want to close while there are unsaved changes?"), @@ -769,7 +769,7 @@ void SkeletonDocumentWindow::initLockButton(QPushButton *button) font.setWeight(QFont::Light); font.setPixelSize(Theme::toolIconFontSize); font.setBold(false); - + button->setFont(font); button->setFixedSize(Theme::toolIconSize, Theme::toolIconSize); button->setStyleSheet("QPushButton {color: #f7d9c8}"); @@ -818,7 +818,7 @@ void SkeletonDocumentWindow::save() void SkeletonDocumentWindow::saveTo(const QString &saveAsFilename) { QString filename = saveAsFilename; - + if (filename.isEmpty()) { filename = QFileDialog::getSaveFileName(this, QString(), QString(), tr("Dust3D Document (*.ds3)")); @@ -826,11 +826,11 @@ void SkeletonDocumentWindow::saveTo(const QString &saveAsFilename) return; } } - + QApplication::setOverrideCursor(Qt::WaitCursor); - + Ds3FileWriter ds3Writer; - + QByteArray modelXml; QXmlStreamWriter stream(&modelXml); SkeletonSnapshot snapshot; @@ -838,7 +838,7 @@ void SkeletonDocumentWindow::saveTo(const QString &saveAsFilename) saveSkeletonToXmlStream(&snapshot, &stream); if (modelXml.size() > 0) ds3Writer.add("model.xml", "model", &modelXml); - + QByteArray imageByteArray; QBuffer pngBuffer(&imageByteArray); if (!m_document->turnaround.isNull()) { @@ -847,11 +847,11 @@ void SkeletonDocumentWindow::saveTo(const QString &saveAsFilename) if (imageByteArray.size() > 0) ds3Writer.add("canvas.png", "asset", &imageByteArray); } - + if (ds3Writer.save(filename)) { setCurrentFilename(filename); } - + QApplication::restoreOverrideCursor(); } @@ -865,12 +865,12 @@ void SkeletonDocumentWindow::open() if (answer != QMessageBox::Yes) return; } - + QString filename = QFileDialog::getOpenFileName(this, QString(), QString(), tr("Dust3D Document (*.ds3)")); if (filename.isEmpty()) return; - + QApplication::setOverrideCursor(Qt::WaitCursor); Ds3FileReader ds3Reader(filename); for (int i = 0; i < ds3Reader.items().size(); ++i) { @@ -893,7 +893,7 @@ void SkeletonDocumentWindow::open() } } QApplication::restoreOverrideCursor(); - + setCurrentFilename(filename); } @@ -1001,4 +1001,3 @@ void SkeletonDocumentWindow::updateZlockButtonState() else m_zlockButton->setStyleSheet("QPushButton {color: #aaebc4}"); } - diff --git a/thirdparty/json/json.hpp b/thirdparty/json/json.hpp index c9ef7581..3f074d18 100644 --- a/thirdparty/json/json.hpp +++ b/thirdparty/json/json.hpp @@ -124,7 +124,7 @@ using json = basic_json<>; #endif #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40900 - #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + //#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" #endif #endif