-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #560 from spirit-code/feature-clang-format
clang-format file for homogeneous formatting
- Loading branch information
Showing
39 changed files
with
7,370 additions
and
6,936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
### General default config, applies to all languages ### | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: AlwaysBreak | ||
AlignConsecutiveAssignments: true | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
AllowShortCaseLabelsOnASingleLine: true | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: false | ||
BreakBeforeBinaryOperators: All | ||
BreakBeforeBraces: Allman | ||
BreakBeforeTernaryOperators: false | ||
ContinuationIndentWidth: 4 | ||
ColumnLimit: 120 | ||
IndentCaseLabels: true | ||
IndentWidth: 4 | ||
PenaltyBreakComment: 10000000 | ||
SpaceBeforeParens: Never | ||
SpacesInParentheses: true | ||
TabWidth: 4 | ||
UseTab: Never | ||
--- | ||
Language: Cpp | ||
Standard: C++11 | ||
AlwaysBreakTemplateDeclarations: Yes | ||
Cpp11BracedListStyle: false | ||
CompactNamespaces: true | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 8 | ||
FixNamespaceComments: true | ||
IncludeCategories: | ||
- Regex: '".*"' | ||
Priority: 1 | ||
- Regex: '^<.*\.h>' | ||
Priority: 2 | ||
- Regex: '^<.*' | ||
Priority: 3 | ||
NamespaceIndentation: None | ||
PointerAlignment: Middle | ||
SpaceAfterTemplateKeyword: false | ||
SpacesInAngles: false | ||
--- | ||
Language: JavaScript | ||
AlignConsecutiveAssignments: false | ||
BreakBeforeBraces: Attach | ||
ContinuationIndentWidth: 2 | ||
IndentWidth: 2 | ||
JavaScriptQuotes: Single | ||
SpacesInContainerLiterals: true | ||
SpaceBeforeParens: ControlStatements | ||
SpacesInParentheses: false | ||
TabWidth: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,85 @@ | ||
#pragma once | ||
#ifndef ConfigurationsWidget_H | ||
#define ConfigurationsWidget_H | ||
#ifndef SPIRIT_CONFIGURATIONSWIDGET_HPP | ||
#define SPIRIT_CONFIGURATIONSWIDGET_HPP | ||
|
||
#include "ui_ConfigurationsWidget.h" | ||
|
||
#include "IsosurfaceWidget.hpp" | ||
#include "SpinWidget.hpp" | ||
|
||
#include <QtWidgets/QWidget> | ||
#include <QRegularExpressionValidator> | ||
#include <QtWidgets/QWidget> | ||
|
||
#include <memory> | ||
#include <thread> | ||
|
||
#include "SpinWidget.hpp" | ||
#include "IsosurfaceWidget.hpp" | ||
//#include "SettingsWidget.hpp" | ||
|
||
#include "ui_ConfigurationsWidget.h" | ||
|
||
struct State; | ||
|
||
/* | ||
Converts a QString to an std::string. | ||
This function is needed sometimes due to weird behaviour of QString::toStdString(). | ||
Converts a QString to an std::string. | ||
This function is needed sometimes due to weird behaviour of QString::toStdString(). | ||
*/ | ||
std::string string_q2std(QString qs); | ||
std::string string_q2std( QString qs ); | ||
|
||
class ConfigurationsWidget : public QWidget, private Ui::ConfigurationsWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
ConfigurationsWidget(std::shared_ptr<State> state, SpinWidget * spinWidget); | ||
void updateData(); | ||
ConfigurationsWidget( std::shared_ptr<State> state, SpinWidget * spinWidget ); | ||
void updateData(); | ||
|
||
public slots: | ||
// Configurations | ||
void configurationAddNoise(); | ||
void randomPressed(); | ||
void lastConfiguration(); | ||
// Configurations | ||
void configurationAddNoise(); | ||
void randomPressed(); | ||
void lastConfiguration(); | ||
|
||
private slots: | ||
// Configurations | ||
void addNoisePressed(); | ||
void domainPressed(); | ||
void plusZ(); | ||
void minusZ(); | ||
void create_Hopfion(); | ||
void create_Skyrmion(); | ||
void create_SpinSpiral(); | ||
// Pinning and atom types | ||
void set_atom_type_pressed(); | ||
void set_pinned_pressed(); | ||
// Transitions | ||
void homogeneousTransitionPressed(); | ||
void homogeneousTransitionFirstLastPressed(); | ||
void homogeneousTransitionInterpolatePressed(); | ||
// Configurations | ||
void addNoisePressed(); | ||
void domainPressed(); | ||
void plusZ(); | ||
void minusZ(); | ||
void create_Hopfion(); | ||
void create_Skyrmion(); | ||
void create_SpinSpiral(); | ||
// Pinning and atom types | ||
void set_atom_type_pressed(); | ||
void set_pinned_pressed(); | ||
// Transitions | ||
void homogeneousTransitionPressed(); | ||
void homogeneousTransitionFirstLastPressed(); | ||
void homogeneousTransitionInterpolatePressed(); | ||
void DW_Width_CheckBox_State_Changed(); | ||
|
||
private: | ||
void Setup_Input_Validators(); | ||
void Setup_Configurations_Slots(); | ||
void Setup_Transitions_Slots(); | ||
|
||
// Helpers | ||
std::array<float, 3> get_position(); | ||
std::array<float, 3> get_border_rectangular(); | ||
float get_border_cylindrical(); | ||
float get_border_spherical(); | ||
float get_inverted(); | ||
|
||
// Debug? | ||
void print_Energies_to_console(); | ||
|
||
std::shared_ptr<State> state; | ||
SpinWidget * spinWidget; | ||
//SettingsWidget * settingsWidget; | ||
|
||
// Last used configuration | ||
std::string last_configuration; | ||
|
||
// Validator for Input into lineEdits | ||
QRegularExpressionValidator * number_validator; | ||
QRegularExpressionValidator * number_validator_unsigned; | ||
QRegularExpressionValidator * number_validator_int; | ||
QRegularExpressionValidator * number_validator_int_unsigned; | ||
void Setup_Input_Validators(); | ||
void Setup_Configurations_Slots(); | ||
void Setup_Transitions_Slots(); | ||
|
||
// Helpers | ||
std::array<float, 3> get_position(); | ||
std::array<float, 3> get_border_rectangular(); | ||
float get_border_cylindrical(); | ||
float get_border_spherical(); | ||
float get_inverted(); | ||
|
||
// Debug? | ||
void print_Energies_to_console(); | ||
|
||
std::shared_ptr<State> state; | ||
SpinWidget * spinWidget; | ||
// SettingsWidget * settingsWidget; | ||
|
||
// Last used configuration | ||
std::string last_configuration; | ||
|
||
// Validator for Input into lineEdits | ||
QRegularExpressionValidator * number_validator; | ||
QRegularExpressionValidator * number_validator_unsigned; | ||
QRegularExpressionValidator * number_validator_int; | ||
QRegularExpressionValidator * number_validator_int_unsigned; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
#pragma once | ||
#ifndef DEBUGWIDGET_H | ||
#define DEBUGWIDGET_H | ||
#ifndef SPIRIT_DEBUGWIDGET_HPP | ||
#define SPIRIT_DEBUGWIDGET_HPP | ||
|
||
#include "ui_DebugWidget.h" | ||
|
||
#include <QWidget> | ||
|
||
#include <memory> | ||
|
||
#include "ui_DebugWidget.h" | ||
|
||
struct State; | ||
|
||
class DebugWidget : public QWidget, private Ui::DebugWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
DebugWidget(std::shared_ptr<State> state); | ||
void updateData(); | ||
DebugWidget( std::shared_ptr<State> state ); | ||
void updateData(); | ||
|
||
void LoadFromLog(); | ||
void UpdateFromLog(); | ||
void LoadFromLog(); | ||
void UpdateFromLog(); | ||
|
||
std::shared_ptr<State> state; | ||
std::shared_ptr<State> state; | ||
|
||
private slots: | ||
void AllPressed(); | ||
void AllPressed(); | ||
|
||
private: | ||
int n_log_entries; | ||
int n_log_entries; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
#pragma once | ||
#ifndef GeometryWidget_H | ||
#define GeometryWidget_H | ||
#ifndef SPIRIT_GEOMETRYWIDGET_HPP | ||
#define SPIRIT_GEOMETRYWIDGET_HPP | ||
|
||
#include "ui_GeometryWidget.h" | ||
|
||
#include "SpinWidget.hpp" | ||
|
||
#include <QtWidgets/QWidget> | ||
#include <QRegularExpressionValidator> | ||
#include <QtWidgets/QWidget> | ||
|
||
#include <memory> | ||
#include <thread> | ||
|
||
#include "SpinWidget.hpp" | ||
|
||
#include "ui_GeometryWidget.h" | ||
|
||
struct State; | ||
|
||
class GeometryWidget : public QWidget, private Ui::GeometryWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
GeometryWidget(std::shared_ptr<State> state, SpinWidget * spinWidget); | ||
void updateData(); | ||
GeometryWidget( std::shared_ptr<State> state, SpinWidget * spinWidget ); | ||
void updateData(); | ||
|
||
signals: | ||
void updateNeeded(); | ||
void updateNeeded(); | ||
|
||
private slots: | ||
void setNCells(); | ||
void setNCells(); | ||
|
||
private: | ||
void Setup_Input_Validators(); | ||
void Setup_Slots(); | ||
void Setup_Input_Validators(); | ||
void Setup_Slots(); | ||
|
||
std::shared_ptr<State> state; | ||
SpinWidget * spinWidget; | ||
std::shared_ptr<State> state; | ||
SpinWidget * spinWidget; | ||
|
||
// Validator for Input into lineEdits | ||
QRegularExpressionValidator * number_validator; | ||
QRegularExpressionValidator * number_validator_unsigned; | ||
QRegularExpressionValidator * number_validator_int; | ||
QRegularExpressionValidator * number_validator_int_unsigned; | ||
// Validator for Input into lineEdits | ||
QRegularExpressionValidator * number_validator; | ||
QRegularExpressionValidator * number_validator_unsigned; | ||
QRegularExpressionValidator * number_validator_int; | ||
QRegularExpressionValidator * number_validator_int_unsigned; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.