Skip to content

Commit

Permalink
Fade and highlight - enable fade and highlight at count parts call #710
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed May 8, 2023
1 parent e5bdf49 commit 70da754
Show file tree
Hide file tree
Showing 22 changed files with 224 additions and 134 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.3338
pkgver=2.4.6.3339
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.3338
pkgver=2.4.6.3339
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.3338) debian; urgency=medium
lpub3d (2.4.6.3339) debian; urgency=medium

* LPub3D version 2.4.6.227.3338_20230508 for Linux
* LPub3D version 2.4.6.228.3339_20230508 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:13:48 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:14:17 +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.3338
Version: 2.4.6.3339
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.3338
Version: 2.4.6.3339
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
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3338
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3339
- 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.3338) debian; urgency=medium
lpub3d (2.4.6.3339) debian; urgency=medium

* LPub3D version 2.4.6.227.3338_20230508 for Linux
* LPub3D version 2.4.6.228.3339_20230508 for Linux

-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:13:50 +0200
-- Trevor SANDY <trevor.sandy@gmail.com> Mon, 08 May 2023 15:14:19 +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.3338
Version: 2.4.6.3339
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.3338
Version: 2.4.6.3339
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
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3338
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3339
- 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 227 3338 017d1f37c
2 4 6 228 3339 e5bdf491f
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 = 227
GIT_REVISION = 228
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 = 3338
GIT_COMMIT = 3339
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}.227.3338.017d1f37c
GIT_VERSION = $${VERSION}.228.3339.e5bdf491f
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
19 changes: 18 additions & 1 deletion mainApp/declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ enum NativeRenderType { NATIVE_VIEW, NATIVE_IMAGE, NATIVE_EXPORT };
enum DividerType { StepDivider, RangeDivider, NoDivider };
enum ShowLoadMsgType { NEVER_SHOW, ALWAYS_SHOW, SHOW_MESSAGE, SHOW_WARNING, SHOW_ERROR };
enum MissingHeaderType { NoneMissing, NameMissing, AuthorMissing, BothMissing };
enum LDrawFileRegExpType { SOF_RX, EOF_RX, LDR_RX, AUT_RX, NAM_RX, CAT_RX, INC_RX, DES_RX, LDG_RX, LDC_RX, EOH_RX, DMS_RX, LDS_RX };
enum RulerTrackingType { TRACKING_TICK, TRACKING_LINE, TRACKING_NONE};
enum SceneGuidesPosType { GUIDES_TOP_LEFT, GUIDES_TOP_RIGHT, GUIDES_CENTRE, GUIDES_BOT_LEFT, GUIDES_BOT_RIGHT};
enum RemoveObjectsRc { RemovedPieceRc, RemovedCameraRc, RemovedLightRc };
Expand All @@ -136,6 +135,24 @@ enum SceneObjectInfo { ObjectId };
enum CamFlag { DefFoV, DefZNear, DefZFar };
enum IniFlag { NativePOVIni, NativeSTLIni, Native3DSIni, NativePartList, POVRayRender, LDViewPOVIni, LDViewIni, NumIniFiles };

enum LDrawFileRegExpType {
SOF_RX, // Start of File
EOF_RX, // End of File
LDR_RX, // LDraw File
AUT_RX, // Author Header
NAM_RX, // Name Header
CAT_RX, // Category Header
INC_RX, // Include File
DES_RX, // Model Description
LDG_RX, // LDCad Group
LDC_RX, // LDCad Generated Content
EOH_RX, // End of Header
DMS_RX, // Display Model Step
LDS_RX, // LDraw Step boundry
FHE_RX, // Fade or Highlight Enabled (or Setup)
LFH_RX // LPub Fade or LPub Highlight
};

