Skip to content

Commit

Permalink
Insert display model - assembled and rotated callouts #704
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed Apr 22, 2023
1 parent 65cb2a3 commit be8b14e
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 40 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.3270
pkgver=2.4.6.3271
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.3270
pkgver=2.4.6.3271
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.3270) debian; urgency=medium
lpub3d (2.4.6.3271) debian; urgency=medium

* LPub3D version 2.4.6.159.3270_20230422 for Linux
* LPub3D version 2.4.6.160.3271_20230422 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:43:21 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:43: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.3270
Version: 2.4.6.3271
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.3270
Version: 2.4.6.3271
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.3270
* Sat Apr 22 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3271
- 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.3270) debian; urgency=medium
lpub3d (2.4.6.3271) debian; urgency=medium

* LPub3D version 2.4.6.159.3270_20230422 for Linux
* LPub3D version 2.4.6.160.3271_20230422 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:43:22 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Sat, 22 Apr 2023 03:43:44 +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.3270
Version: 2.4.6.3271
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.3270
Version: 2.4.6.3271
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.3270
* Sat Apr 22 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3271
- 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 159 3270 5d5166e2e
2 4 6 160 3271 65cb2a363
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 = 159
GIT_REVISION = 160
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 = 3270
GIT_COMMIT = 3271
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}.159.3270.5d5166e2e
GIT_VERSION = $${VERSION}.160.3271.65cb2a363
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.159.3270 (22 04 2023 03:43:22)
LPub3D 2.4.6.160.3271 (22 04 2023 03:43:44)

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.159.3270 (22 04 2023 03:43:22)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.160.3271 (22 04 2023 03:43:44)</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.159.3270
;; Last Update.: Sat, 22 Apr 2023 03:43:22 +0200
;; Version.....: 2.4.6.160.3271
;; Last Update.: Sat, 22 Apr 2023 03:43:44 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
3 changes: 3 additions & 0 deletions mainApp/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ class FindPageOptions
QList<SubmodelStack> &_modelStack,

bool _pageDisplayed,
bool _displayModel,
bool _updateViewer,
bool _isMirrored,
bool _printing,
Expand All @@ -289,6 +290,7 @@ class FindPageOptions
modelStack (_modelStack),

pageDisplayed (_pageDisplayed),
displayModel (_displayModel),
updateViewer (_updateViewer),
isMirrored (_isMirrored),
printing (_printing),
Expand All @@ -303,6 +305,7 @@ class FindPageOptions
FindPageFlags &flags;
QList<SubmodelStack> &modelStack;
bool pageDisplayed;
bool displayModel;
bool updateViewer;
bool isMirrored;
bool printing;
Expand Down
30 changes: 24 additions & 6 deletions mainApp/threadworkers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2323,18 +2323,20 @@ int CountPageWorker::countPage(

int contains = ldrawFile->isSubmodel(type);

CalloutBeginMeta::CalloutMode calloutMode = meta->LPub.callout.begin.value();

// if submodel
if (contains) {

// check if submodel is in current step build modification
bool buildModRendered = Preferences::buildModEnabled && (buildMod.ignore ||
ldrawFile->getBuildModRendered(buildMod.key, colorType, true/*countPage*/));
bool buildModRendered = false;

// if not callout or assembled/rotated callout or parseBuildMods, process the submodel
// note that we accept callouts if parseBuildMods is true to parse any specified build mods
if (!opts.flags.callout || opts.flags.parseBuildMods || (opts.flags.callout && calloutMode != CalloutBeginMeta::Unassembled)) {

bool validCallout = opts.flags.callout && meta->LPub.callout.begin.value() != CalloutBeginMeta::Unassembled;

bool validSubmodel = (!opts.displayModel && (!opts.flags.callout || opts.flags.parseBuildMods)) || (validCallout) || (opts.displayModel && validCallout);

if (validSubmodel) {

// check if submodel was rendered
bool rendered = ldrawFile->rendered(type,
Expand All @@ -2344,6 +2346,9 @@ int CountPageWorker::countPage(
opts.flags.countInstances,
true /*countPage*/);

buildModRendered = Preferences::buildModEnabled && (buildMod.ignore ||
ldrawFile->getBuildModRendered(buildMod.key, colorType, true/*countPage*/));

// if the submodel was not rendered, and (is not in the buffer exchange call setRendered for the submodel.
if (! rendered && ! buildModRendered && (! opts.flags.bfxStore2 || ! bfxParts.contains(colorType))) {

Expand Down Expand Up @@ -2401,6 +2406,7 @@ int CountPageWorker::countPage(
flags2,
opts.modelStack,
opts.pageDisplayed,
opts.displayModel,
opts.updateViewer,
opts.isMirrored,
opts.printing,
Expand Down Expand Up @@ -2628,11 +2634,20 @@ int CountPageWorker::countPage(
buildMod.ignore = true;
break;
}
if (buildMod.state == BM_BEGIN)
if (opts.displayModel) {
emit gui->parseErrorSig(tr("Build modifications are not supported in display model Step"),
opts.current,Preferences::BuildModErrors,false,false);
buildMod.ignore = true;
break;
}
if (buildMod.state == BM_BEGIN) {
emit gui->parseErrorSig(QString("BUILD_MOD BEGIN '%1' encountered but '%2' was already defined in this STEP.<br><br>"
"Multiple build modifications per STEP are not allowed.")
.arg(meta->LPub.buildMod.key()).arg(buildMod.key),
opts.current,Preferences::BuildModErrors,false,false);
buildMod.ignore = true;
break;
}
buildMod.key = meta->LPub.buildMod.key();
buildMod.level = getLevel(buildMod.key, BM_BEGIN);
buildMod.action = BuildModApplyRc;
Expand Down Expand Up @@ -2783,6 +2798,7 @@ int CountPageWorker::countPage(
opts.flags.noStep2 = opts.flags.noStep;
opts.flags.noStep = false;
opts.flags.parseNoStep = false;
opts.displayModel = false;

// terminate build modification countPage at end of step
if (Gui::buildModJumpForward && ! opts.flags.callout && opts.pageNum > gui->saveDisplayPageNum) {
Expand Down Expand Up @@ -2814,6 +2830,8 @@ int CountPageWorker::countPage(
case InsertFinalModelRc:
case InsertDisplayModelRc:
Gui::lastStepPageNum = opts.pageNum;
if (rc == InsertDisplayModelRc)
opts.displayModel = true;
break;

case PartBeginIgnRc:
Expand Down
Loading

0 comments on commit be8b14e

Please sign in to comment.