browser.h 1.55 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * space group browser
 * @author Tobias Weber <tweber@ill.fr>
 * @date Apr-2018
 * @license GPLv3, see 'LICENSE' file
 * @desc The present version was forked on 8-Nov-2018 from the privately developed "magtools" project (https://github.com/t-weber/magtools).
 */

#ifndef __SGBROWSE_H__
#define __SGBROWSE_H__


#include <QtCore/QSettings>
#include <QtGui/QGenericMatrix>
#include <QtWidgets/QDialog>
#include <QtWidgets/QTreeWidgetItem>
#include <QtWidgets/QListWidgetItem>

Tobias WEBER's avatar
Tobias WEBER committed
19
20
#include "libs/magsg.h"
#include "libs/math_algos.h"
21
22
23
24
25
26
27

#include "ui_browser.h"


using t_real_sg = double;
using t_vec_sg = m::qvec_adapter<int, 3, t_real_sg, QGenericMatrix>;
using t_mat_sg = m::qmat_adapter<int, 3, 3, t_real_sg, QGenericMatrix>;
Tobias WEBER's avatar
Tobias WEBER committed
28
using t_mat44_sg = m::qmat_adapter<int, 4, 4, t_real_sg, QGenericMatrix>;
29
30
31
32
33
34


class SgBrowserDlg : public QDialog, Ui::SgBrowserDlg
{
private:
	QSettings *m_pSettings = nullptr;
Tobias WEBER's avatar
Tobias WEBER committed
35
36
37
38

	Spacegroups<t_mat_sg, t_vec_sg> m_magsgs;
	std::vector<std::tuple<int, std::string, std::vector<t_mat44_sg>>> m_nuclsgs;

39
40
41
	bool m_showBNS = true;

private:
Tobias WEBER's avatar
Tobias WEBER committed
42
43
	void SetupMagSpaceGroups();
	void SetupNuclSpaceGroups();
44
45
46
47
48
49
50

protected:
	virtual void showEvent(QShowEvent *pEvt) override;
	virtual void hideEvent(QHideEvent *pEvt) override;
	virtual void closeEvent(QCloseEvent *pEvt) override;

	// slots
Tobias WEBER's avatar
Tobias WEBER committed
51
52
53
	void MagSpaceGroupSelected(QTreeWidgetItem *pItem);
	void NuclSpaceGroupSelected(QTreeWidgetItem *pItem);

54
55
56
57
58
59
60
61
62
63
	void SwitchToBNS(bool bBNS);

public:
	using QDialog::QDialog;
	SgBrowserDlg(QWidget* pParent = nullptr, QSettings* pSett = nullptr);
	~SgBrowserDlg() = default;
};


#endif