Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
DebugTab.cpp
Go to the documentation of this file.
1#include "DebugTab.h"
2#include <QFormLayout>
3#include <QCheckBox>
4#include <QDoubleSpinBox>
5#include "ui/AppSettings.h"
7
8DebugTab::DebugTab(QWidget* parent) : QWidget(parent) {
9 auto* layout = new QFormLayout(this);
10
11 m_showTrailsBox = new QCheckBox();
12 m_trailTimeBox = new QDoubleSpinBox();
13 m_trailTimeBox->setRange(0.1, 10e7);
14 m_trailTimeBox->setSingleStep(0.5);
15
16 m_showForcesBox = new QCheckBox();
17 m_showCollidersBox = new QCheckBox();
18 m_showObjectLabelsBox = new QCheckBox();
19
21 m_showTrailsBox->setChecked(dbgGroup.showAllPathTrails);
22 m_trailTimeBox->setValue(dbgGroup.pathTrailTime);
23 m_showForcesBox->setChecked(dbgGroup.showForces);
24 m_showCollidersBox->setChecked(dbgGroup.showColliders);
25 m_showObjectLabelsBox->setChecked(dbgGroup.showObjectLabels);
26
27 layout->addRow("Show All Path Trails:", m_showTrailsBox);
28 layout->addRow("Path Trail Time (seconds):", m_trailTimeBox);
29 layout->addRow("Show Forces:", m_showForcesBox);
30 layout->addRow("Show Colliders:", m_showCollidersBox);
31 layout->addRow("Show Object Labels:", m_showObjectLabelsBox);
32}
33
35 auto& dbgGroupSave = AppSettings::getInstance().getGroup<DebugSettings>();
36 dbgGroupSave.showAllPathTrails = m_showTrailsBox->isChecked();
37 dbgGroupSave.pathTrailTime = m_trailTimeBox->value();
38 dbgGroupSave.showForces = m_showForcesBox->isChecked();
39 dbgGroupSave.showColliders = m_showCollidersBox->isChecked();
40 dbgGroupSave.showObjectLabels = m_showObjectLabelsBox->isChecked();
41}
static AppSettings & getInstance()
Definition AppSettings.h:11
T & getGroup() const
Definition AppSettings.h:28
void saveSettings() override
Definition DebugTab.cpp:34
DebugTab(QWidget *parent=nullptr)
Definition DebugTab.cpp:8
bool showAllPathTrails