Skip to content

Commit

Permalink
Insert display model - write to tmp #704
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Apr 22, 2023
1 parent c4a25e1 commit d33dd44
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion builds/linux/obs/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.6.3281
pkgver=2.4.6.3282
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.6.3281
pkgver=2.4.6.3282
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/alldeps/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.6.3281) debian; urgency=medium
lpub3d (2.4.6.3282) debian; urgency=medium

* LPub3D version 2.4.6.170.3281_20230422 for Linux
* LPub3D version 2.4.6.171.3282_20230422 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:47:22 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:47:43 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.6.3281
Version: 2.4.6.3282
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/alldeps/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.6.3281
Version: 2.4.6.3282
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -797,7 +797,7 @@ update-desktop-database || true
%endif

%changelog
* Sat Apr 22 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3281
* Sat Apr 22 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3282
- LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details

* Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.6.3281) debian; urgency=medium
lpub3d (2.4.6.3282) debian; urgency=medium

* LPub3D version 2.4.6.170.3281_20230422 for Linux
* LPub3D version 2.4.6.171.3282_20230422 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:47:23 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:47:45 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.6.3281
Version: 2.4.6.3282
Maintainer: Trevor SANDY <trevor.sandy@gmail.com>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.6.3281
Version: 2.4.6.3282
Release: 1%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -313,7 +313,7 @@ update-desktop-database || true
%endif

%changelog
* Sat Apr 22 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3281
* Sat Apr 22 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3282
- LPub3D 2.4.4 enhancements and fixes - see RELEASE_NOTES for details

