moldyn.h 1.33 KB
Newer Older
Tobias WEBER's avatar
Tobias WEBER committed
1
/**
Tobias WEBER's avatar
Tobias WEBER committed
2
 * atom dynamics
Tobias WEBER's avatar
Tobias WEBER committed
3 4 5 6 7
 * @author Tobias Weber <tweber@ill.fr>
 * @date Dec-2019
 * @license GPLv3, see 'LICENSE' file
 */

Tobias WEBER's avatar
Tobias WEBER committed
8 9
#ifndef __MOLDYN_GUI_H__
#define __MOLDYN_GUI_H__
Tobias WEBER's avatar
Tobias WEBER committed
10

Tobias WEBER's avatar
Tobias WEBER committed
11 12 13 14 15 16 17
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QDialog>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QMenu>
#include <QtWidgets/QLabel>
#include <QtCore/QSettings>
Tobias WEBER's avatar
Tobias WEBER committed
18 19

#include <vector>
Tobias WEBER's avatar
Tobias WEBER committed
20
#include <sstream>
Tobias WEBER's avatar
Tobias WEBER committed
21

Tobias WEBER's avatar
Tobias WEBER committed
22 23
#include "libs/_cxx20/glplot.h"
#include "libs/_cxx20/math_algos.h"
Tobias WEBER's avatar
Tobias WEBER committed
24 25


Tobias WEBER's avatar
Tobias WEBER committed
26 27 28
using t_real = double;
using t_vec = std::vector<t_real>;
using t_mat = m::mat<t_real, std::vector>;
Tobias WEBER's avatar
Tobias WEBER committed
29 30


Tobias WEBER's avatar
Tobias WEBER committed
31
class MolDynDlg : public QMainWindow
Tobias WEBER's avatar
Tobias WEBER committed
32
{
Tobias WEBER's avatar
Tobias WEBER committed
33 34 35
public:
	MolDynDlg(QWidget* pParent = nullptr);
	~MolDynDlg() = default;
Tobias WEBER's avatar
Tobias WEBER committed
36

Tobias WEBER's avatar
Tobias WEBER committed
37 38 39 40
protected:
	QSettings *m_sett = nullptr;
	QMenuBar *m_menu = nullptr;
	QStatusBar *m_status = nullptr;
Tobias WEBER's avatar
Tobias WEBER committed
41

Tobias WEBER's avatar
Tobias WEBER committed
42 43
	GlPlot *m_plot = nullptr;
	std::size_t m_sphere = 0;
Tobias WEBER's avatar
Tobias WEBER committed
44 45


Tobias WEBER's avatar
Tobias WEBER committed
46 47 48
protected:
	void Add3DItem(int row=-1);
	void Set3DStatusMsg(const std::string& msg);
Tobias WEBER's avatar
Tobias WEBER committed
49

Tobias WEBER's avatar
Tobias WEBER committed
50 51 52
	void New();
	void Load();
	void Save();
Tobias WEBER's avatar
Tobias WEBER committed
53

Tobias WEBER's avatar
Tobias WEBER committed
54 55 56 57
	void PlotMouseDown(bool left, bool mid, bool right);
	void PlotMouseUp(bool left, bool mid, bool right);
	void PickerIntersection(const t_vec3_gl* pos, std::size_t objIdx, const t_vec3_gl* posSphere);
	void AfterGLInitialisation();
Tobias WEBER's avatar
Tobias WEBER committed
58

Tobias WEBER's avatar
Tobias WEBER committed
59
	virtual void closeEvent(QCloseEvent *evt) override;
Tobias WEBER's avatar
Tobias WEBER committed
60

Tobias WEBER's avatar
Tobias WEBER committed
61 62 63
private:
	long m_curPickedObj = -1;
	bool m_ignoreChanges = 1;
Tobias WEBER's avatar
Tobias WEBER committed
64 65 66 67
};


#endif