Skip to content

Commit 0cd2534

Browse files
committed
Refactor and bug fixes
1 parent c14d071 commit 0cd2534

128 files changed

Lines changed: 3180 additions & 2461 deletions

File tree

Some content is hidden

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

.gitmodules

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
[submodule "HeatSpectra/libs/VulkanMemoryAllocator"]
2-
path = HeatSpectra/libs/VulkanMemoryAllocator
3-
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
41
[submodule "HeatSpectra/libs/tinyply"]
52
path = HeatSpectra/libs/tinyply
63
url = https://github.com/ddiakopoulos/tinyply.git
7-
[submodule "HeatSpectra/libs/isotropicremesher"]
8-
path = HeatSpectra/libs/isotropicremesher
9-
url = https://github.com/huxingyi/isotropicremesher
104
[submodule "HeatSpectra/libs/stb"]
115
path = HeatSpectra/libs/stb
126
url = https://github.com/nothings/stb

HeatSpectra/HeatSpectra.vcxproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
225225
<ClCompile Include="runtime\VulkanCoreContext.cpp" />
226226
<ClCompile Include="runtime\SceneContext.cpp" />
227227
<ClCompile Include="runtime\RenderContext.cpp" />
228-
<ClCompile Include="runtime\ContactPreviewStore.cpp" />
229-
<ClCompile Include="runtime\ComputeCache.cpp" />
228+
<ClCompile Include="runtime\ModelRuntime.cpp" />
230229
<ClCompile Include="runtime\RemeshController.cpp" />
231230
<ClCompile Include="runtime\RuntimePackageCompiler.cpp" />
232231
<ClCompile Include="runtime\RuntimePackageSync.cpp" />
@@ -372,7 +371,7 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
372371
<ClCompile Include="vulkan\MemoryAllocator.cpp" />
373372
<ClCompile Include="scene\Model.cpp" />
374373
<ClCompile Include="scene\ModelUploader.cpp" />
375-
<ClCompile Include="vulkan\ResourceManager.cpp" />
374+
<ClCompile Include="vulkan\ModelRegistry.cpp" />
376375
<ClCompile Include="mesh\\remesher\\Remesher.cpp" />
377376
<ClCompile Include="mesh\\remesher\\SignPostMesh.cpp" />
378377
<ClCompile Include="vulkan\VulkanDevice.cpp" />
@@ -455,6 +454,9 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
455454
<ClInclude Include="runtime\RuntimeContactTransport.hpp" />
456455
<ClInclude Include="runtime\RuntimeHeatTransport.hpp" />
457456
<ClInclude Include="runtime\RemeshController.hpp" />
457+
<ClInclude Include="runtime\ModelRuntime.hpp" />
458+
<ClInclude Include="runtime\RuntimeProductRegistry.hpp" />
459+
<ClInclude Include="runtime\RuntimeProducts.hpp" />
458460
<ClInclude Include="runtime\RuntimeRemeshTransport.hpp" />
459461
<ClInclude Include="runtime\RuntimeVoronoiTransport.hpp" />
460462
<ClInclude Include="vulkan\CommandBufferManager.hpp" />
@@ -473,13 +475,10 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
473475
<ClInclude Include="runtime\VulkanCoreContext.hpp" />
474476
<ClInclude Include="runtime\SceneContext.hpp" />
475477
<ClInclude Include="runtime\RenderContext.hpp" />
476-
<ClInclude Include="runtime\ContactPreviewStore.hpp" />
477-
<ClInclude Include="runtime\ComputeCache.hpp" />
478478
<ClInclude Include="runtime\RuntimePackageCompiler.hpp" />
479479
<ClInclude Include="runtime\RuntimePackageSync.hpp" />
480480
<ClInclude Include="runtime\RuntimePackages.hpp" />
481481
<ClInclude Include="runtime\RuntimePackageController.hpp" />
482-
<ClInclude Include="runtime\RuntimeContactTypes.hpp" />
483482
<ClInclude Include="runtime\RuntimeThermalTypes.hpp" />
484483
<ClInclude Include="runtime\RuntimeController.hpp" />
485484
<ClInclude Include="runtime\RenderSettingsManager.hpp" />
@@ -617,7 +616,7 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
617616
<ClInclude Include="scene\Model.hpp" />
618617
<ClInclude Include="scene\ModelUploader.hpp" />
619618
<ClInclude Include="scene\ModelSelection.hpp" />
620-
<ClInclude Include="vulkan\ResourceManager.hpp" />
619+
<ClInclude Include="vulkan\ModelRegistry.hpp" />
621620
<ClInclude Include="mesh\\remesher\\Remesher.hpp" />
622621
<ClInclude Include="mesh\\remesher\\SignPostMesh.hpp" />
623622
<ClInclude Include="mesh\\remesher\\SupportingHalfedge.hpp" />

