Skip to content

Commit

Permalink
Insert display model - lpub fade highlight setup #704
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorsandy committed May 8, 2023
1 parent ea21ecc commit b04a91a
Show file tree
Hide file tree
Showing 50 changed files with 667 additions and 372 deletions.
2 changes: 1 addition & 1 deletion builds/linux/obs/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.6.3306
pkgver=2.4.6.3307
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Last Update: July 19, 2020
# Copyright (C) 2017 - 2023 by Trevor SANDY
pkgname=lpub3d
pkgver=2.4.6.3306
pkgver=2.4.6.3307
pkgrel=1
pkgdesc="An LDraw Building Instruction Editor"
url="https://github.com/trevorsandy/lpub3d.git"
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/alldeps/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.6.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 <[email protected]> Mon, 08 May 2023 05:55:36 +0200
-- Trevor SANDY <[email protected]> Mon, 08 May 2023 05:55:59 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/alldeps/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.6.3306
Version: 2.4.6.3307
Maintainer: Trevor SANDY <[email protected]>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/alldeps/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.6.3306
Version: 2.4.6.3307
Release: <B_CNT>%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -797,7 +797,7 @@ update-desktop-database || true
%endif

%changelog
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.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
Expand Down
6 changes: 3 additions & 3 deletions builds/linux/obs/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lpub3d (2.4.6.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 <[email protected]> Mon, 08 May 2023 05:55:38 +0200
-- Trevor SANDY <[email protected]> Mon, 08 May 2023 05:56:01 +0200
2 changes: 1 addition & 1 deletion builds/linux/obs/debian/lpub3d.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Format: 1.0
Source: lpub3d
Binary: lpub3d
Architecture: any
Version: 2.4.6.3306
Version: 2.4.6.3307
Maintainer: Trevor SANDY <[email protected]>
Homepage: https://trevorsandy.github.io/lpub3d/
Standards-Version: 3.9.7
Expand Down
4 changes: 2 additions & 2 deletions builds/linux/obs/lpub3d.spec
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BuildRequires: fdupes
Summary: An LDraw Building Instruction Editor
Name: lpub3d
Icon: lpub3d.xpm
Version: 2.4.6.3306
Version: 2.4.6.3307
Release: 1%{?dist}
URL: https://trevorsandy.github.io/lpub3d
Vendor: Trevor SANDY
Expand Down Expand Up @@ -313,7 +313,7 @@ update-desktop-database || true
%endif

%changelog
* Mon May 08 2023 - trevor.dot.sandy.at.gmail.dot.com 2.4.6.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
Expand Down
2 changes: 1 addition & 1 deletion builds/utilities/version.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2 4 6 195 3306 5ca912615
2 4 6 196 3307 ea21ecc84
6 changes: 3 additions & 3 deletions gitversion.pri
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ equals(GIT_DIR, undefined) {

# Check if we do not have a valid version number (i.e. no version tag found)
isEmpty(GIT_VERSION) {
GIT_REVISION = 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}
Expand Down Expand Up @@ -69,7 +69,7 @@ equals(GIT_DIR, undefined) {
# Get commit count
GIT_COMMIT = $$system($$GIT_BASE_COMMAND rev-list --count HEAD 2> $$NULL_DEVICE)
isEmpty(GIT_COMMIT) {
GIT_COMMIT = 3306
GIT_COMMIT = 3307
message("~~~ ERROR! GIT_COMMIT NOT DEFINED, USING $$GIT_COMMIT ~~~")
}

Expand Down Expand Up @@ -117,7 +117,7 @@ if (equals(USE_GIT_VER_FILE, true)|equals(USE_VERSION_INFO_VAR, true)) {
GIT_VERSION = $$cat($$GIT_VER_FILE, lines)
} else {
message("~~~ ERROR! $$GIT_DIR_ENV VERSION_INFO FILE $$GIT_VER_FILE NOT FOUND ~~~")
GIT_VERSION = $${VERSION}.195.3306.5ca912615
GIT_VERSION = $${VERSION}.196.3307.ea21ecc84
message("~~~ GIT_DIR [$$GIT_DIR_ENV, USING VERSION] $$GIT_VERSION ~~~")
GIT_VERSION ~= s/\./" "
}
Expand Down
36 changes: 14 additions & 22 deletions lclib/common/lc_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/
}

Expand Down Expand Up @@ -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 ***/
}

Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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 ***/

Expand Down Expand Up @@ -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 ***/

Expand Down Expand Up @@ -1735,7 +1727,7 @@ void lcApplication::ShowPreferencesDialog()
}

if ((ViewPieceIconsChangd ||
LPubTrueFadeChanged ||
LPubFadeHighlightChanged ||
DefaultCameraChanged ||
DrawConditionalLinesChanged) && !restartApp && !reloadFile)
reloadPage = true;
Expand Down
13 changes: 6 additions & 7 deletions lclib/common/lc_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum class lcPreviewPosition
{
Dockable,
Floating,
Viewport // not implemented
Viewport // not implemented
};
/*** LPub3D Mod end ***/

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 ***/
Expand Down
2 changes: 1 addition & 1 deletion lclib/common/lc_colors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions lclib/common/lc_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,15 +713,15 @@ 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 ***/
{
if (Enable == mCullFace)
return;

if (Enable)
/*** LPub3D Mod - true fade ***/
/*** LPub3D Mod - lpub fade highlight ***/
{
if (LPubFade)
glCullFace(GL_BACK);
Expand Down
4 changes: 2 additions & 2 deletions lclib/common/lc_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
27 changes: 19 additions & 8 deletions lclib/common/lc_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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 ***/
}
}
Expand All @@ -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 ***/
}
Expand Down
4 changes: 2 additions & 2 deletions lclib/common/lc_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 ***/

Expand Down
4 changes: 2 additions & 2 deletions lclib/common/lc_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***/
Expand Down
Loading

0 comments on commit b04a91a

Please sign in to comment.