leocad/common/lc_application.h

77 lines
1.4 KiB
C
Raw Normal View History

#pragma once
2013-08-09 06:57:18 +02:00
2013-08-16 01:43:18 +02:00
#include "lc_array.h"
2013-08-09 06:57:18 +02:00
class Project;
class lcPiecesLibrary;
2017-03-17 23:53:26 +01:00
2017-08-25 21:57:14 +02:00
enum lcShadingMode
2017-03-17 23:53:26 +01:00
{
2017-08-25 21:57:14 +02:00
LC_SHADING_WIREFRAME,
LC_SHADING_FLAT,
LC_SHADING_DEFAULT_LIGHTS,
LC_SHADING_FULL,
LC_NUM_SHADING_MODES
2017-03-17 23:53:26 +01:00
};
class lcPreferences
{
public:
void LoadDefaults();
void SaveDefaults();
int mMouseSensitivity;
2017-08-25 21:57:14 +02:00
lcShadingMode mShadingMode;
bool mDrawAxes;
bool mDrawEdgeLines;
float mLineWidth;
bool mDrawGridStuds;
2017-12-02 21:22:04 +01:00
quint32 mGridStudColor;
bool mDrawGridLines;
int mGridLineSpacing;
2017-12-02 21:22:04 +01:00
quint32 mGridLineColor;
2014-10-05 07:21:51 +02:00
bool mFixedAxes;
};
class lcApplication : public QApplication
2013-08-09 06:57:18 +02:00
{
Q_OBJECT
2015-01-30 17:30:13 +01:00
2013-08-09 06:57:18 +02:00
public:
lcApplication(int& Argc, char** Argv);
2013-08-09 06:57:18 +02:00
~lcApplication();
2014-12-04 02:47:28 +01:00
void SetProject(Project* Project);
bool Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool& ShowWindow);
2013-08-09 06:57:18 +02:00
void Shutdown();
void ShowPreferencesDialog();
2013-08-09 06:57:18 +02:00
bool LoadPartsLibrary(const QList<QPair<QString, bool>>& LibraryPaths, bool OnlyUsePaths, bool ShowProgress);
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
Project* mProject;
lcPiecesLibrary* mLibrary;
lcPreferences mPreferences;
2014-12-16 00:55:17 +01:00
QByteArray mClipboard;
2013-08-09 06:57:18 +02:00
};
extern lcApplication* gApplication;
2013-08-09 06:57:18 +02:00
inline lcPiecesLibrary* lcGetPiecesLibrary()
{
return gApplication->mLibrary;
2013-08-09 06:57:18 +02:00
}
inline Project* lcGetActiveProject()
{
return gApplication->mProject;
2013-08-09 06:57:18 +02:00
}
2014-10-05 07:21:51 +02:00
inline lcPreferences& lcGetPreferences()
{
return gApplication->mPreferences;
}