Skip to content

Commit 0438767

Browse files
committed
Adding comments
1 parent 0f38328 commit 0438767

66 files changed

Lines changed: 2473 additions & 2982 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codex.patch

Lines changed: 0 additions & 1911 deletions
This file was deleted.

src/atomarchitectapplication.cpp

Lines changed: 65 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,65 @@
1-
/****************************************************************************
2-
* *
3-
* ATOM ARCHITECT *
4-
* Copyright (C) 2020-2024 Ivo Filot <i.a.w.filot@tue.nl> *
5-
* *
6-
* This program is free software: you can redistribute it and/or modify *
7-
* it under the terms of the GNU Lesser General Public License as *
8-
* published by the Free Software Foundation, either version 3 of the *
9-
* License, or (at your option) any later version. *
10-
* *
11-
* This program is distributed in the hope that it will be useful, *
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14-
* GNU General Public License for more details. *
15-
* *
16-
* You should have received a copy of the GNU General Public license *
17-
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
18-
* *
19-
****************************************************************************/
20-
21-
#include "atomarchitectapplication.h"
22-
23-
/**
24-
* @brief Default constructor
25-
* @param argc number of command line argument
26-
* @param argv command line arguments
27-
*/
28-
AtomArchitectApplication::AtomArchitectApplication(int& argc, char** argv) :
29-
QApplication(argc, argv) {}
30-
31-
/**
32-
* @brief notify
33-
* @param receiver
34-
* @param event
35-
* @return
36-
*/
37-
bool AtomArchitectApplication::notify(QObject* receiver, QEvent* event) {
38-
bool done = true;
39-
try {
40-
done = QApplication::notify(receiver, event);
41-
} catch (const std::exception& e) {
42-
this->throw_message_window(tr("Uncaught exception was thrown."),
43-
tr("An uncaught exception was thrown by the program. This is undiserable behavior and "
44-
"the program will be terminated. Please carefully read the error message "
45-
"and consult the manual or contact one of the developers.\n\nError:\n") + e.what());
46-
throw(e);
47-
}
48-
return done;
49-
}
50-
51-
52-
void AtomArchitectApplication::throw_message_window(const QString& title, const QString& message) {
53-
QMessageBox message_box;
54-
message_box.setText(message);
55-
message_box.setIcon(QMessageBox::Critical);
56-
message_box.setWindowTitle(title);
57-
message_box.setWindowIcon(QIcon(":/assets/icon/atom_architect_256.ico"));
58-
message_box.exec();
59-
}
1+
/****************************************************************************
2+
* *
3+
* ATOM ARCHITECT *
4+
* Copyright (C) 2020-2026 Ivo Filot <i.a.w.filot@tue.nl> *
5+
* *
6+
* This program is free software: you can redistribute it and/or modify *
7+
* it under the terms of the GNU Lesser General Public License as *
8+
* published by the Free Software Foundation, either version 3 of the *
9+
* License, or (at your option) any later version. *
10+
* *
11+
* This program is distributed in the hope that it will be useful, *
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14+
* GNU General Public License for more details. *
15+
* *
16+
* You should have received a copy of the GNU General Public license *
17+
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
18+
* *
19+
****************************************************************************/
20+
21+
#include "atomarchitectapplication.h"
22+
23+
/**
24+
* @brief Default constructor
25+
* @param argc number of command line argument
26+
* @param argv command line arguments
27+
*/
28+
AtomArchitectApplication::AtomArchitectApplication(int& argc, char** argv) :
29+
QApplication(argc, argv) {}
30+
31+
/**
32+
* @brief notify
33+
* @param receiver
34+
* @param event
35+
* @return
36+
*/
37+
bool AtomArchitectApplication::notify(QObject* receiver, QEvent* event) {
38+
bool done = true;
39+
try {
40+
done = QApplication::notify(receiver, event);
41+
} catch (const std::exception& e) {
42+
this->throw_message_window(tr("Uncaught exception was thrown."),
43+
tr("An uncaught exception was thrown by the program. This is undiserable behavior and "
44+
"the program will be terminated. Please carefully read the error message "
45+
"and consult the manual or contact one of the developers.\n\nError:\n") + e.what());
46+
throw(e);
47+
}
48+
return done;
49+
}
50+
51+
52+
/**
53+
* @brief throw_message_window.
54+
*
55+
* @param title Parameter title.
56+
* @param message Parameter message.
57+
*/
58+
void AtomArchitectApplication::throw_message_window(const QString& title, const QString& message) {
59+
QMessageBox message_box;
60+
message_box.setText(message);
61+
message_box.setIcon(QMessageBox::Critical);
62+
message_box.setWindowTitle(title);
63+
message_box.setWindowIcon(QIcon(":/assets/icon/atom_architect_256.ico"));
64+
message_box.exec();
65+
}

