mirror of
https://github.com/leozide/leocad
synced 2025-01-18 22:26:44 +01:00
Stud style - Rename stud logo
This commit is contained in:
parent
0a749f6f3a
commit
f21d7ad63a
16 changed files with 89 additions and 89 deletions
|
@ -340,7 +340,7 @@ lcCommandLineOptions lcApplication::ParseCommandLineOptions()
|
||||||
Options.ImageWidth = lcGetProfileInt(LC_PROFILE_IMAGE_WIDTH);
|
Options.ImageWidth = lcGetProfileInt(LC_PROFILE_IMAGE_WIDTH);
|
||||||
Options.ImageHeight = lcGetProfileInt(LC_PROFILE_IMAGE_HEIGHT);
|
Options.ImageHeight = lcGetProfileInt(LC_PROFILE_IMAGE_HEIGHT);
|
||||||
Options.AASamples = lcGetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES);
|
Options.AASamples = lcGetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES);
|
||||||
Options.StudLogo = lcGetProfileInt(LC_PROFILE_STUD_LOGO);
|
Options.StudStyle = lcGetProfileInt(LC_PROFILE_STUD_STYLE);
|
||||||
Options.ImageStart = 0;
|
Options.ImageStart = 0;
|
||||||
Options.ImageEnd = 0;
|
Options.ImageEnd = 0;
|
||||||
Options.CameraPosition[0] = lcVector3(0.0f, 0.0f, 0.0f);
|
Options.CameraPosition[0] = lcVector3(0.0f, 0.0f, 0.0f);
|
||||||
|
@ -654,12 +654,12 @@ lcCommandLineOptions lcApplication::ParseCommandLineOptions()
|
||||||
Options.ParseOK = false;
|
Options.ParseOK = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Option == QLatin1String("-sl") || Option == QLatin1String("--stud-logo"))
|
else if (Option == QLatin1String("-ss") || Option == QLatin1String("--stud-style"))
|
||||||
{
|
{
|
||||||
ParseInteger(Options.StudLogo, 0, 7);
|
ParseInteger(Options.StudStyle, 0, 7);
|
||||||
|
|
||||||
if (Options.StudLogo != lcGetProfileInt(LC_PROFILE_STUD_LOGO))
|
if (Options.StudStyle != lcGetProfileInt(LC_PROFILE_STUD_STYLE))
|
||||||
lcGetPiecesLibrary()->SetStudLogo(Options.StudLogo, false);
|
lcGetPiecesLibrary()->SetStudStyle(Options.StudStyle, false);
|
||||||
}
|
}
|
||||||
else if (Option == QLatin1String("-obj") || Option == QLatin1String("--export-wavefront"))
|
else if (Option == QLatin1String("-obj") || Option == QLatin1String("--export-wavefront"))
|
||||||
{
|
{
|
||||||
|
@ -703,7 +703,7 @@ lcCommandLineOptions lcApplication::ParseCommandLineOptions()
|
||||||
Options.StdOut += tr(" -t, --to <step>: Set the last step to save pictures.\n");
|
Options.StdOut += tr(" -t, --to <step>: Set the last step to save pictures.\n");
|
||||||
Options.StdOut += tr(" -s, --submodel <submodel>: Set the active submodel.\n");
|
Options.StdOut += tr(" -s, --submodel <submodel>: Set the active submodel.\n");
|
||||||
Options.StdOut += tr(" -c, --camera <camera>: Set the active camera.\n");
|
Options.StdOut += tr(" -c, --camera <camera>: Set the active camera.\n");
|
||||||
Options.StdOut += tr(" -sl, --stud-logo <type>: Set the stud logo type 0 - 5, 0 is no logo.\n");
|
Options.StdOut += tr(" -ss, --stud-style <id>: Set the stud style 0=No style, 1=LDraw single wire, 2=LDraw double wire, 3=LDraw raised floating, 4=LDraw raised rounded, 5=LDraw subtle rounded, 6=LEGO no logo, 7=LEGO single wire.\n");
|
||||||
Options.StdOut += tr(" --viewpoint <front|back|left|right|top|bottom|home>: Set the viewpoint.\n");
|
Options.StdOut += tr(" --viewpoint <front|back|left|right|top|bottom|home>: Set the viewpoint.\n");
|
||||||
Options.StdOut += tr(" --camera-angles <latitude> <longitude>: Set the camera angles in degrees around the model.\n");
|
Options.StdOut += tr(" --camera-angles <latitude> <longitude>: Set the camera angles in degrees around the model.\n");
|
||||||
Options.StdOut += tr(" --camera-position <x> <y> <z> <tx> <ty> <tz> <ux> <uy> <uz>: Set the camera position, target and up vector.\n");
|
Options.StdOut += tr(" --camera-position <x> <y> <z> <tx> <ty> <tz> <ux> <uy> <uz>: Set the camera position, target and up vector.\n");
|
||||||
|
@ -1108,7 +1108,7 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
{
|
{
|
||||||
lcPreferencesDialogOptions Options;
|
lcPreferencesDialogOptions Options;
|
||||||
int CurrentAASamples = lcGetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES);
|
int CurrentAASamples = lcGetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES);
|
||||||
int CurrentStudLogo = lcGetProfileInt(LC_PROFILE_STUD_LOGO);
|
int CurrentStudStyle = lcGetProfileInt(LC_PROFILE_STUD_STYLE);
|
||||||
|
|
||||||
Options.Preferences = mPreferences;
|
Options.Preferences = mPreferences;
|
||||||
|
|
||||||
|
@ -1122,7 +1122,7 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
Options.CheckForUpdates = lcGetProfileInt(LC_PROFILE_CHECK_UPDATES);
|
Options.CheckForUpdates = lcGetProfileInt(LC_PROFILE_CHECK_UPDATES);
|
||||||
|
|
||||||
Options.AASamples = CurrentAASamples;
|
Options.AASamples = CurrentAASamples;
|
||||||
Options.StudLogo = CurrentStudLogo;
|
Options.StudStyle = CurrentStudStyle;
|
||||||
|
|
||||||
Options.Categories = gCategories;
|
Options.Categories = gCategories;
|
||||||
Options.CategoriesModified = false;
|
Options.CategoriesModified = false;
|
||||||
|
@ -1143,7 +1143,7 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
bool LibraryChanged = Options.LibraryPath != lcGetProfileString(LC_PROFILE_PARTS_LIBRARY);
|
bool LibraryChanged = Options.LibraryPath != lcGetProfileString(LC_PROFILE_PARTS_LIBRARY);
|
||||||
bool ColorsChanged = Options.ColorConfigPath != lcGetProfileString(LC_PROFILE_COLOR_CONFIG);
|
bool ColorsChanged = Options.ColorConfigPath != lcGetProfileString(LC_PROFILE_COLOR_CONFIG);
|
||||||
bool AAChanged = CurrentAASamples != Options.AASamples;
|
bool AAChanged = CurrentAASamples != Options.AASamples;
|
||||||
bool StudLogoChanged = CurrentStudLogo != Options.StudLogo;
|
bool StudStyleChanged = CurrentStudStyle != Options.StudStyle;
|
||||||
|
|
||||||
mPreferences = Options.Preferences;
|
mPreferences = Options.Preferences;
|
||||||
|
|
||||||
|
@ -1159,7 +1159,7 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
lcSetProfileString(LC_PROFILE_LANGUAGE, Options.Language);
|
lcSetProfileString(LC_PROFILE_LANGUAGE, Options.Language);
|
||||||
lcSetProfileInt(LC_PROFILE_CHECK_UPDATES, Options.CheckForUpdates);
|
lcSetProfileInt(LC_PROFILE_CHECK_UPDATES, Options.CheckForUpdates);
|
||||||
lcSetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES, Options.AASamples);
|
lcSetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES, Options.AASamples);
|
||||||
lcSetProfileInt(LC_PROFILE_STUD_LOGO, Options.StudLogo);
|
lcSetProfileInt(LC_PROFILE_STUD_STYLE, Options.StudStyle);
|
||||||
|
|
||||||
if (LanguageChanged || LibraryChanged || ColorsChanged || AAChanged)
|
if (LanguageChanged || LibraryChanged || ColorsChanged || AAChanged)
|
||||||
QMessageBox::information(gMainWindow, tr("LeoCAD"), tr("Some changes will only take effect the next time you start LeoCAD."));
|
QMessageBox::information(gMainWindow, tr("LeoCAD"), tr("Some changes will only take effect the next time you start LeoCAD."));
|
||||||
|
@ -1201,10 +1201,10 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StudLogoChanged)
|
if (StudStyleChanged)
|
||||||
{
|
{
|
||||||
lcSetProfileInt(LC_PROFILE_STUD_LOGO, Options.StudLogo);
|
lcSetProfileInt(LC_PROFILE_STUD_STYLE, Options.StudStyle);
|
||||||
lcGetPiecesLibrary()->SetStudLogo(Options.StudLogo, true);
|
lcGetPiecesLibrary()->SetStudStyle(Options.StudStyle, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: printing preferences
|
// TODO: printing preferences
|
||||||
|
|
|
@ -95,7 +95,7 @@ struct lcCommandLineOptions
|
||||||
int ImageWidth;
|
int ImageWidth;
|
||||||
int ImageHeight;
|
int ImageHeight;
|
||||||
int AASamples;
|
int AASamples;
|
||||||
int StudLogo;
|
int StudStyle;
|
||||||
lcStep ImageStart;
|
lcStep ImageStart;
|
||||||
lcStep ImageEnd;
|
lcStep ImageEnd;
|
||||||
lcVector3 CameraPosition[3];
|
lcVector3 CameraPosition[3];
|
||||||
|
|
|
@ -487,7 +487,7 @@ int lcGetColorIndex(quint32 ColorCode)
|
||||||
return (int)gColorList.size() - 1;
|
return (int)gColorList.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcLoadLegoStyleDisplayColors()
|
void lcLoadLegoStudStyleColors()
|
||||||
{
|
{
|
||||||
QByteArray ColorData;
|
QByteArray ColorData;
|
||||||
const char *ColorEntry = "0 !COLOUR Stud_Style_Black CODE 4242 VALUE #1B2A34 EDGE #000000\r\n";
|
const char *ColorEntry = "0 !COLOUR Stud_Style_Black CODE 4242 VALUE #1B2A34 EDGE #000000\r\n";
|
||||||
|
|
|
@ -49,7 +49,7 @@ extern int gEdgeColor;
|
||||||
extern int gDefaultColor;
|
extern int gDefaultColor;
|
||||||
|
|
||||||
void lcLoadDefaultColors();
|
void lcLoadDefaultColors();
|
||||||
void lcLoadLegoStyleDisplayColors();
|
void lcLoadLegoStudStyleColors();
|
||||||
bool lcLoadColorFile(lcFile& File, bool Update);
|
bool lcLoadColorFile(lcFile& File, bool Update);
|
||||||
int lcGetColorIndex(quint32 ColorCode);
|
int lcGetColorIndex(quint32 ColorCode);
|
||||||
int lcGetColorIndexByName(const char * ColorName);
|
int lcGetColorIndexByName(const char * ColorName);
|
||||||
|
|
|
@ -41,7 +41,7 @@ lcPiecesLibrary::lcPiecesLibrary()
|
||||||
mBuffersDirty = false;
|
mBuffersDirty = false;
|
||||||
mHasUnofficial = false;
|
mHasUnofficial = false;
|
||||||
mCancelLoading = false;
|
mCancelLoading = false;
|
||||||
mStudLogo = lcGetProfileInt(LC_PROFILE_STUD_LOGO);
|
mStudStyle = lcGetProfileInt(LC_PROFILE_STUD_STYLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcPiecesLibrary::~lcPiecesLibrary()
|
lcPiecesLibrary::~lcPiecesLibrary()
|
||||||
|
@ -260,7 +260,7 @@ bool lcPiecesLibrary::Load(const QString& LibraryPath, bool ShowProgress)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStudLogoSource();
|
UpdateStudStyleSource();
|
||||||
lcLoadDefaultCategories();
|
lcLoadDefaultCategories();
|
||||||
lcSynthInit();
|
lcSynthInit();
|
||||||
|
|
||||||
|
@ -305,29 +305,29 @@ void lcPiecesLibrary::LoadColors(bool Update)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcPiecesLibrary::UpdateStudLogoSource()
|
void lcPiecesLibrary::UpdateStudStyleSource()
|
||||||
{
|
{
|
||||||
if (!mSources.empty() && mSources.front()->Type == lcLibrarySourceType::StudLogo)
|
if (!mSources.empty() && mSources.front()->Type == lcLibrarySourceType::StudStyle)
|
||||||
mSources.erase(mSources.begin());
|
mSources.erase(mSources.begin());
|
||||||
|
|
||||||
mZipFiles[static_cast<int>(lcZipFileType::StudLogo)].reset();
|
mZipFiles[static_cast<int>(lcZipFileType::StudStyle)].reset();
|
||||||
|
|
||||||
if (!mStudLogo)
|
if (!mStudStyle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mStudLogo > 5)
|
if (mStudStyle > 5)
|
||||||
lcLoadLegoStyleDisplayColors();
|
lcLoadLegoStudStyleColors();
|
||||||
|
|
||||||
std::unique_ptr<lcDiskFile> StudLogoFile;
|
std::unique_ptr<lcDiskFile> StudStyleFile;
|
||||||
if (mStudLogo < 6)
|
if (mStudStyle < 6)
|
||||||
StudLogoFile = std::unique_ptr<lcDiskFile>(new lcDiskFile(QString(":/resources/studlogo%1.zip").arg(QString::number(mStudLogo))));
|
StudStyleFile = std::unique_ptr<lcDiskFile>(new lcDiskFile(QString(":/resources/studlogo%1.zip").arg(QString::number(mStudStyle))));
|
||||||
else if (mStudLogo == 6)
|
else if (mStudStyle == 6)
|
||||||
StudLogoFile = std::unique_ptr<lcDiskFile>(new lcDiskFile(QString(":/resources/studslegostyle1.zip")));
|
StudStyleFile = std::unique_ptr<lcDiskFile>(new lcDiskFile(QString(":/resources/studslegostyle1.zip")));
|
||||||
else
|
else
|
||||||
StudLogoFile = std::unique_ptr<lcDiskFile>(new lcDiskFile(QString(":/resources/studslegostyle2.zip")));
|
StudStyleFile = std::unique_ptr<lcDiskFile>(new lcDiskFile(QString(":/resources/studslegostyle2.zip")));
|
||||||
|
|
||||||
if (StudLogoFile->Open(QIODevice::ReadOnly))
|
if (StudStyleFile->Open(QIODevice::ReadOnly))
|
||||||
OpenArchive(std::move(StudLogoFile), lcZipFileType::StudLogo);
|
OpenArchive(std::move(StudStyleFile), lcZipFileType::StudStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lcPiecesLibrary::OpenArchive(const QString& FileName, lcZipFileType ZipFileType)
|
bool lcPiecesLibrary::OpenArchive(const QString& FileName, lcZipFileType ZipFileType)
|
||||||
|
@ -348,7 +348,7 @@ bool lcPiecesLibrary::OpenArchive(std::unique_ptr<lcFile> File, lcZipFileType Zi
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::unique_ptr<lcLibrarySource> Source(new lcLibrarySource);
|
std::unique_ptr<lcLibrarySource> Source(new lcLibrarySource);
|
||||||
Source->Type = ZipFileType != lcZipFileType::StudLogo ? lcLibrarySourceType::Library : lcLibrarySourceType::StudLogo;
|
Source->Type = ZipFileType != lcZipFileType::StudStyle ? lcLibrarySourceType::Library : lcLibrarySourceType::StudStyle;
|
||||||
|
|
||||||
for (int FileIdx = 0; FileIdx < ZipFile->mFiles.GetSize(); FileIdx++)
|
for (int FileIdx = 0; FileIdx < ZipFile->mFiles.GetSize(); FileIdx++)
|
||||||
{
|
{
|
||||||
|
@ -1085,7 +1085,7 @@ bool lcPiecesLibrary::LoadCachePiece(PieceInfo* Info)
|
||||||
if (MeshData.ReadBuffer((char*)&Flags, sizeof(Flags)) == 0)
|
if (MeshData.ReadBuffer((char*)&Flags, sizeof(Flags)) == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Flags != mStudLogo)
|
if (Flags != mStudStyle)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lcMesh* Mesh = new lcMesh;
|
lcMesh* Mesh = new lcMesh;
|
||||||
|
@ -1105,7 +1105,7 @@ bool lcPiecesLibrary::SaveCachePiece(PieceInfo* Info)
|
||||||
{
|
{
|
||||||
lcMemFile MeshData;
|
lcMemFile MeshData;
|
||||||
|
|
||||||
const qint32 Flags = mStudLogo;
|
const qint32 Flags = mStudStyle;
|
||||||
if (MeshData.WriteBuffer((char*)&Flags, sizeof(Flags)) == 0)
|
if (MeshData.WriteBuffer((char*)&Flags, sizeof(Flags)) == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1532,19 +1532,19 @@ void lcPiecesLibrary::UploadTextures(lcContext* Context)
|
||||||
mTextureUploads.clear();
|
mTextureUploads.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lcPiecesLibrary::SupportsStudLogo() const
|
bool lcPiecesLibrary::SupportsStudStyle() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcPiecesLibrary::SetStudLogo(int StudLogo, bool Reload)
|
void lcPiecesLibrary::SetStudStyle(int StudStyle, bool Reload)
|
||||||
{
|
{
|
||||||
if (mStudLogo > 5 && StudLogo < 6 && Reload)
|
if (mStudStyle > 5 && StudStyle < 6 && Reload)
|
||||||
LoadColors(Reload);
|
LoadColors(Reload);
|
||||||
|
|
||||||
mStudLogo = StudLogo;
|
mStudStyle = StudStyle;
|
||||||
|
|
||||||
UpdateStudLogoSource();
|
UpdateStudStyleSource();
|
||||||
|
|
||||||
mLoadMutex.lock();
|
mLoadMutex.lock();
|
||||||
|
|
||||||
|
@ -1553,7 +1553,7 @@ void lcPiecesLibrary::SetStudLogo(int StudLogo, bool Reload)
|
||||||
for (const auto& PrimitiveIt : Source->Primitives)
|
for (const auto& PrimitiveIt : Source->Primitives)
|
||||||
{
|
{
|
||||||
lcLibraryPrimitive* Primitive = PrimitiveIt.second;
|
lcLibraryPrimitive* Primitive = PrimitiveIt.second;
|
||||||
if (Primitive->mMeshData.mHasLogoStud)
|
if (Primitive->mMeshData.mHasStyleStud)
|
||||||
Primitive->Unload();
|
Primitive->Unload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1568,7 +1568,7 @@ void lcPiecesLibrary::SetStudLogo(int StudLogo, bool Reload)
|
||||||
{
|
{
|
||||||
PieceInfo* Info = PieceIt.second;
|
PieceInfo* Info = PieceIt.second;
|
||||||
|
|
||||||
if (Info->mState == LC_PIECEINFO_LOADED && Info->GetMesh() && Info->GetMesh()->mFlags & lcMeshFlag::HasLogoStud)
|
if (Info->mState == LC_PIECEINFO_LOADED && Info->GetMesh() && Info->GetMesh()->mFlags & lcMeshFlag::HasStyleStud)
|
||||||
{
|
{
|
||||||
Info->Unload();
|
Info->Unload();
|
||||||
mLoadQueue.append(Info);
|
mLoadQueue.append(Info);
|
||||||
|
@ -1624,9 +1624,9 @@ bool lcPiecesLibrary::LoadPrimitive(lcLibraryPrimitive* Primitive)
|
||||||
|
|
||||||
lcMeshLoader MeshLoader(Primitive->mMeshData, true, nullptr, false);
|
lcMeshLoader MeshLoader(Primitive->mMeshData, true, nullptr, false);
|
||||||
|
|
||||||
auto StudLogoPrimitive = [this, &Primitive] ()
|
auto StudStylePrimitive = [this, &Primitive] ()
|
||||||
{
|
{
|
||||||
if (!mSources.empty() && mSources.front()->Type == lcLibrarySourceType::StudLogo)
|
if (!mSources.empty() && mSources.front()->Type == lcLibrarySourceType::StudStyle)
|
||||||
{
|
{
|
||||||
char Name[LC_PIECE_NAME_LEN];
|
char Name[LC_PIECE_NAME_LEN];
|
||||||
strcpy(Name, Primitive->mName);
|
strcpy(Name, Primitive->mName);
|
||||||
|
@ -1647,8 +1647,8 @@ bool lcPiecesLibrary::LoadPrimitive(lcLibraryPrimitive* Primitive)
|
||||||
|
|
||||||
if (Primitive->mStud)
|
if (Primitive->mStud)
|
||||||
{
|
{
|
||||||
if (StudLogoPrimitive())
|
if (StudStylePrimitive())
|
||||||
Primitive->mMeshData.mHasLogoStud = true;
|
Primitive->mMeshData.mHasStyleStud = true;
|
||||||
else if (strncmp(Primitive->mName, "8/", 2)) // todo: this is currently the only place that uses mName so use mFileName instead. this should also be done for the loose file libraries.
|
else if (strncmp(Primitive->mName, "8/", 2)) // todo: this is currently the only place that uses mName so use mFileName instead. this should also be done for the loose file libraries.
|
||||||
{
|
{
|
||||||
char Name[LC_PIECE_NAME_LEN];
|
char Name[LC_PIECE_NAME_LEN];
|
||||||
|
@ -1684,8 +1684,8 @@ bool lcPiecesLibrary::LoadPrimitive(lcLibraryPrimitive* Primitive)
|
||||||
{
|
{
|
||||||
if (Primitive->mStud)
|
if (Primitive->mStud)
|
||||||
{
|
{
|
||||||
if (StudLogoPrimitive())
|
if (StudStylePrimitive())
|
||||||
Primitive->mMeshData.mHasLogoStud = true;
|
Primitive->mMeshData.mHasStyleStud = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Primitive->mZipFileType == lcZipFileType::Count)
|
if (Primitive->mZipFileType == lcZipFileType::Count)
|
||||||
|
|
|
@ -14,7 +14,7 @@ enum class lcZipFileType
|
||||||
{
|
{
|
||||||
Official,
|
Official,
|
||||||
Unofficial,
|
Unofficial,
|
||||||
StudLogo,
|
StudStyle,
|
||||||
Count
|
Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public:
|
||||||
enum class lcLibrarySourceType
|
enum class lcLibrarySourceType
|
||||||
{
|
{
|
||||||
Library,
|
Library,
|
||||||
StudLogo
|
StudStyle
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lcLibrarySource
|
struct lcLibrarySource
|
||||||
|
@ -138,12 +138,12 @@ public:
|
||||||
lcLibraryPrimitive* FindPrimitive(const char* Name) const;
|
lcLibraryPrimitive* FindPrimitive(const char* Name) const;
|
||||||
bool LoadPrimitive(lcLibraryPrimitive* Primitive);
|
bool LoadPrimitive(lcLibraryPrimitive* Primitive);
|
||||||
|
|
||||||
bool SupportsStudLogo() const;
|
bool SupportsStudStyle() const;
|
||||||
void SetStudLogo(int StudLogo, bool Reload);
|
void SetStudStyle(int StudStyle, bool Reload);
|
||||||
|
|
||||||
int GetStudLogo() const
|
int GetStudStyle() const
|
||||||
{
|
{
|
||||||
return mStudLogo;
|
return mStudStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetOfficialPieces()
|
void SetOfficialPieces()
|
||||||
|
@ -191,7 +191,7 @@ protected:
|
||||||
bool ReadDirectoryCacheFile(const QString& FileName, lcMemFile& CacheFile);
|
bool ReadDirectoryCacheFile(const QString& FileName, lcMemFile& CacheFile);
|
||||||
bool WriteDirectoryCacheFile(const QString& FileName, lcMemFile& CacheFile);
|
bool WriteDirectoryCacheFile(const QString& FileName, lcMemFile& CacheFile);
|
||||||
|
|
||||||
void UpdateStudLogoSource();
|
void UpdateStudStyleSource();
|
||||||
|
|
||||||
std::vector<std::unique_ptr<lcLibrarySource>> mSources;
|
std::vector<std::unique_ptr<lcLibrarySource>> mSources;
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ protected:
|
||||||
QMutex mTextureMutex;
|
QMutex mTextureMutex;
|
||||||
std::vector<lcTexture*> mTextureUploads;
|
std::vector<lcTexture*> mTextureUploads;
|
||||||
|
|
||||||
int mStudLogo;
|
int mStudStyle;
|
||||||
|
|
||||||
QString mCachePath;
|
QString mCachePath;
|
||||||
qint64 mArchiveCheckSum[4];
|
qint64 mArchiveCheckSum[4];
|
||||||
|
|
|
@ -492,7 +492,7 @@ bool lcMesh::FileSave(lcMemFile& File)
|
||||||
|
|
||||||
int lcMesh::GetLodIndex(float Distance) const
|
int lcMesh::GetLodIndex(float Distance) const
|
||||||
{
|
{
|
||||||
if (lcGetPiecesLibrary()->GetStudLogo())
|
if (lcGetPiecesLibrary()->GetStudStyle())
|
||||||
return LC_MESH_LOD_HIGH;
|
return LC_MESH_LOD_HIGH;
|
||||||
|
|
||||||
if (mLods[LC_MESH_LOD_LOW].NumSections && (Distance > mRadius))
|
if (mLods[LC_MESH_LOD_LOW].NumSections && (Distance > mRadius))
|
||||||
|
|
|
@ -55,7 +55,7 @@ enum class lcMeshFlag
|
||||||
HasTranslucent = 0x04, // Mesh has triangles using a translucent color
|
HasTranslucent = 0x04, // Mesh has triangles using a translucent color
|
||||||
HasLines = 0x08, // Mesh has lines
|
HasLines = 0x08, // Mesh has lines
|
||||||
HasTexture = 0x10, // Mesh has sections using textures
|
HasTexture = 0x10, // Mesh has sections using textures
|
||||||
HasLogoStud = 0x20 // Mesh has a stud that can have a logo applied
|
HasStyleStud = 0x20 // Mesh has a stud that can have a logo applied
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_FLAGS(lcMeshFlags, lcMeshFlag)
|
Q_DECLARE_FLAGS(lcMeshFlags, lcMeshFlag)
|
||||||
|
|
|
@ -1187,8 +1187,8 @@ lcMesh* lcLibraryMeshData::CreateMesh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mHasLogoStud)
|
if (mHasStyleStud)
|
||||||
Mesh->mFlags |= lcMeshFlag::HasLogoStud;
|
Mesh->mFlags |= lcMeshFlag::HasStyleStud;
|
||||||
|
|
||||||
lcVector3 MeshMin(FLT_MAX, FLT_MAX, FLT_MAX), MeshMax(-FLT_MAX, -FLT_MAX, -FLT_MAX);
|
lcVector3 MeshMin(FLT_MAX, FLT_MAX, FLT_MAX), MeshMax(-FLT_MAX, -FLT_MAX, -FLT_MAX);
|
||||||
bool UpdatedBoundingBox = false;
|
bool UpdatedBoundingBox = false;
|
||||||
|
@ -1625,7 +1625,7 @@ bool lcMeshLoader::ReadMeshData(lcFile& File, const lcMatrix44& CurrentTransform
|
||||||
else
|
else
|
||||||
Library->GetPrimitiveFile(Primitive, FileCallback);
|
Library->GetPrimitiveFile(Primitive, FileCallback);
|
||||||
|
|
||||||
mMeshData.mHasLogoStud |= Primitive->mMeshData.mHasLogoStud;
|
mMeshData.mHasStyleStud |= Primitive->mMeshData.mHasStyleStud;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Library->GetPieceFile(FileName, FileCallback);
|
Library->GetPieceFile(FileName, FileCallback);
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
lcLibraryMeshData()
|
lcLibraryMeshData()
|
||||||
{
|
{
|
||||||
mHasTextures = false;
|
mHasTextures = false;
|
||||||
mHasLogoStud = false;
|
mHasStyleStud = false;
|
||||||
|
|
||||||
for (int MeshDataIdx = 0; MeshDataIdx < LC_NUM_MESHDATA_TYPES; MeshDataIdx++)
|
for (int MeshDataIdx = 0; MeshDataIdx < LC_NUM_MESHDATA_TYPES; MeshDataIdx++)
|
||||||
mVertices[MeshDataIdx].SetGrow(1024);
|
mVertices[MeshDataIdx].SetGrow(1024);
|
||||||
|
@ -148,7 +148,7 @@ public:
|
||||||
lcArray<lcLibraryMeshSection*> mSections[LC_NUM_MESHDATA_TYPES];
|
lcArray<lcLibraryMeshSection*> mSections[LC_NUM_MESHDATA_TYPES];
|
||||||
lcArray<lcLibraryMeshVertex> mVertices[LC_NUM_MESHDATA_TYPES];
|
lcArray<lcLibraryMeshVertex> mVertices[LC_NUM_MESHDATA_TYPES];
|
||||||
bool mHasTextures;
|
bool mHasTextures;
|
||||||
bool mHasLogoStud;
|
bool mHasStyleStud;
|
||||||
};
|
};
|
||||||
|
|
||||||
class lcMeshLoader
|
class lcMeshLoader
|
||||||
|
|
|
@ -120,7 +120,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
||||||
lcProfileEntry("Settings", "PartsListDecorated", 1), // LC_PROFILE_PARTS_LIST_DECORATED
|
lcProfileEntry("Settings", "PartsListDecorated", 1), // LC_PROFILE_PARTS_LIST_DECORATED
|
||||||
lcProfileEntry("Settings", "PartsListAliases", 1), // LC_PROFILE_PARTS_LIST_ALIASES
|
lcProfileEntry("Settings", "PartsListAliases", 1), // LC_PROFILE_PARTS_LIST_ALIASES
|
||||||
lcProfileEntry("Settings", "PartsListListMode", 0), // LC_PROFILE_PARTS_LIST_LISTMODE
|
lcProfileEntry("Settings", "PartsListListMode", 0), // LC_PROFILE_PARTS_LIST_LISTMODE
|
||||||
lcProfileEntry("Settings", "StudLogo", 0), // LC_PROFILE_STUD_LOGO
|
lcProfileEntry("Settings", "StudStyle", 0), // LC_PROFILE_STUD_STYLE
|
||||||
|
|
||||||
lcProfileEntry("Defaults", "Author", ""), // LC_PROFILE_DEFAULT_AUTHOR_NAME
|
lcProfileEntry("Defaults", "Author", ""), // LC_PROFILE_DEFAULT_AUTHOR_NAME
|
||||||
lcProfileEntry("Defaults", "AmbientColor", LC_RGB(75, 75, 75)), // LC_PROFILE_DEFAULT_AMBIENT_COLOR
|
lcProfileEntry("Defaults", "AmbientColor", LC_RGB(75, 75, 75)), // LC_PROFILE_DEFAULT_AMBIENT_COLOR
|
||||||
|
|
|
@ -67,7 +67,7 @@ enum LC_PROFILE_KEY
|
||||||
LC_PROFILE_PARTS_LIST_DECORATED,
|
LC_PROFILE_PARTS_LIST_DECORATED,
|
||||||
LC_PROFILE_PARTS_LIST_ALIASES,
|
LC_PROFILE_PARTS_LIST_ALIASES,
|
||||||
LC_PROFILE_PARTS_LIST_LISTMODE,
|
LC_PROFILE_PARTS_LIST_LISTMODE,
|
||||||
LC_PROFILE_STUD_LOGO,
|
LC_PROFILE_STUD_STYLE,
|
||||||
|
|
||||||
// Defaults for new projects.
|
// Defaults for new projects.
|
||||||
LC_PROFILE_DEFAULT_AUTHOR_NAME,
|
LC_PROFILE_DEFAULT_AUTHOR_NAME,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH LEOCAD 1 "12 January 2021"
|
.TH LEOCAD 1 "20 January 2021"
|
||||||
.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
|
.\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
|
||||||
.\" other params are allowed: see man(7), man(1)
|
.\" other params are allowed: see man(7), man(1)
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
@ -66,9 +66,9 @@ Sets the active submodel to \fIsubmodel\fR.
|
||||||
Sets the active camera to \fIcamera\fR.
|
Sets the active camera to \fIcamera\fR.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-sl \fItype\fR,\ \fB\-\-stud\-logo\ \fItype
|
\fB\-ss \fIid\fR,\ \fB\-\-stud\-style\ \fIid
|
||||||
.br
|
.br
|
||||||
Set the stud logo type. Valid values or 0 - 5, inclusive, with 0 meaning no stud logo. Stud logos may be found as part of the unofficial parts library from \fILDraw.org\fR.
|
Set the stud style. Valid values 0=No style, 1=LDraw single wire, 2=LDraw double wire, 3=LDraw raised floating, 4=LDraw raised rounded, 5=LDraw subtle rounded, 6=LEGO no logo, 7=LEGO single wire. Stud style 1 - 5 require stud logo primitives which are in the unofficial parts library from \fILDraw.org\fR.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-viewpoint \fRfront\ |\ back\ |\ left\ |\ right\ |\ top\ |\ bottom\ |\ home
|
\fB\-\-viewpoint \fRfront\ |\ back\ |\ left\ |\ right\ |\ top\ |\ bottom\ |\ home
|
||||||
|
|
|
@ -161,17 +161,17 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
||||||
else
|
else
|
||||||
ui->PreviewViewSphereSizeCombo->setCurrentIndex(0);
|
ui->PreviewViewSphereSizeCombo->setCurrentIndex(0);
|
||||||
|
|
||||||
if (!lcGetPiecesLibrary()->SupportsStudLogo())
|
if (!lcGetPiecesLibrary()->SupportsStudStyle())
|
||||||
{
|
{
|
||||||
ui->studLogo->setEnabled(false);
|
ui->studStyle->setEnabled(false);
|
||||||
ui->studLogoCombo->setEnabled(false);
|
ui->studStyleCombo->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->studLogo->setChecked(mOptions->StudLogo);
|
ui->studStyle->setChecked(mOptions->StudStyle);
|
||||||
if (ui->studLogo->isChecked())
|
if (ui->studStyle->isChecked())
|
||||||
ui->studLogoCombo->setCurrentIndex(mOptions->StudLogo - 1);
|
ui->studStyleCombo->setCurrentIndex(mOptions->StudStyle - 1);
|
||||||
else
|
else
|
||||||
ui->studLogoCombo->setCurrentIndex(mOptions->StudLogo);
|
ui->studStyleCombo->setCurrentIndex(mOptions->StudStyle);
|
||||||
|
|
||||||
if (!gSupportsShaderObjects)
|
if (!gSupportsShaderObjects)
|
||||||
ui->ShadingMode->removeItem(static_cast<int>(lcShadingMode::DefaultLights));
|
ui->ShadingMode->removeItem(static_cast<int>(lcShadingMode::DefaultLights));
|
||||||
|
@ -203,7 +203,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
||||||
SetButtonPixmap(mOptions->Preferences.mViewSphereTextColor, ui->ViewSphereTextColorButton);
|
SetButtonPixmap(mOptions->Preferences.mViewSphereTextColor, ui->ViewSphereTextColorButton);
|
||||||
SetButtonPixmap(mOptions->Preferences.mViewSphereHighlightColor, ui->ViewSphereHighlightColorButton);
|
SetButtonPixmap(mOptions->Preferences.mViewSphereHighlightColor, ui->ViewSphereHighlightColorButton);
|
||||||
|
|
||||||
on_studLogo_toggled();
|
on_studStyle_toggled();
|
||||||
on_antiAliasing_toggled();
|
on_antiAliasing_toggled();
|
||||||
on_edgeLines_toggled();
|
on_edgeLines_toggled();
|
||||||
on_LineWidthSlider_valueChanged();
|
on_LineWidthSlider_valueChanged();
|
||||||
|
@ -303,10 +303,10 @@ void lcQPreferencesDialog::accept()
|
||||||
|
|
||||||
mOptions->Preferences.mShadingMode = (lcShadingMode)ui->ShadingMode->currentIndex();
|
mOptions->Preferences.mShadingMode = (lcShadingMode)ui->ShadingMode->currentIndex();
|
||||||
|
|
||||||
if (ui->studLogoCombo->isEnabled())
|
if (ui->studStyleCombo->isEnabled())
|
||||||
mOptions->StudLogo = ui->studLogoCombo->currentIndex() + 1;
|
mOptions->StudStyle = ui->studStyleCombo->currentIndex() + 1;
|
||||||
else
|
else
|
||||||
mOptions->StudLogo = 0;
|
mOptions->StudStyle = 0;
|
||||||
|
|
||||||
mOptions->Preferences.mDrawPreviewAxis = ui->PreviewAxisIconCheckBox->isChecked();
|
mOptions->Preferences.mDrawPreviewAxis = ui->PreviewAxisIconCheckBox->isChecked();
|
||||||
mOptions->Preferences.mPreviewViewSphereEnabled = ui->PreviewViewSphereSizeCombo->currentIndex() > 0;
|
mOptions->Preferences.mPreviewViewSphereEnabled = ui->PreviewViewSphereSizeCombo->currentIndex() > 0;
|
||||||
|
@ -504,10 +504,10 @@ void lcQPreferencesDialog::ColorButtonClicked()
|
||||||
((QToolButton*)Button)->setIcon(pix);
|
((QToolButton*)Button)->setIcon(pix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcQPreferencesDialog::on_studLogo_toggled()
|
void lcQPreferencesDialog::on_studStyle_toggled()
|
||||||
{
|
{
|
||||||
if (lcGetPiecesLibrary()->SupportsStudLogo())
|
if (lcGetPiecesLibrary()->SupportsStudStyle())
|
||||||
ui->studLogoCombo->setEnabled(ui->studLogo->isChecked());
|
ui->studStyleCombo->setEnabled(ui->studStyle->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcQPreferencesDialog::on_antiAliasing_toggled()
|
void lcQPreferencesDialog::on_antiAliasing_toggled()
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct lcPreferencesDialogOptions
|
||||||
int CheckForUpdates;
|
int CheckForUpdates;
|
||||||
|
|
||||||
int AASamples;
|
int AASamples;
|
||||||
int StudLogo;
|
int StudStyle;
|
||||||
|
|
||||||
std::vector<lcLibraryCategory> Categories;
|
std::vector<lcLibraryCategory> Categories;
|
||||||
bool CategoriesModified;
|
bool CategoriesModified;
|
||||||
|
@ -94,7 +94,7 @@ public slots:
|
||||||
void on_MouseImportButton_clicked();
|
void on_MouseImportButton_clicked();
|
||||||
void on_MouseExportButton_clicked();
|
void on_MouseExportButton_clicked();
|
||||||
void on_mouseReset_clicked();
|
void on_mouseReset_clicked();
|
||||||
void on_studLogo_toggled();
|
void on_studStyle_toggled();
|
||||||
void MouseTreeItemChanged(QTreeWidgetItem* Current);
|
void MouseTreeItemChanged(QTreeWidgetItem* Current);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -387,7 +387,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="studLogoCombo">
|
<widget class="QComboBox" name="studStyleCombo">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>1 LDraw Single Wire</string>
|
<string>1 LDraw Single Wire</string>
|
||||||
|
@ -426,9 +426,9 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="studLogo">
|
<widget class="QCheckBox" name="studStyle">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Stud Logo</string>
|
<string>Stud Style</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1703,8 +1703,8 @@
|
||||||
<tabstop>RestoreTabLayout</tabstop>
|
<tabstop>RestoreTabLayout</tabstop>
|
||||||
<tabstop>antiAliasing</tabstop>
|
<tabstop>antiAliasing</tabstop>
|
||||||
<tabstop>antiAliasingSamples</tabstop>
|
<tabstop>antiAliasingSamples</tabstop>
|
||||||
<tabstop>studLogo</tabstop>
|
<tabstop>studStyle</tabstop>
|
||||||
<tabstop>studLogoCombo</tabstop>
|
<tabstop>studStyleCombo</tabstop>
|
||||||
<tabstop>edgeLines</tabstop>
|
<tabstop>edgeLines</tabstop>
|
||||||
<tabstop>LineWidthSlider</tabstop>
|
<tabstop>LineWidthSlider</tabstop>
|
||||||
<tabstop>MeshLOD</tabstop>
|
<tabstop>MeshLOD</tabstop>
|
||||||
|
|
Loading…
Reference in a new issue