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"
|
2013-08-09 04:57:18 +00:00
|
|
|
|
|
|
|
class Project;
|
|
|
|
class lcPiecesLibrary;
|
2017-03-17 15:53:26 -07:00
|
|
|
|
2017-08-25 12:57:14 -07:00
|
|
|
enum lcShadingMode
|
2017-03-17 15:53:26 -07:00
|
|
|
{
|
2017-08-25 12:57:14 -07:00
|
|
|
LC_SHADING_WIREFRAME,
|
|
|
|
LC_SHADING_FLAT,
|
|
|
|
LC_SHADING_DEFAULT_LIGHTS,
|
|
|
|
LC_SHADING_FULL,
|
|
|
|
LC_NUM_SHADING_MODES
|
2017-03-17 15:53:26 -07:00
|
|
|
};
|
2014-02-10 00:13:41 +00:00
|
|
|
|
|
|
|
class lcPreferences
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void LoadDefaults();
|
|
|
|
void SaveDefaults();
|
|
|
|
|
|
|
|
int mMouseSensitivity;
|
2017-08-25 12:57:14 -07:00
|
|
|
lcShadingMode mShadingMode;
|
2014-02-10 00:13:41 +00:00
|
|
|
bool mDrawAxes;
|
|
|
|
bool mDrawEdgeLines;
|
|
|
|
float mLineWidth;
|
|
|
|
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;
|
2014-02-10 00:13:41 +00:00
|
|
|
};
|
|
|
|
|
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);
|
2017-12-02 19:42:42 -08:00
|
|
|
bool Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool& ShowWindow);
|
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
|
|
|
|
|
|
|
Project* mProject;
|
2014-02-10 00:13:41 +00:00
|
|
|
lcPiecesLibrary* mLibrary;
|
|
|
|
lcPreferences mPreferences;
|
2014-12-15 23:55:17 +00:00
|
|
|
QByteArray mClipboard;
|
2018-01-06 15:01:04 -08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
QString GetTabLayoutKey() const;
|
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
|
|
|
}
|
|
|
|
|