2017-07-19 14:20:32 -07:00
|
|
|
#pragma once
|
2013-08-09 04:57:18 +00:00
|
|
|
|
2013-08-15 23:43:18 +00:00
|
|
|
#include "lc_array.h"
|
2021-01-10 17:45:28 -08:00
|
|
|
#include "lc_math.h"
|
2013-08-09 04:57:18 +00:00
|
|
|
|
|
|
|
class Project;
|
|
|
|
class lcPiecesLibrary;
|
2020-12-05 10:29:39 -08:00
|
|
|
enum class lcViewSphereLocation;
|
2017-03-17 15:53:26 -07:00
|
|
|
|
2020-03-22 13:44:20 -07:00
|
|
|
enum class lcShadingMode
|
2017-03-17 15:53:26 -07:00
|
|
|
{
|
2020-03-22 13:44:20 -07:00
|
|
|
Wireframe,
|
|
|
|
Flat,
|
|
|
|
DefaultLights,
|
|
|
|
Full
|
2017-03-17 15:53:26 -07:00
|
|
|
};
|
2014-02-10 00:13:41 +00:00
|
|
|
|
2020-07-25 13:21:22 -07:00
|
|
|
enum class lcColorTheme
|
|
|
|
{
|
|
|
|
Dark,
|
|
|
|
System
|
|
|
|
};
|
|
|
|
|
2014-02-10 00:13:41 +00:00
|
|
|
class lcPreferences
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void LoadDefaults();
|
|
|
|
void SaveDefaults();
|
2020-07-25 13:21:22 -07:00
|
|
|
void SetInterfaceColors(lcColorTheme ColorTheme);
|
2014-02-10 00:13:41 +00:00
|
|
|
|
|
|
|
int mMouseSensitivity;
|
2017-08-25 12:57:14 -07:00
|
|
|
lcShadingMode mShadingMode;
|
2020-11-26 11:51:50 -08:00
|
|
|
bool mBackgroundGradient;
|
|
|
|
quint32 mBackgroundSolidColor;
|
|
|
|
quint32 mBackgroundGradientColorTop;
|
|
|
|
quint32 mBackgroundGradientColorBottom;
|
2014-02-10 00:13:41 +00:00
|
|
|
bool mDrawAxes;
|
2020-07-11 10:47:52 -07:00
|
|
|
quint32 mAxesColor;
|
2020-12-30 13:44:08 -08:00
|
|
|
quint32 mTextColor;
|
2020-12-31 15:54:28 -08:00
|
|
|
quint32 mMarqueeBorderColor;
|
|
|
|
quint32 mMarqueeFillColor;
|
2020-07-11 10:47:52 -07:00
|
|
|
quint32 mOverlayColor;
|
2020-07-25 13:21:22 -07:00
|
|
|
quint32 mActiveViewColor;
|
2020-12-11 18:01:04 -08:00
|
|
|
quint32 mInactiveViewColor;
|
2014-02-10 00:13:41 +00:00
|
|
|
bool mDrawEdgeLines;
|
|
|
|
float mLineWidth;
|
2019-11-28 12:47:19 -08:00
|
|
|
bool mAllowLOD;
|
2020-08-15 16:16:26 -07:00
|
|
|
float mMeshLODDistance;
|
2020-01-01 17:06:17 -08:00
|
|
|
bool mFadeSteps;
|
2020-04-25 12:16:37 -07:00
|
|
|
quint32 mFadeStepsColor;
|
2020-04-25 11:36:28 -07:00
|
|
|
bool mHighlightNewParts;
|
|
|
|
quint32 mHighlightNewPartsColor;
|
2020-12-23 19:10:54 -08:00
|
|
|
bool mGridEnabled = true;
|
2014-02-10 00:13:41 +00:00
|
|
|
bool mDrawGridStuds;
|
2017-12-02 12:22:04 -08:00
|
|
|
quint32 mGridStudColor;
|
2014-02-10 00:13:41 +00:00
|
|
|
bool mDrawGridLines;
|
|
|
|
int mGridLineSpacing;
|
2017-12-02 12:22:04 -08:00
|
|
|
quint32 mGridLineColor;
|
2014-10-05 05:21:51 +00:00
|
|
|
bool mFixedAxes;
|
2020-01-05 11:38:24 -08:00
|
|
|
bool mViewSphereEnabled;
|
2018-10-28 17:59:01 -07:00
|
|
|
lcViewSphereLocation mViewSphereLocation;
|
|
|
|
int mViewSphereSize;
|
2019-01-20 11:59:18 -08:00
|
|
|
quint32 mViewSphereColor;
|
|
|
|
quint32 mViewSphereTextColor;
|
|
|
|
quint32 mViewSphereHighlightColor;
|
2019-03-09 16:38:54 -08:00
|
|
|
bool mAutoLoadMostRecent;
|
2020-01-01 17:06:17 -08:00
|
|
|
bool mRestoreTabLayout;
|
2020-07-25 13:21:22 -07:00
|
|
|
lcColorTheme mColorTheme;
|
2020-10-03 12:02:27 +02:00
|
|
|
|
|
|
|
int mPreviewViewSphereEnabled;
|
|
|
|
int mPreviewViewSphereSize;
|
|
|
|
lcViewSphereLocation mPreviewViewSphereLocation;
|
|
|
|
int mDrawPreviewAxis;
|
2014-02-10 00:13:41 +00:00
|
|
|
};
|
|
|
|
|
2021-01-10 17:45:28 -08:00
|
|
|
struct lcCommandLineOptions
|
|
|
|
{
|
|
|
|
bool ParseOK;
|
|
|
|
bool Exit;
|
|
|
|
bool SaveImage;
|
|
|
|
bool SaveWavefront;
|
|
|
|
bool Save3DS;
|
|
|
|
bool SaveCOLLADA;
|
|
|
|
bool SaveHTML;
|
|
|
|
bool SetCameraAngles;
|
|
|
|
bool SetCameraPosition;
|
|
|
|
bool Orthographic;
|
|
|
|
bool SetFoV;
|
|
|
|
bool SetZPlanes;
|
|
|
|
bool SetFadeStepsColor;
|
|
|
|
bool SetHighlightColor;
|
|
|
|
bool FadeSteps;
|
|
|
|
bool ImageHighlight;
|
|
|
|
int ImageWidth;
|
|
|
|
int ImageHeight;
|
|
|
|
int AASamples;
|
|
|
|
int StudLogo;
|
|
|
|
int ImageStart;
|
|
|
|
int ImageEnd;
|
|
|
|
lcVector3 CameraPosition[3];
|
|
|
|
lcVector2 CameraLatLon;
|
|
|
|
float FoV;
|
|
|
|
lcVector2 ZPlanes;
|
|
|
|
lcViewpoint Viewpoint;
|
|
|
|
quint32 FadeStepsColor;
|
|
|
|
quint32 HighlightColor;
|
|
|
|
QString ImageName;
|
|
|
|
QString ModelName;
|
|
|
|
QString CameraName;
|
|
|
|
QString ProjectName;
|
|
|
|
QString SaveWavefrontName;
|
|
|
|
QString Save3DSName;
|
|
|
|
QString SaveCOLLADAName;
|
|
|
|
QString SaveHTMLName;
|
|
|
|
QList<QPair<QString, bool>> LibraryPaths;
|
|
|
|
QString Output;
|
|
|
|
};
|
|
|
|
|
2020-12-30 18:22:02 -08:00
|
|
|
enum class lcStartupMode
|
|
|
|
{
|
|
|
|
ShowWindow,
|
|
|
|
Success,
|
|
|
|
Error
|
|
|
|
};
|
|
|
|
|
2017-12-02 19:42:42 -08:00
|
|
|
class lcApplication : public QApplication
|
2013-08-09 04:57:18 +00:00
|
|
|
{
|
2017-12-02 19:42:42 -08:00
|
|
|
Q_OBJECT
|
2015-01-30 16:30:13 +00:00
|
|
|
|
2013-08-09 04:57:18 +00:00
|
|
|
public:
|
2017-12-10 10:20:31 -08:00
|
|
|
lcApplication(int& Argc, char** Argv);
|
2013-08-09 04:57:18 +00:00
|
|
|
~lcApplication();
|
|
|
|
|
2014-12-04 01:47:28 +00:00
|
|
|
void SetProject(Project* Project);
|
2021-01-10 17:45:28 -08:00
|
|
|
lcCommandLineOptions ParseCommandLineOptions();
|
|
|
|
lcStartupMode Initialize(const QList<QPair<QString, bool>>& LibraryPaths);
|
2013-08-09 04:57:18 +00:00
|
|
|
void Shutdown();
|
2014-02-10 00:13:41 +00:00
|
|
|
void ShowPreferencesDialog();
|
2018-01-06 15:01:04 -08:00
|
|
|
void SaveTabLayout() const;
|
2013-08-09 04:57:18 +00:00
|
|
|
|
2017-11-24 20:00:16 -08:00
|
|
|
bool LoadPartsLibrary(const QList<QPair<QString, bool>>& LibraryPaths, bool OnlyUsePaths, bool ShowProgress);
|
2013-08-09 04:57:18 +00:00
|
|
|
|
2014-12-15 23:55:17 +00:00
|
|
|
void SetClipboard(const QByteArray& Clipboard);
|
|
|
|
void ExportClipboard(const QByteArray& Clipboard);
|
2013-08-09 04:57:18 +00:00
|
|
|
|
2021-01-10 11:03:54 -08:00
|
|
|
Project* mProject = nullptr;
|
|
|
|
lcPiecesLibrary* mLibrary = nullptr;
|
2014-02-10 00:13:41 +00:00
|
|
|
lcPreferences mPreferences;
|
2014-12-15 23:55:17 +00:00
|
|
|
QByteArray mClipboard;
|
2018-01-06 15:01:04 -08:00
|
|
|
|
|
|
|
protected:
|
2021-01-10 17:45:28 -08:00
|
|
|
bool InitializeRenderer();
|
2021-01-02 10:23:51 -08:00
|
|
|
void ShutdownRenderer();
|
2020-07-25 13:21:22 -07:00
|
|
|
void UpdateStyle();
|
2018-01-06 15:01:04 -08:00
|
|
|
QString GetTabLayoutKey() const;
|
2020-07-25 13:21:22 -07:00
|
|
|
|
|
|
|
QString mDefaultStyle;
|
2013-08-09 04:57:18 +00:00
|
|
|
};
|
|
|
|
|
2017-12-02 19:42:42 -08:00
|
|
|
extern lcApplication* gApplication;
|
2013-08-09 04:57:18 +00:00
|
|
|
|
|
|
|
inline lcPiecesLibrary* lcGetPiecesLibrary()
|
|
|
|
{
|
2017-12-02 19:42:42 -08:00
|
|
|
return gApplication->mLibrary;
|
2013-08-09 04:57:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline Project* lcGetActiveProject()
|
|
|
|
{
|
2017-12-02 19:42:42 -08:00
|
|
|
return gApplication->mProject;
|
2013-08-09 04:57:18 +00:00
|
|
|
}
|
|
|
|
|
2014-10-05 05:21:51 +00:00
|
|
|
inline lcPreferences& lcGetPreferences()
|
2014-02-10 00:13:41 +00:00
|
|
|
{
|
2017-12-02 19:42:42 -08:00
|
|
|
return gApplication->mPreferences;
|
2014-02-10 00:13:41 +00:00
|
|
|
}
|