diff --git a/builds/linux/obs/PKGBUILD b/builds/linux/obs/PKGBUILD index 8345a28bd..9984566c7 100755 --- a/builds/linux/obs/PKGBUILD +++ b/builds/linux/obs/PKGBUILD @@ -2,7 +2,7 @@ # Last Update: July 19, 2020 # Copyright (C) 2017 - 2023 by Trevor SANDY pkgname=lpub3d -pkgver=2.4.6.3306 +pkgver=2.4.6.3307 pkgrel=1 pkgdesc="An LDraw Building Instruction Editor" url="https://github.com/trevorsandy/lpub3d.git" diff --git a/builds/linux/obs/alldeps/PKGBUILD b/builds/linux/obs/alldeps/PKGBUILD index 8d7532b95..b6021c704 100644 --- a/builds/linux/obs/alldeps/PKGBUILD +++ b/builds/linux/obs/alldeps/PKGBUILD @@ -2,7 +2,7 @@ # Last Update: July 19, 2020 # Copyright (C) 2017 - 2023 by Trevor SANDY pkgname=lpub3d -pkgver=2.4.6.3306 +pkgver=2.4.6.3307 pkgrel=1 pkgdesc="An LDraw Building Instruction Editor" url="https://github.com/trevorsandy/lpub3d.git" diff --git a/builds/linux/obs/alldeps/debian/changelog b/builds/linux/obs/alldeps/debian/changelog index 550671e8f..ccb5e4a5f 100644 --- a/builds/linux/obs/alldeps/debian/changelog +++ b/builds/linux/obs/alldeps/debian/changelog @@ -1,5 +1,5 @@ -lpub3d (2.4.6.3306) debian; urgency=medium +lpub3d (2.4.6.3307) debian; urgency=medium - * LPub3D version 2.4.6.195.3306_20230508 for Linux + * LPub3D version 2.4.6.196.3307_20230508 for Linux - -- Trevor SANDY Mon, 08 May 2023 05:55:36 +0200 + -- Trevor SANDY Mon, 08 May 2023 05:55:59 +0200 diff --git a/builds/linux/obs/alldeps/debian/lpub3d.dsc b/builds/linux/obs/alldeps/debian/lpub3d.dsc index 0de6affcb..260db0e00 100644 --- a/builds/linux/obs/alldeps/debian/lpub3d.dsc +++ b/builds/linux/obs/alldeps/debian/lpub3d.dsc @@ -2,7 +2,7 @@ Format: 1.0 Source: lpub3d Binary: lpub3d Architecture: any -Version: 2.4.6.3306 +Version: 2.4.6.3307 Maintainer: Trevor SANDY Homepage: https://trevorsandy.github.io/lpub3d/ Standards-Version: 3.9.7 diff --git a/builds/linux/obs/alldeps/lpub3d.spec b/builds/linux/obs/alldeps/lpub3d.spec index 4d0fe2350..a1358fa7e 100644 --- a/builds/linux/obs/alldeps/lpub3d.spec +++ b/builds/linux/obs/alldeps/lpub3d.spec @@ -120,7 +120,7 @@ BuildRequires: fdupes Summary: An LDraw Building Instruction Editor Name: lpub3d Icon: lpub3d.xpm -Version: 2.4.6.3306 +Version: 2.4.6.3307 Release: %{?dist} URL: https://trevorsandy.github.io/lpub3d Vendor: Trevor SANDY @@ -797,7 +797,7 @@ update-desktop-database || true %endif %changelog -* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3306 +* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3307 - 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 diff --git a/builds/linux/obs/debian/changelog b/builds/linux/obs/debian/changelog index 71285d509..147b47f9a 100644 --- a/builds/linux/obs/debian/changelog +++ b/builds/linux/obs/debian/changelog @@ -1,5 +1,5 @@ -lpub3d (2.4.6.3306) debian; urgency=medium +lpub3d (2.4.6.3307) debian; urgency=medium - * LPub3D version 2.4.6.195.3306_20230508 for Linux + * LPub3D version 2.4.6.196.3307_20230508 for Linux - -- Trevor SANDY Mon, 08 May 2023 05:55:38 +0200 + -- Trevor SANDY Mon, 08 May 2023 05:56:01 +0200 diff --git a/builds/linux/obs/debian/lpub3d.dsc b/builds/linux/obs/debian/lpub3d.dsc index 2de3c4f7b..84a494a3a 100755 --- a/builds/linux/obs/debian/lpub3d.dsc +++ b/builds/linux/obs/debian/lpub3d.dsc @@ -2,7 +2,7 @@ Format: 1.0 Source: lpub3d Binary: lpub3d Architecture: any -Version: 2.4.6.3306 +Version: 2.4.6.3307 Maintainer: Trevor SANDY Homepage: https://trevorsandy.github.io/lpub3d/ Standards-Version: 3.9.7 diff --git a/builds/linux/obs/lpub3d.spec b/builds/linux/obs/lpub3d.spec index 59f012339..7dbf41c79 100755 --- a/builds/linux/obs/lpub3d.spec +++ b/builds/linux/obs/lpub3d.spec @@ -82,7 +82,7 @@ BuildRequires: fdupes Summary: An LDraw Building Instruction Editor Name: lpub3d Icon: lpub3d.xpm -Version: 2.4.6.3306 +Version: 2.4.6.3307 Release: 1%{?dist} URL: https://trevorsandy.github.io/lpub3d Vendor: Trevor SANDY @@ -313,7 +313,7 @@ update-desktop-database || true %endif %changelog -* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3306 +* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.3307 - 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 diff --git a/builds/utilities/version.info b/builds/utilities/version.info index 200f406a9..3a08d5b25 100755 --- a/builds/utilities/version.info +++ b/builds/utilities/version.info @@ -1 +1 @@ -2 4 6 195 3306 5ca912615 +2 4 6 196 3307 ea21ecc84 diff --git a/gitversion.pri b/gitversion.pri index 901c49e4b..6d74145c6 100644 --- a/gitversion.pri +++ b/gitversion.pri @@ -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 = 195 + GIT_REVISION = 196 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} @@ -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 = 3306 + GIT_COMMIT = 3307 message("~~~ ERROR! GIT_COMMIT NOT DEFINED, USING $$GIT_COMMIT ~~~") } @@ -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}.195.3306.5ca912615 + GIT_VERSION = $${VERSION}.196.3307.ea21ecc84 message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~") GIT_VERSION ~= s/\./" " } diff --git a/lclib/common/lc_application.cpp b/lclib/common/lc_application.cpp index f2a9e93aa..812783cfd 100644 --- a/lclib/common/lc_application.cpp +++ b/lclib/common/lc_application.cpp @@ -131,8 +131,8 @@ void lcPreferences::LoadDefaults() mViewPieceIcons = lcGetProfileInt(LC_PROFILE_VIEW_PIECE_ICONS); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - mLPubTrueFade = lcGetProfileInt(LC_PROFILE_LPUB_TRUE_FADE); +/*** LPub3D Mod - lpub fade highlight ***/ + mLPubFadeHighlight = lcGetProfileInt(LC_PROFILE_LPUB_FADE_HIGHLIGHT); /*** LPub3D Mod end ***/ } @@ -238,8 +238,8 @@ void lcPreferences::SaveDefaults() lcSetProfileInt(LC_PROFILE_VIEW_PIECE_ICONS, mViewPieceIcons); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - lcSetProfileInt(LC_PROFILE_LPUB_TRUE_FADE, mLPubTrueFade); +/*** LPub3D Mod - lpub fade highlight ***/ + lcSetProfileInt(LC_PROFILE_LPUB_FADE_HIGHLIGHT, mLPubFadeHighlight); /*** LPub3D Mod end ***/ } @@ -335,32 +335,24 @@ lcApplication::lcApplication(const lcCommandLineOptions &Options) } /*** LPub3D Mod - load color entry ***/ -bool lcApplication::LPubHighlightStep() +bool lcApplication::LPubHighlightParts() { if (mProject) - return mProject->mHighlightStep; + return mProject->mLPubHighlightParts; else return Preferences::enableHighlightStep; } /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ // used by lcScene::Draw -bool lcApplication::LPubFadeSteps() +bool lcApplication::LPubFadeParts() { if (mProject) - return mProject->mFadeSteps; + return mProject->mLPubFadeParts; else return Preferences::enableFadeSteps; } -bool lcApplication::UseLPubTrueFade() -{ - if (mProject) - return mProject->mTrueFade; - else - return mPreferences.mLPubTrueFade; -} - // used by lcTimeLineWidget::Update bool lcApplication::UseLPubFadeColour() { @@ -1610,8 +1602,8 @@ void lcApplication::ShowPreferencesDialog() Options.Preferences.mViewPieceIcons = lcGetProfileInt(LC_PROFILE_VIEW_PIECE_ICONS); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - Options.Preferences.mLPubTrueFade = lcGetProfileInt(LC_PROFILE_LPUB_TRUE_FADE); +/*** LPub3D Mod - lpub fade highlight ***/ + Options.Preferences.mLPubFadeHighlight = lcGetProfileInt(LC_PROFILE_LPUB_FADE_HIGHLIGHT); Options.Preferences.mDrawConditionalLines = lcGetProfileInt(LC_PROFILE_DRAW_CONDITIONAL_LINES); /*** LPub3D Mod end ***/ @@ -1665,8 +1657,8 @@ void lcApplication::ShowPreferencesDialog() bool ViewPieceIconsChangd = Options.Preferences.mViewPieceIcons != mPreferences.mViewPieceIcons; /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - bool LPubTrueFadeChanged = Options.Preferences.mLPubTrueFade != mPreferences.mLPubTrueFade; +/*** LPub3D Mod - lpub fade highlight ***/ + bool LPubFadeHighlightChanged = Options.Preferences.mLPubFadeHighlight != mPreferences.mLPubFadeHighlight; bool DrawConditionalLinesChanged = Options.Preferences.mDrawConditionalLines != mPreferences.mDrawConditionalLines; /*** LPub3D Mod end ***/ @@ -1735,7 +1727,7 @@ void lcApplication::ShowPreferencesDialog() } if ((ViewPieceIconsChangd || - LPubTrueFadeChanged || + LPubFadeHighlightChanged || DefaultCameraChanged || DrawConditionalLinesChanged) && !restartApp && !reloadFile) reloadPage = true; diff --git a/lclib/common/lc_application.h b/lclib/common/lc_application.h index 4d22ef1f0..7354f8be5 100644 --- a/lclib/common/lc_application.h +++ b/lclib/common/lc_application.h @@ -48,7 +48,7 @@ enum class lcPreviewPosition { Dockable, Floating, - Viewport // not implemented + Viewport // not implemented }; /*** LPub3D Mod end ***/ @@ -162,8 +162,8 @@ class lcPreferences /*** LPub3D Mod - Timeline part icons ***/ bool mViewPieceIcons; /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - bool mLPubTrueFade; +/*** LPub3D Mod - lpub fade highlight ***/ + bool mLPubFadeHighlight; /*** LPub3D Mod end ***/ /*** LPub3D Mod - Selected Parts ***/ bool mBuildModificationEnabled; @@ -274,11 +274,10 @@ class lcApplication : public QObject void ExportClipboard(const QByteArray& Clipboard); /*** LPub3D Mod - load color entry ***/ - bool LPubHighlightStep(); + bool LPubHighlightParts(); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - bool LPubFadeSteps(); - bool UseLPubTrueFade(); +/*** LPub3D Mod - lpub fade highlight ***/ + bool LPubFadeParts(); bool UseLPubFadeColour(); QString LPubFadeColour(); /*** LPub3D Mod end ***/ diff --git a/lclib/common/lc_colors.cpp b/lclib/common/lc_colors.cpp index a95712532..c50a9ecaf 100644 --- a/lclib/common/lc_colors.cpp +++ b/lclib/common/lc_colors.cpp @@ -234,7 +234,7 @@ bool lcLoadColorFile(lcFile& File, lcStudStyle StudStyle, bool Update, bool LPub if (LPubColor) { - if ((LPubHighlightColor = gApplication->LPubHighlightStep())) + if ((LPubHighlightColor = gApplication->LPubHighlightParts())) { char Code[32]; lcColor& Color = Colors.front(); diff --git a/lclib/common/lc_context.cpp b/lclib/common/lc_context.cpp index c61f0a8b0..561bd68c4 100644 --- a/lclib/common/lc_context.cpp +++ b/lclib/common/lc_context.cpp @@ -713,7 +713,7 @@ void lcContext::EnableColorBlend(bool Enable) mColorBlend = Enable; } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void lcContext::EnableCullFace(bool Enable, bool LPubFade) /*** LPub3D Mod end ***/ { @@ -721,7 +721,7 @@ void lcContext::EnableCullFace(bool Enable, bool LPubFade) return; if (Enable) -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ { if (LPubFade) glCullFace(GL_BACK); diff --git a/lclib/common/lc_context.h b/lclib/common/lc_context.h index bc94731a4..13c9d6b97 100644 --- a/lclib/common/lc_context.h +++ b/lclib/common/lc_context.h @@ -168,9 +168,9 @@ class lcContext : protected QOpenGLFunctions void EnableDepthTest(bool Enable); void EnableColorWrite(bool Enable); void EnableColorBlend(bool Enable); -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void EnableCullFace(bool Enable, bool LPubFade = false); -/*** LPub3D Mod end ***/ +/*** LPub3D Mod end ***/ void SetLineWidth(float LineWidth); void BindTexture2D(const lcTexture* Texture); diff --git a/lclib/common/lc_model.cpp b/lclib/common/lc_model.cpp index d6f01c38a..ab0de0b91 100644 --- a/lclib/common/lc_model.cpp +++ b/lclib/common/lc_model.cpp @@ -508,7 +508,7 @@ void lcModel::LoadLDraw(QIODevice& Device, Project* Project) /*** LPub3D Mod - Selected Parts ***/ int LineTypeIndex = -1; /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ mLPubFade = false; /*** LPub3D Mod end ***/ /*** LPub3D Mod - preview widget ***/ @@ -589,7 +589,7 @@ void lcModel::LoadLDraw(QIODevice& Device, Project* Project) .arg(OriginalLine)); } /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ else if (Token == QLatin1String("!FADE")) { mLPubFade = !mLPubFade; @@ -626,7 +626,7 @@ void lcModel::LoadLDraw(QIODevice& Device, Project* Project) delete Piece; Piece = nullptr; CurrentStep++; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ mLPubFade = false; /*** LPub3D Mod end ***/ mFileLines.append(OriginalLine); @@ -771,7 +771,7 @@ void lcModel::LoadLDraw(QIODevice& Device, Project* Project) LineTypeIndex++; Piece->SetLineTypeIndex(LineTypeIndex); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ Piece->SetLPubFade(mLPubFade); /*** LPub3D Mod end ***/ Piece->SetFileLine(mFileLines.size()); @@ -1361,13 +1361,24 @@ void lcModel::GetScene(lcScene* Scene, const lcCamera* ViewCamera, bool AllowHig if (mPieceInfo) mPieceInfo->AddRenderMesh(*Scene); +/*** LPub3D Mod - lpub fade highlight ***/ + lcPreferences& Preferences = lcGetPreferences(); +/*** LPub3D Mod end ***/ + for (const lcPiece* Piece : mPieces) { if (Piece->IsVisible(mCurrentStep)) { const lcStep StepShow = Piece->GetStepShow(); -/*** LPub3D Mod - true fade ***/ - Piece->AddMainModelRenderMeshes(Scene, AllowHighlight && StepShow == mCurrentStep, AllowFade && StepShow < mCurrentStep, Piece->GetLPubFade()); +/*** LPub3D Mod - lpub fade highlight ***/ + bool LPubFade = false; + if (Preferences.mLPubFadeHighlight) + { + AllowHighlight &= StepShow == mCurrentStep; + AllowFade &= StepShow < mCurrentStep; + LPubFade = Piece->GetLPubFade(); + } + Piece->AddMainModelRenderMeshes(Scene, AllowHighlight, AllowFade, LPubFade); /*** LPub3D Mod end ***/ } } @@ -1384,13 +1395,13 @@ void lcModel::GetScene(lcScene* Scene, const lcCamera* ViewCamera, bool AllowHig } } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void lcModel::AddSubModelRenderMeshes(lcScene* Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive, bool LPubFade) const /*** LPub3D Mod end ***/ { for (const lcPiece* Piece : mPieces) if (Piece->IsVisibleInSubModel()) -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ Piece->AddSubModelRenderMeshes(Scene, WorldMatrix, DefaultColorIndex, RenderMeshState, ParentActive, LPubFade); /*** LPub3D Mod end ***/ } diff --git a/lclib/common/lc_model.h b/lclib/common/lc_model.h index 70923c81f..5d407eaa2 100644 --- a/lclib/common/lc_model.h +++ b/lclib/common/lc_model.h @@ -265,7 +265,7 @@ class lcModel void PaintSelectedPieces(); void GetScene(lcScene* Scene, const lcCamera* ViewCamera, bool AllowHighlight, bool AllowFade) const; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void AddSubModelRenderMeshes(lcScene* Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive, bool LPubFade) const; /*** LPub3D Mod end ***/ QImage GetStepImage(bool Zoom, int Width, int Height, lcStep Step); @@ -438,7 +438,7 @@ class lcModel /*** LPub3D Mod - Build Modification ***/ quint32 RemoveSelectedObjects(); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ bool mLPubFade; /*** LPub3D Mod end ***/ diff --git a/lclib/common/lc_profile.cpp b/lclib/common/lc_profile.cpp index 6bb7532da..34bba3e71 100644 --- a/lclib/common/lc_profile.cpp +++ b/lclib/common/lc_profile.cpp @@ -203,8 +203,8 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] = lcProfileEntry("Settings", "ViewpointZoomExtent", 1), // LC_PROFILE_VIEWPOINT_ZOOM_EXTENT /*** LPub3D Mod - View point zoom extent ***/ /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - lcProfileEntry("Settings", "LPubTrueFade", 1), // LC_PROFILE_LPUB_TRUE_FADE /*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ + lcProfileEntry("Settings", "LPubFadeHighlight", 1), // LC_PROFILE_LPUB_FADE_HIGHLIGHT /*** LPub3D Mod - lpub fade highlight ***/ /*** LPub3D Mod end ***/ /*** LPub3D Mod - parts load order ***/ diff --git a/lclib/common/lc_profile.h b/lclib/common/lc_profile.h index 6ca2dc2c9..9351c1a74 100644 --- a/lclib/common/lc_profile.h +++ b/lclib/common/lc_profile.h @@ -152,8 +152,8 @@ enum LC_PROFILE_KEY LC_PROFILE_VIEWPOINT_ZOOM_EXTENT, /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - LC_PROFILE_LPUB_TRUE_FADE, +/*** LPub3D Mod - lpub fade highlight ***/ + LC_PROFILE_LPUB_FADE_HIGHLIGHT, /*** LPub3D Mod end ***/ /*** LPub3D Mod - parts load order ***/ diff --git a/lclib/common/lc_scene.cpp b/lclib/common/lc_scene.cpp index 45fac14ec..a2923ac3b 100644 --- a/lclib/common/lc_scene.cpp +++ b/lclib/common/lc_scene.cpp @@ -16,7 +16,7 @@ lcScene::lcScene() mAllowLOD = true; mMeshLODDistance = 250.0f; mHasFadedParts = false; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ mHasLPubFadedParts = false; /*** LPub3D Mod end ***/ @@ -37,7 +37,7 @@ void lcScene::Begin(const lcMatrix44& ViewMatrix) mHighlightColor = lcVector4FromColor(Preferences.mHighlightNewPartsColor); mFadeColor = lcVector4FromColor(Preferences.mFadeStepsColor); mHasFadedParts = false; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ mHasLPubFadedParts = false; /*** LPub3D Mod end ***/ mTranslucentFade = mFadeColor.w != 1.0f; @@ -69,7 +69,7 @@ void lcScene::End() std::sort(mTranslucentMeshes.begin(), mTranslucentMeshes.end(), TranslucentMeshCompare); } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void lcScene::AddMesh(lcMesh* Mesh, const lcMatrix44& WorldMatrix, int ColorIndex, lcRenderMeshState State, bool LPubFade) /*** LPub3D Mod end ***/ { @@ -86,7 +86,7 @@ void lcScene::AddMesh(lcMesh* Mesh, const lcMatrix44& WorldMatrix, int ColorInde const bool Translucent = lcIsColorTranslucent(ColorIndex) || ForceTranslucent; const lcMeshFlags Flags = Mesh->mFlags; mHasFadedParts |= State == lcRenderMeshState::Faded; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ mHasLPubFadedParts |= LPubFade; /*** LPub3D Mod end ***/ @@ -334,7 +334,7 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy Context->SetPolygonOffset(lcPolygonOffset::None); } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawFadePrepass, bool DrawFaded, bool DrawNonFaded, lcFadeArgs LPubFadeArg) const /*** LPub3D Mod end ***/ { @@ -354,7 +354,7 @@ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawF TexturedMaterial = lcMaterialType::UnlitTextureDecal; } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ if (LPubFadeArg) { // Enable BFC @@ -411,7 +411,7 @@ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawF if (ColorIndex == gDefaultColor) ColorIndex = RenderMesh.ColorIndex; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ if (!LPubFadeArg && DrawFadePrepass && lcIsColorTranslucent(ColorIndex)) continue; /*** LPub3D Mod end ***/ @@ -466,7 +466,7 @@ void lcScene::DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawF Context->ClearTexture2D(); Context->SetPolygonOffset(lcPolygonOffset::None); -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ if (LPubFadeArg) { Context->SetDepthWrite(true); @@ -496,12 +496,12 @@ void lcScene::Draw(lcContext* Context) const const lcPreferences& Preferences = lcGetPreferences(); const bool DrawLines = Preferences.mDrawEdgeLines && Preferences.mLineWidth > 0.0f; const bool DrawConditional = Preferences.mDrawConditionalLines && Preferences.mLineWidth > 0.0f; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ // 03/22/2021 8039f5b Draw conditional lines on a separate pass. - const bool LPubTrueFade = gApplication->LPubFadeSteps() && // turn off during HTML Steps export - gApplication->UseLPubTrueFade() && - mHasLPubFadedParts && - !mTranslucentMeshes.IsEmpty(); + const bool LPubFadeHighlight = gApplication->LPubFadeParts() && // turn off during HTML Steps export + Preferences.mLPubFadeHighlight && + mHasLPubFadedParts && + !mTranslucentMeshes.IsEmpty(); /*** LPub3D Mod end ***/ // lcShadingMode ShadingMode = Preferences.mShadingMode; @@ -522,8 +522,8 @@ void lcScene::Draw(lcContext* Context) const { const int SolidPrimitiveTypes = LC_MESH_TRIANGLES | LC_MESH_TEXTURED_TRIANGLES | (DrawLines ? LC_MESH_LINES : 0); -/*** LPub3D Mod - true fade ***/ - if (LPubTrueFade) // Fade - Flat +/*** LPub3D Mod - lpub fade highlight ***/ + if (LPubFadeHighlight) // Fade - Flat { // 1. Draw opaque mesh triangles - without mesh lines DrawOpaqueMeshes(Context, false, SolidPrimitiveTypes, false, true); @@ -581,8 +581,8 @@ void lcScene::Draw(lcContext* Context) const } else { -/*** LPub3D Mod - true fade ***/ - if (LPubTrueFade) // Fade - Default +/*** LPub3D Mod - lpub fade highlight ***/ + if (LPubFadeHighlight) // Fade - Default { // 1. Draw opaque mesh triangles - without mesh lines DrawOpaqueMeshes(Context, true, LC_MESH_TRIANGLES | LC_MESH_TEXTURED_TRIANGLES , false, true); diff --git a/lclib/common/lc_scene.h b/lclib/common/lc_scene.h index 924d0e053..1098e4c3f 100644 --- a/lclib/common/lc_scene.h +++ b/lclib/common/lc_scene.h @@ -3,7 +3,7 @@ #include "lc_mesh.h" #include "lc_array.h" -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ enum lcFadeArgs { LC_NO_FADE, @@ -96,7 +96,7 @@ class lcScene void Begin(const lcMatrix44& ViewMatrix); void End(); -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void AddMesh(lcMesh* Mesh, const lcMatrix44& WorldMatrix, int ColorIndex, lcRenderMeshState State, bool LPubFade = false); /*** LPub3D Mod end ***/ @@ -110,7 +110,7 @@ class lcScene protected: void DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTypes, bool DrawFaded, bool DrawNonFaded) const; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void DrawTranslucentMeshes(lcContext* Context, bool DrawLit, bool DrawFadePrepass, bool DrawFaded, bool DrawNonFaded, lcFadeArgs LPubFadeArg = LC_NO_FADE) const; /*** LPub3D Mod end ***/ void DrawDebugNormals(lcContext* Context, const lcMesh* Mesh) const; @@ -126,7 +126,7 @@ class lcScene lcVector4 mFadeColor; lcVector4 mHighlightColor; bool mHasFadedParts; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ bool mHasLPubFadedParts; /*** LPub3D Mod end ***/ bool mTranslucentFade; diff --git a/lclib/common/piece.cpp b/lclib/common/piece.cpp index 1d4624703..f9315a107 100644 --- a/lclib/common/piece.cpp +++ b/lclib/common/piece.cpp @@ -593,7 +593,7 @@ void lcPiece::DrawInterface(lcContext* Context, const lcScene& Scene) const } else { -/*** LPub3D Mod - Selected Parts ***/ +/*** LPub3D Mod - Selected Parts ***/ if (Preferences.mBuildModificationEnabled) { const lcVector4 BMSelectedColor = lcVector4FromColor(Preferences.mBMObjectSelectedColor); @@ -604,7 +604,7 @@ void lcPiece::DrawInterface(lcContext* Context, const lcScene& Scene) const const lcVector4 SelectedColor = lcVector4FromColor(Preferences.mObjectSelectedColor); Context->SetColor(SelectedColor); } -/*** LPub3D Mod end ***/ +/*** LPub3D Mod end ***/ } Context->SetVertexBufferPointer(LineVerts); @@ -694,7 +694,7 @@ void lcPiece::RemoveKeyFrames() mRotationKeys.ChangeKey(lcMatrix33(mModelWorld), 1, true); } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void lcPiece::AddMainModelRenderMeshes(lcScene* Scene, bool Highlight, bool Fade, bool LPubFade) const /*** LPub3D Mod end ***/ { @@ -719,7 +719,7 @@ void lcPiece::AddMainModelRenderMeshes(lcScene* Scene, bool Highlight, bool Fade RenderMeshState = lcRenderMeshState::Faded; } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ if (!mMesh) mPieceInfo->AddRenderMeshes(Scene, mModelWorld, mColorIndex, RenderMeshState, ParentActive, LPubFade); else @@ -730,7 +730,7 @@ void lcPiece::AddMainModelRenderMeshes(lcScene* Scene, bool Highlight, bool Fade Scene->AddInterfaceObject(this); } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void lcPiece::AddSubModelRenderMeshes(lcScene* Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive, bool LPubFade) const /*** LPub3D Mod end ***/ { @@ -746,7 +746,7 @@ void lcPiece::AddSubModelRenderMeshes(lcScene* Scene, const lcMatrix44& WorldMat else if (ParentActive) RenderMeshState = IsFocused() ? lcRenderMeshState::Focused : (IsSelected() ? lcRenderMeshState::Selected : lcRenderMeshState::Default); -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ if (!mMesh) mPieceInfo->AddRenderMeshes(Scene, lcMul(mModelWorld, WorldMatrix), ColorIndex, RenderMeshState, ActiveSubmodelInstance == this, LPubFade); else diff --git a/lclib/common/piece.h b/lclib/common/piece.h index 1d964f830..2914ee33c 100644 --- a/lclib/common/piece.h +++ b/lclib/common/piece.h @@ -147,7 +147,7 @@ class lcPiece : public lcObject return mPieceModified; } /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void SetLPubFade(bool Faded) { mLPubFade = Faded; @@ -164,7 +164,7 @@ class lcPiece : public lcObject void DrawInterface(lcContext* Context, const lcScene& Scene) const override; void RemoveKeyFrames() override; -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void AddMainModelRenderMeshes(lcScene* Scene, bool Highlight, bool Fade, bool LPubFade = false) const; void AddSubModelRenderMeshes(lcScene* Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive, bool LPubFade = false) const; /*** LPub3D Mod end ***/ @@ -396,7 +396,7 @@ class lcPiece : public lcObject /*** LPub3D Mod - Piece modified ***/ int mPieceModified; /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ int mLPubFade; /*** LPub3D Mod end ***/ QString mID; diff --git a/lclib/common/pieceinf.cpp b/lclib/common/pieceinf.cpp index 1cccbe1bd..147027600 100644 --- a/lclib/common/pieceinf.cpp +++ b/lclib/common/pieceinf.cpp @@ -380,24 +380,24 @@ void PieceInfo::AddRenderMesh(lcScene& Scene) Scene.AddMesh(mMesh, lcMatrix44Identity(), gDefaultColor, lcRenderMeshState::Default); } -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void PieceInfo::AddRenderMeshes(lcScene* Scene, const lcMatrix44& WorldMatrix, int ColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive, bool LPubFade) const /*** LPub3D Mod end ***/ { if (mMesh || IsPlaceholder()) -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ Scene->AddMesh(mMesh, WorldMatrix, ColorIndex, RenderMeshState, LPubFade); /*** LPub3D Mod end ***/ if (IsModel()) -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ mModel->AddSubModelRenderMeshes(Scene, WorldMatrix, ColorIndex, RenderMeshState, ParentActive, LPubFade); /*** LPub3D Mod end ***/ else if (IsProject()) { const lcModel* const Model = mProject->GetMainModel(); if (Model) -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ Model->AddSubModelRenderMeshes(Scene, WorldMatrix, ColorIndex, RenderMeshState, ParentActive, LPubFade); /*** LPub3D Mod end ***/ } diff --git a/lclib/common/pieceinf.h b/lclib/common/pieceinf.h index 19e648a6d..cf6c1582f 100644 --- a/lclib/common/pieceinf.h +++ b/lclib/common/pieceinf.h @@ -174,7 +174,7 @@ class PieceInfo /*** LPub3D Mod end ***/ void ZoomExtents(float FoV, float AspectRatio, lcMatrix44& ProjectionMatrix, lcMatrix44& ViewMatrix) const; void AddRenderMesh(lcScene& Scene); -/*** LPub3D Mod - true fade ***/ +/*** LPub3D Mod - lpub fade highlight ***/ void AddRenderMeshes(lcScene* Scene, const lcMatrix44& WorldMatrix, int ColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive, bool LPubFade = false) const; /*** LPub3D Mod end ***/ diff --git a/lclib/common/project.cpp b/lclib/common/project.cpp index 2b6937126..0cecd0686 100644 --- a/lclib/common/project.cpp +++ b/lclib/common/project.cpp @@ -100,10 +100,9 @@ Project::Project(bool IsPreview, bool IsRenderImage) mActiveModel->CreatePieceInfo(this); mActiveModel->SetSaved(); mModels.Add(mActiveModel); -/*** LPub3D Mod - true fade ***/ - mFadeSteps = Preferences::enableFadeSteps; - mHighlightStep = Preferences::enableHighlightStep; - mTrueFade = gApplication->mPreferences.mLPubTrueFade; +/*** LPub3D Mod - lpub fade highlight ***/ + mLPubFadeParts = false; + mLPubHighlightParts = false; /*** LPub3D Mod end ***/ if (!mIsPreview && gMainWindow) QObject::connect(&mFileWatcher, SIGNAL(fileChanged(const QString&)), gMainWindow, SLOT(ProjectFileChanged(const QString&))); @@ -115,7 +114,8 @@ Project::~Project() } /*** LPub3D Mod - Camera Globe and Image Export ***/ -void Project::SetRenderAttributes(const int Renderer, +void Project::SetRenderAttributes( + const int Renderer, const int ImageType, const int ImageWidth, const int ImageHeight, @@ -123,10 +123,10 @@ void Project::SetRenderAttributes(const int Renderer, const int PageHeight, const QString FileName, const float Resolution, -/*** LPub3D Mod - true fade ***/ - const bool TrueFade, - const bool FadeSteps, - const bool HighlightStep) +/*** LPub3D Mod - lpub fade highlight ***/ + const bool LPubFadeHighlight, + const bool FadeParts, + const bool HighlightParts) /*** LPub3D Mod end ***/ { mRenderer = Renderer; @@ -138,10 +138,9 @@ void Project::SetRenderAttributes(const int Renderer, lcSetProfileInt(LC_PROFILE_IMAGE_WIDTH,ImageWidth); lcSetProfileInt(LC_PROFILE_IMAGE_HEIGHT,ImageHeight); mViewerLoaded = true; -/*** LPub3D Mod - true fade ***/ - mTrueFade =TrueFade; - mFadeSteps =FadeSteps; - mHighlightStep =HighlightStep; +/*** LPub3D Mod - lpub fade highlight ***/ + mLPubFadeParts = LPubFadeHighlight ? FadeParts : false; + mLPubHighlightParts = LPubFadeHighlight ? HighlightParts : false; /*** LPub3D Mod end ***/ } void Project::SetImageSize( diff --git a/lclib/common/project.h b/lclib/common/project.h index 2a0adab0e..0ad12a1ef 100644 --- a/lclib/common/project.h +++ b/lclib/common/project.h @@ -109,10 +109,10 @@ class Project const int PageHeight, const QString FileName, const float Resolution, -/*** LPub3D Mod - true fade ***/ - const bool TrueFade, - const bool FadeSteps, - const bool HighlightStep); +/*** LPub3D Mod - lpub fade highlight ***/ + const bool LPubFadeHighlight, + const bool FadeParts, + const bool HighlightParts); /*** LPub3D Mod end ***/ void SetImageSize( const int ImageWidth, @@ -230,10 +230,9 @@ class Project /*** LPub3D Mod - set Timeline top item ***/ QString mTimelineTopItem; /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - bool mTrueFade; - bool mFadeSteps; - bool mHighlightStep; +/*** LPub3D Mod - lpub fade highlight ***/ + bool mLPubFadeParts; + bool mLPubHighlightParts; friend class lcApplication; /*** LPub3D Mod end ***/ diff --git a/lclib/qt/lc_qpreferencesdialog.cpp b/lclib/qt/lc_qpreferencesdialog.cpp index 14880d733..a670caa05 100644 --- a/lclib/qt/lc_qpreferencesdialog.cpp +++ b/lclib/qt/lc_qpreferencesdialog.cpp @@ -418,8 +418,8 @@ void lcQPreferencesDialog::setOptions(lcPreferencesDialogOptions* Options) ui->viewColorIconsRadio->setChecked(!preferredIcons); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - ui->LPubTrueFade->setChecked(mOptions->Preferences.mLPubTrueFade); +/*** LPub3D Mod - lpub fade highlight ***/ + ui->LPubFadeHighlight->setChecked(mOptions->Preferences.mLPubFadeHighlight); /*** LPub3D Mod end ***/ /*** LPub3D Mod - set preferences dialog properties ***/ @@ -586,8 +586,8 @@ void lcQPreferencesDialog::accept() mOptions->Preferences.mViewPieceIcons = ui->viewPieceIconsRadio->isChecked(); /*** LPub3D Mod end ***/ -/*** LPub3D Mod - true fade ***/ - mOptions->Preferences.mLPubTrueFade = ui->LPubTrueFade->isChecked(); +/*** LPub3D Mod - lpub fade highlight ***/ + mOptions->Preferences.mLPubFadeHighlight = ui->LPubFadeHighlight->isChecked(); /*** LPub3D Mod end ***/ QDialog::accept(); @@ -883,12 +883,29 @@ void lcQPreferencesDialog::on_MeshLODSlider_valueChanged() ui->MeshLODLabel->setText(QString::number(static_cast(Value))); } +/*** LPub3D Mod - lpub fade highlight ***/ +void lcQPreferencesDialog::on_LPubFadeHighlight_toggled() +{ + if (ui->LPubFadeHighlight->isChecked()) + { + if (ui->FadeSteps->isChecked()) + ui->FadeSteps->setChecked(false); + if (ui->HighlightNewParts->isChecked()) + ui->HighlightNewParts->setChecked(false); + } +} +/*** LPub3D Mod end ***/ + void lcQPreferencesDialog::on_FadeSteps_toggled() { ui->FadeStepsColor->setEnabled(ui->FadeSteps->isChecked()); /*** LPub3D Mod - Reset fade default colours ***/ ui->ResetFadeStepsButton->setEnabled(ui->FadeSteps->isChecked()); /*** LPub3D Mod end ***/ +/*** LPub3D Mod - lpub fade highlight ***/ + if (ui->FadeSteps->isChecked() && ui->LPubFadeHighlight->isChecked()) + ui->LPubFadeHighlight->setChecked(false); +/*** LPub3D Mod end ***/ } void lcQPreferencesDialog::on_HighlightNewParts_toggled() @@ -897,6 +914,10 @@ void lcQPreferencesDialog::on_HighlightNewParts_toggled() /*** LPub3D Mod - Reset highlight default colours ***/ ui->ResetHighlightNewPartsButton->setEnabled(ui->HighlightNewParts->isChecked()); /*** LPub3D Mod end ***/ +/*** LPub3D Mod - lpub fade highlight ***/ + if (ui->HighlightNewParts->isChecked() && ui->LPubFadeHighlight->isChecked()) + ui->LPubFadeHighlight->setChecked(false); +/*** LPub3D Mod end ***/ } void lcQPreferencesDialog::on_gridStuds_toggled() diff --git a/lclib/qt/lc_qpreferencesdialog.h b/lclib/qt/lc_qpreferencesdialog.h index 8a8682248..db34b9c51 100644 --- a/lclib/qt/lc_qpreferencesdialog.h +++ b/lclib/qt/lc_qpreferencesdialog.h @@ -86,6 +86,9 @@ public slots: void on_ConditionalLinesCheckBox_toggled(); void on_LineWidthSlider_valueChanged(); void on_MeshLODSlider_valueChanged(); +/*** LPub3D Mod - lpub fade highlight ***/ + void on_LPubFadeHighlight_toggled(); +/*** LPub3D Mod end ***/ void on_FadeSteps_toggled(); void on_HighlightNewParts_toggled(); void on_gridStuds_toggled(); diff --git a/lclib/qt/lc_qpreferencesdialog.ui b/lclib/qt/lc_qpreferencesdialog.ui index 2d4523b48..50a000e8b 100644 --- a/lclib/qt/lc_qpreferencesdialog.ui +++ b/lclib/qt/lc_qpreferencesdialog.ui @@ -477,16 +477,6 @@ - - - - Make faded parts translucent but do not draw back faces - - - LPub True Fade - - - @@ -626,10 +616,10 @@ - Enable fade previous steps when exporting HTML Steps + Enable visual editor fade parts behaviour - HTML Export Fade Previous Steps: + Fade Parts: @@ -653,10 +643,10 @@ - Enable highlight current step parts when exporting HTML Steps + Enable visual editor highlight parts behaviour - HTML Export Highlight New Parts: + Highlight Parts: @@ -704,6 +694,16 @@ + + + + Make faded parts translucent but do not draw back faces or highlight part edges using LPub3D behaviour + + + LPub Fade and Highlight + + + @@ -2611,7 +2611,7 @@ ShadingMode studStyleCombo HighContrastButton - LPubTrueFade + LPubFadeHighlight ConditionalLinesCheckBox FadeSteps FadeStepsColor diff --git a/mainApp/commonmenus.cpp b/mainApp/commonmenus.cpp index 6725aca58..eb7c6a074 100644 --- a/mainApp/commonmenus.cpp +++ b/mainApp/commonmenus.cpp @@ -5323,19 +5323,26 @@ void CommonMenus::setWhatsThis() " High Contrast Stud And Edge Color Setttings allow\n" " you to configure part edge and stud cylinder\n" " color settings.\n\n" - " - LPub True Fade: toggle on or off drawing the back\n" - " faces of faded parts.\n\n" + " - LPub Fade and Highlight: toggle on or off rendering\n" + " fade and highlight parts using %1 behaviour.\n" + " When enabled, the back faces of faded parts will\n" + " not be drawn. Also, when enabled, Highlight New\n" + " Parts and Fade Previous Steps are disabled.\n\n" " - Draw Conditional Lines: toggle on or off drawing\n" " conditional lines.\n\n" - " - HTML Export Fade Prefious Steps: toggle on or off\n" - " fade previous steps when exporting HTML steps.\n\n" - " - HTML Export Highlight New Parts: toggle on or off\n" - " highlight current step when exporting HTML steps.\n\n" + " - Fade Parts: toggle on or off fade parts using the\n" + " Visual Editor/Native Renderer fade behaviour.\n\n" + " - Highlight Parts: toggle on or off highlight parts\n" + " using the Visual Editor/Native highlight behavoiur.\n\n" + " When Fade or Highlight Parts is enabled, LPub Fade\n" + " and Highlight is disabled. Also, These settings are\n" + " applied when exporting HTML steps.\n\n" " - Automate Edge Color: automatically adjust part edge\n" " colors based on the following configured settings:\n" " * Contrast: the amount of contrast.\n\n" " * Saturation: the amount of edge color tint\n" - " or shade.%1\n") + " or shade.%2\n") + .arg(QLatin1String(VER_PRODUCTNAME_STR)) .arg( #ifdef QT_DEBUG_MODE QLatin1String("\n\n WT_CONTROL_LPUB3D_PREFERENCES_RENDERING") diff --git a/mainApp/docs/README.txt b/mainApp/docs/README.txt index 4b9eaabff..d1ab60e2b 100755 --- a/mainApp/docs/README.txt +++ b/mainApp/docs/README.txt @@ -1,4 +1,4 @@ -LPub3D 2.4.6.195.3306 (08 05 2023 05:55:38) +LPub3D 2.4.6.196.3307 (08 05 2023 05:56:01) Features, enhancements, fixes and changes ------------ diff --git a/mainApp/docs/RELEASE_NOTES.html b/mainApp/docs/RELEASE_NOTES.html index 539abb5e3..38857c03a 100644 --- a/mainApp/docs/RELEASE_NOTES.html +++ b/mainApp/docs/RELEASE_NOTES.html @@ -18,7 +18,7 @@
-