enum DisplayType { DT_DEFAULT,
DT_PAGE,
DT_COVER_FRONT,
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.227.3338 (08 05 2023 15:13:50)
LPub3D 2.4.6.228.3339 (08 05 2023 15:14:19)

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.227.3338 (08 05 2023 15:13:50)</h4>
<h4><a id="LPub3D_0"></a>LPub3D 2.4.6.228.3339 (08 05 2023 15:14:19)</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.227.3338
;; Last Update.: Mon, 08 May 2023 15:13:50 +0200
;; Version.....: 2.4.6.228.3339
;; Last Update.: Mon, 08 May 2023 15:14:19 +0200
;; License.....: GPLv3
;; Homepage....: https://trevorsandy.github.io/lpub3d
;; Copyright (C) 2021 - 2023 by Trevor SANDY
Expand Down
60 changes: 43 additions & 17 deletions mainApp/ldrawfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ int LDrawFile::_uniquePartCount= 0;
int LDrawFile::_helperPartCount= 0;
int LDrawFile::_loadIssues = 0;
qint64 LDrawFile::_elapsed = 0;
bool LDrawFile::_lpubFadeHighlight = false;
bool LDrawFile::_currFileIsUTF8 = false;
bool LDrawFile::_loadAborted = false;
bool LDrawFile::_loadBuildMods = false;
Expand Down Expand Up @@ -329,6 +330,7 @@ void LDrawFile::empty()
_loadBuildMods = false;
_loadUnofficialParts = true;
_hasUnofficialParts = false;
_lpubFadeHighlight = false;
_loadIssues = 0;
_elapsed = 0;
_partCount = 0;
Expand Down Expand Up @@ -3302,6 +3304,10 @@ void LDrawFile::loadStatusEntry(const int messageType,

void LDrawFile::countParts(const QString &fileName) {

displayModel = false;
bool lpubFade = false;
bool lpubHighlight = false;

Where top(fileName, getSubmodelIndex(fileName), 0);

int topModelIndx = top.modelIndex;
Expand Down Expand Up @@ -3355,20 +3361,40 @@ void LDrawFile::countParts(const QString &fileName) {

// meta command parse
if (tokens.size() > 1 && tokens[0] == "0") {
if (displayModel)
displayModel = !line.contains(_fileRegExp[LDS_RX]); // LDraw Step
else
displayModel = line.contains(_fileRegExp[DMS_RX]); // Display Model
if (displayModel) {
if (!(displayModel = !line.contains(_fileRegExp[LDS_RX]))) // LDraw Step Boundry
continue;
}
if (tokens[1] == "!LPUB" || tokens[1] == "LPUB") {
// build modification - starts at BEGIN command and ends at END_MOD action
if (tokens.size() >= 4 &&
tokens[2] == "BUILD_MOD") {
if (tokens[3] == "BEGIN") {
buildModLevel = getLevel(tokens[4], BM_BEGIN);
} else if (tokens[3] == "END_MOD") {
buildModLevel = getLevel(QString(), BM_END);
if (tokens.size() >= 4) {
if (!displayModel) {
if ((displayModel = line.contains(_fileRegExp[DMS_RX]))) // Display Model
continue;
}
if (!_lpubFadeHighlight) {
if ((_lpubFadeHighlight = line.contains(_fileRegExp[LFH_RX]))) { // LPub Fade or LPub Highlight
if (_fileRegExp[LFH_RX].cap(1) == "LPUB_FADE")
lpubFade = true;
else
lpubHighlight = true;
}
continue;
}
if (_lpubFadeHighlight) {
if (line.contains(_fileRegExp[FHE_RX])) { // Fade or Highlight Enabled (or Setup)
emit gui->enableLPubFadeOrHighlightSig(lpubFade,lpubHighlight,true/*wait for finish*/);
continue;
}
}
// build modification - starts at BEGIN command and ends at END_MOD action
if (tokens[2] == "BUILD_MOD") {
if (tokens[3] == "BEGIN") {
buildModLevel = getLevel(tokens[4], BM_BEGIN);
} else if (tokens[3] == "END_MOD") {
buildModLevel = getLevel(QString(), BM_END);
}
lineIncluded = ! buildModLevel;
}
lineIncluded = ! buildModLevel;
}
// ignore parts begin
if (tokens.size() == 5 && tokens[0] == "0" &&
Expand Down Expand Up @@ -3522,8 +3548,6 @@ void LDrawFile::countParts(const QString &fileName) {
} // content size
};

displayModel = false;

countModelParts(top);

emit gui->progressPermSetValueSig(size(top.modelName));
Expand Down Expand Up @@ -5756,12 +5780,14 @@ LDrawFile::LDrawFile() : ldrawMutex(QMutex::Recursive)
<< QRegExp("^0\\s+NAME:?\\s+(.*)$",Qt::CaseInsensitive) // NAM_RX - Name Header
<< QRegExp("^0\\s+!?CATEGORY\\s+(.*)$",Qt::CaseInsensitive) // CAT_RX - Category Header
<< QRegExp("^0\\s+!?LPUB\\s+INCLUDE\\s+[\"']?([^\"']*)[\"']?$",Qt::CaseSensitive) // INC_RX - Include File
<< QRegExp("^(?!0 !?LPUB|0 FILE |0 NOFILE|0 !?LEOCAD|0 !?LDCAD|0 MLCAD|0 GHOST|0 !?SYNTH|[1-5]).*$",Qt::CaseSensitive) // DES_RX - Description
<< QRegExp("^(?!0 !?LPUB|0 FILE |0 NOFILE|0 !?LEOCAD|0 !?LDCAD|0 MLCAD|0 GHOST|0 !?SYNTH|[1-5]).*$",Qt::CaseSensitive) // DES_RX - Model Description
<< QRegExp("^0\\s+!?LDCAD\\s+GROUP_DEF.*\\s+\\[LID=(\\d+)\\]\\s+\\[GID=([\\d\\w]+)\\]\\s+\\[name=(.[^\\]]+)\\].*$",Qt::CaseInsensitive) // LDG_RX - LDCad Group
<< QRegExp("^0\\s+!?LDCAD\\s+(CONTENT|PATH_POINT|PATH_SKIN|GENERATED)[^\n]*") // LDC_RX - LDCad Generated Content
<< QRegExp("^0\\s+!?(?:LPUB)*\\s?(STEP|ROTSTEP|MULTI_STEP BEGIN|CALLOUT BEGIN|BUILD_MOD BEGIN|0 ROTATION)[^\n]*") // EOH_RX - End of Header
<< QRegExp("^0\\s+!?(?:LPUB)*\\s?(INSERT DISPLAY_MODEL)[^\n]*") // DMS_RX - Display Model Step
<< QRegExp("^0\\s+!?(?:LPUB)*\\s?(STEP|ROTSTEP|NOSTEP|NOFILE)[^\n]*") // LDS_RX - LDraw Step boundry
<< QRegExp("^0\\s+!?(?:LPUB)*\\s?(INSERT DISPLAY_MODEL)[^\n]*") // DMS_RX - Display Model Step
<< QRegExp("^0\\s+!?(?:LPUB)*\\s?(STEP|ROTSTEP|NOSTEP|NOFILE)[^\n]*") // LDS_RX - LDraw Step boundry
<< QRegExp("(?:FADE_STEPS|HIGHLIGHT_STEP)\\s+(SETUP|ENABLED)\\s*(GLOBAL|LOCAL)?\\s*TRUE[^\n]*") // FHE_RX - Fade or Highlight Enabled (or Setup)
<< QRegExp("(?:FADE_STEPS|HIGHLIGHT_STEP)\\s+(LPUB_FADE|LPUB_HIGHLIGHT)\\s*(GLOBAL|LOCAL)?\\s*TRUE[^\n]*") // LFH_RX - LPub Fade or LPub Highlight
;
}

Expand Down
1 change: 1 addition & 0 deletions mainApp/ldrawfiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ class LDrawFile {
int _buildModPrevStepIndex;
bool _mpd;
static bool _helperPartsNotInArchive;
static bool _lpubFadeHighlight;
static int _savedLines;
static qint64 _elapsed;

Expand Down
6 changes: 5 additions & 1 deletion mainApp/lpub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3477,6 +3477,10 @@ Gui::Gui() : pageMutex(QMutex::Recursive)
connect(undoStack, SIGNAL(cleanChanged(bool)),
this, SLOT( cleanChanged(bool)));

// Fade and Highlight
connect(this, SIGNAL(enableLPubFadeOrHighlightSig(bool,bool,bool)),
this, SLOT( enableLPubFadeOrHighlight(bool,bool,bool)));

progressLabel = new QLabel(this);
progressLabel->setMinimumWidth(200);
progressBar = new QProgressBar();
Expand Down Expand Up @@ -4804,7 +4808,7 @@ QAction *Gui::getAct(const QString &objectName)
if (lpub->actions.contains(objectName))
return lpub->actions.value(objectName).action;
#ifdef QT_DEBUG_MODE
emit lpub->messageSig(LOG_ERROR, QString("Mainwindow action was not found or is null [%1]").arg(objectName));
emit gui->messageSig(LOG_ERROR, QString("Mainwindow action was not found or is null [%1]").arg(objectName));
#endif
return nullptr;
}
Expand Down
11 changes: 6 additions & 5 deletions mainApp/lpub.h
Original file line number Diff line number Diff line change
Expand Up @@ -1244,11 +1244,11 @@ public slots:
void updatePreview();
void enableVisualBuildModification();
void viewStandardOutput(const QString filePath, const QString title = "");
void setupFadeOrHighlight(bool enableFadeSteps, bool enableHighlightStep);
int setupFadeOrHighlight(bool setupFadeSteps, bool setupHighlightStep);

bool VisualEditorRotateTransform()
{
return EnableBuildModAct->isChecked();
return EnableBuildModAct->isChecked();
}

void SetVisualEditorRotateTransform(bool b)
Expand Down Expand Up @@ -1592,6 +1592,7 @@ public slots:
void requestEndThreadNowSig();
void loadFileSig(const QString &file);

void enableLPubFadeOrHighlightSig(bool, bool, bool);
void operateHighlightParts(bool, bool);
void operateFadeParts(bool, bool);
void setPliIconPathSig(QString &,QString &);
Expand All @@ -1606,7 +1607,6 @@ public slots:
PartWorker partWorkerLDSearchDirs; // part worker to process search directories and fade and or highlight color parts
PartWorker *partWorkerCustomColour; // part worker to process color part fade and or highlight
ColourPartListWorker *colourPartListWorker; // create static color parts list in separate thread

static QMap<int, PageSizeData> pageSizes; // page size and orientation object

protected:
Expand All @@ -1618,6 +1618,7 @@ public slots:
QString mRotStepType;
QMap<QString, QString> mPliIconsPath; // used to set an icon image in the Visual Editor timeline view
QVector<int> mBuildModRange; // begin and end range of modified parts from Visual Editor
QFutureWatcher<int> futureWatcher; // watch the countPage future

int mViewerZoomLevel;

Expand All @@ -1640,8 +1641,6 @@ public slots:
QLabel *progressLabel;
QLabel *progressLabelPerm; //
PliSubstituteParts pliSubstituteParts; // internal list of PLI/BOM substitute parts

QFutureWatcher<int> futureWatcher; // watch the countPage future

QMutex pageMutex; // recursive drawPage, buildModNextStep, and findPage mutex,
QMutex writeMutex; // non-recursive write to temp working directory and countPage mutex
Expand Down Expand Up @@ -1839,6 +1838,8 @@ private slots:
void editBLColors();
void editBLCodes();
void generateCustomColourPartsList(bool prompt = true);
void enableLPubFadeOrHighlight(bool enableFadeSteps, bool enableHighlightStep ,bool waitForFinish);

void viewLog();
void loadStatus();

Expand Down
Loading

0 comments on commit 70da754

Please sign in to comment.