HeatSpectra/HeatSpectra.vcxproj.filters

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@
7878
<ClCompile Include="runtime\RenderContext.cpp">
7979
<Filter>Source Files</Filter>
8080
</ClCompile>
81-
<ClCompile Include="runtime\ContactPreviewStore.cpp">
82-
<Filter>Source Files</Filter>
83-
</ClCompile>
84-
<ClCompile Include="runtime\ComputeCache.cpp">
85-
<Filter>Source Files</Filter>
86-
</ClCompile>
8781
<ClCompile Include="runtime\RemeshController.cpp">
8882
<Filter>Source Files</Filter>
8983
</ClCompile>
@@ -210,7 +204,7 @@
210204
<ClCompile Include="vulkan\MemoryAllocator.cpp">
211205
<Filter>Source Files</Filter>
212206
</ClCompile>
213-
<ClCompile Include="vulkan\ResourceManager.cpp">
207+
<ClCompile Include="vulkan\ModelRegistry.cpp">
214208
<Filter>Source Files</Filter>
215209
</ClCompile>
216210
<ClCompile Include="mesh\\remesher\\Remesher.cpp">
@@ -712,12 +706,6 @@
712706
<ClInclude Include="runtime\RenderContext.hpp">
713707
<Filter>Header Files</Filter>
714708
</ClInclude>
715-
<ClInclude Include="runtime\ContactPreviewStore.hpp">
716-
<Filter>Header Files</Filter>
717-
</ClInclude>
718-
<ClInclude Include="runtime\ComputeCache.hpp">
719-
<Filter>Header Files</Filter>
720-
</ClInclude>
721709
<ClInclude Include="runtime\RuntimePackageCompiler.hpp">
722710
<Filter>Header Files</Filter>
723711
</ClInclude>
@@ -730,9 +718,6 @@
730718
<ClInclude Include="runtime\RuntimePackageController.hpp">
731719
<Filter>Header Files</Filter>
732720
</ClInclude>
733-
<ClInclude Include="runtime\RuntimeContactTypes.hpp">
734-
<Filter>Header Files</Filter>
735-
</ClInclude>
736721
<ClInclude Include="runtime\RuntimeThermalTypes.hpp">
737722
<Filter>Header Files</Filter>
738723
</ClInclude>
@@ -862,7 +847,7 @@
862847
<ClInclude Include="vulkan\MemoryAllocator.hpp">
863848
<Filter>Header Files</Filter>
864849
</ClInclude>
865-
<ClInclude Include="vulkan\ResourceManager.hpp">
850+
<ClInclude Include="vulkan\ModelRegistry.hpp">
866851
<Filter>Header Files</Filter>
867852
</ClInclude>
868853
<ClInclude Include="mesh\\remesher\\Remesher.hpp">
@@ -1247,3 +1232,4 @@
12471232
</QtMoc>
12481233
</ItemGroup>
12491234
</Project>
1235+

HeatSpectra/app/MainQt.cpp

Lines changed: 2 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#include "MainQt.h"
22
#include "App.h"
33
#include "nodegraph/NodeGraphDock.hpp"
4-
#include "runtime/RenderSettingsController.hpp"
54
#include "util/UiTheme.hpp"
65
#include "VulkanWindow.hpp"
76

