Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
FrameGraphPanel.h
Go to the documentation of this file.
1#pragma once
2
3#include <QWidget>
4#include <QGridLayout>
5#include <QScrollArea>
6#include <array>
7#include <memory>
8#include <vector>
9
10#include "Metric.h"
11#include "physics/PhysicsBody.h"
12
14
15class FrameGraphPanel : public QWidget {
16 Q_OBJECT
17public:
18 explicit FrameGraphPanel(QWidget* parent = nullptr);
19 void loadSnapshots(const std::vector<ObjectSnapshot>& snapshots);
20 void clear();
21protected:
22 void resizeEvent(QResizeEvent* event) override;
23private:
24 void recomputeTimeAndValueRanges();
25 void relayoutGraphs();
26 QGridLayout* gridLayout;
27 QScrollArea* scrollArea;
28 std::vector<FrameGraphWidget*> frameGraphs;
29 int currentColumns = 0;
30 std::shared_ptr<const std::vector<ObjectSnapshot>> m_snapshots;
31 float m_tMin = 0.0f;
32 float m_tMax = 0.0f;
33 std::array<std::pair<float, float>, kPlottableMetricCount> m_valueMinMaxPerMetric{};
34};
constexpr std::size_t kPlottableMetricCount
Definition Metric.h:21
void loadSnapshots(const std::vector< ObjectSnapshot > &snapshots)
void resizeEvent(QResizeEvent *event) override