src/atomarchitectapplication.h

Lines changed: 58 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,58 @@
1-
/****************************************************************************
2-
* *
3-
* ATOM ARCHITECT *
4-
* Copyright (C) 2020-2024 Ivo Filot <i.a.w.filot@tue.nl> *
5-
* *
6-
* This program is free software: you can redistribute it and/or modify *
7-
* it under the terms of the GNU Lesser General Public License as *
8-
* published by the Free Software Foundation, either version 3 of the *
9-
* License, or (at your option) any later version. *
10-
* *
11-
* This program is distributed in the hope that it will be useful, *
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14-
* GNU General Public License for more details. *
15-
* *
16-
* You should have received a copy of the GNU General Public license *
17-
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
18-
* *
19-
****************************************************************************/
20-
#pragma once
21-
22-
#include <QApplication>
23-
#include <QMessageBox>
24-
#include <QIcon>
25-
26-
#include "config.h"
27-
28-
class AtomArchitectApplication : public QApplication
29-
{
30-
public:
31-
/**
32-
* @brief Default constructor
33-
* @param argc number of command line argument
34-
* @param argv command line arguments
35-
*/
36-
AtomArchitectApplication(int& argc, char** argv);
37-
38-
/**
39-
* @brief notify
40-
* @param receiver
41-
* @param event
42-
* @return
43-
*/
44-
bool notify(QObject* receiver, QEvent* event);
45-
46-
private:
47-
void throw_message_window(const QString& title, const QString& message);
48-
};
1+
/****************************************************************************
2+
* *
3+
* ATOM ARCHITECT *
4+
* Copyright (C) 2020-2026 Ivo Filot <i.a.w.filot@tue.nl> *
5+
* *
6+
* This program is free software: you can redistribute it and/or modify *
7+
* it under the terms of the GNU Lesser General Public License as *
8+
* published by the Free Software Foundation, either version 3 of the *
9+
* License, or (at your option) any later version. *
10+
* *
11+
* This program is distributed in the hope that it will be useful, *
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14+
* GNU General Public License for more details. *
15+
* *
16+
* You should have received a copy of the GNU General Public license *
17+
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
18+
* *
19+
****************************************************************************/
20+
21+
#pragma once
22+
23+
#include <QApplication>
24+
#include <QMessageBox>
25+
#include <QIcon>
26+
27+
#include "config.h"
28+
29+
/**
30+
* @brief AtomArchitectApplication class.
31+
*/
32+
class AtomArchitectApplication : public QApplication
33+
{
34+
public:
35+
/**
36+
* @brief Default constructor
37+
* @param argc number of command line argument
38+
* @param argv command line arguments
39+
*/
40+
AtomArchitectApplication(int& argc, char** argv);
41+
42+
/**
43+
* @brief notify
44+
* @param receiver
45+
* @param event
46+
* @return
47+
*/
48+
bool notify(QObject* receiver, QEvent* event);
49+
50+
private:
51+
/**
52+
* @brief throw_message_window.
53+
*
54+
* @param title Parameter title.
55+
* @param message Parameter message.
56+
*/
57+
void throw_message_window(const QString& title, const QString& message);
58+
};

src/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* *
33
* ATOM ARCHITECT *
4-
* Copyright (C) 2020-2024 Ivo Filot <i.a.w.filot@tue.nl> *
4+
* Copyright (C) 2020-2026 Ivo Filot <i.a.w.filot@tue.nl> *
55
* *
66
* This program is free software: you can redistribute it and/or modify *
77
* it under the terms of the GNU Lesser General Public License as *

