Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
ThermalInspectorWidget.h
Go to the documentation of this file.
1#pragma once
2#include <functional>
3#include <vector>
4#include "IInspectorSection.h"
5#include "InspectorRow.h"
6
7class QFormLayout;
8class QTabWidget;
9class SceneObject;
10class ScalarWidget;
11class QString;
12namespace Physics { class PhysicsBody; }
14
16 Q_OBJECT
17public:
18 explicit ThermalInspectorWidget(QWidget* parent = nullptr);
19
20 void load(SceneObject* object) override;
21 void unload() override;
22 void refresh() override;
23
24private:
25 using ThermalGetter = std::function<double(const ThermalProperties&)>;
26 using ThermalSetter = std::function<void(ThermalProperties&, double)>;
27 using ScalarInitializer = std::function<void(ScalarWidget*)>;
28
29 SceneObject* selectedObject = nullptr;
30 QTabWidget* tabs;
31 std::vector<InspectorRow> rows;
32
33 void createUiComponents();
34 QFormLayout* createTab(const QString& title);
35 void addThermalScalar(QFormLayout* target,
36 const QString& label,
37 const ThermalGetter& get,
38 const ThermalSetter& set,
39 const QString& unit = "",
40 const ScalarInitializer& onInit = nullptr);
41 Physics::PhysicsBody* getBody() const;
42};
Interface for inspector panel sections in the editor UI.
Abstract base class for inspector panel sections.
void unload() override
Unloads the current object and clears section state.
void load(SceneObject *object) override
Loads and binds this section to a scene object.
void refresh() override
Updates UI widgets from the current object's state.