LPub3D 2.4.6.195.3306 (08 05 2023 05:55:38)

+

LPub3D 2.4.6.196.3307 (08 05 2023 05:56:01)


LPub3D Official release.
diff --git a/mainApp/extras/LPub3D_Npp_UDL.xml b/mainApp/extras/LPub3D_Npp_UDL.xml index 09b1333bd..c7db7fe60 100644 --- a/mainApp/extras/LPub3D_Npp_UDL.xml +++ b/mainApp/extras/LPub3D_Npp_UDL.xml @@ -14,8 +14,8 @@ ;; ;; Author......: Trevor SANDY ;; Name........: LPub3D_Npp_UDL.xml -;; Version.....: 2.4.6.195.3306 -;; Last Update.: Mon, 08 May 2023 05:55:38 +0200 +;; Version.....: 2.4.6.196.3307 +;; Last Update.: Mon, 08 May 2023 05:56:01 +0200 ;; License.....: GPLv3 ;; Homepage....: https://trevorsandy.github.io/lpub3d ;; Copyright (C) 2021 - 2023 by Trevor SANDY @@ -47,7 +47,7 @@ - ADJUST_ON_ITEM_OFFSET ALLOC ANGLE ANGLE_KEY ANNOTATE ANNOTATION APP_PLUG APP_PLUG_IMAGE APPLY AREA ARROW ASPECT ASSEM ASSEMBLED AT_MODEL AT_STEP AT_TOP ATTRIBUTE_PIXMAP ATTRIBUTE_TEXT AUTHOR AUTOMATE_EDGE_COLOR AXLE BACK BACKGROUND BASE_BOTTOM BASE_LEFT BASE_RIGHT BASE_TOP BEAM BEGIN BLACK_EDGE_COLOR BOM BORDER BOTTOM BOTTOM_LEFT BOTTOM_RIGHT BRICKLINK BRING_TO_FRONT BUFEXCHG BUILD_MOD BUILD_MOD_ENABLED CABLE CALLOUT CALLOUT_INSTANCE CALLOUT_POINTER CALLOUT_UNDERPINNING CAMERA CAMERA_ANGLES CAMERA_DISTANCE CAMERA_DEFAULT_DISTANCE_FACTOR CAMERA_DISTANCE_NATIVE CAMERA_FOV CAMERA_NAME CAMERA_ORTHOGRAPHIC CAMERA_POSITION CAMERA_TARGET CAMERA_UPVECTOR CAMERA_ZFAR CAMERA_ZNEAR CENTER CHAIN CIRCLE_STYLE CLEAR COLOR COLOR_LIGHT_DARK_INDEX COLOR_RGB COLOR_RGB_KEY COLS COMMENT CONNECTOR CONSOLIDATE_INSTANCE_COUNT CONSTRAIN CONTENT CONTINUOUS_STEP_NUMBERS CONTRAST COUNT_GROUP_STEPS COVER_PAGE COVER_PAGE_MODEL_VIEW_ENABLED CROSS CSI_ANNOTATION CSI_ANNOTATION_PART CUSTOM_LENGTH CUTOFF_DISTANCE CUTOFF_DISTANCE_KEY DARK_EDGE_COLOR DASH DASH_DOT DASH_DOT_DOT DESCRIPTION DISPLAY DISPLAY_MODEL DISPLAY_PAGE_NUMBER DIVIDER DIVIDER_ITEM DIVIDER_LINE DIVIDER_POINTER DIVIDER_POINTER_ATTRIBUTE DOCUMENT_AUTHOR DOCUMENT_AUTHOR_BACK DOCUMENT_AUTHOR_FRONT DOCUMENT_COVER_IMAGE DOCUMENT_LOGO DOCUMENT_LOGO_BACK DOCUMENT_LOGO_FRONT DOCUMENT_TITLE DOCUMENT_TITLE_BACK DOCUMENT_TITLE_FRONT DOT DPCM DPI EDGE_COLOR ELECTRIC_CABLE ELEMENT ELEMENT_STYLE ENABLE ENABLE_SETTING ENABLE_STYLE ENABLE_TEXT_PLACEMENT ENABLE ENABLED END END_MOD EXTENDED FADE_STEPS FIBER_OPTIC_CABLE FILE FILL FINAL_MODEL_ENABLED FIXED_ANNOTATIONS FLATTENED_LOGO FLEX_CABLE FLEXIBLE_AXLE FLEXIBLE_TUBE FONT FONT_COLOR FOR_SUBMODEL FOV FREEFORM FRONT GENERATED GRADIENT GROUP GROUP_DEF GROUP_NXT GROUP_OBJ HEIGHT HIDDEN HIDE HIDE_TIP HIGH_CONTRAST HIGH_CONTRAST_WITH_LOGO HIGHLIGHT_STEP HOME HORIZONTAL HOSE HTML_TEXT ICON ID IGN IMAGE IMAGE_SIZE INCLUDE INCLUDE_SUBMODELS INSERT INSIDE INSTANCE_COUNT JUSTIFY_CENTER JUSTIFY_CENTER_HORIZONTAL JUSTIFY_CENTER_VERTICAL JUSTIFY_LEFT LANDSCAPE LDGLITE LDGLITE_PARMS LDRAW_TYPE LDVIEW LDVIEW_PARMS LDVIEW_POV_GENERATOR LEFT LEGO LEGO_DISCLAIMER LIGHT LINE LINE_WIDTH LOAD_UNOFFICIAL_PARTS_IN_EDITOR LOCAL_LEGO_ELEMENTS_FILE MARGINS MARKER MODEL MODEL_CATEGORY MODEL_DESCRIPTION MODEL_ID MODEL_PARTS MODEL_SCALE MODEL_STEP_NUMBER MULTI_STEP MULTI_STEPS NAME NATIVE NONE NUMBER OFFSET OPACITY ORIENTATION ORTHOGRAPHIC OUTLINE_LOGO OUTSIDE PAGE PAGE_FOOTER PAGE_HEADER PAGE_LENGTH PAGE_NUMBER PAGE_POINTER PANEL PARSE_NOSTEP PART PART_ELEMENTS PART_GROUP PART_GROUP_ENABLE PART_ROTATION PATH_ANCHOR PATH_CAP PATH_LENGTH PATH_POINT PATH_SKIN PER_STEP PICTURE PIECE PIVOT PLACEMENT PLAIN PLASTIC_TREAD PLI PLI_ANNOTATION PLI_GRABBER PLI_INSTANCE PLI_PART PLI_PART_GROUP PNEUMATIC_TUBE POINTER POINTER_ATTRIBUTE POINTER_BASE POINTER_GRABBER POINTER_HEAD POINTER_SEG_FIRST POINTER_SEG_SECOND POINTER_SEG_THIRD PORTRAIT POSITION POSITION_KEY POVRAY POVRAY_PARMS POWER POWER_KEY PREFERRED_RENDERER PRIMARY PRIMARY_DIRECTION PUBLISH_COPYRIGHT PUBLISH_COPYRIGHT_BACK PUBLISH_DESCRIPTION PUBLISH_EMAIL PUBLISH_EMAIL_BACK PUBLISH_URL PUBLISH_URL_BACK RADIUS RADIUS_AND_SPOT_BLEND_KEY RADIUS_KEY RANGE RECTANGLE_STYLE REMOVE RESERVE RESOLUTION RETRIEVE RIBBED_TUBE RICH_TEXT RIGHT RIGID_TUBE ROTATE_ICON ROTATED ROTATION_KEY ROTSTEP ROUND ROUNDED_TOP_LOGO RUBBER_BAND RUBBER_TREAD SATURATION SCALE SCENE SCRIPT SECONDARY SECONDARY_DIRECTION SEND_TO_BACK SEPARATOR SETUP SHAPE SHAPE_KEY SHARP_TOP_LOGO SHOW SHOW_GROUP_STEP_NUMBER SHOW_INSTANCE_COUNT SHOW_STEP_NUM SHOW_STEP_NUMBER SHOW_SUBMODEL_IN_CALLOUT SHOW_TOP_MODEL SILHOUETTE SINGLE_CALL SINGLE_CALL_EXPORT_LIST SINGLE_STEP SIZE SIZE_KEY SKIP_BEGIN SKIP_END SNAP_CLEAR SNAP_CLP SNAP_CYL SNAP_FGR SNAP_GEN SNAP_INCL SNAP_SPH SOLID SORT SORT_BY SORT_OPTION SORT_ORDER SPECULAR SPECULAR_KEY SPOT_BLEND SPOT_SIZE SPOT_SIZE_KEY SPRING_ANCHOR SPRING_CAP SPRING_POINT SPRING_SECTION SQUARE SQUARE_STYLE START_PAGE_NUMBER START_STEP_NUMBER STEP_GROUP STEP_HIDE STEP_NUMBER STEP_PLI STEP_RECTANGLE STEP_SIZE STEPS STORE STRENGTH STRENGTH_KEY STRETCH STUD_CYLINDER_COLOR STUD_STYLE STYLE SUB SUBMODEL_BACKGROUND_COLOR SUBMODEL_DISPLAY SUBMODEL_FONT SUBMODEL_FONT_COLOR SUBMODEL_GRABBER SUBMODEL_INST_COUNT SUBMODEL_INSTANCE SUBMODEL_INSTANCE_COUNT SUBMODEL_INSTANCE_COUNT_OVERRIDE SUBMODEL_ROTATION SYNTHESIZED TARGET_POSITION TARGET_POSITION_KEY TERTIARY TERTIARY_DIRECTION TEXT TEXT_PLACEMENT THICKNESS THIN_LINE_LOGO TILE TIP TOGGLE_PAGE_NUMBER_PLACEMENT TOP TOP_LEFT TOP_RIGHT TRANSPARENT TRUE_FADE TYPE TYPE_KEY UP_VECTOR UP_VECTOR_KEY USE USE_FREE_FORM USE_TITLE USE_TITLE_AND_FREE_FORM VERTICAL VIEW_ANGLE WHOLE WIDTH ZFAR ZNEAR + ADJUST_ON_ITEM_OFFSET ALLOC ANGLE ANGLE_KEY ANNOTATE ANNOTATION APP_PLUG APP_PLUG_IMAGE APPLY AREA ARROW ASPECT ASSEM ASSEMBLED AT_MODEL AT_STEP AT_TOP ATTRIBUTE_PIXMAP ATTRIBUTE_TEXT AUTHOR AUTOMATE_EDGE_COLOR AXLE BACK BACKGROUND BASE_BOTTOM BASE_LEFT BASE_RIGHT BASE_TOP BEAM BEGIN BLACK_EDGE_COLOR BOM BORDER BOTTOM BOTTOM_LEFT BOTTOM_RIGHT BRICKLINK BRING_TO_FRONT BUFEXCHG BUILD_MOD BUILD_MOD_ENABLED CABLE CALLOUT CALLOUT_INSTANCE CALLOUT_POINTER CALLOUT_UNDERPINNING CAMERA CAMERA_ANGLES CAMERA_DISTANCE CAMERA_DEFAULT_DISTANCE_FACTOR CAMERA_DISTANCE_NATIVE CAMERA_FOV CAMERA_NAME CAMERA_ORTHOGRAPHIC CAMERA_POSITION CAMERA_TARGET CAMERA_UPVECTOR CAMERA_ZFAR CAMERA_ZNEAR CENTER CHAIN CIRCLE_STYLE CLEAR COLOR COLOR_LIGHT_DARK_INDEX COLOR_RGB COLOR_RGB_KEY COLS COMMENT CONNECTOR CONSOLIDATE_INSTANCE_COUNT CONSTRAIN CONTENT CONTINUOUS_STEP_NUMBERS CONTRAST COUNT_GROUP_STEPS COVER_PAGE COVER_PAGE_MODEL_VIEW_ENABLED CROSS CSI_ANNOTATION CSI_ANNOTATION_PART CUSTOM_LENGTH CUTOFF_DISTANCE CUTOFF_DISTANCE_KEY DARK_EDGE_COLOR DASH DASH_DOT DASH_DOT_DOT DESCRIPTION DISPLAY DISPLAY_MODEL DISPLAY_PAGE_NUMBER DIVIDER DIVIDER_ITEM DIVIDER_LINE DIVIDER_POINTER DIVIDER_POINTER_ATTRIBUTE DOCUMENT_AUTHOR DOCUMENT_AUTHOR_BACK DOCUMENT_AUTHOR_FRONT DOCUMENT_COVER_IMAGE DOCUMENT_LOGO DOCUMENT_LOGO_BACK DOCUMENT_LOGO_FRONT DOCUMENT_TITLE DOCUMENT_TITLE_BACK DOCUMENT_TITLE_FRONT DOT DPCM DPI EDGE_COLOR ELECTRIC_CABLE ELEMENT ELEMENT_STYLE ENABLE ENABLE_SETTING ENABLE_STYLE ENABLE_TEXT_PLACEMENT ENABLE ENABLED END END_MOD EXTENDED FADE_STEPS FIBER_OPTIC_CABLE FILE FILL FINAL_MODEL_ENABLED FIXED_ANNOTATIONS FLATTENED_LOGO FLEX_CABLE FLEXIBLE_AXLE FLEXIBLE_TUBE FONT FONT_COLOR FOR_SUBMODEL FOV FREEFORM FRONT GENERATED GRADIENT GROUP GROUP_DEF GROUP_NXT GROUP_OBJ HEIGHT HIDDEN HIDE HIDE_TIP HIGH_CONTRAST HIGH_CONTRAST_WITH_LOGO HIGHLIGHT_STEP HOME HORIZONTAL HOSE HTML_TEXT ICON ID IGN IMAGE IMAGE_SIZE INCLUDE INCLUDE_SUBMODELS INSERT INSIDE INSTANCE_COUNT JUSTIFY_CENTER JUSTIFY_CENTER_HORIZONTAL JUSTIFY_CENTER_VERTICAL JUSTIFY_LEFT LANDSCAPE LDGLITE LDGLITE_PARMS LDRAW_TYPE LDVIEW LDVIEW_PARMS LDVIEW_POV_GENERATOR LEFT LEGO LEGO_DISCLAIMER LIGHT LINE LINE_WIDTH LOAD_UNOFFICIAL_PARTS_IN_EDITOR LOCAL_LEGO_ELEMENTS_FILE LPUB_FADE LPUB_HIGHLIGHT MARGINS MARKER MODEL MODEL_CATEGORY MODEL_DESCRIPTION MODEL_ID MODEL_PARTS MODEL_SCALE MODEL_STEP_NUMBER MULTI_STEP MULTI_STEPS NAME NATIVE NONE NUMBER OFFSET OPACITY ORIENTATION ORTHOGRAPHIC OUTLINE_LOGO OUTSIDE PAGE PAGE_FOOTER PAGE_HEADER PAGE_LENGTH PAGE_NUMBER PAGE_POINTER PANEL PARSE_NOSTEP PART PART_ELEMENTS PART_GROUP PART_GROUP_ENABLE PART_ROTATION PATH_ANCHOR PATH_CAP PATH_LENGTH PATH_POINT PATH_SKIN PER_STEP PICTURE PIECE PIVOT PLACEMENT PLAIN PLASTIC_TREAD PLI PLI_ANNOTATION PLI_GRABBER PLI_INSTANCE PLI_PART PLI_PART_GROUP PNEUMATIC_TUBE POINTER POINTER_ATTRIBUTE POINTER_BASE POINTER_GRABBER POINTER_HEAD POINTER_SEG_FIRST POINTER_SEG_SECOND POINTER_SEG_THIRD PORTRAIT POSITION POSITION_KEY POVRAY POVRAY_PARMS POWER POWER_KEY PREFERRED_RENDERER PRIMARY PRIMARY_DIRECTION PUBLISH_COPYRIGHT PUBLISH_COPYRIGHT_BACK PUBLISH_DESCRIPTION PUBLISH_EMAIL PUBLISH_EMAIL_BACK PUBLISH_URL PUBLISH_URL_BACK RADIUS RADIUS_AND_SPOT_BLEND_KEY RADIUS_KEY RANGE RECTANGLE_STYLE REMOVE RESERVE RESOLUTION RETRIEVE RIBBED_TUBE RICH_TEXT RIGHT RIGID_TUBE ROTATE_ICON ROTATED ROTATION_KEY ROTSTEP ROUND ROUNDED_TOP_LOGO RUBBER_BAND RUBBER_TREAD SATURATION SCALE SCENE SCRIPT SECONDARY SECONDARY_DIRECTION SEND_TO_BACK SEPARATOR SETUP SHAPE SHAPE_KEY SHARP_TOP_LOGO SHOW SHOW_GROUP_STEP_NUMBER SHOW_INSTANCE_COUNT SHOW_STEP_NUM SHOW_STEP_NUMBER SHOW_SUBMODEL_IN_CALLOUT SHOW_TOP_MODEL SILHOUETTE SINGLE_CALL SINGLE_CALL_EXPORT_LIST SINGLE_STEP SIZE SIZE_KEY SKIP_BEGIN SKIP_END SNAP_CLEAR SNAP_CLP SNAP_CYL SNAP_FGR SNAP_GEN SNAP_INCL SNAP_SPH SOLID SORT SORT_BY SORT_OPTION SORT_ORDER SPECULAR SPECULAR_KEY SPOT_BLEND SPOT_SIZE SPOT_SIZE_KEY SPRING_ANCHOR SPRING_CAP SPRING_POINT SPRING_SECTION SQUARE SQUARE_STYLE START_PAGE_NUMBER START_STEP_NUMBER STEP_GROUP STEP_HIDE STEP_NUMBER STEP_PLI STEP_RECTANGLE STEP_SIZE STEPS STORE STRENGTH STRENGTH_KEY STRETCH STUD_CYLINDER_COLOR STUD_STYLE STYLE SUB SUBMODEL_BACKGROUND_COLOR SUBMODEL_DISPLAY SUBMODEL_FONT SUBMODEL_FONT_COLOR SUBMODEL_GRABBER SUBMODEL_INST_COUNT SUBMODEL_INSTANCE SUBMODEL_INSTANCE_COUNT SUBMODEL_INSTANCE_COUNT_OVERRIDE SUBMODEL_ROTATION SYNTHESIZED TARGET_POSITION TARGET_POSITION_KEY TERTIARY TERTIARY_DIRECTION TEXT TEXT_PLACEMENT THICKNESS THIN_LINE_LOGO TILE TIP TOGGLE_PAGE_NUMBER_PLACEMENT TOP TOP_LEFT TOP_RIGHT TRANSPARENT TYPE TYPE_KEY UP_VECTOR UP_VECTOR_KEY USE USE_FREE_FORM USE_TITLE USE_TITLE_AND_FREE_FORM VERTICAL VIEW_ANGLE WHOLE WIDTH ZFAR ZNEAR LOCAL GLOBAL !LPUB LPUB PLIST !SYNTH SYNTH !LDCAD LDCAD !LEOCAD LEOCAD FALSE TRUE diff --git a/mainApp/highlighter.cpp b/mainApp/highlighter.cpp index 160a62305..4393b98d7 100644 --- a/mainApp/highlighter.cpp +++ b/mainApp/highlighter.cpp @@ -398,6 +398,8 @@ Highlighter::Highlighter(QTextDocument *parent) QStringLiteral("\\bLINE_WIDTH\\b"), QStringLiteral("\\bLOAD_UNOFFICIAL_PARTS_IN_EDITOR\\b"), QStringLiteral("\\bLOCAL_LEGO_ELEMENTS_FILE\\b"), + QStringLiteral("\\bLPUB_FADE\\b"), + QStringLiteral("\\bLPUB_HIGHLIGHT\\b"), QStringLiteral("\\bMARGINS\\b"), QStringLiteral("\\bMODEL\\b"), QStringLiteral("\\bMODEL_CATEGORY\\b"), @@ -551,7 +553,6 @@ Highlighter::Highlighter(QTextDocument *parent) QStringLiteral("\\bTOP_LEFT\\b"), QStringLiteral("\\bTOP_RIGHT\\b"), QStringLiteral("\\bTRANSPARENT\\b"), - QStringLiteral("\\bTRUE_FADE\\b"), QStringLiteral("\\bTYPE\\b"), QStringLiteral("\\bUSE\\b"), QStringLiteral("\\bUSE_FREE_FORM\\b"), diff --git a/mainApp/lclibpreferences.cpp b/mainApp/lclibpreferences.cpp index cc4763b69..8125b753c 100644 --- a/mainApp/lclibpreferences.cpp +++ b/mainApp/lclibpreferences.cpp @@ -72,7 +72,7 @@ void PreferencesDialog::lcQPreferencesInit() ui.AutomateEdgeColor->setChecked(mOptions->Preferences.mAutomateEdgeColor); ui.ProjectionCombo->setCurrentIndex(mOptions->Preferences.mNativeProjection); ui.ViewpointsCombo->setCurrentIndex(mOptions->Preferences.mNativeViewpoint); - ui.LPubTrueFade->setChecked(mOptions->Preferences.mLPubTrueFade); + ui.LPubFadeHighlight->setChecked(mOptions->Preferences.mLPubFadeHighlight); ui.ZoomExtentCombo->setCurrentIndex(mOptions->Preferences.mZoomExtents); LPub::ViewpointsComboSaveIndex = mOptions->Preferences.mNativeViewpoint; @@ -143,7 +143,7 @@ void PreferencesDialog::lcQPreferencesAccept() mOptions->Preferences.mAutomateEdgeColor = ui.AutomateEdgeColor->isChecked(); mOptions->Preferences.mNativeViewpoint = ui.ViewpointsCombo->currentIndex(); mOptions->Preferences.mNativeProjection = ui.ProjectionCombo->currentIndex(); - mOptions->Preferences.mLPubTrueFade = ui.LPubTrueFade->isChecked(); + mOptions->Preferences.mLPubFadeHighlight = ui.LPubFadeHighlight->isChecked(); mOptions->Preferences.mZoomExtents = ui.ZoomExtentCombo->currentIndex(); mOptions->Preferences.mDefaultCameraProperties = ui.defaultCameraProperties->isChecked(); mOptions->Preferences.mDDF = float(ui.cameraDefaultDistanceFactor->value()); @@ -210,16 +210,31 @@ void PreferencesDialog::AutomateEdgeColor() } } +void PreferencesDialog::on_LPubFadeHighlight_toggled() +{ + if (ui.LPubFadeHighlight->isChecked()) + { + if (ui.FadeSteps->isChecked()) + ui.FadeSteps->setChecked(false); + if (ui.HighlightNewParts->isChecked()) + ui.HighlightNewParts->setChecked(false); + } +} + void PreferencesDialog::on_FadeSteps_toggled() { ui.FadeStepsColor->setEnabled(ui.FadeSteps->isChecked()); ui.ResetFadeStepsButton->setEnabled(ui.FadeSteps->isChecked()); + if (ui.FadeSteps->isChecked() && ui.LPubFadeHighlight->isChecked()) + ui.LPubFadeHighlight->setChecked(false); } void PreferencesDialog::on_HighlightNewParts_toggled() { ui.HighlightNewPartsColor->setEnabled(ui.HighlightNewParts->isChecked()); ui.ResetHighlightNewPartsButton->setEnabled(ui.HighlightNewParts->isChecked()); + if (ui.HighlightNewParts->isChecked() && ui.LPubFadeHighlight->isChecked()) + ui.LPubFadeHighlight->setChecked(false); } void PreferencesDialog::on_AutomateEdgeColor_toggled() diff --git a/mainApp/lpub.cpp b/mainApp/lpub.cpp index 3042d8ecf..ffb9f1535 100644 --- a/mainApp/lpub.cpp +++ b/mainApp/lpub.cpp @@ -3253,6 +3253,9 @@ Gui::Gui() : pageMutex(QMutex::Recursive) nextPageContinuousIsRunning = false; previousPageContinuousIsRunning = false; + m_fadeStepsSetup = Preferences::enableFadeSteps; + m_highlightStepSetup = Preferences::enableHighlightStep; + mBuildModRange = { 0, 0, -1 }; mStepRotation = { 0.0f, 0.0f, 0.0f }; mRotStepAngleX = 0.0f; diff --git a/mainApp/lpub.h b/mainApp/lpub.h index 2b74b546b..5a921cc11 100644 --- a/mainApp/lpub.h +++ b/mainApp/lpub.h @@ -1244,6 +1244,7 @@ public slots: void updatePreview(); void enableVisualBuildModification(); void viewStandardOutput(const QString filePath, const QString title = ""); + void setupFadeOrHighlight(bool enableFadeSteps, bool enableHighlightStep); bool VisualEditorRotateTransform() { diff --git a/mainApp/lpub_object.cpp b/mainApp/lpub_object.cpp index b0ff9783a..cbcaf08dc 100644 --- a/mainApp/lpub_object.cpp +++ b/mainApp/lpub_object.cpp @@ -575,8 +575,23 @@ bool LPub::setFadeStepsFromCommand() QString result; Where top(ldrawFile.topLevelFile(),0,0); Where topLevelModel(top); - QRegExp fadeRx = QRegExp("FADE_STEPS ENABLED\\s*(GLOBAL)?\\s*TRUE"); - if (!Preferences::enableFadeSteps) { + QRegExp fadeRx = QRegExp("FADE_STEPS LPUB_FADE\\s*(GLOBAL)?\\s*FALSE"); + bool nativeRenderer = Preferences::preferredRenderer == RENDERER_NATIVE; + bool noLPubFadeHighlight = Gui::stepContains(topLevelModel,fadeRx,result,1); + if (noLPubFadeHighlight && result != QLatin1String("GLOBAL")) { + emit lpub->messageSig(LOG_WARNING,tr("Top level LPUB_FADE command must have GLOBAL qualifier.
" + "Command will be IGNORED."),true/*Show Dialog*/); + noLPubFadeHighlight = false; + } + + if(noLPubFadeHighlight) + return false; + + bool setupFadeSteps = !noLPubFadeHighlight && nativeRenderer; + + if (setupFadeSteps && !Preferences::enableFadeSteps) { + result.clear(); + fadeRx.setPattern("FADE_STEPS ENABLED\\s*(GLOBAL)?\\s*TRUE"); Preferences::enableFadeSteps = Gui::stepContains(topLevelModel,fadeRx,result,1); if (Preferences::enableFadeSteps) { if (result != QLatin1String("GLOBAL")) { @@ -598,14 +613,13 @@ bool LPub::setFadeStepsFromCommand() } } - bool setupFadeSteps = false; result.clear(); topLevelModel = top; fadeRx.setPattern("FADE_STEPS SETUP\\s*(GLOBAL)?\\s*TRUE"); setupFadeSteps = Gui::stepContains(topLevelModel,fadeRx,result,1); if (setupFadeSteps && result != QLatin1String("GLOBAL")) { - emit lpub->messageSig(LOG_ERROR,tr("Top level FADE_STEPS SETUP command must have GLOBAL qualifier.
" - "Command will be IGNORED."),true/*Show Dialog*/); + emit lpub->messageSig(LOG_WARNING,tr("Top level FADE_STEPS SETUP command must have GLOBAL qualifier.
" + "Command will be IGNORED."),true/*Show Dialog*/); setupFadeSteps = false; } if (setupFadeSteps) { @@ -636,8 +650,8 @@ bool LPub::setFadeStepsFromCommand() bool fadeStepsOpacityChanged = Preferences::fadeStepsOpacity != fadeStepsOpacityCompare; if (fadeStepsOpacityChanged) emit lpub->messageSig(LOG_INFO,tr("Fade Steps Transparency changed from %1 to %2 percent - Set from meta command") - .arg(fadeStepsOpacityCompare) - .arg(Preferences::fadeStepsOpacity)); + .arg(fadeStepsOpacityCompare) + .arg(Preferences::fadeStepsOpacity)); } result.clear(); @@ -650,16 +664,16 @@ bool LPub::setFadeStepsFromCommand() Preferences::fadeStepsUseColour = ParsedColor.isValid(); if (Preferences::fadeStepsUseColour != fadeStepsUseColorCompare) emit lpub->messageSig(LOG_INFO,tr("Use Fade Color is %1 - Set from meta command") - .arg(Preferences::fadeStepsUseColour ? "ON" : "OFF")); + .arg(Preferences::fadeStepsUseColour ? "ON" : "OFF")); QString fadeStepsColourCompare = Preferences::validFadeStepsColour; Preferences::validFadeStepsColour = ParsedColor.isValid() ? result : Preferences::validFadeStepsColour; if (QString(Preferences::validFadeStepsColour).toLower() != fadeStepsColourCompare.toLower()) emit lpub->messageSig(LOG_INFO,tr("Fade Steps Color preference changed from %1 to %2 - Set from meta command") - .arg(fadeStepsColourCompare.replace("_"," ")) - .arg(QString(Preferences::validFadeStepsColour).replace("_"," "))); + .arg(fadeStepsColourCompare.replace("_"," ")) + .arg(QString(Preferences::validFadeStepsColour).replace("_"," "))); } - return setupFadeSteps; + return setupFadeSteps || Preferences::enableFadeSteps; } bool LPub::setHighlightStepFromCommand() @@ -667,8 +681,12 @@ bool LPub::setHighlightStepFromCommand() QString result; Where top(ldrawFile.topLevelFile(),0,0); Where topLevelModel(top); - QRegExp highlightRx = QRegExp("HIGHLIGHT_STEP ENABLED\\s*(GLOBAL)?\\s*TRUE"); - if (!Preferences::enableHighlightStep) { + QRegExp highlightRx; + bool setupHighlightStep = true; + + if (setupHighlightStep && !Preferences::enableHighlightStep) { + result.clear(); + highlightRx.setPattern("HIGHLIGHT_STEP ENABLED\\s*(GLOBAL)?\\s*TRUE"); Preferences::enableHighlightStep = Gui::stepContains(topLevelModel,highlightRx,result,1); if (Preferences::enableHighlightStep) { if (result != QLatin1String("GLOBAL")) { @@ -690,7 +708,6 @@ bool LPub::setHighlightStepFromCommand() } } - bool setupHighlightStep = false; result.clear(); topLevelModel = top; highlightRx.setPattern("HIGHLIGHT_STEP SETUP\\s*(GLOBAL)?\\s*TRUE"); @@ -710,7 +727,7 @@ bool LPub::setHighlightStepFromCommand() if (Preferences::enableHighlightStep != Preferences::initEnableHighlightStep) emit lpub->messageSig(LOG_INFO_STATUS,tr("Highlight Current Step is %1 - Set from meta command.") - .arg(Preferences::enableHighlightStep ? "ON" : "OFF")); + .arg(Preferences::enableHighlightStep ? "ON" : "OFF")); if (setupHighlightStep) emit lpub->messageSig(LOG_INFO_STATUS,tr("Highlight Current Step Setup is ENABLED.")); @@ -728,11 +745,11 @@ bool LPub::setHighlightStepFromCommand() bool highlightStepColorChanged = QString(Preferences::highlightStepColour).toLower() != highlightStepColourCompare.toLower(); if (highlightStepColorChanged) emit lpub->messageSig(LOG_INFO,tr("Highlight Step Color preference changed from %1 to %2 - Set from meta command") - .arg(highlightStepColourCompare) - .arg(Preferences::highlightStepColour)); + .arg(highlightStepColourCompare) + .arg(Preferences::highlightStepColour)); } - return setupHighlightStep; + return setupHighlightStep || Preferences::enableHighlightStep; } bool LPub::setPreferredRendererFromCommand(const QString &preferredRenderer) diff --git a/mainApp/lpub_preferences.cpp b/mainApp/lpub_preferences.cpp index b39c20de9..ae53915d8 100644 --- a/mainApp/lpub_preferences.cpp +++ b/mainApp/lpub_preferences.cpp @@ -5036,7 +5036,7 @@ bool Preferences::getPreferences() Options.Preferences.mNativeViewpoint = lcGetProfileInt(LC_PROFILE_NATIVE_VIEWPOINT); Options.Preferences.mNativeProjection = lcGetProfileInt(LC_PROFILE_NATIVE_PROJECTION); - Options.Preferences.mLPubTrueFade = lcGetProfileInt(LC_PROFILE_LPUB_TRUE_FADE); + Options.Preferences.mLPubFadeHighlight = lcGetProfileInt(LC_PROFILE_LPUB_FADE_HIGHLIGHT); Options.Preferences.mDrawConditionalLines = lcGetProfileInt(LC_PROFILE_DRAW_CONDITIONAL_LINES); Options.KeyboardShortcutsModified = false; @@ -5956,7 +5956,7 @@ bool Preferences::getPreferences() bool shadingModeChanged = Options.Preferences.mShadingMode != Preferences.mShadingMode; bool lineWidthChanged = Options.Preferences.mLineWidth != Preferences.mLineWidth; bool NativeViewpointChanged = Options.Preferences.mNativeViewpoint != Preferences.mNativeViewpoint; - bool LPubTrueFadeChanged = Options.Preferences.mLPubTrueFade != Preferences.mLPubTrueFade; + bool LPubFadeHighlightChanged = Options.Preferences.mLPubFadeHighlight != Preferences.mLPubFadeHighlight; bool DrawCondlLinesChanged = Options.Preferences.mDrawConditionalLines != Preferences.mDrawConditionalLines; bool NativeProjectionChanged = false; @@ -5982,12 +5982,12 @@ bool Preferences::getPreferences() restartApplication = true; } } - if ((LPubTrueFadeChanged || + if ((LPubFadeHighlightChanged || DefaultCameraChanged || DrawCondlLinesChanged) && !restartApplication && !reloadFile) reloadPage = true; - if ((LPubTrueFadeChanged || + if ((LPubFadeHighlightChanged || DefaultCameraChanged || DrawCondlLinesChanged) && !restartApplication && !reloadFile) reloadPage = true; diff --git a/mainApp/meta.cpp b/mainApp/meta.cpp index 968a87b04..d29ac3b15 100644 --- a/mainApp/meta.cpp +++ b/mainApp/meta.cpp @@ -44,7 +44,7 @@ #include "pagesizes.h" -/* The token map translates known keywords to values +/* The token map translates known keywords to values * used by LPub to identify things like placement and such */ @@ -72,13 +72,13 @@ QString LeafMeta::format( QString suffix) { QString result; - + if (local) { result = "LOCAL "; } else if (global) { result = "GLOBAL "; } - + return preamble + result + suffix; } @@ -181,7 +181,7 @@ Rc BranchMeta::parse(QStringList &argv, int index, Where &here) return FailureRc; } -/* +/* * Find out if the match string matches the syntax graph up until this * point */ @@ -236,7 +236,7 @@ void BranchMeta::pop() /* ------------------ */ void RcMeta::init(BranchMeta *parent, const QString name, Rc _rc) -{ +{ AbstractMeta::init(parent,name); rc = _rc; } @@ -293,7 +293,7 @@ Rc IntMeta::parse(QStringList &argv, int index,Where &here) QString IntMeta::format(bool local, bool global) { QString foo = QString("%1").arg(_value[pushed],0,base); - + return LeafMeta::format(local,global,foo); } @@ -569,7 +569,7 @@ Rc BoolMeta::parse(QStringList &argv, int index,Where &here) _here[pushed] = here; return OkRc; } - + if (reportErrors) { emit gui->messageSig(LOG_ERROR,QMessageBox::tr("Expected TRUE or FALSE \"%1\" %2") .arg(argv[index]) .arg(argv.join(" "))); } @@ -587,7 +587,7 @@ void BoolMeta::doc(QStringList &out, QString preamble) out << preamble + " ( TRUE | FALSE )"; } -/* ------------------ */ +/* ------------------ */ const QString placementOptions[][3] = { @@ -882,7 +882,7 @@ QString PlacementMeta::format(bool local, bool global) // ; //#endif QString foo; - + if (_value[pushed].preposition == Inside) { switch (_value[pushed].placement) { case Top: @@ -937,7 +937,7 @@ void PlacementMeta::metaKeywords(QStringList &out, QString preamble) out << preamble + " TOP BOTTOM LEFT CENTER RIGHT TOP_LEFT TOP_RIGHT BOTTOM_LEFT BOTTOM_RIGHT" " PAGE ASSEM INSIDE OUTSIDE MULTI_STEP STEP_NUMBER PLI SUBMODEL_DISPLAY ROTATE_ICON CALLOUT"; } -/* ------------------ */ +/* ------------------ */ Rc BackgroundMeta::parse(QStringList &argv, int index,Where &here) { @@ -1067,7 +1067,7 @@ Rc BackgroundMeta::parse(QStringList &argv, int index,Where &here) _here[pushed] = here; return rc; } else { - + if (reportErrors) { emit gui->messageSig(LOG_ERROR,QMessageBox::tr("Malformed background \"%1\"") .arg(argv.join(" "))); } @@ -1736,10 +1736,10 @@ void PointerAttribMeta::metaKeywords(QStringList &out, QString preamble) out << preamble + " LINE BORDER NONE SOLID DASH DOT DASH_DOT DASH_DOT_DOT COLOR WIDTH HIDE_TIP TRUE FALSE ID BASE_TOP BASE_BOTTOM BASE_LEFT BASE_RIGHT TIP HEIGHT"; } -/* ------------------ */ +/* ------------------ */ PointerMeta::PointerMeta() : LeafMeta() -{ +{ _value[0].placement = TopLeft; _value[0].loc = 0; // Location _value[0].x1 = 0.5; // TipX @@ -2362,7 +2362,7 @@ void PreferredRendererMeta::metaKeywords(QStringList &out, QString preamble) { out << preamble + " NATIVE LDGLITE LDVIEW SINGLE_CALL SINGLE_CALL_EXPORT_LIST POVRAY LDVIEW_POV_GENERATOR"; } -/* ------------------ */ +/* ------------------ */ FreeFormMeta::FreeFormMeta() : LeafMeta() { @@ -2413,7 +2413,7 @@ void FreeFormMeta::metaKeywords(QStringList &out, QString preamble) { out << preamble + " FALSE STEP_NUMBER ASSEM PLI ROTATE_ICON LEFT RIGHT TOP BOTTOM CENTER"; } -/* ------------------ */ +/* ------------------ */ ConstrainMeta::ConstrainMeta() { @@ -2483,7 +2483,7 @@ void ConstrainMeta::metaKeywords(QStringList &out, QString preamble) out << preamble + " AREA SQUARE WIDTH HEIGHT COLS"; } -/* ------------------ */ +/* ------------------ */ AllocMeta::AllocMeta() : LeafMeta() { @@ -3565,7 +3565,7 @@ void ColorMeta::metaKeywords(QStringList &out, QString preamble) out << preamble; } -/* ------------------ */ +/* ------------------ */ /* * INSERT ( @@ -3591,7 +3591,7 @@ void InsertMeta::initPlacement() } Rc InsertMeta::parse(QStringList &argv, int index, Where &here) -{ +{ InsertData insertData; bool displayModel = false; Rc rc = OkRc; @@ -3856,7 +3856,7 @@ Rc AlignmentMeta::parse(QStringList &argv, int index, Where &here) QString AlignmentMeta::format(bool local, bool global) { QString foo; - + switch (_value[pushed]) { case Qt::AlignLeft: foo = " LEFT"; @@ -3867,7 +3867,7 @@ QString AlignmentMeta::format(bool local, bool global) default: foo = " RIGHT"; } - + return LeafMeta::format(local,global,foo); } @@ -3880,7 +3880,7 @@ void AlignmentMeta::metaKeywords(QStringList &out, QString preamble) { out << preamble + " LEFT CENTER RIGHT"; } -/* ------------------ */ +/* ------------------ */ void TextMeta::init(BranchMeta *parent, QString name) { @@ -3941,7 +3941,7 @@ void ArrowHeadMeta::metaKeywords(QStringList &out, QString preamble) out << preamble; } -/* ------------------ */ +/* ------------------ */ Rc ArrowEndMeta::parse(QStringList &argv, int index, Where &here) { @@ -3962,7 +3962,7 @@ Rc ArrowEndMeta::parse(QStringList &argv, int index, Where &here) QString ArrowEndMeta::format(bool local, bool global) { QString foo; - + if (_value[pushed]) { foo = "ROUND"; } else { @@ -4060,7 +4060,7 @@ void SettingsMeta::init(BranchMeta *parent, QString name) AbstractMeta::init(parent, name); placement.init (this,"PLACEMENT"); margin.init (this,"MARGINS"); - studStyle.init (this,"STUD_STYLE"); + studStyle.init (this,"STUD_STYLE"); highContrast.init (this,"HIGH_CONTRAST"); autoEdgeColor.init (this,"AUTOMATE_EDGE_COLOR"); fadeSteps.init (this,"FADE_STEPS"); @@ -4091,7 +4091,7 @@ void SettingsMeta::resetCameraFoV() cameraZFar.setValue(MetaDefaults::getNativeCameraZFar()); } -/* ------------------ */ +/* ------------------ */ CalloutPliMeta::CalloutPliMeta() : BranchMeta() { @@ -4123,7 +4123,7 @@ void ShowSubModelMeta::init(BranchMeta *parent, QString name) show.init ( this,"SHOW"); } -/* ------------------ */ +/* ------------------ */ StepPliMeta::StepPliMeta() : BranchMeta() { @@ -4145,7 +4145,7 @@ void PliBeginMeta::init(BranchMeta *parent, QString name) sub.init (this, "SUB"); } -/* ------------------ */ +/* ------------------ */ NumberMeta::NumberMeta() : BranchMeta() { @@ -4432,6 +4432,67 @@ void EnableMeta::metaKeywords(QStringList &out, QString preamble) { out << preamble + " TRUE FALSE"; } + +/* ------------------ */ + +Rc LPubFaHiMeta::parse(QStringList &argv, int index, Where &here) +{ + Rc rc = FailureRc; + QRegExp rx("^(TRUE|FALSE)$"); + if (argv.size() - index == 1 && argv[index].contains(rx)) { + _value[pushed] = argv[index] == "TRUE"; + _here[pushed] = here; + if (argv[1] == "FADE_STEPS") { + rc = LPubFadeRc; + } else if (argv[1] == "HIGHLIGHT_STEP") { + rc = LPubHighlightRc; + } else if (argv[1] == "ASSEM") { + if (argv[2] == "FADE_STEPS") + rc = LPubFadeAssemRc; + else if (argv[2] == "HIGHLIGHT_STEP") + rc = LPubHighlightAssemRc; + } else if (argv[1] == "MULTI_STEP") { + if (argv[2] == "ASSEM") { + if (argv[3] == "FADE_STEPS") + rc = LPubFadeGroupAssemRc; + else if (argv[3] == "HIGHLIGHT_STEP") + rc = LPubHighlightGroupAssemRc; + } + } else if (argv[1] == "CALLOUT") { + if (argv[2] == "ASSEM") { + if (argv[3] == "FADE_STEPS") + rc = LPubFadeCalloutAssemRc; + else if (argv[3] == "HIGHLIGHT_STEP") + rc = LPubHighlightCalloutAssemRc; + } + } + } + + if (rc == FailureRc) { + if (reportErrors) { + emit gui->messageSig(LOG_ERROR,QMessageBox::tr("Expected TRUE or FALSE, but got \"%1\" %2") .arg(argv[index]) .arg(argv.join(" "))); + } + } + + return rc; +} + +QString LPubFaHiMeta::format(bool local, bool global) +{ + QString foo (_value[pushed] ? "TRUE" : "FALSE"); + return LeafMeta::format(local,global,foo); +} + +void LPubFaHiMeta::doc(QStringList &out, QString preamble) +{ + out << preamble + " ( TRUE | FALSE )"; +} + +void LPubFaHiMeta::metaKeywords(QStringList &out, QString preamble) +{ + out << preamble + " TRUE FALSE"; +} + /* ------------------ */ Rc FadeColorMeta::parse(QStringList &argv, int index, Where &here) @@ -4500,7 +4561,7 @@ FadeStepsMeta::FadeStepsMeta() : BranchMeta() fdata.useColor = Preferences::fadeStepsUseColour; color.setValue(fdata); opacity.setValue(Preferences::fadeStepsOpacity); - truefade.setValue(true); + lpubFade.setValue(true); } void FadeStepsMeta::setPreferences(bool reset) @@ -4516,13 +4577,15 @@ void FadeStepsMeta::setPreferences(bool reset) fdata.useColor = Preferences::fadeStepsUseColour; color.setValue(fdata); opacity.setValue(Preferences::fadeStepsOpacity); - truefade.setValue(true); + lpubFade.setValue(true); } else { if ((displayPreference = Preferences::enableFadeSteps != enable.value() || enable.global)) Preferences::enableFadeSteps = enable.value(); Preferences::validFadeStepsColour = fdata.color; Preferences::fadeStepsUseColour = fdata.useColor; Preferences::fadeStepsOpacity = opacity.value(); + if (Preferences::enableFadeSteps && lpubFade.value()) + gui->setupFadeOrHighlight(true, Preferences::enableFadeSteps); if (enable.global) { Preferences::fadestepPreferences(enable.global); if (Preferences::enableFadeSteps != enable.value()) @@ -4558,7 +4621,7 @@ void FadeStepsMeta::init( setup.init( this, "SETUP"); color.init( this, "COLOR"); opacity.init( this, "OPACITY"); - truefade.init(this, "TRUE_FADE"); + lpubFade.init(this, "LPUB_FADE"); } /* ------------------ */ @@ -4570,6 +4633,7 @@ HighlightStepMeta::HighlightStepMeta() : BranchMeta() setup.setValue(false); color.setValue(Preferences::highlightStepColour); lineWidth.setValue(Preferences::highlightStepLineWidth); + lpubHighlight.setValue(true); } void HighlightStepMeta::setPreferences(bool reset) @@ -4582,11 +4646,14 @@ void HighlightStepMeta::setPreferences(bool reset) enable.setValue(Preferences::enableHighlightStep); color.setValue(Preferences::highlightStepColour); lineWidth.setValue(Preferences::highlightStepLineWidth); + lpubHighlight.setValue(true); } else { if ((displayPreference = Preferences::enableHighlightStep != enable.value() || enable.global)) Preferences::enableHighlightStep = enable.value(); Preferences::highlightStepColour = color.value(); Preferences::highlightStepLineWidth = lineWidth.value(); + if (Preferences::enableHighlightStep && lpubHighlight.value()) + gui->setupFadeOrHighlight(Preferences::enableFadeSteps, true); if (enable.global) { Preferences::highlightstepPreferences(enable.global); if (Preferences::enableHighlightStep != enable.value()) @@ -4614,10 +4681,11 @@ void HighlightStepMeta::init( QString name) { AbstractMeta::init(parent, name); - enable.init( this, "ENABLED"); - setup.init( this, "SETUP"); - color.init( this, "COLOR"); - lineWidth.init(this, "LINE_WIDTH"); + enable.init( this, "ENABLED"); + setup.init( this, "SETUP"); + color.init( this, "COLOR"); + lineWidth.init( this, "LINE_WIDTH"); + lpubHighlight.init(this, "LPUB_HIGHLIGHT"); } /* ------------------ */ @@ -4642,7 +4710,7 @@ void PartMeta::init(BranchMeta *parent, QString name) margin.init(this,"MARGINS"); } -/* ------------------ */ +/* ------------------ */ Rc SubMeta::parse(QStringList &argv, int index,Where &here) { @@ -4799,7 +4867,7 @@ QString SubMeta::format(bool local, bool global) QStringList _attributeList = _value.attrs.split(";"); QString foo; - + if (_value.type == PliBeginSub1Rc) { foo = QString("%1") .arg(_value.part); @@ -4876,7 +4944,7 @@ void SubMeta::metaKeywords(QStringList &out, QString preamble) { out << preamble + " ABS REL ADD LDRAW_TYPE"; } -/* ------------------ */ +/* ------------------ */ void PartBeginMeta::init(BranchMeta *parent, QString name) { @@ -4884,7 +4952,7 @@ void PartBeginMeta::init(BranchMeta *parent, QString name) ignore.init(this, "IGN", PartBeginIgnRc); } -/* ------------------ */ +/* ------------------ */ void PartIgnMeta::init(BranchMeta *parent, QString name) { @@ -4893,7 +4961,7 @@ void PartIgnMeta::init(BranchMeta *parent, QString name) end .init(this, "END", PartEndRc); } -/* ------------------ */ +/* ------------------ */ Rc RotStepMeta::parse(QStringList &argv, int index,Where &here) { @@ -4947,7 +5015,7 @@ void RotStepMeta::metaKeywords(QStringList &out, QString preamble) out << preamble + " ABS REL ADD"; } -/* ------------------ */ +/* ------------------ */ Rc BuffExchgMeta::parse(QStringList &argv, int index,Where &here) { if (index + 2 == argv.size()) { @@ -5815,7 +5883,7 @@ void PageMeta::init(BranchMeta *parent, QString name) category.init (this, "MODEL_CATEGORY" ); } -/* ------------------ */ +/* ------------------ */ AssemMeta::AssemMeta() : BranchMeta() { @@ -6032,7 +6100,7 @@ void PliMeta::resetCameraFoV() cameraZFar.setValue(MetaDefaults::getNativeCameraZFar()); } -/* ------------------ */ +/* ------------------ */ BomMeta::BomMeta() : PliMeta() { @@ -6171,7 +6239,7 @@ void BomMeta::init(BranchMeta *parent, QString name) preferredRenderer .init(this,"PREFERRED_RENDERER"); } -/* ------------------ */ +/* ------------------ */ Rc CalloutBeginMeta::parse(QStringList &argv, int index,Where &here) { @@ -6313,7 +6381,7 @@ void PointerBaseMeta::init(BranchMeta *parent, QString name) margin .init(this, "MARGINS"); } -/* ------------------ */ +/* ------------------ */ MultiStepMeta::MultiStepMeta() : BranchMeta() { @@ -6375,7 +6443,7 @@ void MultiStepMeta::init(BranchMeta *parent, QString name) end .init(this, "END", StepGroupEndRc); } -/* ------------------ */ +/* ------------------ */ void ResolutionMeta::init( BranchMeta *parent, @@ -6411,7 +6479,7 @@ QString ResolutionMeta::format(bool local, bool global) QString res; res = QString("%1 DPI") .arg(double(resolution()),0,'f',0); return LeafMeta::format(local,global,res); -} +} void ResolutionMeta::doc(QStringList &out, QString preamble) { @@ -6665,7 +6733,7 @@ Rc PartNameMeta::parse(QStringList &argv, int index,Where &here) return rc; } -/* ------------------ */ +/* ------------------ */ void MLCadMeta::init(BranchMeta *parent, QString name) { @@ -6763,7 +6831,7 @@ Rc LeoCadGroupMeta::parse(QStringList &argv, int index,Where &here) // return rc; } -/* ------------------ */ +/* ------------------ */ void LSynthMeta::init(BranchMeta *parent, QString name) { @@ -6778,7 +6846,7 @@ void LSynthMeta::init(BranchMeta *parent, QString name) synthesized.init(this, "SYNTHESIZED"); } -/* ------------------ */ +/* ------------------ */ Meta::Meta() : BranchMeta() { diff --git a/mainApp/meta.h b/mainApp/meta.h index 1c81bb7dc..bcaaae7cb 100644 --- a/mainApp/meta.h +++ b/mainApp/meta.h @@ -167,6 +167,16 @@ enum Rc { EnableHighlightStepAssemRc, EnableHighlightStepRc, + LPubFadeCalloutAssemRc, + LPubFadeGroupAssemRc, + LPubFadeAssemRc, + LPubFadeRc, + + LPubHighlightCalloutAssemRc, + LPubHighlightGroupAssemRc, + LPubHighlightAssemRc, + LPubHighlightRc, + PageOrientationRc, PageSizeRc, @@ -2928,8 +2938,8 @@ class EnableMeta : public RcMeta { } EnableMeta () { - _value[0] = false; - _value[1] = false; + _value[0] = true; + _value[1] = true; } EnableMeta(const EnableMeta &rhs) : RcMeta(rhs) { @@ -2945,6 +2955,43 @@ class EnableMeta : public RcMeta { /*------------------------*/ +/* + * + * This leaf is to catch true fade boolean (TRUE or FALSE) flag + * + */ + +class LPubFaHiMeta : public RcMeta { + private: + bool _value[2]; + public: + bool value() + { + return _value[pushed]; + } + void setValue(bool value) + { + _value[pushed] = value; + } + LPubFaHiMeta () + { + _value[0] = false; + _value[1] = false; + } + LPubFaHiMeta(const LPubFaHiMeta &rhs) : RcMeta(rhs) + { + _value[0] = rhs._value[0]; + _value[1] = rhs._value[1]; + } + // virtual ~LPubFaHiMeta() {} + Rc parse(QStringList &argv, int index, Where &here); + QString format(bool,bool); + virtual void doc(QStringList &out, QString preamble); + virtual void metaKeywords(QStringList &out, QString preamble); +}; + +/*------------------------*/ + // 0 LPUB CALLOUT BEGIN class CalloutBeginMeta : public RcMeta @@ -3083,8 +3130,8 @@ class FadeStepsMeta : public BranchMeta { public: EnableMeta enable; + LPubFaHiMeta lpubFade; BoolMeta setup; - BoolMeta truefade; FadeColorMeta color; IntMeta opacity; void setPreferences(bool = false); @@ -3106,10 +3153,11 @@ class FadeStepsMeta : public BranchMeta class HighlightStepMeta : public BranchMeta { public: - EnableMeta enable; - BoolMeta setup; - StringMeta color; - IntMeta lineWidth; + EnableMeta enable; + LPubFaHiMeta lpubHighlight; + BoolMeta setup; + StringMeta color; + IntMeta lineWidth; void setPreferences(bool = false); HighlightStepMeta(); HighlightStepMeta(const HighlightStepMeta &rhs) : BranchMeta(rhs) diff --git a/mainApp/openclose.cpp b/mainApp/openclose.cpp index 8565f1fb0..0324244d5 100644 --- a/mainApp/openclose.cpp +++ b/mainApp/openclose.cpp @@ -786,8 +786,6 @@ void Gui::closeFile() Preferences::preferredRendererPreferences(); Preferences::fadestepPreferences(); Preferences::highlightstepPreferences(); - m_fadeStepsSetup = false; - m_highlightStepSetup = false; if (!Preferences::enableFadeSteps && !Preferences::enableHighlightStep) { LDrawColourParts::clearGeneratedColorParts(); partWorkerLDSearchDirs.removeCustomDirs(); @@ -910,28 +908,9 @@ bool Gui::openFile(const QString &fileName) loadLDSearchDirParts(false/*Process*/, true/*OnDemand*/, false/*Update*/); } } - m_fadeStepsSetup = lpub->setFadeStepsFromCommand(); - m_highlightStepSetup = lpub->setHighlightStepFromCommand(); - bool enableFadeSteps = m_fadeStepsSetup || Preferences::enableFadeSteps; - bool enableHighlightStep = m_highlightStepSetup || Preferences::enableHighlightStep; - if (enableFadeSteps || enableHighlightStep) { - ldrawColorPartsLoad(); - writeGeneratedColorPartsToTemp(); - // archive fade/highlight colour parts - partWorkerLDSearchDirs.addCustomDirs(); - if (enableFadeSteps) { - if (Preferences::enableImageMatting) - LDVImageMatte::clearMatteCSIImages(); - emit lpub->messageSig(LOG_INFO_STATUS, tr("Loading fade color parts...")); - partWorkerLDSearchDirs.setDoFadeStep(true); - processFadeColourParts(false/*overwrite*/, enableFadeSteps); - } - if (enableHighlightStep) { - emit lpub->messageSig(LOG_INFO_STATUS, tr("Loading highlight color parts...")); - partWorkerLDSearchDirs.setDoHighlightStep(true); - processHighlightColourParts(false/*overwrite*/, enableHighlightStep); - } - } + + setupFadeOrHighlight(lpub->setFadeStepsFromCommand(), lpub->setHighlightStepFromCommand()); + QString previewLoadPath = QDir::toNativeSeparators(QString("%1/%2").arg(QDir::currentPath()).arg(Paths::tmpDir)); lcSetProfileString(LC_PROFILE_PREVIEW_LOAD_PATH, previewLoadPath); emit lpub->messageSig(LOG_INFO, tr("Loading user interface items...")); @@ -962,6 +941,41 @@ bool Gui::openFile(const QString &fileName) return true; } +void Gui::setupFadeOrHighlight(bool enableFadeSteps, bool enableHighlightStep) +{ + if (!enableFadeSteps && !enableHighlightStep) + return; + + if (!m_fadeStepsSetup || !m_highlightStepSetup) { + QString const message = enableFadeSteps && enableHighlightStep + ? tr("Setup and load fade and highlight color parts...") + : enableFadeSteps + ? tr("Setup and load fade color parts...") + : tr("Setup and load highlight color parts..."); + emit lpub->messageSig(LOG_INFO_STATUS, message); + } + + if (!m_fadeStepsSetup && !m_highlightStepSetup) { + ldrawColorPartsLoad(); + writeGeneratedColorPartsToTemp(); + partWorkerLDSearchDirs.addCustomDirs(); + } + + if (enableFadeSteps && !m_fadeStepsSetup) { + if (Preferences::enableImageMatting) + LDVImageMatte::clearMatteCSIImages(); + partWorkerLDSearchDirs.setDoFadeStep(true); + processFadeColourParts(false/*overwrite*/, enableFadeSteps); + m_fadeStepsSetup = true; + } + + if (enableHighlightStep && !m_highlightStepSetup) { + partWorkerLDSearchDirs.setDoHighlightStep(true); + processHighlightColourParts(false/*overwrite*/, enableHighlightStep); + m_highlightStepSetup = true; + } +} + void Gui::updateRecentFileActions() { QSettings Settings; diff --git a/mainApp/options.h b/mainApp/options.h index 437483054..6beea649c 100644 --- a/mainApp/options.h +++ b/mainApp/options.h @@ -103,9 +103,9 @@ class NativeOptions IsOrtho (false), ZoomExtents (false), AutoEdgeColor (false), - TrueFade (true), - FadeSteps (false), - HighlightStep (false), + LPubFadeHighlight (true), + FadeParts (false), + HighlightParts (false), HighlightNewParts (false), // gui->HighlightNewParts TransBackground (true), CustomViewpoint (false), @@ -157,9 +157,9 @@ class NativeOptions bool IsOrtho; bool ZoomExtents; bool AutoEdgeColor; - bool TrueFade; - bool FadeSteps; - bool HighlightStep; + bool LPubFadeHighlight; + bool FadeParts; + bool HighlightParts; bool HighlightNewParts; bool TransBackground; bool CustomViewpoint; diff --git a/mainApp/preferences.ui b/mainApp/preferences.ui index 98e851000..23b90bbaa 100644 --- a/mainApp/preferences.ui +++ b/mainApp/preferences.ui @@ -7,7 +7,7 @@ 0 0 - 613 + 636 660 @@ -1024,16 +1024,6 @@ - - - - Make faded parts translucent but do not draw back faces - - - LPub True Fade - - - @@ -1173,10 +1163,10 @@ - Enable fade previous steps when exporting HTML Steps + Enable native fade parts behaviour - HTML Export Fade Previous Steps: + Fade Parts: @@ -1200,10 +1190,10 @@ - Enable highlight current step parts when exporting HTML Steps + Enable native highlight parts behaviour - HTML Export Highlight New Parts: + Highlight Parts: @@ -1251,6 +1241,16 @@ + + + + Make faded parts translucent but do not draw back faces or highlight part edges using LPub3D behaviour + + + LPub Fade and Highlight + + + @@ -3621,13 +3621,10 @@ Check if LSynth parts exist in LDraw folder but not included in search paths -e. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -hr { height: 1px; border-width: 0; } -li.unchecked::marker { content: "\2610"; } -li.checked::marker { content: "\2612"; } -</style></head><body style=" font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:7.8pt;"><br /></p></body></html> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:7.8pt;"><br /></p></body></html> @@ -3792,7 +3789,7 @@ li.checked::marker { content: "\2612"; } MeshLODSlider ShadingMode studStyleCombo - LPubTrueFade + LPubFadeHighlight ConditionalLinesCheckBox FadeSteps FadeStepsColor diff --git a/mainApp/preferencesdialog.h b/mainApp/preferencesdialog.h index 1faa6c9b3..69d9cda10 100644 --- a/mainApp/preferencesdialog.h +++ b/mainApp/preferencesdialog.h @@ -256,6 +256,7 @@ class PreferencesDialog : public QDialog void on_LineWidthSlider_valueChanged(); void on_MeshLODSlider_valueChanged(); void on_studStyleCombo_currentIndexChanged(int index); + void on_LPubFadeHighlight_toggled(); void on_FadeSteps_toggled(); void on_HighlightNewParts_toggled(); void on_AutomateEdgeColor_toggled(); diff --git a/mainApp/render.cpp b/mainApp/render.cpp index d66bfee93..48ffae738 100644 --- a/mainApp/render.cpp +++ b/mainApp/render.cpp @@ -2797,9 +2797,10 @@ int Native::renderCsi( float cameraZFar = meta.LPub.assem.cameraZFar.value(); bool isOrtho = meta.LPub.assem.isOrtho.value(); bool customViewpoint= meta.LPub.assem.cameraAngles.customViewpoint(); - bool trueFade = meta.LPub.assem.fadeSteps.truefade.value(); - bool fadeSteps = meta.LPub.assem.fadeSteps.enable.value(); - bool highlightStep = meta.LPub.assem.fadeSteps.enable.value(); + bool fadeParts = meta.LPub.assem.fadeSteps.enable.value(); + bool highlightParts = meta.LPub.assem.highlightStep.enable.value(); + bool lpubFade = meta.LPub.assem.fadeSteps.lpubFade.value(); + bool lpubHighlight = meta.LPub.assem.highlightStep.lpubHighlight.value(); QString cameraName = meta.LPub.assem.cameraName.value(); Vector3 position = Vector3(meta.LPub.assem.position.x(),meta.LPub.assem.position.y(),meta.LPub.assem.position.z()); Vector3 target = Vector3(meta.LPub.assem.target.x(),meta.LPub.assem.target.y(),meta.LPub.assem.target.z()); @@ -2819,9 +2820,10 @@ int Native::renderCsi( cameraZNear = meta.LPub.callout.csi.cameraZNear.value(); cameraZFar = meta.LPub.callout.csi.cameraZFar.value(); isOrtho = meta.LPub.callout.csi.isOrtho.value(); - trueFade = meta.LPub.callout.csi.fadeSteps.truefade.value(); - fadeSteps = meta.LPub.callout.csi.fadeSteps.enable.value(); - highlightStep = meta.LPub.callout.csi.fadeSteps.enable.value(); + fadeParts = meta.LPub.callout.csi.fadeSteps.enable.value(); + highlightParts = meta.LPub.callout.csi.highlightStep.enable.value(); + lpubFade = meta.LPub.callout.csi.fadeSteps.lpubFade.value(); + lpubHighlight = meta.LPub.callout.csi.highlightStep.lpubHighlight.value(); cameraName = meta.LPub.callout.csi.cameraName.value(); position = Vector3(meta.LPub.callout.csi.position.x(),meta.LPub.callout.csi.position.y(),meta.LPub.callout.csi.position.z()); target = Vector3(meta.LPub.callout.csi.target.x(),meta.LPub.callout.csi.target.y(),meta.LPub.callout.csi.target.z()); @@ -2840,9 +2842,10 @@ int Native::renderCsi( cameraZNear = meta.LPub.multiStep.csi.cameraZNear.value(); cameraZFar = meta.LPub.multiStep.csi.cameraZFar.value(); isOrtho = meta.LPub.multiStep.csi.isOrtho.value(); - trueFade = meta.LPub.multiStep.csi.fadeSteps.truefade.value(); - fadeSteps = meta.LPub.multiStep.csi.fadeSteps.enable.value(); - highlightStep = meta.LPub.multiStep.csi.fadeSteps.enable.value(); + fadeParts = meta.LPub.multiStep.csi.fadeSteps.enable.value(); + highlightParts = meta.LPub.multiStep.csi.highlightStep.enable.value(); + lpubFade = meta.LPub.multiStep.csi.fadeSteps.lpubFade.value(); + lpubHighlight = meta.LPub.multiStep.csi.highlightStep.lpubHighlight.value(); cameraName = meta.LPub.multiStep.csi.cameraName.value(); position = Vector3(meta.LPub.multiStep.csi.position.x(),meta.LPub.multiStep.csi.position.y(),meta.LPub.multiStep.csi.position.z()); target = Vector3(meta.LPub.multiStep.csi.target.x(),meta.LPub.multiStep.csi.target.y(),meta.LPub.multiStep.csi.target.z()); @@ -2857,6 +2860,14 @@ int Native::renderCsi( bool pp = Preferences::perspectiveProjection; bool useImageSize = meta.LPub.assem.imageSize.value(XX) > 0; +//* debugging only *// +#ifdef QT_DEBUG_MODE + Page *currentPage = &lpub->page; + Step *currentStep = lpub->currentStep; + Q_UNUSED(currentStep) + Q_UNUSED(currentPage) +#endif +//*/ // Renderer options NativeOptions *Options = lpub->currentStep->viewerOptions; const QString viewerStepKey = lpub->currentStep->viewerStepKey; @@ -2887,9 +2898,9 @@ int Native::renderCsi( Options->ZFar = cameraZFar; Options->ZNear = cameraZNear; Options->ZoomExtents = false; - Options->TrueFade = trueFade; - Options->FadeSteps = fadeSteps; - Options->HighlightStep = highlightStep; + Options->FadeParts = fadeParts; + Options->HighlightParts = highlightParts; + Options->LPubFadeHighlight = (fadeParts && lpubFade) || (highlightParts && lpubHighlight); Options->AutoEdgeColor = aecm->enable.value(); Options->EdgeContrast = aecm->contrast.value(); Options->EdgeSaturation = aecm->saturation.value(); @@ -3227,12 +3238,42 @@ bool Render::RenderNativeView(const NativeOptions *O, bool RenderImage/*false*/) O->PageHeight, O->ImageFileName, O->Resolution, - O->TrueFade, - O->FadeSteps, - O->HighlightStep); + O->LPubFadeHighlight, + O->FadeParts, + O->HighlightParts); lcPreferences& Preferences = lcGetPreferences(); + Preferences.mFadeStepsColor = lcGetProfileInt(LC_PROFILE_FADE_STEPS_COLOR); + Preferences.mHighlightNewPartsColor = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS_COLOR); + if (O->LPubFadeHighlight) + { + Preferences.mFadeSteps = lcGetProfileInt(LC_PROFILE_FADE_STEPS); + Preferences.mHighlightNewParts = lcGetProfileInt(LC_PROFILE_HIGHLIGHT_NEW_PARTS); + } + else + { + Preferences.mFadeSteps = O->FadeParts; + Preferences.mHighlightNewParts = O->HighlightParts; + Preferences.mLPubFadeHighlight = O->LPubFadeHighlight; + if (O->FadeParts) + { + if (Preferences::fadeStepsUseColour) + { + QColor FC = LDrawColor::color(Preferences::validFadeStepsColour); + if (FC.isValid()) + Preferences.mFadeStepsColor = LC_RGBA(FC.red(), FC.green(), FC.blue(), FC.alpha());; + } + } + + if (O->HighlightParts) + { + QColor HC = QColor(Preferences::highlightStepColour); + if (HC.isValid()) + Preferences.mHighlightNewPartsColor = LC_RGBA(HC.red(), HC.green(), HC.blue(), HC.alpha()); + } + } + lcCamera* Camera = nullptr; lcViewpoint Viewpoint = lcViewpoint::Count; @@ -3595,12 +3636,12 @@ bool Render::RenderNativeView(const NativeOptions *O, bool RenderImage/*false*/) arguments << QString("CameraPosition: X(%1) Y(%2) Z(%3),").arg(double(O->Position.x)).arg(double(O->Position.y)).arg(double(O->Position.z)); if (O->UpVector.isPopulated()) arguments << QString("CameraUpVector: X(%1) Y(%2) Z(%3),").arg(double(O->UpVector.x)).arg(double(O->UpVector.y)).arg(double(O->UpVector.z)); - if (O->FadeSteps) { - arguments << QString("FadeSteps: True,"); - arguments << QString("TrueFade: %1,").arg(O->TrueFade ? "True" : "False"); + if (O->FadeParts) { + arguments << QString("FadeParts: True,"); + arguments << QString("LPubFadeHighlight: %1,").arg(O->LPubFadeHighlight ? "True" : "False"); } - if (O->HighlightStep) - arguments << QString("HighlightStep: True,"); + if (O->HighlightParts) + arguments << QString("HighlightParts: True,"); if (O->AutoEdgeColor || O->AutoEdgeColor != lpub->GetAutomateEdgeColor()) { arguments << QString("AutomateEdgeColor: True,"); diff --git a/mainApp/step.cpp b/mainApp/step.cpp index 424f82322..d07dc0a0b 100644 --- a/mainApp/step.cpp +++ b/mainApp/step.cpp @@ -101,54 +101,61 @@ Step::Step( plPageFooter.size[YY] = footerMeta.size.valuePixels(YY); if (calledOut) { - csiPlacement.margin = _meta.LPub.callout.csi.margin; - csiPlacement.placement = _meta.LPub.callout.csi.placement; - pli.margin = _meta.LPub.callout.pli.margin; - pli.placement = _meta.LPub.callout.pli.placement; - rotateIconMeta = _meta.LPub.callout.rotateIcon; - numberPlacemetMeta = _meta.LPub.callout.stepNum; - stepNumber.placement = _meta.LPub.callout.stepNum.placement; - stepNumber.font = _meta.LPub.callout.stepNum.font.valueFoo(); - stepNumber.color = _meta.LPub.callout.stepNum.color.value(); - stepNumber.margin = _meta.LPub.callout.stepNum.margin; - subModel.margin = _meta.LPub.callout.subModel.margin; - subModel.placement = _meta.LPub.callout.subModel.placement; - pliPerStep = _meta.LPub.callout.pli.perStep.value(); - csiStepMeta = _meta.LPub.callout.csi; - justifyStep = _meta.LPub.callout.justifyStep; + csiStepMeta.fadeSteps = _meta.LPub.callout.csi.fadeSteps; + csiStepMeta.highlightStep = _meta.LPub.callout.csi.highlightStep; + csiStepMeta.preferredRenderer= _meta.LPub.callout.csi.preferredRenderer; + csiStepMeta.studStyle = _meta.LPub.callout.csi.studStyle; + csiPlacement.margin = _meta.LPub.callout.csi.margin; + csiPlacement.placement = _meta.LPub.callout.csi.placement; + pli.margin = _meta.LPub.callout.pli.margin; + pli.placement = _meta.LPub.callout.pli.placement; + rotateIconMeta = _meta.LPub.callout.rotateIcon; + numberPlacemetMeta = _meta.LPub.callout.stepNum; + stepNumber.placement = _meta.LPub.callout.stepNum.placement; + stepNumber.font = _meta.LPub.callout.stepNum.font.valueFoo(); + stepNumber.color = _meta.LPub.callout.stepNum.color.value(); + stepNumber.margin = _meta.LPub.callout.stepNum.margin; + subModel.margin = _meta.LPub.callout.subModel.margin; + subModel.placement = _meta.LPub.callout.subModel.placement; + pliPerStep = _meta.LPub.callout.pli.perStep.value(); + csiStepMeta = _meta.LPub.callout.csi; + justifyStep = _meta.LPub.callout.justifyStep; } else if (multiStep) { - csiPlacement.margin = _meta.LPub.multiStep.csi.margin; - csiPlacement.placement = _meta.LPub.multiStep.csi.placement; - pli.margin = _meta.LPub.multiStep.pli.margin; - pli.placement = _meta.LPub.multiStep.pli.placement; - rotateIconMeta = _meta.LPub.multiStep.rotateIcon; - numberPlacemetMeta = _meta.LPub.multiStep.stepNum; - stepNumber.placement = _meta.LPub.multiStep.stepNum.placement; - stepNumber.font = _meta.LPub.multiStep.stepNum.font.valueFoo(); - stepNumber.color = _meta.LPub.multiStep.stepNum.color.value(); - stepNumber.margin = _meta.LPub.multiStep.stepNum.margin; - subModel.margin = _meta.LPub.multiStep.subModel.margin; - subModel.placement = _meta.LPub.multiStep.subModel.placement; - pliPerStep = _meta.LPub.multiStep.pli.perStep.value(); - csiStepMeta = _meta.LPub.multiStep.csi; - justifyStep = _meta.LPub.multiStep.justifyStep; - adjustOnItemOffset = _meta.LPub.multiStep.adjustOnItemOffset.value(); - stepSize = _meta.LPub.multiStep.stepSize; + csiStepMeta.fadeSteps = _meta.LPub.multiStep.csi.fadeSteps; + csiStepMeta.highlightStep = _meta.LPub.multiStep.csi.highlightStep; + csiStepMeta.preferredRenderer= _meta.LPub.multiStep.csi.preferredRenderer; + csiStepMeta.studStyle = _meta.LPub.multiStep.csi.studStyle; + csiPlacement.margin = _meta.LPub.multiStep.csi.margin; + csiPlacement.placement = _meta.LPub.multiStep.csi.placement; + pli.margin = _meta.LPub.multiStep.pli.margin; + pli.placement = _meta.LPub.multiStep.pli.placement; + rotateIconMeta = _meta.LPub.multiStep.rotateIcon; + numberPlacemetMeta = _meta.LPub.multiStep.stepNum; + stepNumber.placement = _meta.LPub.multiStep.stepNum.placement; + stepNumber.font = _meta.LPub.multiStep.stepNum.font.valueFoo(); + stepNumber.color = _meta.LPub.multiStep.stepNum.color.value(); + stepNumber.margin = _meta.LPub.multiStep.stepNum.margin; + subModel.margin = _meta.LPub.multiStep.subModel.margin; + subModel.placement = _meta.LPub.multiStep.subModel.placement; + pliPerStep = _meta.LPub.multiStep.pli.perStep.value(); + csiStepMeta = _meta.LPub.multiStep.csi; + justifyStep = _meta.LPub.multiStep.justifyStep; + adjustOnItemOffset = _meta.LPub.multiStep.adjustOnItemOffset.value(); + stepSize = _meta.LPub.multiStep.stepSize; } else { - csiPlacement.margin = _meta.LPub.assem.margin; - csiPlacement.placement = _meta.LPub.assem.placement; - placement = _meta.LPub.assem.placement; - pli.margin = _meta.LPub.pli.margin; - pli.placement = _meta.LPub.pli.placement; - rotateIconMeta = _meta.LPub.rotateIcon; - stepNumber.placement = _meta.LPub.stepNumber.placement; - stepNumber.font = _meta.LPub.stepNumber.font.valueFoo(); - stepNumber.color = _meta.LPub.stepNumber.color.value(); - stepNumber.margin = _meta.LPub.stepNumber.margin; - subModel.margin = _meta.LPub.subModel.margin; - subModel.placement = _meta.LPub.subModel.placement; - pliPerStep = false; - + csiPlacement.margin = _meta.LPub.assem.margin; + csiPlacement.placement = _meta.LPub.assem.placement; + placement = _meta.LPub.assem.placement; + pli.margin = _meta.LPub.pli.margin; + pli.placement = _meta.LPub.pli.placement; + rotateIconMeta = _meta.LPub.rotateIcon; + stepNumber.placement = _meta.LPub.stepNumber.placement; + stepNumber.font = _meta.LPub.stepNumber.font.valueFoo(); + stepNumber.color = _meta.LPub.stepNumber.color.value(); + stepNumber.margin = _meta.LPub.stepNumber.margin; + subModel.margin = _meta.LPub.subModel.margin; + subModel.placement = _meta.LPub.subModel.placement; + pliPerStep = false; csiStepMeta.fadeSteps = _meta.LPub.assem.fadeSteps; csiStepMeta.highlightStep = _meta.LPub.assem.highlightStep; csiStepMeta.preferredRenderer= _meta.LPub.assem.preferredRenderer; @@ -186,8 +193,6 @@ Step::Step( placeRotateIcon = false; placeCsiAnnotation = false; updateViewer = true; // this is set to false on csiItem mouseReleaseEvent and countPages - fadeSteps = Preferences::enableFadeSteps; - highlightStep = Preferences::enableHighlightStep; gStep = this; } @@ -492,7 +497,9 @@ int Step::createCsi( // header and closing meta for Visual Editor - this call returns an updated rotatedParts file renderer->setLDrawHeaderAndFooterMeta(futureParts,top.modelName,Options::CSI,displayStep); // consolidate subfiles and parts into single file - if (renderer->createNativeModelFile(futureParts,fadeSteps,highlightStep) != 0) { + bool doFadeSteps = csiStepMeta.fadeSteps.enable.value(); + bool doHighlightStep = csiStepMeta.highlightStep.enable.value(); + if (renderer->createNativeModelFile(futureParts,doFadeSteps,doHighlightStep) != 0) { emit gui->messageSig(LOG_ERROR,QString("Failed to consolidate Viewer CSI parts")); pngName = QString(":/resources/missingimage.png"); futureParts.clear(); @@ -521,6 +528,8 @@ int Step::createCsi( StudStyleMeta* ssm = meta.LPub.studStyle.value() ? &meta.LPub.studStyle : &csiStepMeta.studStyle; AutoEdgeColorMeta* aecm = meta.LPub.autoEdgeColor.enable.value() ? &meta.LPub.autoEdgeColor : &csiStepMeta.autoEdgeColor; HighContrastColorMeta* hccm = meta.LPub.studStyle.value() ? &meta.LPub.highContrast : &csiStepMeta.highContrast; + bool lpubFadeHighlight = (csiStepMeta.fadeSteps.lpubFade.value() && csiStepMeta.fadeSteps.enable.value()) || + (csiStepMeta.highlightStep.lpubHighlight.value() && csiStepMeta.highlightStep.enable.value()); viewerOptions = new NativeOptions(); viewerOptions->HighlightNewParts = false; // gui->suppressColourMeta(); viewerOptions->CameraDistance = camDistance > 0 ? camDistance : renderer->ViewerCameraDistance(meta,csiStepMeta.modelScale.value()); @@ -539,9 +548,9 @@ int Step::createCsi( viewerOptions->Resolution = resolution(); viewerOptions->RotStep = Vector3(float(rotStepMeta.value().rots[0]),float(rotStepMeta.value().rots[1]),float(rotStepMeta.value().rots[2])); viewerOptions->RotStepType = rotStepMeta.value().type; - viewerOptions->TrueFade = csiStepMeta.fadeSteps.truefade.value(); - viewerOptions->FadeSteps = csiStepMeta.fadeSteps.enable.value(); - viewerOptions->HighlightStep = csiStepMeta.highlightStep.enable.value(); + viewerOptions->LPubFadeHighlight = lpubFadeHighlight; + viewerOptions->FadeParts = csiStepMeta.fadeSteps.enable.value(); + viewerOptions->HighlightParts = csiStepMeta.highlightStep.enable.value(); viewerOptions->AutoEdgeColor = aecm->enable.value(); viewerOptions->EdgeContrast = aecm->contrast.value(); viewerOptions->EdgeSaturation = aecm->saturation.value(); @@ -644,7 +653,9 @@ int Step::createCsi( QStringList csiKeys = QStringList() << csiKey; // adding just a single key - i.e.nameAndStepKey // set the current step - enable access from other parts of the application - e.g. Renderer - lpub->setCurrentStep(this); + if (nativeRenderer) { + lpub->setCurrentStep(this); + } //QFuture RenderFuture = QtConcurrent::run([this, &addLine, &csiParts, &csiKeys, &meta, nType] () { // int frc = 0; @@ -708,8 +719,10 @@ QStringList Step::configureModelStep(const QStringList &csiParts, Where ¤t { QStringList processedCsiParts, stepColourList; - bool enableFadeSteps = (/* Preferences::enableFadeSteps || */csiStepMeta.fadeSteps.enable.value()); - bool enableHighlightStep = (/* Preferences::enableHighlightStep || */csiStepMeta.highlightStep.enable.value()); + bool enableFadeSteps = csiStepMeta.fadeSteps.enable.value(); + bool enableHighlightStep = csiStepMeta.highlightStep.enable.value(); + bool lpubFadeHighlight = (csiStepMeta.fadeSteps.lpubFade.value() && enableFadeSteps) || + (csiStepMeta.highlightStep.lpubHighlight.value() && enableHighlightStep); bool highlightFirstStep = Preferences::highlightFirstStep; @@ -1016,7 +1029,10 @@ QStringList Step::configureModelStep(const QStringList &csiParts, Where ¤t lpub->ldrawFile.setPrevStepPosition(current.modelName,stepNum,type_1_5_line_count); }; - if (csiParts.size() && (enableFadeSteps || enableHighlightStep) && (highlightFirstStep ? true : stepNum > 1)) { + if (lpubFadeHighlight && + csiParts.size() && + (enableFadeSteps || enableHighlightStep) && + (highlightFirstStep ? true : stepNum > 1)) { QFuture processFuture = QtConcurrent::run([&] () { processCsiParts(csiParts); }); processFuture.waitForFinished(); diff --git a/mainApp/step.h b/mainApp/step.h index 4f473a84b..c1f2ca407 100644 --- a/mainApp/step.h +++ b/mainApp/step.h @@ -90,8 +90,6 @@ class Step : public AbstractRangeElement bool csiOutOfDate; bool bfxLoadStep; bool buildModActionStep; - bool fadeSteps; - bool highlightStep; bool adjustOnItemOffset; bool updateViewer; QString ldrName; diff --git a/mainApp/traverse.cpp b/mainApp/traverse.cpp index 7f7c21359..b3d8d8bf6 100644 --- a/mainApp/traverse.cpp +++ b/mainApp/traverse.cpp @@ -1193,10 +1193,11 @@ int Gui::drawPage( /*rc == EnableFadeStepsAssemRc*/ !curMeta.LPub.assem.fadeSteps.enable.global && !curMeta.LPub.assem.fadeSteps.setup.value())) { - parseError(tr("Fade previous steps command IGNORED.
" - "FADE_STEPS SETUP must be set to TRUE." + parseError(tr("Fade previous steps command IGNORED." + "
FADE_STEPS SETUP must be set to TRUE." "
FADE_STEPS SETUP must precede FADE_STEPS ENABLED." "
GLOBAL command must appear in the header of the top model."),opts.current); + break; } else if (rc == EnableFadeStepsCalloutAssemRc) { curMeta.LPub.callout.csi.fadeSteps.setPreferences(); if (step) @@ -1213,8 +1214,8 @@ int Gui::drawPage( break; case EnableFadeStepsRc: if (!curMeta.LPub.fadeSteps.enable.global && !curMeta.LPub.fadeSteps.setup.value()) { - parseError(tr("Fade previous steps command IGNORED.
" - "FADE_STEPS SETUP must be set to TRUE." + parseError(tr("Fade previous steps command IGNORED." + "
FADE_STEPS SETUP must be set to TRUE." "
FADE_STEPS SETUP must precede FADE_STEPS ENABLED." "
GLOBAL command must appear in the header of the top model."),opts.current); break; @@ -1242,10 +1243,11 @@ int Gui::drawPage( /*rc == EnableHighlightStepAssemRc*/ !curMeta.LPub.assem.highlightStep.enable.global && !curMeta.LPub.assem.highlightStep.setup.value())) { - parseError(tr("Highlight current step command IGNORED.
" - "HIGHLIGHT_STEP SETUP TRUE not deteced." + parseError(tr("Highlight current step command IGNORED." + "
HIGHLIGHT_STEP SETUP TRUE not deteced." "
HIGHLIGHT_STEP SETUP must precede HIGHLIGHT_STEP ENABLED." "
GLOBAL command must appear in the header of the top model."),opts.current); + break; } else if (rc == EnableHighlightStepCalloutAssemRc) { curMeta.LPub.callout.csi.highlightStep.setPreferences(); if (step) @@ -1262,8 +1264,8 @@ int Gui::drawPage( break; case EnableHighlightStepRc: if (!curMeta.LPub.highlightStep.enable.global && !curMeta.LPub.highlightStep.setup.value()) { - parseError(tr("Highlight current step command IGNORED.
" - "HIGHLIGHT_STEP SETUP must be set to TRUE." + parseError(tr("Highlight current step command IGNORED." + "
HIGHLIGHT_STEP SETUP must be set to TRUE." "
HIGHLIGHT_STEP SETUP must precede HIGHLIGHT_STEP ENABLED." "
GLOBAL command must appear in the header of the top model."),opts.current); break; @@ -1278,6 +1280,48 @@ int Gui::drawPage( } break; + case LPubFadeCalloutAssemRc: + case LPubFadeGroupAssemRc: + case LPubFadeAssemRc: + case LPubFadeRc: + case LPubHighlightCalloutAssemRc: + case LPubHighlightGroupAssemRc: + case LPubHighlightAssemRc: + case LPubHighlightRc: + if (Preferences::preferredRenderer == RENDERER_NATIVE) { + if (rc == LPubFadeCalloutAssemRc) { + if (step) + step->csiStepMeta.fadeSteps.lpubFade = curMeta.LPub.callout.csi.fadeSteps.lpubFade; + } else if (rc == LPubFadeGroupAssemRc) { + if (step) + step->csiStepMeta.fadeSteps.lpubFade = curMeta.LPub.multiStep.csi.fadeSteps.lpubFade; + } else if (rc == LPubFadeAssemRc) { + if (step) + step->csiStepMeta.fadeSteps.lpubFade = curMeta.LPub.assem.fadeSteps.lpubFade; + } else if (rc == LPubFadeRc) { + if (step) + step->csiStepMeta.fadeSteps.lpubFade = curMeta.LPub.assem.fadeSteps.lpubFade; + } else if (rc == LPubHighlightCalloutAssemRc) { + if (step) + step->csiStepMeta.highlightStep.lpubHighlight = curMeta.LPub.callout.csi.highlightStep.lpubHighlight; + } else if (rc == LPubHighlightGroupAssemRc) { + if (step) + step->csiStepMeta.highlightStep.lpubHighlight = curMeta.LPub.multiStep.csi.highlightStep.lpubHighlight; + } else if (rc == LPubHighlightAssemRc) { + if (step) + step->csiStepMeta.highlightStep.lpubHighlight = curMeta.LPub.assem.highlightStep.lpubHighlight; + } else if (rc == LPubHighlightRc) { + if (step) + step->csiStepMeta.highlightStep.lpubHighlight = curMeta.LPub.assem.highlightStep.lpubHighlight; + } + } else { + QString const command = line.contains("LPUB_FADE") ? QLatin1String("LPUB_FADE") : QLatin1String("LPUB_HIGHLIGHT"); + parseError(tr("%1 command IGNORED." + "
%1 command requires preferred render RENDERER_NATIVE." + "
PREFERRED_RENDERER command must precede %1.").arg(command),opts.current); + } + break; + /* Buffer exchange */ case BufferStoreRc: opts.bfx[curMeta.bfx.value()] = opts.csiParts;