2017-07-19 23:20:32 +02:00
|
|
|
#pragma once
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2021-01-11 02:45:28 +01:00
|
|
|
#include "lc_math.h"
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
class Project;
|
|
|
|
class lcPiecesLibrary;
|
2020-12-05 19:29:39 +01:00
|
|
|
enum class lcViewSphereLocation;
|
2017-03-17 23:53:26 +01:00
|
|
|
|
2020-03-22 21:44:20 +01:00
|
|
|
enum class lcShadingMode
|
2017-03-17 23:53:26 +01:00
|
|
|
{
|
2020-03-22 21:44:20 +01:00
|
|
|
Wireframe,
|
|
|
|
Flat,
|
|
|
|
DefaultLights,
|
|
|
|
Full
|
2017-03-17 23:53:26 +01:00
|
|
|
};
|
2014-02-10 01:13:41 +01:00
|
|
|
|
2020-07-25 22:21:22 +02:00
|
|
|
enum class lcColorTheme
|
|
|
|
{
|
|
|
|
Dark,
|
|
|
|
System
|
|
|
|
};
|
|
|
|
|
2021-05-30 20:52:13 +02:00
|
|
|
enum class lcAxisIconLocation
|
|
|
|
{
|
|
|
|
TopLeft,
|
|
|
|
TopRight,
|
|
|
|
BottomLeft,
|
|
|
|
BottomRight
|
|
|
|
};
|
|
|
|
|
2014-02-10 01:13:41 +01:00
|
|
|
class lcPreferences
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void LoadDefaults();
|
|
|
|
void SaveDefaults();
|
2020-07-25 22:21:22 +02:00
|
|
|
void SetInterfaceColors(lcColorTheme ColorTheme);
|
2014-02-10 01:13:41 +01:00
|
|
|
|
|
|
|
int mMouseSensitivity;
|
2017-08-25 21:57:14 +02:00
|
|
|
lcShadingMode mShadingMode;
|
2020-11-26 20:51:50 +01:00
|
|
|
bool mBackgroundGradient;
|
|
|
|
quint32 mBackgroundSolidColor;
|
|
|
|
quint32 mBackgroundGradientColorTop;
|
|
|
|
quint32 mBackgroundGradientColorBottom;
|
2014-02-10 01:13:41 +01:00
|
|
|
bool mDrawAxes;
|
2021-05-30 20:52:13 +02:00
|
|
|
lcAxisIconLocation mAxisIconLocation;
|
2020-07-11 19:47:52 +02:00
|
|
|
quint32 mAxesColor;
|
2020-12-30 22:44:08 +01:00
|
|
|
quint32 mTextColor;
|
2021-01-01 00:54:28 +01:00
|
|
|
quint32 mMarqueeBorderColor;
|
|
|
|
quint32 mMarqueeFillColor;
|
2020-07-11 19:47:52 +02:00
|
|
|
quint32 mOverlayColor;
|
2020-07-25 22:21:22 +02:00
|
|
|
quint32 mActiveViewColor;
|
2020-12-12 03:01:04 +01:00
|
|
|
quint32 mInactiveViewColor;
|
2014-02-10 01:13:41 +01:00
|
|
|
bool mDrawEdgeLines;
|
2021-03-07 18:53:35 +01:00
|
|
|
bool mDrawConditionalLines;
|
2014-02-10 01:13:41 +01:00
|
|
|
float mLineWidth;
|
2019-11-28 21:47:19 +01:00
|
|
|
bool mAllowLOD;
|
2020-08-16 01:16:26 +02:00
|
|
|
float mMeshLODDistance;
|
2020-01-02 02:06:17 +01:00
|
|
|
bool mFadeSteps;
|
2020-04-25 21:16:37 +02:00
|
|
|
quint32 mFadeStepsColor;
|
2020-04-25 20:36:28 +02:00
|
|
|
bool mHighlightNewParts;
|
|
|
|
quint32 mHighlightNewPartsColor;
|
2020-12-24 04:10:54 +01:00
|
|
|
bool mGridEnabled = true;
|
2014-02-10 01:13:41 +01:00
|
|
|
bool mDrawGridStuds;
|
2017-12-02 21:22:04 +01:00
|
|
|
quint32 mGridStudColor;
|
2014-02-10 01:13:41 +01:00
|
|
|
bool mDrawGridLines;
|
|
|
|
int mGridLineSpacing;
|
2017-12-02 21:22:04 +01:00
|
|
|
quint32 mGridLineColor;
|
2021-01-12 03:49:57 +01:00
|
|
|
bool mDrawGridOrigin;
|
2014-10-05 07:21:51 +02:00
|
|
|
bool mFixedAxes;
|
2020-01-05 20:38:24 +01:00
|
|
|
bool mViewSphereEnabled;
|
2018-10-29 01:59:01 +01:00
|
|
|
lcViewSphereLocation mViewSphereLocation;
|
|
|
|
int mViewSphereSize;
|
2019-01-20 20:59:18 +01:00
|
|
|
quint32 mViewSphereColor;
|
|
|
|
quint32 mViewSphereTextColor;
|
|
|
|
quint32 mViewSphereHighlightColor;
|
2019-03-10 01:38:54 +01:00
|
|
|
bool mAutoLoadMostRecent;
|
2020-01-02 02:06:17 +01:00
|
|
|
bool mRestoreTabLayout;
|
2020-07-25 22:21:22 +02:00
|
|
|
lcColorTheme mColorTheme;
|
2021-11-25 00:20:08 +01:00
|
|
|
quint32 mObjectSelectedColor;
|
|
|
|
quint32 mObjectFocusedColor;
|
|
|
|
quint32 mCameraColor;
|
|
|
|
quint32 mLightColor;
|
|
|
|
quint32 mControlPointColor;
|
|
|
|
quint32 mControlPointFocusedColor;
|
|
|
|
|
2020-10-03 12:02:27 +02:00
|
|
|
|
|
|
|
int mPreviewViewSphereEnabled;
|
|
|
|
int mPreviewViewSphereSize;
|
|
|
|
lcViewSphereLocation mPreviewViewSphereLocation;
|
|
|
|
int mDrawPreviewAxis;
|
2021-01-24 12:53:02 +01:00
|
|
|
|
2023-04-17 18:37:56 +02:00
|
|
|
bool mStudCylinderColorEnabled;
|
2021-01-26 16:42:19 +01:00
|
|
|
quint32 mStudCylinderColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
bool mPartEdgeColorEnabled;
|
2021-01-26 16:42:19 +01:00
|
|
|
quint32 mPartEdgeColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
bool mBlackEdgeColorEnabled;
|
2021-01-25 13:35:04 +01:00
|
|
|
quint32 mBlackEdgeColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
bool mDarkEdgeColorEnabled;
|
2021-01-25 13:35:04 +01:00
|
|
|
quint32 mDarkEdgeColor;
|
2021-01-24 12:53:02 +01:00
|
|
|
float mPartEdgeContrast;
|
2021-01-25 08:34:22 +01:00
|
|
|
float mPartColorValueLDIndex;
|
2021-01-24 12:53:02 +01:00
|
|
|
bool mAutomateEdgeColor;
|
2014-02-10 01:13:41 +01:00
|
|
|
};
|
|
|
|
|
2021-01-11 02:45:28 +01:00
|
|
|
struct lcCommandLineOptions
|
|
|
|
{
|
2022-10-30 22:12:34 +01:00
|
|
|
bool ParseOK = true;
|
|
|
|
bool Exit = false;
|
|
|
|
bool SaveImage = false;
|
|
|
|
bool SaveWavefront = false;
|
|
|
|
bool Save3DS = false;
|
|
|
|
bool SaveCOLLADA = false;
|
|
|
|
bool SaveCSV = false;
|
|
|
|
bool SaveHTML = false;
|
|
|
|
bool SetCameraAngles = false;
|
|
|
|
bool SetCameraPosition = false;
|
|
|
|
bool Orthographic = false;
|
|
|
|
bool SetFoV = false;
|
|
|
|
bool SetZPlanes = false;
|
|
|
|
bool SetFadeStepsColor = false;
|
|
|
|
bool SetHighlightColor = false;
|
|
|
|
bool FadeSteps = false;
|
|
|
|
bool ImageHighlight = false;
|
|
|
|
bool AutomateEdgeColor = false;
|
2021-01-11 02:45:28 +01:00
|
|
|
int ImageWidth;
|
|
|
|
int ImageHeight;
|
|
|
|
int AASamples;
|
2021-01-28 21:10:16 +01:00
|
|
|
lcShadingMode ShadingMode;
|
|
|
|
float LineWidth;
|
2021-01-22 23:16:28 +01:00
|
|
|
lcStudStyle StudStyle;
|
2021-01-13 20:39:55 +01:00
|
|
|
lcStep ImageStart;
|
|
|
|
lcStep ImageEnd;
|
2021-01-11 02:45:28 +01:00
|
|
|
lcVector3 CameraPosition[3];
|
|
|
|
lcVector2 CameraLatLon;
|
|
|
|
float FoV;
|
2021-01-26 20:59:37 +01:00
|
|
|
float PartEdgeContrast;
|
|
|
|
float PartColorValueLDIndex;
|
2021-01-11 02:45:28 +01:00
|
|
|
lcVector2 ZPlanes;
|
|
|
|
lcViewpoint Viewpoint;
|
2023-04-17 18:37:56 +02:00
|
|
|
bool StudCylinderColorEnabled;
|
2021-01-26 20:59:37 +01:00
|
|
|
quint32 StudCylinderColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
bool PartEdgeColorEnabled;
|
2021-01-26 20:59:37 +01:00
|
|
|
quint32 PartEdgeColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
bool BlackEdgeColorEnabled;
|
2021-01-26 20:59:37 +01:00
|
|
|
quint32 BlackEdgeColor;
|
2023-04-17 18:37:56 +02:00
|
|
|
bool DarkEdgeColorEnabled;
|
2021-01-26 20:59:37 +01:00
|
|
|
quint32 DarkEdgeColor;
|
2021-01-11 02:45:28 +01:00
|
|
|
quint32 FadeStepsColor;
|
|
|
|
quint32 HighlightColor;
|
|
|
|
QString ImageName;
|
|
|
|
QString ModelName;
|
|
|
|
QString CameraName;
|
|
|
|
QString ProjectName;
|
|
|
|
QString SaveWavefrontName;
|
|
|
|
QString Save3DSName;
|
|
|
|
QString SaveCOLLADAName;
|
2022-10-30 22:12:34 +01:00
|
|
|
QString SaveCSVName;
|
2021-01-11 02:45:28 +01:00
|
|
|
QString SaveHTMLName;
|
|
|
|
QList<QPair<QString, bool>> LibraryPaths;
|
2021-01-11 18:54:56 +01:00
|
|
|
QString StdOut;
|
|
|
|
QString StdErr;
|
2021-01-11 02:45:28 +01:00
|
|
|
};
|
|
|
|
|
2020-12-31 03:22:02 +01:00
|
|
|
enum class lcStartupMode
|
|
|
|
{
|
|
|
|
ShowWindow,
|
|
|
|
Success,
|
|
|
|
Error
|
|
|
|
};
|
|
|
|
|
2017-12-03 04:42:42 +01:00
|
|
|
class lcApplication : public QApplication
|
2013-08-09 06:57:18 +02:00
|
|
|
{
|
2017-12-03 04:42:42 +01:00
|
|
|
Q_OBJECT
|
2015-01-30 17:30:13 +01:00
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
public:
|
2017-12-10 19:20:31 +01:00
|
|
|
lcApplication(int& Argc, char** Argv);
|
2013-08-09 06:57:18 +02:00
|
|
|
~lcApplication();
|
|
|
|
|
2021-11-15 03:34:24 +01:00
|
|
|
lcApplication(const lcApplication&) = delete;
|
|
|
|
lcApplication(lcApplication&&) = delete;
|
|
|
|
lcApplication& operator=(const lcApplication&) = delete;
|
|
|
|
lcApplication& operator=(lcApplication&&) = delete;
|
|
|
|
|
2014-12-04 02:47:28 +01:00
|
|
|
void SetProject(Project* Project);
|
2021-01-28 21:10:16 +01:00
|
|
|
static lcCommandLineOptions ParseCommandLineOptions();
|
2021-01-11 02:45:28 +01:00
|
|
|
lcStartupMode Initialize(const QList<QPair<QString, bool>>& LibraryPaths);
|
2013-08-09 06:57:18 +02:00
|
|
|
void Shutdown();
|
2014-02-10 01:13:41 +01:00
|
|
|
void ShowPreferencesDialog();
|
2018-01-07 00:01:04 +01:00
|
|
|
void SaveTabLayout() const;
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2021-01-11 18:54:56 +01:00
|
|
|
bool LoadPartsLibrary(const QList<QPair<QString, bool>>& LibraryPaths, bool OnlyUsePaths);
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2014-12-16 00:55:17 +01:00
|
|
|
void SetClipboard(const QByteArray& Clipboard);
|
|
|
|
void ExportClipboard(const QByteArray& Clipboard);
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2021-01-10 20:03:54 +01:00
|
|
|
Project* mProject = nullptr;
|
|
|
|
lcPiecesLibrary* mLibrary = nullptr;
|
2014-02-10 01:13:41 +01:00
|
|
|
lcPreferences mPreferences;
|
2014-12-16 00:55:17 +01:00
|
|
|
QByteArray mClipboard;
|
2018-01-07 00:01:04 +01:00
|
|
|
|
|
|
|
protected:
|
2020-07-25 22:21:22 +02:00
|
|
|
void UpdateStyle();
|
2018-01-07 00:01:04 +01:00
|
|
|
QString GetTabLayoutKey() const;
|
2020-07-25 22:21:22 +02:00
|
|
|
|
|
|
|
QString mDefaultStyle;
|
2013-08-09 06:57:18 +02:00
|
|
|
};
|
|
|
|
|
2017-12-03 04:42:42 +01:00
|
|
|
extern lcApplication* gApplication;
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
inline lcPiecesLibrary* lcGetPiecesLibrary()
|
|
|
|
{
|
2017-12-03 04:42:42 +01:00
|
|
|
return gApplication->mLibrary;
|
2013-08-09 06:57:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
inline Project* lcGetActiveProject()
|
|
|
|
{
|
2017-12-03 04:42:42 +01:00
|
|
|
return gApplication->mProject;
|
2013-08-09 06:57:18 +02:00
|
|
|
}
|
|
|
|
|
2014-10-05 07:21:51 +02:00
|
|
|
inline lcPreferences& lcGetPreferences()
|
2014-02-10 01:13:41 +01:00
|
|
|
{
|
2017-12-03 04:42:42 +01:00
|
|
|
return gApplication->mPreferences;
|
2014-02-10 01:13:41 +01:00
|
|
|
}
|