src/data/atom.cpp

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* *
33
* ATOM ARCHITECT *
4-
* Copyright (C) 2020-2024 Ivo Filot <i.a.w.filot@tue.nl> *
4+
* Copyright (C) 2020-2026 Ivo Filot <i.a.w.filot@tue.nl> *
55
* *
66
* This program is free software: you can redistribute it and/or modify *
77
* it under the terms of the GNU Lesser General Public License as *
@@ -20,6 +20,19 @@
2020

2121
#include "atom.h"
2222

23+
/**
24+
* @brief Atom.
25+
*
26+
* @param _atnr Parameter _atnr.
27+
* @param _x Parameter _x.
28+
* @param _y Parameter _y.
29+
* @param _z Parameter _z.
30+
* @param param Parameter param.
31+
* @param param Parameter param.
32+
* @param param Parameter param.
33+
* @param param Parameter param.
34+
* @param param Parameter param.
35+
*/
2336
Atom::Atom(unsigned int _atnr, double _x, double _y, double _z, unsigned int _atomtype) :
2437
atnr(_atnr),
2538
x(_x),
@@ -29,33 +42,33 @@ atomtype(_atomtype) {
2942

3043
}
3144

32-
/**
33-
* @brief Distance between two atoms
34-
*
35-
* @param[in] other The other atom
36-
*
37-
* @return Distance
38-
*/
45+
/**
46+
* @brief Distance between two atoms
47+
*
48+
* @param[in] other The other atom
49+
*
50+
* @return Distance
51+
*/
3952
double Atom::dist(const Atom& other) const {
4053
return std::sqrt(this->dist2(other));
4154
}
4255

43-
/**
44-
* @brief Squared distance between two atoms
45-
*
46-
* @param[in] other The other atom
47-
*
48-
* @return Squared distance
49-
*/
56+
/**
57+
* @brief Squared distance between two atoms
58+
*
59+
* @param[in] other The other atom
60+
*
61+
* @return Squared distance
62+
*/
5063
double Atom::dist2(const Atom& other) const {
5164
return (this->x - other.x) * (this->x - other.x) +
5265
(this->y - other.y) * (this->y - other.y) +
5366
(this->z - other.z) * (this->z - other.z);
5467
}
5568

56-
/**
57-
* @brief Select this atom
58-
*/
69+
/**
70+
* @brief Select this atom
71+
*/
5972
void Atom::select_atom() {
6073
select++;
6174
select = select % 3;

src/data/atom.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
* *
33
* ATOM ARCHITECT *
4-
* Copyright (C) 2020-2024 Ivo Filot <i.a.w.filot@tue.nl> *
4+
* Copyright (C) 2020-2026 Ivo Filot <i.a.w.filot@tue.nl> *
55
* *
66
* This program is free software: you can redistribute it and/or modify *
77
* it under the terms of the GNU Lesser General Public License as *
@@ -31,6 +31,9 @@ enum {
3131
ATOM_EXPANSION_Z
3232
};
3333

34+
/**
35+
* @brief Atom class.
36+
*/
3437
class Atom {
3538
public:
3639
unsigned int atnr;
@@ -39,6 +42,15 @@ class Atom {
3942
unsigned int select = 0;
4043
std::array<bool, 3> selective_dynamics = {true, true, true};
4144

45+
/**
46+
* @brief Atom.
47+
*
48+
* @param _atnr Parameter _atnr.
49+
* @param _x Parameter _x.
50+
* @param _y Parameter _y.
51+
* @param _z Parameter _z.
52+
* @param _atomtype Parameter _atomtype.
53+
*/
4254
Atom(unsigned int _atnr, double _x, double _y, double _z, unsigned int _atomtype = (1 << ATOM_CENTRAL_UNITCELL));
4355

4456
/**
@@ -47,6 +59,13 @@ class Atom {
4759
* @return The position.
4860
*/
4961
inline QVector3D get_pos_qtvec() const {
62+
/**
63+
* @brief QVector3D.
64+
*
65+
* @param param Parameter param.
66+
* @param param Parameter param.
67+
* @param param Parameter param.
68+
*/
5069
return QVector3D(this->x, this->y, this->z);
5170
}
5271

0 commit comments

Comments
 (0)