87
#include <QAction>
98
#include <QApplication>
10-
#include <QCheckBox>
119
#include <QCloseEvent>
12-
#include <QComboBox>
13-
#include <QDoubleSpinBox>
1410
#include <QFileDialog>
1511
#include <QHBoxLayout>
16-
#include <QLabel>
1712
#include <QMenu>
1813
#include <QMenuBar>
1914
#include <QMessageBox>
@@ -38,7 +33,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) {
3833
setStyleSheet(QString::fromStdString(ui::splitterStyleSheet()));
3934

4035
createMenuBar();
41-
createDockWidget();
4236
createNodeGraphDock();
4337

4438
QWidget* centralHost = new QWidget(this);
@@ -71,16 +65,9 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) {
7165
viewportHost->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
7266
mainSplitter->addWidget(viewportHost);
7367

74-
if (controlsPanel) {
75-
controlsPanel->setMinimumWidth(160);
76-
controlsPanel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
77-
mainSplitter->addWidget(controlsPanel);
78-
}
79-
8068
mainSplitter->setStretchFactor(0, 0);
8169
mainSplitter->setStretchFactor(1, 1);
82-
mainSplitter->setStretchFactor(2, 0);
83-
mainSplitter->setSizes({320, 880, 220});
70+
mainSplitter->setSizes({320, 1100});
8471

8572
setCentralWidget(centralHost);
8673
connect(mainSplitter, &QSplitter::splitterMoved, this, [this](int, int) {
@@ -114,7 +101,6 @@ void MainWindow::setApp(App* application) {
114101
if (viewportWindow) {
115102
viewportWindow->setApp(app);
116103
}
117-
settingsController = app ? app->getSettingsController() : nullptr;
118104
if (nodeGraphDock) {
119105
boundRuntimeQuery = app ? app->runtimeQuery() : nullptr;
120106
nodeGraphDock->setRuntimeQuery(boundRuntimeQuery);
@@ -176,12 +162,6 @@ void MainWindow::createMenuBar() {
176162

177163
QMenu* viewMenu = menuBar->addMenu("&View");
178164

179-
remeshOverlayAction = new QAction("&Remesh Overlay", this);
180-
remeshOverlayAction->setCheckable(true);
181-
remeshOverlayAction->setShortcut(Qt::Key_C);
182-
connect(remeshOverlayAction, &QAction::triggered, this, &MainWindow::onIntrinsicToggled);
183-
viewMenu->addAction(remeshOverlayAction);
184-
185165
nodeGraphAction = new QAction("Node &Graph", this);
186166
nodeGraphAction->setCheckable(true);
187167
nodeGraphAction->setChecked(true);
@@ -191,98 +171,6 @@ void MainWindow::createMenuBar() {
191171
viewMenu->addAction(nodeGraphAction);
192172
}
193173

194-
void MainWindow::createDockWidget() {
195-
controlsPanel = new QWidget(this);
196-
controlsPanel->setObjectName("ControlsPanel");
197-
QVBoxLayout* layout = new QVBoxLayout();
198-
layout->setContentsMargins(8, 8, 8, 8);
199-
layout->setSpacing(6);
200-
201-
QLabel* viewLabel = new QLabel("<b>View Options</b>");
202-
layout->addWidget(viewLabel);
203-
204-
wireframeModeCombo = new QComboBox();
205-
wireframeModeCombo->addItem("Normal");
206-
wireframeModeCombo->addItem("Wireframe");
207-
wireframeModeCombo->addItem("Shaded Wire");
208-
wireframeModeCombo->setCurrentIndex(0);
209-
connect(wireframeModeCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
210-
this, &MainWindow::onWireframeModeChanged);
211-
layout->addWidget(wireframeModeCombo);
212-
213-
intrinsicCheck = new QCheckBox("Remesh Overlay (Ctrl+C)");
214-
connect(intrinsicCheck, &QCheckBox::toggled, this, &MainWindow::onIntrinsicToggled);
215-
layout->addWidget(intrinsicCheck);
216-
217-
heatOverlayCheck = new QCheckBox("Heat Overlay (Ctrl+V)");
218-
connect(heatOverlayCheck, &QCheckBox::toggled, this, &MainWindow::onHeatOverlayToggled);
219-
layout->addWidget(heatOverlayCheck);
220-
221-
intrinsicNormalsCheck = new QCheckBox("Normal Vectors");
222-
connect(intrinsicNormalsCheck, &QCheckBox::toggled, this, &MainWindow::onIntrinsicNormalsToggled);
223-
layout->addWidget(intrinsicNormalsCheck);
224-
225-
intrinsicVertexNormalsCheck = new QCheckBox("Vertex Normals");
226-
connect(intrinsicVertexNormalsCheck, &QCheckBox::toggled, this, &MainWindow::onIntrinsicVertexNormalsToggled);
227-
layout->addWidget(intrinsicVertexNormalsCheck);
228-
229-
QHBoxLayout* normalLengthLayout = new QHBoxLayout();
230-
QLabel* normalLengthLabel = new QLabel(" Normal Length:");
231-
normalLengthLayout->addWidget(normalLengthLabel);
232-
233-
normalLengthSpinBox = new QDoubleSpinBox();
234-
normalLengthSpinBox->setMinimum(0.001);
235-
normalLengthSpinBox->setMaximum(10.0);
236-
normalLengthSpinBox->setValue(0.05);
237-
normalLengthSpinBox->setSingleStep(0.01);
238-
normalLengthSpinBox->setDecimals(3);
239-
normalLengthSpinBox->setToolTip("Length of normal vectors for visualization");
240-
connect(normalLengthSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
241-
this, &MainWindow::onNormalLengthChanged);
242-
normalLengthLayout->addWidget(normalLengthSpinBox);
243-
normalLengthLayout->addStretch();
244-
layout->addLayout(normalLengthLayout);
245-
246-
QHBoxLayout* panSensLayout = new QHBoxLayout();
247-
QLabel* panSensLabel = new QLabel(" Pan Sensitivity:");
248-
panSensLayout->addWidget(panSensLabel);
249-
250-
panSensitivitySpinBox = new QDoubleSpinBox();
251-
panSensitivitySpinBox->setMinimum(0.0);
252-
panSensitivitySpinBox->setMaximum(10.0);
253-
panSensitivitySpinBox->setValue(1.0);
254-
panSensitivitySpinBox->setSingleStep(0.1);
255-
panSensitivitySpinBox->setDecimals(2);
256-
panSensitivitySpinBox->setToolTip("Sensitivity of camera panning (Default: 1.0)");
257-
connect(panSensitivitySpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
258-
this, &MainWindow::onPanSensitivityChanged);
259-
panSensLayout->addWidget(panSensitivitySpinBox);
260-
panSensLayout->addStretch();
261-
layout->addLayout(panSensLayout);
262-
263-
layout->addSpacing(10);
264-
265-
surfelsCheck = new QCheckBox("Show Surfels");
266-
connect(surfelsCheck, &QCheckBox::toggled, this, &MainWindow::onSurfelsToggled);
267-
layout->addWidget(surfelsCheck);
268-
269-
voronoiCheck = new QCheckBox("View Voronoi");
270-
connect(voronoiCheck, &QCheckBox::toggled, this, &MainWindow::onVoronoiToggled);
271-
layout->addWidget(voronoiCheck);
272-
273-
pointsCheck = new QCheckBox("View Points");
274-
connect(pointsCheck, &QCheckBox::toggled, this, &MainWindow::onPointsToggled);
275-
layout->addWidget(pointsCheck);
276-
277-
contactLinesCheck = new QCheckBox("Show Contact Lines");
278-
connect(contactLinesCheck, &QCheckBox::toggled, this, &MainWindow::onContactLinesToggled);
279-
layout->addWidget(contactLinesCheck);
280-
281-
layout->addStretch();
282-
283-
controlsPanel->setLayout(layout);
284-
}
285-
286174
void MainWindow::createNodeGraphDock() {
287175
nodeGraphDock = new NodeGraphDock(this);
288176
nodeGraphDock->setObjectName("NodeGraphDock");
@@ -346,7 +234,7 @@ void MainWindow::setNodeGraphVisible(bool visible) {
346234
}
347235

348236
QList<int> sizes = mainSplitter->sizes();
349-
if (sizes.size() < 3) {
237+
if (sizes.size() < 2) {
350238
return;
351239
}
352240

@@ -363,100 +251,6 @@ void MainWindow::setNodeGraphVisible(bool visible) {
363251
nodeGraphDock->hide();
364252
}
365253

366-
void MainWindow::onWireframeModeChanged(int index) {
367-
if (settingsController) {
368-
settingsController->setWireframeMode(static_cast<app::WireframeMode>(index));
369-
}
370-
}
371-
372-
void MainWindow::onIntrinsicToggled(bool checked) {
373-
if (settingsController) {
374-
settingsController->setIntrinsicOverlayEnabled(checked);
375-
}
376-
377-
if (remeshOverlayAction && remeshOverlayAction->isChecked() != checked) {
378-
remeshOverlayAction->setChecked(checked);
379-
}
380-
if (intrinsicCheck && intrinsicCheck->isChecked() != checked) {
381-
intrinsicCheck->setChecked(checked);
382-
}
383-
}
384-
385-
void MainWindow::onHeatOverlayToggled(bool checked) {
386-
if (settingsController) {
387-
settingsController->setHeatOverlayEnabled(checked);
388-
}
389-
if (heatOverlayCheck && heatOverlayCheck->isChecked() != checked) {
390-
heatOverlayCheck->setChecked(checked);
391-
}
392-
}
393-
394-
void MainWindow::onIntrinsicNormalsToggled(bool checked) {
395-
if (settingsController) {
396-
settingsController->setIntrinsicNormalsEnabled(checked);
397-
}
398-
if (intrinsicNormalsCheck && intrinsicNormalsCheck->isChecked() != checked) {
399-
intrinsicNormalsCheck->setChecked(checked);
400-
}
401-
}
402-
403-
void MainWindow::onIntrinsicVertexNormalsToggled(bool checked) {
404-
if (settingsController) {
405-
settingsController->setIntrinsicVertexNormalsEnabled(checked);
406-
}
407-
if (intrinsicVertexNormalsCheck && intrinsicVertexNormalsCheck->isChecked() != checked) {
408-
intrinsicVertexNormalsCheck->setChecked(checked);
409-
}
410-
}
411-
412-
void MainWindow::onSurfelsToggled(bool checked) {
413-
if (settingsController) {
414-
settingsController->setSurfelsEnabled(checked);
415-
}
416-
if (surfelsCheck && surfelsCheck->isChecked() != checked) {
417-
surfelsCheck->setChecked(checked);
418-
}
419-
}
420-
421-
void MainWindow::onVoronoiToggled(bool checked) {
422-
if (settingsController) {
423-
settingsController->setVoronoiEnabled(checked);
424-
}
425-
if (voronoiCheck && voronoiCheck->isChecked() != checked) {
426-
voronoiCheck->setChecked(checked);
427-
}
428-
}
429-
430-
void MainWindow::onPointsToggled(bool checked) {
431-
if (settingsController) {
432-
settingsController->setPointsEnabled(checked);
433-
}
434-
if (pointsCheck && pointsCheck->isChecked() != checked) {
435-
pointsCheck->setChecked(checked);
436-
}
437-
}
438-
439-
void MainWindow::onContactLinesToggled(bool checked) {
440-
if (settingsController) {
441-
settingsController->setContactLinesEnabled(checked);
442-
}
443-
if (contactLinesCheck && contactLinesCheck->isChecked() != checked) {
444-
contactLinesCheck->setChecked(checked);
445-
}
446-
}
447-
448-
void MainWindow::onNormalLengthChanged(double value) {
449-
if (settingsController) {
450-
settingsController->setIntrinsicNormalLength(static_cast<float>(value));
451-
}
452-
}
453-
454-
void MainWindow::onPanSensitivityChanged(double value) {
455-
if (app) {
456-
app->setPanSensitivity(static_cast<float>(value) * 0.001f);
457-
}
458-
}
459-
460254
void MainWindow::onOpenModel() {
461255
if (app) {
462256
app->setRenderPaused(true);

0 commit comments

Comments
 (0)