* Tue May 31 2022 - trevor dot sandy at gmail dot com 2.4.4.2670
Expand Down
2 changes: 1 addition & 1 deletion builds/utilities/version.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2 4 6 170 3281 a3d81fad3
2 4 6 171 3282 c4a25e118
6 changes: 3 additions & 3 deletions gitversion.pri
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ equals(GIT_DIR, undefined) {

# Check if we do not have a valid version number (i.e. no version tag found)
isEmpty(GIT_VERSION) {
GIT_REVISION = 170
GIT_REVISION = 171
GIT_SHA = $$system($$GIT_BASE_COMMAND rev-parse --short HEAD 2> $$NULL_DEVICE)
GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE)
GIT_VERSION = v$${VERSION}-$${GIT_REVISION}-$${GIT_SHA}
Expand Down Expand Up @@ -69,7 +69,7 @@ equals(GIT_DIR, undefined) {
# Get commit count
GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE)
isEmpty(GIT_COMMIT) {
GIT_COMMIT = 3281
GIT_COMMIT = 3282
message("~~~ ERROR! GIT_COMMIT NOT DEFINED, USING $$GIT_COMMIT ~~~")
}

Expand Down Expand Up @@ -117,7 +117,7 @@ if (equals(USE_GIT_VER_FILE, true)|equals(USE_VERSION_INFO_VAR, true)) {
GIT_VERSION = $$cat($$GIT_VER_FILE, lines)
} else {
message("~~~ ERROR! $$GIT_DIR_ENV VERSION_INFO FILE $$GIT_VER_FILE NOT FOUND ~~~")
GIT_VERSION = $${VERSION}.170.3281.a3d81fad3
GIT_VERSION = $${VERSION}.171.3282.c4a25e118
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LPub3D 2.4.6.170.3281 (22 04 2023 03:47:23)
LPub3D 2.4.6.171.3282 (22 04 2023 03:47:45)

Features, enhancements, fixes and changes
------------
Expand Down
2 changes: 1 addition & 1 deletion mainApp/docs/RELEASE_NOTES.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<table class="tg">
<tr>
<th class="tg-0pky">
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.170.3281 (22 04 2023 03:47:23)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.171.3282 (22 04 2023 03:47:45)</h4>
<hr>
<p>
<span class="tg-1pky">LPub3D Official release.</span><br>
Expand Down
4 changes: 2 additions & 2 deletions mainApp/extras/LPub3D_Npp_UDL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
;;
;; Author......: Trevor SANDY
;; Name........: LPub3D_Npp_UDL.xml
;; Version.....: 2.4.6.170.3281
;; Last Update.: Sat, 22 Apr 2023 03:47:23 +0200
;; Version.....: 2.4.6.171.3282
;; Last Update.: Sat, 22 Apr 2023 03:47:45 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
28 changes: 16 additions & 12 deletions mainApp/traverse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6043,21 +6043,25 @@ void Gui::writeToTmp()

bool externalFile = !sourceFilePath.isEmpty();

fileType = externalFile ? "external" : "";
fileType += lpub->ldrawFile.isUnofficialPart(fileName) ? "unofficial part" : "submodel";
bool displayModel = lpub->ldrawFile.isDisplayModel(fileName);

message = QString("Writing %1 '%2' to temp folder...").arg(fileType).arg(fileName);
fileType = externalFile ? tr("external ") : " ";
fileType += lpub->ldrawFile.isUnofficialPart(fileName)
? tr("unofficial %1part ").arg(displayModel ? tr("display ") : "")
: tr("%1submodel ").arg(displayModel ? tr("display ") : "");

message = QString("Writing %1'%2' to temp folder...").arg(fileType).arg(fileName);

emit messageSig(LOG_INFO_STATUS, message);

if (Gui::suspendFileDisplay) {
message = QString("Writing %1 %2 of %3 files (%4 lines)...")
message = QString("Writing %1%2 of %3 files (%4 lines)...")
.arg(fileType)
.arg(QStringLiteral("%1").arg(i + 1, 3, 10, QLatin1Char('0')))
.arg(QStringLiteral("%1").arg(subFileCount, 3, 10, QLatin1Char('0')))
.arg(QStringLiteral("%1").arg(numberOfLines, 5, 10, QLatin1Char('0')));
} else {
message = QString("Writing %1 %2 (%3 lines)").arg(fileType).arg(fileName).arg(numberOfLines);
message = QString("Writing %1%2 (%3 lines)").arg(fileType).arg(fileName).arg(numberOfLines);
}

if (!ContinuousPage()) {
Expand All @@ -6071,7 +6075,7 @@ void Gui::writeToTmp()
QFile::remove(destinationPath);
}
if(!QFile::copy(sourceFilePath, destinationPath)) {
emit messageSig(LOG_ERROR, QString("Could not write external file '%1' to temp folder...").arg(fileName));
emit messageSig(LOG_ERROR, QString("Could not write %1file '%2' to temp folder...").arg(fileType).arg(fileName));
}
} else {
writeToTmpFutures.append(QtConcurrent::run([this, fileName]() {
Expand All @@ -6085,19 +6089,19 @@ void Gui::writeToTmp()
QString fileNameStr = fileName;
QString extension = QFileInfo(fileNameStr).suffix().toLower();

// Write faded version of submodels
// Write faded version of submodels - except display model
if (externalFile && (doFadeStep || doHighlightStep)) {
fileContent.clear();
fileContent = getFileContent();
}

if (doFadeStep) {
if (doFadeStep && !displayModel) {
if (extension.isEmpty())
fileNameStr = fileNameStr.append(QString("%1.ldr").arg(FADE_SFX));
else
fileNameStr = fileNameStr.replace("."+extension, QString("%1.%2").arg(FADE_SFX).arg(extension));

emit messageSig(LOG_INFO_STATUS, QString("Writing %1 '%2' to temp folder...").arg(fileType).arg(fileNameStr));
emit messageSig(LOG_INFO_STATUS, QString("Writing %1'%2' to temp folder...").arg(fileType).arg(fileNameStr));

writeToTmpFutures.append(QtConcurrent::run([this, fileName, fileNameStr, fadeColor, externalFile, fileContent]() {
QStringList *modelContent = new QStringList;
Expand All @@ -6109,14 +6113,14 @@ void Gui::writeToTmp()
}));
}

// Write highlighted version of submodels
if (doHighlightStep) {
// Write highlighted version of submodels - except display model
if (doHighlightStep&& !displayModel) {
if (extension.isEmpty())
fileNameStr = fileNameStr.append(QString("%1.ldr").arg(HIGHLIGHT_SFX));
else
fileNameStr = fileNameStr.replace("."+extension, QString("%1.%2").arg(HIGHLIGHT_SFX).arg(extension));

emit messageSig(LOG_INFO_STATUS, QString("Writing %1 '%2' to temp folder...").arg(fileType).arg(fileNameStr));
emit messageSig(LOG_INFO_STATUS, QString("Writing %1'%2' to temp folder...").arg(fileType).arg(fileNameStr));

writeToTmpFutures.append(QtConcurrent::run([this, fileName, fileNameStr, fadeColor, externalFile, fileContent]() {
QStringList *modelContent = new QStringList;
Expand Down

0 comments on commit d33dd44

Please sign in to comment.