Skip to content

Commit

Permalink
Move core datastructures into their own directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-van-bergen committed Jan 12, 2022
1 parent 04035af commit b9f49f6
Show file tree
Hide file tree
Showing 70 changed files with 182 additions and 176 deletions.
34 changes: 17 additions & 17 deletions Pathtracer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@
<ClCompile Include="Src\BVH\BVH.cpp" />
<ClCompile Include="Src\BVH\BVHCollapser.cpp" />
<ClCompile Include="Src\BVH\BVHOptimizer.cpp" />
<ClCompile Include="Src\Core\Format.cpp" />
<ClCompile Include="Src\Core\IO.cpp" />
<ClCompile Include="Src\Core\Mutex.cpp" />
<ClCompile Include="Src\Device\CUDAContext.cpp" />
<ClCompile Include="Src\Device\CUDAMemory.cpp" />
<ClCompile Include="Src\Device\CUDAModule.cpp" />
Expand All @@ -234,10 +237,7 @@
<ClCompile Include="Src\Pathtracer\Sky.cpp" />
<ClCompile Include="Src\Pathtracer\Texture.cpp" />
<ClCompile Include="Src\Util\BlueNoise.cpp" />
<ClCompile Include="Src\Util\Format.cpp" />
<ClCompile Include="Src\Util\Geometry.cpp" />
<ClCompile Include="Src\Util\IO.cpp" />
<ClCompile Include="Src\Util\Mutex.cpp" />
<ClCompile Include="Src\Util\PerfTest.cpp" />
<ClCompile Include="Src\Util\PMJ.cpp" />
<ClCompile Include="Src\Util\Shader.cpp" />
Expand Down Expand Up @@ -273,6 +273,20 @@
<ClInclude Include="Src\BVH\BVHCollapser.h" />
<ClInclude Include="Src\BVH\BVHOptimizer.h" />
<ClInclude Include="Src\Config.h" />
<ClInclude Include="Src\Core\Array.h" />
<ClInclude Include="Src\Core\Assertion.h" />
<ClInclude Include="Src\Core\BitArray.h" />
<ClInclude Include="Src\Core\Format.h" />
<ClInclude Include="Src\Core\HashMap.h" />
<ClInclude Include="Src\Core\IO.h" />
<ClInclude Include="Src\Core\MinHeap.h" />
<ClInclude Include="Src\Core\Mutex.h" />
<ClInclude Include="Src\Core\OwnPtr.h" />
<ClInclude Include="Src\Core\Parser.h" />
<ClInclude Include="Src\Core\Queue.h" />
<ClInclude Include="Src\Core\ScopeTimer.h" />
<ClInclude Include="Src\Core\String.h" />
<ClInclude Include="Src\Core\StringView.h" />
<ClInclude Include="Src\Device\CUDACall.h" />
<ClInclude Include="Src\Device\CUDAContext.h" />
<ClInclude Include="Src\Device\CUDAEvent.h" />
Expand All @@ -298,27 +312,13 @@
<ClInclude Include="Src\Pathtracer\Sky.h" />
<ClInclude Include="Src\Pathtracer\Texture.h" />
<ClInclude Include="Src\Pathtracer\Triangle.h" />
<ClInclude Include="Src\Util\Array.h" />
<ClInclude Include="Src\Util\Assertion.h" />
<ClInclude Include="Src\Util\BitArray.h" />
<ClInclude Include="Src\Util\BlueNoise.h" />
<ClInclude Include="Src\Util\Format.h" />
<ClInclude Include="Src\Util\Geometry.h" />
<ClInclude Include="Src\Util\HashMap.h" />
<ClInclude Include="Src\Util\IO.h" />
<ClInclude Include="Src\Util\Mutex.h" />
<ClInclude Include="Src\Util\OwnPtr.h" />
<ClInclude Include="Src\Util\Parser.h" />
<ClInclude Include="Src\Util\PerfTest.h" />
<ClInclude Include="Src\Util\PMJ.h" />
<ClInclude Include="Src\Util\MinHeap.h" />
<ClInclude Include="Src\Util\Queue.h" />
<ClInclude Include="Src\Util\Random.h" />
<ClInclude Include="Src\Util\ScopeTimer.h" />
<ClInclude Include="Src\Util\Shader.h" />
<ClInclude Include="Src\Util\String.h" />
<ClInclude Include="Src\Util\StringUtil.h" />
<ClInclude Include="Src\Util\StringView.h" />
<ClInclude Include="Src\Util\ThreadPool.h" />
<ClInclude Include="Src\Util\Util.h" />
<ClInclude Include="Src\Window.h" />
Expand Down
93 changes: 48 additions & 45 deletions Pathtracer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@
<ClCompile Include="Src\BVH\BVHCollapser.cpp">
<Filter>BVH</Filter>
</ClCompile>
<ClCompile Include="Src\Util\Mutex.cpp">
<Filter>Util</Filter>
</ClCompile>
<ClCompile Include="Src\Assets\Mitsuba\MitsubaLoader.cpp">
<Filter>Assets\Mitsuba</Filter>
</ClCompile>
Expand Down Expand Up @@ -133,11 +130,14 @@
<ClCompile Include="Src\Util\StringUtil.cpp">
<Filter>Util</Filter>
</ClCompile>
<ClCompile Include="Src\Util\IO.cpp">
<Filter>Util</Filter>
<ClCompile Include="Src\Core\Mutex.cpp">
<Filter>Core</Filter>
</ClCompile>
<ClCompile Include="Src\Util\Format.cpp">
<Filter>Util</Filter>
<ClCompile Include="Src\Core\Format.cpp">
<Filter>Core</Filter>
</ClCompile>
<ClCompile Include="Src\Core\IO.cpp">
<Filter>Core</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -168,6 +168,9 @@
<Filter Include="Device">
<UniqueIdentifier>{05d166cc-0368-4859-a6e2-171631634c79}</UniqueIdentifier>
</Filter>
<Filter Include="Core">
<UniqueIdentifier>{87976692-3c4f-4690-bdef-efd0d64a9f29}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Imgui\imconfig.h">
Expand Down Expand Up @@ -251,15 +254,9 @@
<ClInclude Include="Src\Pathtracer\Triangle.h">
<Filter>Pathtracer</Filter>
</ClInclude>
<ClInclude Include="Src\Util\BitArray.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\PerfTest.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\ScopeTimer.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Util.h">
<Filter>Util</Filter>
</ClInclude>
Expand All @@ -286,27 +283,12 @@
<ClInclude Include="Src\Util\Geometry.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\StringView.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\ThreadPool.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Math\Mipmap.h">
<Filter>Math</Filter>
</ClInclude>
<ClInclude Include="Src\Util\HashMap.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Array.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\String.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Parser.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Assets\PLYLoader.h">
<Filter>Assets</Filter>
</ClInclude>
Expand All @@ -319,18 +301,9 @@
<ClInclude Include="Src\BVH\BVHCollapser.h">
<Filter>BVH</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Mutex.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\MinHeap.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Random.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Queue.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Config.h" />
<ClInclude Include="Src\Assets\Mitsuba\MitsubaLoader.h">
<Filter>Assets\Mitsuba</Filter>
Expand Down Expand Up @@ -377,17 +350,47 @@
<ClInclude Include="Src\Util\StringUtil.h">
<Filter>Util</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Assertion.h">
<Filter>Util</Filter>
<ClInclude Include="Src\Core\Mutex.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Util\Format.h">
<Filter>Util</Filter>
<ClInclude Include="Src\Core\OwnPtr.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Util\IO.h">
<Filter>Util</Filter>
<ClInclude Include="Src\Core\Parser.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Util\OwnPtr.h">
<Filter>Util</Filter>
<ClInclude Include="Src\Core\Queue.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\ScopeTimer.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\String.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\StringView.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\Array.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\Assertion.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\BitArray.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\Format.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\HashMap.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\IO.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Src\Core\MinHeap.h">
<Filter>Core</Filter>
</ClInclude>
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions Src/Assets/AssetManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "AssetManager.h"

#include "Core/IO.h"
#include "Core/ScopeTimer.h"

#include "Math/Vector4.h"

#include "BVHLoader.h"
Expand All @@ -11,9 +14,7 @@
#include "BVH/BVHOptimizer.h"

#include "Util/Util.h"
#include "Util/IO.h"
#include "Util/StringUtil.h"
#include "Util/ScopeTimer.h"
#include "Util/ThreadPool.h"

BVH2 AssetManager::build_bvh(const Array<Triangle> & triangles) {
Expand Down
10 changes: 5 additions & 5 deletions Src/Assets/AssetManager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#pragma once
#include "Core/Array.h"
#include "Core/HashMap.h"
#include "Core/String.h"
#include "Core/Mutex.h"

#include "Pathtracer/MeshData.h"
#include "Pathtracer/Material.h"
#include "Pathtracer/Medium.h"
Expand All @@ -7,11 +12,6 @@
#include "BVHLoader.h"
#include "BVH/BVHCollapser.h"

#include "Util/Array.h"
#include "Util/HashMap.h"
#include "Util/String.h"
#include "Util/Mutex.h"

struct ThreadPool;

struct AssetManager {
Expand Down
5 changes: 3 additions & 2 deletions Src/Assets/BVHLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#include <stdio.h>
#include <string.h>

#include "Core/IO.h"
#include "Core/Parser.h"

#include "Util/Util.h"
#include "Util/IO.h"
#include "Util/Parser.h"
#include "Util/StringUtil.h"

String BVHLoader::get_bvh_filename(StringView filename) {
Expand Down
6 changes: 3 additions & 3 deletions Src/Assets/BVHLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

#include "Config.h"

#include "Core/String.h"
#include "Core/StringView.h"

#include "BVH/BVH.h"
#include "Pathtracer/MeshData.h"

#include "Util/String.h"
#include "Util/StringView.h"

namespace BVHLoader {
inline constexpr const char * BVH_FILE_EXTENSION = ".bvh";
inline constexpr int BVH_FILETYPE_VERSION = 5;
Expand Down
4 changes: 2 additions & 2 deletions Src/Assets/Mitsuba/MitshairLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "MitshairLoader.h"

#include "Core/Array.h"

#include "Math/Quaternion.h"

#include "Pathtracer/Triangle.h"

#include "Util/Array.h"

Array<Triangle> MitshairLoader::load(const String & filename, SourceLocation location_in_mitsuba_file, float radius) {
String file = IO::file_read(filename);

Expand Down
4 changes: 2 additions & 2 deletions Src/Assets/Mitsuba/MitshairLoader.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include "Util/Array.h"
#include "Util/Parser.h"
#include "Core/Array.h"
#include "Core/Parser.h"

struct Triangle;

Expand Down
14 changes: 6 additions & 8 deletions Src/Assets/Mitsuba/MitsubaLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@
#include <stdio.h>
#include <stdlib.h>

#include "Core/Array.h"
#include "Core/HashMap.h"
#include "Core/Format.h"
#include "Core/Parser.h"
#include "Core/StringView.h"

#include "Assets/BVHLoader.h"
#include "Assets/OBJLoader.h"
#include "Assets/PLYLoader.h"

#include "BVH/Builders/BVHBuilder.h"
#include "BVH/Builders/CWBVHBuilder.h"

#include "Pathtracer/Scene.h"
#include "Pathtracer/MeshData.h"

#include "Util/Util.h"
#include "Util/Array.h"
#include "Util/HashMap.h"
#include "Util/Format.h"
#include "Util/Parser.h"
#include "Util/Geometry.h"
#include "Util/StringView.h"

#include "XMLParser.h"
#include "MitshairLoader.h"
Expand Down
2 changes: 1 addition & 1 deletion Src/Assets/Mitsuba/SerializedLoader.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <stdint.h>

#include "Util/Parser.h"
#include "Core/Parser.h"

struct Triangle;
struct XMLNode;
Expand Down
4 changes: 2 additions & 2 deletions Src/Assets/Mitsuba/XMLParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include "Math/Vector3.h"
#include "Math/Matrix4.h"

#include "Util/Array.h"
#include "Util/Parser.h"
#include "Core/Array.h"
#include "Core/Parser.h"

struct XMLAttribute {
StringView name;
Expand Down
8 changes: 4 additions & 4 deletions Src/Assets/OBJLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "OBJLoader.h"

#include "Core/Array.h"
#include "Core/Parser.h"
#include "Core/String.h"

#include "Math/Vector2.h"
#include "Math/Vector3.h"

#include "Util/Array.h"
#include "Util/Parser.h"
#include "Util/String.h"

static float parse_float(Parser & parser) {
parser.skip_whitespace();
return parser.parse_float();
Expand Down
2 changes: 1 addition & 1 deletion Src/Assets/OBJLoader.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "Pathtracer/Triangle.h"

#include "Util/String.h"
#include "Core/String.h"

namespace OBJLoader {
Array<Triangle> load(const String & filename);
Expand Down
Loading

0 comments on commit b9f49f6

Please sign in to comment.