Skip to content

Commit c14d071

Browse files
committed
Refactor and bug fixes
1 parent 9644409 commit c14d071

157 files changed

Lines changed: 7004 additions & 5353 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.

HeatSpectra/HeatSpectra.vcxproj

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
227227
<ClCompile Include="runtime\RenderContext.cpp" />
228228
<ClCompile Include="runtime\ContactPreviewStore.cpp" />
229229
<ClCompile Include="runtime\ComputeCache.cpp" />
230+
<ClCompile Include="runtime\RemeshController.cpp" />
230231
<ClCompile Include="runtime\RuntimePackageCompiler.cpp" />
231-
<ClCompile Include="runtime\RuntimePayloadController.cpp" />
232+
<ClCompile Include="runtime\RuntimePackageSync.cpp" />
233+
<ClCompile Include="runtime\RuntimePackageController.cpp" />
234+
<ClCompile Include="runtime\RuntimeModelTransport.cpp" />
232235
<ClCompile Include="runtime\RuntimeController.cpp" />
233236
<ClCompile Include="runtime\RenderSettingsManager.cpp" />
234237
<ClCompile Include="runtime\RenderSettingsController.cpp" />
@@ -283,7 +286,6 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
283286
<ClCompile Include="heat\HeatSystemRuntime.cpp" />
284287
<ClCompile Include="heat\HeatSystemSimRuntime.cpp" />
285288
<ClCompile Include="heat\HeatSystemSurfaceRuntime.cpp" />
286-
<ClCompile Include="heat\HeatSystemResources.cpp" />
287289
<ClCompile Include="heat\HeatSystemVoronoiStage.cpp" />
288290
<ClCompile Include="heat\HeatSystemContactStage.cpp" />
289291
<ClCompile Include="contact\ContactSystemRuntime.cpp" />
@@ -438,14 +440,23 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
438440
<ClInclude Include="app\VulkanWindow.hpp" />
439441
<ClInclude Include="contact\ContactTypes.hpp" />
440442
<ClInclude Include="domain\ContactData.hpp" />
443+
<ClInclude Include="domain\GeometryData.hpp" />
444+
<ClInclude Include="domain\HeatData.hpp" />
445+
<ClInclude Include="domain\RemeshData.hpp" />
441446
<ClInclude Include="domain\RemeshParams.hpp" />
442447
<ClInclude Include="domain\VoronoiParams.hpp" />
443448
<ClInclude Include="domain\VoronoiData.hpp" />
444449
<ClInclude Include="heat\ContactSampling.hpp" />
445450
<ClInclude Include="heat\HeatContactParams.hpp" />
451+
<ClInclude Include="nodegraph\NodeGraphCoreTypes.hpp" />
446452
<ClInclude Include="nodegraph\NodeGraphPayloadTypes.hpp" />
447453
<ClInclude Include="nodegraph\NodeGraphRegistry.hpp" />
448454
<ClInclude Include="nodegraph\NodeGraphUtils.hpp" />
455+
<ClInclude Include="runtime\RuntimeContactTransport.hpp" />
456+
<ClInclude Include="runtime\RuntimeHeatTransport.hpp" />
457+
<ClInclude Include="runtime\RemeshController.hpp" />
458+
<ClInclude Include="runtime\RuntimeRemeshTransport.hpp" />
459+
<ClInclude Include="runtime\RuntimeVoronoiTransport.hpp" />
449460
<ClInclude Include="vulkan\CommandBufferManager.hpp" />
450461
<ClInclude Include="util\ComputeTiming.hpp" />
451462
<ClInclude Include="framegraph\FrameController.hpp" />
@@ -465,8 +476,9 @@ xcopy /y /d "C:\Qt\6.9.3\msvc2022_64\plugins\platforms\qwindows.dll" "$(OutDir)p
465476
<ClInclude Include="runtime\ContactPreviewStore.hpp" />
466477
<ClInclude Include="runtime\ComputeCache.hpp" />
467478
<ClInclude Include="runtime\RuntimePackageCompiler.hpp" />
479+
<ClInclude Include="runtime\RuntimePackageSync.hpp" />
468480
<ClInclude Include="runtime\RuntimePackages.hpp" />
469-
<ClInclude Include="runtime\RuntimePayloadController.hpp" />
481+
<ClInclude Include="runtime\RuntimePackageController.hpp" />
470482
<ClInclude Include="runtime\RuntimeContactTypes.hpp" />
471483
<ClInclude Include="runtime\RuntimeThermalTypes.hpp" />
472484
<ClInclude Include="runtime\RuntimeController.hpp" />

HeatSpectra/HeatSpectra.vcxproj.filters

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,19 @@
8484
<ClCompile Include="runtime\ComputeCache.cpp">
8585
<Filter>Source Files</Filter>
8686
</ClCompile>
87+
<ClCompile Include="runtime\RemeshController.cpp">
88+
<Filter>Source Files</Filter>
89+
</ClCompile>
8790
<ClCompile Include="runtime\RuntimePackageCompiler.cpp">
8891
<Filter>Source Files</Filter>
8992
</ClCompile>
90-
<ClCompile Include="runtime\RuntimePayloadController.cpp">
93+
<ClCompile Include="runtime\RuntimePackageSync.cpp">
94+
<Filter>Source Files</Filter>
95+
</ClCompile>
96+
<ClCompile Include="runtime\RuntimePackageController.cpp">
97+
<Filter>Source Files</Filter>
98+
</ClCompile>
99+
<ClCompile Include="runtime\RuntimeModelTransport.cpp">
91100
<Filter>Source Files</Filter>
92101
</ClCompile>
93102
<ClCompile Include="runtime\RuntimeController.cpp">
@@ -159,9 +168,6 @@
159168
<ClCompile Include="heat\HeatSystemSurfaceRuntime.cpp">
160169
<Filter>Source Files</Filter>
161170
</ClCompile>
162-
<ClCompile Include="heat\HeatSystemResources.cpp">
163-
<Filter>Source Files</Filter>
164-
</ClCompile>
165171
<ClCompile Include="heat\HeatSystemVoronoiStage.cpp">
166172
<Filter>Source Files</Filter>
167173
</ClCompile>
@@ -715,10 +721,13 @@
715721
<ClInclude Include="runtime\RuntimePackageCompiler.hpp">
716722
<Filter>Header Files</Filter>
717723
</ClInclude>
724+
<ClInclude Include="runtime\RuntimePackageSync.hpp">
725+
<Filter>Header Files</Filter>
726+
</ClInclude>
718727
<ClInclude Include="runtime\RuntimePackages.hpp">
719728
<Filter>Header Files</Filter>
720729
</ClInclude>
721-
<ClInclude Include="runtime\RuntimePayloadController.hpp">
730+
<ClInclude Include="runtime\RuntimePackageController.hpp">
722731
<Filter>Header Files</Filter>
723732
</ClInclude>
724733
<ClInclude Include="runtime\RuntimeContactTypes.hpp">
@@ -1204,6 +1213,33 @@
12041213
<ClInclude Include="nodegraph\NodeGraphUtils.hpp">
12051214
<Filter>Header Files</Filter>
12061215
</ClInclude>
1216+
<ClInclude Include="domain\RemeshData.hpp">
1217+
<Filter>Header Files</Filter>
1218+
</ClInclude>
1219+
<ClInclude Include="nodegraph\NodeGraphCoreTypes.hpp">
1220+
<Filter>Header Files</Filter>
1221+
</ClInclude>
1222+
<ClInclude Include="runtime\RuntimeVoronoiTransport.hpp">
1223+
<Filter>Header Files</Filter>
1224+
</ClInclude>
1225+
<ClInclude Include="runtime\RuntimeContactTransport.hpp">
1226+
<Filter>Header Files</Filter>
1227+
</ClInclude>
1228+
<ClInclude Include="runtime\RuntimeHeatTransport.hpp">
1229+
<Filter>Header Files</Filter>
1230+
</ClInclude>
1231+
<ClInclude Include="runtime\RemeshController.hpp">
1232+
<Filter>Header Files</Filter>
1233+
</ClInclude>
1234+
<ClInclude Include="runtime\RuntimeRemeshTransport.hpp">
1235+
<Filter>Header Files</Filter>
1236+
</ClInclude>
1237+
<ClInclude Include="domain\GeometryData.hpp">
1238+
<Filter>Header Files</Filter>
1239+
</ClInclude>
1240+
<ClInclude Include="domain\HeatData.hpp">
1241+
<Filter>Header Files</Filter>
1242+
</ClInclude>
12071243
</ItemGroup>
12081244
<ItemGroup>
12091245
<QtMoc Include="app\MainQt.h">

HeatSpectra/HeatSpectra.vcxproj.user

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
77
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
88
</PropertyGroup>
9+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
10+
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
11+
</PropertyGroup>
912
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
1013
<QtTouchProperty>
1114
</QtTouchProperty>

HeatSpectra/app/SwapchainStage.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ void SwapchainStage::cleanupSwapChain() {
5454
swapchainManager.cleanup();
5555
}
5656

57-
void SwapchainStage::setSystems(HeatSystem* updatedHeatSystem, VoronoiSystem* updatedVoronoiSystem) {
58-
heatSystem = updatedHeatSystem;
59-
voronoiSystem = updatedVoronoiSystem;
60-
}
61-
62-
void SwapchainStage::setHeatSystem(HeatSystem* updatedHeatSystem) {
63-
heatSystem = updatedHeatSystem;
64-
}
65-
6657
bool SwapchainStage::recreateSwapChain() {
6758
if (isShuttingDown.load(std::memory_order_acquire)) {
6859
return false;

HeatSpectra/app/SwapchainStage.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ class SwapchainStage {
3535
void shutdownSyncObjects();
3636
void cleanupSwapChain();
3737
bool recreateSwapChain();
38-
void setSystems(HeatSystem* heatSystem, VoronoiSystem* voronoiSystem);
39-
void setHeatSystem(HeatSystem* heatSystem);
4038

4139
FrameStageResult acquireFrameImage(uint32_t& imageIndex);
4240
FrameStageResult presentFrame(uint32_t imageIndex);
Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#include "ContactSystem.hpp"
22

3+
#include <glm/glm.hpp>
4+
35
#include <vector>
46

5-
bool ContactSystem::hasUsableContactPairs(const std::vector<ContactPair>& pairs) {
7+
namespace {
8+
9+
bool hasUsableContactPairs(const std::vector<ContactPair>& pairs) {
610
for (const ContactPair& pair : pairs) {
711
if (pair.contactArea > 0.0f) {
812
return true;
@@ -11,31 +15,42 @@ bool ContactSystem::hasUsableContactPairs(const std::vector<ContactPair>& pairs)
1115

1216
return false;
1317
}
18+
}
1419

15-
bool ContactSystem::compute(const ContactPairPayloadConfig& pair, Result& outResult) {
20+
static bool computeContactPairs(
21+
ContactInterface& contactInterface,
22+
const GeometryData& emitterGeometry,
23+
const SupportingHalfedge::IntrinsicMesh& emitterIntrinsicMesh,
24+
const GeometryData& receiverGeometry,
25+
const SupportingHalfedge::IntrinsicMesh& receiverIntrinsicMesh,
26+
ContactCouplingType couplingType,
27+
float minNormalDot,
28+
float contactRadius,
29+
ContactSystem::Result& outResult) {
30+
(void)couplingType;
1631
outResult = {};
17-
if (pair.emitter.geometryHandle.key == 0 ||
18-
pair.receiver.geometryHandle.key == 0 ||
19-
pair.emitter.geometryHandle == pair.receiver.geometryHandle ||
20-
pair.emitter.intrinsic.vertices.empty() ||
21-
pair.receiver.intrinsic.vertices.empty()) {
32+
if (emitterGeometry.modelId == 0 ||
33+
receiverGeometry.modelId == 0 ||
34+
emitterGeometry.modelId == receiverGeometry.modelId ||
35+
emitterIntrinsicMesh.vertices.empty() ||
36+
receiverIntrinsicMesh.vertices.empty()) {
2237
return false;
2338
}
2439

2540
ContactInterface::Settings settings{};
26-
settings.minNormalDot = pair.minNormalDot;
27-
settings.contactRadius = pair.contactRadius;
41+
settings.minNormalDot = minNormalDot;
42+
settings.contactRadius = contactRadius;
2843

2944
std::vector<std::vector<ContactPair>> receiverContactPairs;
30-
std::vector<const IntrinsicMeshData*> receiverIntrinsics;
45+
std::vector<const SupportingHalfedge::IntrinsicMesh*> receiverIntrinsicMeshes;
3146
std::vector<std::array<float, 16>> receiverLocalToWorld;
32-
receiverIntrinsics.push_back(&pair.receiver.intrinsic);
33-
receiverLocalToWorld.push_back(pair.receiver.geometry.localToWorld);
47+
receiverIntrinsicMeshes.push_back(&receiverIntrinsicMesh);
48+
receiverLocalToWorld.push_back(receiverGeometry.localToWorld);
3449

3550
contactInterface.mapSurfacePoints(
36-
pair.emitter.intrinsic,
37-
pair.emitter.geometry.localToWorld,
38-
receiverIntrinsics,
51+
emitterIntrinsicMesh,
52+
emitterGeometry.localToWorld,
53+
receiverIntrinsicMeshes,
3954
receiverLocalToWorld,
4055
receiverContactPairs,
4156
outResult.outlineVertices,
@@ -48,3 +63,16 @@ bool ContactSystem::compute(const ContactPairPayloadConfig& pair, Result& outRes
4863
outResult.hasContact = hasUsableContactPairs(outResult.pairs);
4964
return outResult.hasContact;
5065
}
66+
67+
bool ContactSystem::compute(const RuntimeContactPairConfig& pair, Result& outResult) {
68+
return computeContactPairs(
69+
contactInterface,
70+
pair.emitter.geometry,
71+
pair.emitter.intrinsicMesh,
72+
pair.receiver.geometry,
73+
pair.receiver.intrinsicMesh,
74+
pair.couplingType,
75+
pair.minNormalDot,
76+
pair.contactRadius,
77+
outResult);
78+
}

HeatSpectra/contact/ContactSystem.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "heat/ContactInterface.hpp"
44
#include "ContactTypes.hpp"
5+
#include "runtime/RuntimeContactTypes.hpp"
56

67
#include <vector>
78

@@ -15,10 +16,7 @@ class ContactSystem {
1516
};
1617

1718
ContactSystem() = default;
18-
bool compute(const ContactPairPayloadConfig& pair, Result& outResult);
19-
20-
private:
21-
static bool hasUsableContactPairs(const std::vector<ContactPair>& pairs);
19+
bool compute(const RuntimeContactPairConfig& pair, Result& outResult);
2220

2321
ContactInterface contactInterface;
2422
};

0 commit comments

Comments
 (0)