Commit 22681a14 authored by Tobias WEBER's avatar Tobias WEBER
Browse files

continued with magnetic moments

parent 9fa55d1d
......@@ -217,6 +217,7 @@ public:
const t_vec_gl& color, bool bUseVertsAsNorm=false);
GlPlotObj CreateLineObject(const std::vector<t_vec3_gl>& verts, const t_vec_gl& color);
std::size_t GetNumObjects() const { return m_objs.size(); }
void RemoveObject(std::size_t obj);
std::size_t AddLinkedObject(std::size_t linkTo,
t_real_gl x=0, t_real_gl y=0, t_real_gl z=0,
......
This diff is collapsed.
......@@ -53,16 +53,24 @@ class MagStructFactDlg : public QDialog
{
public:
MagStructFactDlg(QWidget* pParent = nullptr);
~MagStructFactDlg() = default;
virtual ~MagStructFactDlg() = default;
protected:
QSettings *m_sett = nullptr;
QMenuBar *m_menu = nullptr;
// unit cell view
QDialog *m_dlgPlot = nullptr;
std::shared_ptr<GlPlot> m_plot;
std::size_t m_sphere = 0;
std::size_t m_arrow = 0;
// super cell view
QDialog *m_dlgPlotSC = nullptr;
std::shared_ptr<GlPlot> m_plotSC;
std::size_t m_sphereSC = 0;
std::size_t m_arrowSC = 0;
QLabel *m_labelGlInfos[4] = { nullptr, nullptr, nullptr, nullptr };
QLabel *m_status3D = nullptr;
......@@ -86,7 +94,7 @@ protected:
QSpinBox *m_maxBZ = nullptr;
QCheckBox *m_RemoveZeroes = nullptr;
QSpinBox *m_maxSC = nullptr;
QSpinBox *m_maxSC[3] = { nullptr, nullptr, nullptr };
t_mat m_crystA = m::unit<t_mat>(3);
t_mat m_crystB = m::unit<t_mat>(3);
......@@ -111,13 +119,12 @@ protected:
// propagation vectors table
void AddPropItem(int row=-1, const std::string& name="n/a",
t_real x=0., t_real y=0., t_real z=0.);
t_real x=0., t_real y=0., t_real z=0., bool bConjFC=0);
void DelPropItem(int begin=-2, int end=-2);
void PropItemChanged(QTableWidgetItem *item);
void Add3DItem(int row=-1);
void Sync3DItem(int row=-1);
void Set3DStatusMsg(const std::string& msg);
void Load();
void Save();
......@@ -129,18 +136,21 @@ protected:
void Calc();
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();
void AfterGLInitialisationSC();
virtual void closeEvent(QCloseEvent *evt) override;
private:
int m_iCursorRow = -1;
bool m_ignoreChanges = 1;
bool m_ignoreCalc = 0;
long m_curPickedObj = -1;
std::vector<std::size_t> m_3dobjsSC;
};
......
<?xml version="1.0" encoding="utf-8"?>
<sfact>
<meta>
<info>magsfact_tool</info>
<date>Thu 2019-Feb-07 08:18:33 CET</date>
</meta>
<xtal>
<a>5</a>
<b>5</b>
<c>5</c>
<alpha>90</alpha>
<beta>90</beta>
<gamma>90</gamma>
</xtal>
<order>4</order>
<scorder_x>0</scorder_x>
<scorder_y>0</scorder_y>
<scorder_z>10</scorder_z>
<removezeroes>1</removezeroes>
<sg_idx>0</sg_idx>
<nuclei>
<nucleus>
<name>fourier1</name>
<M_mag>1</M_mag>
<x>0</x>
<y>0</y>
<z>0</z>
<ReMx>1</ReMx>
<ReMy>1</ReMy>
<ReMz>0</ReMz>
<ImMx>1</ImMx>
<ImMy>-1</ImMy>
<ImMz>0</ImMz>
<rad>1</rad>
<col>#ff0000</col>
</nucleus>
</nuclei>
<propvecs>
<vec>
<name>plus</name>
<x>0</x>
<y>0</y>
<z>0.05</z>
<conjFC>0</conjFC>
</vec>
<vec>
<name>minus</name>
<x>0</x>
<y>0</y>
<z>-0.05</z>
<conjFC>1</conjFC>
</vec>
</propvecs>
</sfact>
......@@ -328,6 +328,7 @@ StructFactDlg::StructFactDlg(QWidget* pParent) : QDialog{pParent},
auto menuFile = new QMenu("File", m_menu);
auto menuView = new QMenu("View", m_menu);
auto acNew = new QAction("New", menuFile);
auto acLoad = new QAction("Load...", menuFile);
auto acSave = new QAction("Save...", menuFile);
auto acImportCIF = new QAction("Import CIF...", menuFile);
......@@ -335,6 +336,8 @@ StructFactDlg::StructFactDlg(QWidget* pParent) : QDialog{pParent},
auto acExit = new QAction("Exit", menuFile);
auto ac3DView = new QAction("3D View...", menuFile);
menuFile->addAction(acNew);
menuFile->addSeparator();
menuFile->addAction(acLoad);
menuFile->addAction(acSave);
menuFile->addSeparator();
......@@ -344,6 +347,20 @@ StructFactDlg::StructFactDlg(QWidget* pParent) : QDialog{pParent},
menuFile->addAction(acExit);
menuView->addAction(ac3DView);
connect(acNew, &QAction::triggered, this, [this]()
{
// clear old table
DelTabItem(-1);
// set some defaults
m_comboSG->setCurrentIndex(0);
m_editA->setText("5");
m_editB->setText("5");
m_editC->setText("5");
m_editAlpha->setText("90");
m_editBeta->setText("90");
m_editGamma->setText("90");
});
connect(acLoad, &QAction::triggered, this, &StructFactDlg::Load);
connect(acSave, &QAction::triggered, this, &StructFactDlg::Save);
connect(acImportCIF, &QAction::triggered, this, &StructFactDlg::ImportCIF);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment