├── .github └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md └── gladius ├── .clang-format ├── .clang-tidy ├── CMakeLists.txt ├── CMakePresets.json ├── LICENSE ├── LICENSE.txt ├── components ├── fonts │ ├── Roboto-Medium.ttf │ └── fontawesome-free-5.14.0-web │ │ ├── LICENSE.txt │ │ ├── fa-regular-400.ttf │ │ └── fa-solid-900.ttf └── licenses │ ├── IconFontCppHeaders │ ├── LICENSE │ └── url │ ├── blosc │ ├── LICENSE │ └── url │ ├── boost │ ├── LICENSE │ └── url │ ├── eigen3 │ ├── LICENSE │ └── url │ ├── fmt │ ├── LICENSE │ └── url │ ├── glad │ ├── LICENSE │ └── url │ ├── glew │ ├── LICENSE │ └── url │ ├── glfw3 │ ├── LICENSE │ └── url │ ├── gtest │ ├── LICENSE │ └── url │ ├── imgui-node-editor │ ├── LICENSE │ └── url │ ├── imgui │ ├── LICENSE │ └── url │ ├── jsoncpp │ ├── LICENSE │ └── url │ ├── lodepng │ ├── LICENSE │ └── url │ ├── lz4 │ ├── LICENSE │ └── url │ ├── nanovdb │ ├── LICENSE │ └── url │ ├── nlopt │ ├── LICENSE │ └── url │ ├── opencl │ ├── LICENSE │ └── url │ ├── openexr │ ├── LICENSE │ └── url │ ├── openmesh │ ├── LICENSE │ └── url │ ├── openvdb │ ├── LICENSE │ └── url │ ├── platform_folders │ ├── LICENSE │ └── url │ ├── psimpl │ ├── LICENSE │ └── url │ ├── stb │ ├── LICENSE │ └── url │ ├── tbb │ ├── LICENSE │ └── url │ ├── tinyfiledialogs │ ├── LICENSE │ └── url │ ├── zlib │ ├── LICENSE │ └── url │ └── zstd │ ├── LICENSE │ └── url ├── create_bom.sh ├── documentation └── img │ ├── banner.png │ ├── dialog.png │ ├── difference.jpg │ ├── eyecatcher.jpg │ ├── eyecatcher.png │ ├── gladius.ico │ ├── gladius_animation.gif │ └── gladius_screenshot.jpg ├── examples ├── implicit │ ├── 3mf-implicit.3mf │ ├── RadialRadiator.3mf │ ├── SphereInACage.3mf │ └── keyboard │ │ ├── 2x_tpu_attachablefoot.3mf │ │ ├── 2x_tpu_bottomcover.3mf │ │ ├── 2x_tpu_pla_jogwheel_color.3mf │ │ ├── 2x_wing.3mf │ │ ├── 2xmirrored_honeycombecase.3mf │ │ └── buzzingbeekeyboard.jpg ├── template.3mf └── volumetric │ └── 3mf-image3d.3mf ├── src ├── Application.cpp ├── Application.h ├── BBox.h ├── BitmapChannel.cpp ├── BitmapChannel.h ├── BitmapLayer.h ├── Buffer.h ├── CLMath.cpp ├── CLMath.h ├── CLProgram.cpp ├── CLProgram.h ├── CMakeLists.txt ├── CliReader.cpp ├── CliReader.h ├── CliWriter.cpp ├── CliWriter.h ├── ComputeContext.cpp ├── ComputeContext.h ├── Contour.h ├── ContourExtractor.cpp ├── ContourExtractor.h ├── Document.cpp ├── Document.h ├── EventLogger.cpp ├── EventLogger.h ├── FileSystemUtils.cpp ├── FileSystemUtils.h ├── GLImageBuffer.cpp ├── GLImageBuffer.h ├── ImageBuffer.h ├── ImageRGBA.h ├── ImageStackOCL.cpp ├── ImageStackOCL.h ├── ImageStackOCLBuffer.cpp ├── ImageStackOCLBuffer.h ├── ImageStackResource.cpp ├── ImageStackResource.h ├── KernelReplacements.h ├── Mesh.h ├── MeshResource.cpp ├── MeshResource.h ├── ModelState.h ├── PathBuilder.cpp ├── PathBuilder.h ├── Primitives.h ├── Profiling.h ├── ProgramBase.cpp ├── ProgramBase.h ├── RenderProgram.cpp ├── RenderProgram.h ├── ResourceContext.cpp ├── ResourceContext.h ├── ResourceKey.h ├── ResourceManager.cpp ├── ResourceManager.h ├── SlicerProgram.cpp ├── SlicerProgram.h ├── StlResource.h ├── SvgWriter.cpp ├── SvgWriter.h ├── TimeMeasurement.h ├── VdbResource.cpp ├── VdbResource.h ├── api │ ├── ACT.xsd │ ├── CMakeLists.txt │ ├── CSharp │ │ └── GladiusLib.cs │ ├── Gladius.xml │ └── GladiusLib_component │ │ ├── Bindings │ │ ├── CDynamic │ │ │ ├── gladius_dynamic.cc │ │ │ ├── gladius_dynamic.h │ │ │ └── gladius_types.h │ │ ├── CSharp │ │ │ └── GladiusLib.cs │ │ ├── Cpp │ │ │ ├── gladius_abi.hpp │ │ │ ├── gladius_implicit.hpp │ │ │ └── gladius_types.hpp │ │ ├── CppDynamic │ │ │ ├── gladius_abi.hpp │ │ │ ├── gladius_dynamic.h │ │ │ ├── gladius_dynamic.hpp │ │ │ └── gladius_types.hpp │ │ └── Python │ │ │ └── GladiusLib.py │ │ ├── Examples │ │ ├── CDynamic │ │ │ ├── CMakeLists.txt │ │ │ └── GladiusLib_example.c │ │ ├── CSharp │ │ │ ├── GladiusLib_Example.cs │ │ │ ├── GladiusLib_Example.csproj │ │ │ ├── GladiusLib_Example.sln │ │ │ └── obj │ │ │ │ └── x64 │ │ │ │ ├── Debug │ │ │ │ └── netcoreapp2.0 │ │ │ │ │ ├── .NETCoreApp,Version=v2.0.AssemblyAttributes.cs │ │ │ │ │ ├── GladiusLib_Example.AssemblyInfo.cs │ │ │ │ │ ├── GladiusLib_Example.AssemblyInfoInputs.cache │ │ │ │ │ └── GladiusLib_Example.GeneratedMSBuildEditorConfig.editorconfig │ │ │ │ └── Release │ │ │ │ └── netcoreapp2.0 │ │ │ │ ├── .NETCoreApp,Version=v2.0.AssemblyAttributes.cs │ │ │ │ ├── GladiusLib_Example.AssemblyInfo.cs │ │ │ │ ├── GladiusLib_Example.AssemblyInfoInputs.cache │ │ │ │ └── GladiusLib_Example.GeneratedMSBuildEditorConfig.editorconfig │ │ ├── Cpp │ │ │ ├── CMakeLists.txt │ │ │ └── GladiusLib_example.cpp │ │ ├── CppDynamic │ │ │ ├── CMakeLists.txt │ │ │ └── GladiusLib_example.cpp │ │ └── Python │ │ │ ├── GladiusLib_Example.py │ │ │ ├── ToyTrack.py │ │ │ └── VCore3PanelRight.py │ │ ├── Implementations │ │ └── Cpp │ │ │ ├── CMakeLists.txt │ │ │ ├── Interfaces │ │ │ ├── gladius_abi.hpp │ │ │ ├── gladius_interfaceexception.cpp │ │ │ ├── gladius_interfaceexception.hpp │ │ │ ├── gladius_interfaces.hpp │ │ │ ├── gladius_interfacewrapper.cpp │ │ │ └── gladius_types.hpp │ │ │ └── Stub │ │ │ ├── gladius.cpp │ │ │ ├── gladius_base.cpp │ │ │ ├── gladius_base.hpp │ │ │ ├── gladius_boundingbox.cpp │ │ │ ├── gladius_boundingbox.hpp │ │ │ ├── gladius_channelaccessor.cpp │ │ │ ├── gladius_channelaccessor.hpp │ │ │ ├── gladius_contouraccessor.cpp │ │ │ ├── gladius_contouraccessor.hpp │ │ │ ├── gladius_detailederroraccessor.cpp │ │ │ ├── gladius_detailederroraccessor.hpp │ │ │ ├── gladius_face.cpp │ │ │ ├── gladius_face.hpp │ │ │ ├── gladius_faceaccessor.cpp │ │ │ ├── gladius_faceaccessor.hpp │ │ │ ├── gladius_gladius.cpp │ │ │ ├── gladius_gladius.hpp │ │ │ ├── gladius_polygonaccessor.cpp │ │ │ ├── gladius_polygonaccessor.hpp │ │ │ ├── gladius_resourceaccessor.cpp │ │ │ └── gladius_resourceaccessor.hpp │ │ └── license.txt ├── compute │ ├── CMakeLists.txt │ ├── ComputeCore.cpp │ ├── ComputeCore.h │ ├── ProgramManager.cpp │ ├── ProgramManager.h │ ├── Rendering.cpp │ ├── Rendering.h │ └── types.h ├── contour │ ├── CMakeLists.txt │ ├── ContourValidator.cpp │ ├── ContourValidator.h │ ├── PointsToContour.cpp │ ├── PointsToContour.h │ ├── QuadTree.cpp │ ├── QuadTree.h │ ├── utils.cpp │ └── utils.h ├── exceptions.cpp ├── exceptions.h ├── gladius.ico ├── gladius.rc ├── gladius.rc.res ├── gpgpu.h ├── imgui.ini ├── io │ ├── 3mf │ │ ├── ImageExtractor.cpp │ │ ├── ImageExtractor.h │ │ ├── ImageStack.h │ │ ├── ImageStackCreator.cpp │ │ ├── ImageStackCreator.h │ │ ├── Importer3mf.cpp │ │ ├── Importer3mf.h │ │ ├── Writer3mf.cpp │ │ └── Writer3mf.h │ ├── CMakeLists.txt │ ├── IExporter.h │ ├── ImageStackExporter.cpp │ ├── ImageStackExporter.h │ ├── ImporterVdb.cpp │ ├── ImporterVdb.h │ ├── MeshExporter.cpp │ ├── MeshExporter.h │ ├── VdbImporter.cpp │ ├── VdbImporter.h │ └── vdb.h ├── kernel │ ├── .clang-format │ ├── CNanoVDB.h │ ├── arguments.h │ ├── commands.cl │ ├── distanceUpDown.cl │ ├── model.cl │ ├── renderer.cl │ ├── renderer.h │ ├── rendering.cl │ ├── rendering.h │ ├── sampler.h │ ├── sdf.cl │ ├── sdf.h │ ├── sdf_generator.cl │ ├── sdf_generator.h │ └── types.h ├── main.cpp ├── nodes │ ├── Assembly.cpp │ ├── Assembly.h │ ├── BuildItem.cpp │ ├── BuildItem.h │ ├── BuildParameter.h │ ├── Builder.cpp │ ├── Builder.h │ ├── CMakeLists.txt │ ├── ClonableNode.h │ ├── Commands.h │ ├── Component.cpp │ ├── Component.h │ ├── Components.cpp │ ├── Components.h │ ├── DerivedNodes.cpp │ ├── DerivedNodes.h │ ├── GraphFlattener.cpp │ ├── GraphFlattener.h │ ├── History.cpp │ ├── History.h │ ├── Model.cpp │ ├── Model.h │ ├── NodeBase.cpp │ ├── NodeBase.h │ ├── NodesWithSpezializedAccesors.h │ ├── Object.cpp │ ├── Object.h │ ├── OptimizeOutputs.cpp │ ├── OptimizeOutputs.h │ ├── Parameter.cpp │ ├── Parameter.h │ ├── Port.cpp │ ├── Port.h │ ├── ToCommandStreamVisitor.cpp │ ├── ToCommandStreamVisitor.h │ ├── ToOCLVisitor.cpp │ ├── ToOCLVisitor.h │ ├── Validator.cpp │ ├── Validator.h │ ├── Visitor.cpp │ ├── Visitor.h │ ├── graph │ │ ├── CMakeLists.txt │ │ ├── DirectedGraph.cpp │ │ ├── DirectedGraph.h │ │ ├── GraphAlgorithms.cpp │ │ ├── GraphAlgorithms.h │ │ └── IDirectedGraph.h │ ├── nodesfwd.h │ ├── types.h │ ├── utils.cpp │ └── utils.h ├── scopeguard.h ├── types.h ├── ui │ ├── AboutDialog.cpp │ ├── AboutDialog.h │ ├── CMakeLists.txt │ ├── CliExportDialog.cpp │ ├── CliExportDialog.h │ ├── FileChooser.cpp │ ├── FileChooser.h │ ├── GLView.cpp │ ├── GLView.h │ ├── ImageStackExportDialog.cpp │ ├── ImageStackExportDialog.h │ ├── InputList.cpp │ ├── InputList.h │ ├── LogView.cpp │ ├── LogView.h │ ├── MainWindow.cpp │ ├── MainWindow.h │ ├── MeshExportDialog.cpp │ ├── MeshExportDialog.h │ ├── ModelEditor.cpp │ ├── ModelEditor.h │ ├── NodeView.cpp │ ├── NodeView.h │ ├── OrbitalCamera.cpp │ ├── OrbitalCamera.h │ ├── Outline.cpp │ ├── Outline.h │ ├── RenderWindow.cpp │ ├── RenderWindow.h │ ├── ResourceView.cpp │ ├── ResourceView.h │ ├── SliceView.cpp │ ├── SliceView.h │ ├── Style.cpp │ ├── Style.h │ ├── Widgets.cpp │ ├── Widgets.h │ ├── imguinodeeditor.h │ ├── wordwarp.cpp │ └── wordwarp.h ├── version.h └── version.h.in ├── tests ├── CMakeLists.txt ├── integrationtests │ ├── CMakeLists.txt │ ├── GladiusLib_tests.cpp │ ├── Slice_tests.cpp │ ├── main.cpp │ ├── testdata.h │ ├── testdata │ │ ├── F360.3mf │ │ └── ImplicitGyroid.3mf │ ├── testhelper.cpp │ └── testhelper.h └── unittests │ ├── Assembly_tests.cpp │ ├── BoundingBoxDetermination_tests.cpp │ ├── Builder_tests.cpp │ ├── CLPrgram_tests.cpp │ ├── CMakeLists.txt │ ├── CliReader_tests.cpp │ ├── ComputeCore_tests.cpp │ ├── ContourValidator_tests.cpp │ ├── ImageExtractor_tests.cpp │ ├── ImageStackExporter_tests.cpp │ ├── Interpolation_tests.cpp │ ├── ModelState_tests.cpp │ ├── Model_tests.cpp │ ├── PointsToContour_tests.cpp │ ├── QuadTree_tests.cpp │ ├── SignDetermination_tests.cpp │ ├── ToCommandStreamVisitor_tests.cpp │ ├── Writer3mf_tests.cpp │ ├── main.cpp │ ├── testdata │ ├── Boundary.3mf │ ├── ImplicitGyroid.3mf │ ├── cube.json │ └── new.json │ ├── testhelper.cpp │ └── testhelper.h ├── url ├── vcpkg-overlay-ports ├── imgui-node-editor │ ├── CMakeLists.txt │ ├── fix-vec2-math-operators.patch │ ├── portfile.cmake │ └── vcpkg.json ├── imgui │ ├── CMakeLists.txt │ ├── imgui-config.cmake.in │ ├── portfile.cmake │ └── vcpkg.json ├── lib3mf │ ├── portfile.cmake │ ├── updateToLatestCommit.sh │ └── vcpkg.json └── openvdb │ ├── fix_cmake.patch │ ├── fix_nanovdb.patch │ ├── portfile.cmake │ ├── usage │ ├── vcpkg-cmake-wrapper.cmake.in │ └── vcpkg.json ├── vcpkg-triplets └── x64-windows-gladius.cmake ├── vcpkg.json └── vcpkg.json.in /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.d 3 | *.o.d 4 | *.ipch 5 | gladius/.vs/slnx.sqlite 6 | gladius/.vs/gladius/v15/Browse.VC.opendb 7 | gladius/.vs/gladius/v15/Browse.VC.db 8 | gladius/.vs/ 9 | gladius/build/ 10 | gladius/.vscode/ 11 | .vscode/ 12 | gladius/src/.clangd/ 13 | gladius/tests/.clangd/ 14 | 15 | gladius/tests/compile_commands.json 16 | gladius/src/compile_commands.json 17 | gladius/.clangd/index/* 18 | gladius/src/build/* 19 | 20 | gladius/.cache/* 21 | /gladius/install/ 22 | *.pyc 23 | *.user 24 | *.cli 25 | *.sli 26 | gladius/out/ 27 | *.rej 28 | *.stl 29 | gladius/components/lib3mf/Examples/CSharp/obj/* 30 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "gladius/components/IconFontCppHeaders"] 2 | path = gladius/components/IconFontCppHeaders 3 | url = https://github.com/juliettef/IconFontCppHeaders.git 4 | 5 | [submodule "gladius/components/psimpl"] 6 | path = gladius/components/psimpl 7 | url = https://github.com/dand-oss/psimpl-code.git 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2024, 3MF Consortium 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /gladius/.clang-format: -------------------------------------------------------------------------------- 1 | #Features requiring a newer clang-format version than the one provided by VS2017 are commented out 2 | 3 | #AllowAllArgumentsOnNextLine: false 4 | #AllowAllConstructorInitializersOnNextLine: false 5 | #AllowShortLambdasOnASingleLine: All 6 | #BasedOnStyle: Microsoft 7 | #BreakInheritanceList: BeforeColon 8 | #IncludeBlocksStyle: Preserve 9 | #SpaceAfterLogicalNot: false 10 | #SpaceBeforeCpp11BracedList: true 11 | #SpaceBeforeInheritanceColon: true 12 | #SpaceBeforeRangeBasedForLoopColon: true 13 | #SpaceInEmptyBlock: false 14 | #Standard: Latest 15 | 16 | AlignAfterOpenBracket: true 17 | AllowAllParametersOfDeclarationOnNextLine: false 18 | AllowShortBlocksOnASingleLine: true 19 | AllowShortCaseLabelsOnASingleLine: false 20 | AllowShortFunctionsOnASingleLine: None 21 | AllowShortIfStatementsOnASingleLine: false 22 | AllowShortLoopsOnASingleLine: false 23 | AlwaysBreakAfterReturnType: None 24 | AlwaysBreakTemplateDeclarations: true 25 | BinPackArguments: false 26 | BinPackParameters: false 27 | BreakBeforeBraces: Allman 28 | BreakBeforeTernaryOperators: true 29 | BreakConstructorInitializers: BeforeComma 30 | ColumnLimit: 100 31 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 32 | ContinuationIndentWidth: 2 33 | DerivePointerAlignment: false 34 | FixNamespaceComments: false 35 | IndentWidth: 4 36 | Language: Cpp 37 | NamespaceIndentation: All 38 | PointerAlignment: Middle 39 | SortIncludes: true 40 | SpaceAfterCStyleCast: true 41 | SpaceAfterTemplateKeyword: true 42 | SpaceBeforeAssignmentOperators: true 43 | SpaceBeforeParens: ControlStatements 44 | SpaceInEmptyParentheses: false 45 | SpacesInAngles: false 46 | SpacesInCStyleCastParentheses: false 47 | SpacesInSquareBrackets: false 48 | UseTab: Never 49 | 50 | -------------------------------------------------------------------------------- /gladius/.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: 'clang-diagnostic-cppcoreguidelines*' 3 | WarningsAsErrors: '' 4 | HeaderFilterRegex: '' 5 | AnalyzeTemporaryDtors: false 6 | FormatStyle: none 7 | User: jan 8 | -------------------------------------------------------------------------------- /gladius/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2024, 3MF Consortium 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /gladius/LICENSE.txt: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2024, 3MF Consortium 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /gladius/components/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/components/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /gladius/components/fonts/fontawesome-free-5.14.0-web/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Font Awesome Free License 2 | ------------------------- 3 | 4 | Font Awesome Free is free, open source, and GPL friendly. You can use it for 5 | commercial projects, open source projects, or really almost whatever you want. 6 | Full Font Awesome Free license: https://fontawesome.com/license/free. 7 | 8 | # Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) 9 | In the Font Awesome Free download, the CC BY 4.0 license applies to all icons 10 | packaged as SVG and JS file types. 11 | 12 | # Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) 13 | In the Font Awesome Free download, the SIL OFL license applies to all icons 14 | packaged as web and desktop font files. 15 | 16 | # Code: MIT License (https://opensource.org/licenses/MIT) 17 | In the Font Awesome Free download, the MIT license applies to all non-font and 18 | non-icon files. 19 | 20 | # Attribution 21 | Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font 22 | Awesome Free files already contain embedded comments with sufficient 23 | attribution, so you shouldn't need to do anything additional when using these 24 | files normally. 25 | 26 | We've kept attribution comments terse, so we ask that you do not actively work 27 | to remove them from files, especially code. They're a great way for folks to 28 | learn about Font Awesome. 29 | 30 | # Brand Icons 31 | All brand icons are trademarks of their respective owners. The use of these 32 | trademarks does not indicate endorsement of the trademark holder by Font 33 | Awesome, nor vice versa. **Please do not use brand logos for any purpose except 34 | to represent the company, product, or service to which they refer.** 35 | -------------------------------------------------------------------------------- /gladius/components/fonts/fontawesome-free-5.14.0-web/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/components/fonts/fontawesome-free-5.14.0-web/fa-regular-400.ttf -------------------------------------------------------------------------------- /gladius/components/fonts/fontawesome-free-5.14.0-web/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/components/fonts/fontawesome-free-5.14.0-web/fa-solid-900.ttf -------------------------------------------------------------------------------- /gladius/components/licenses/IconFontCppHeaders/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Juliette Foucaut and Doug Binks 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | -------------------------------------------------------------------------------- /gladius/components/licenses/IconFontCppHeaders/url: -------------------------------------------------------------------------------- 1 | https://github.com/juliettef/IconFontCppHeaders 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/blosc/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For Blosc - A blocking, shuffling and lossless compression library 4 | 5 | Copyright (C) 2009-2018 Francesc Alted 6 | Copyright (C) 2019-present Blosc Development team 7 | 8 | Redistribution and use in source and binary forms, with or without modification, 9 | are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | * Neither the name Francesc Alted nor the names of its contributors may be used 19 | to endorse or promote products derived from this software without specific 20 | prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 29 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /gladius/components/licenses/blosc/url: -------------------------------------------------------------------------------- 1 | https://github.com/Blosc/c-blosc 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/boost/LICENSE: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | 25 | -------------------------------------------------------------------------------- /gladius/components/licenses/boost/url: -------------------------------------------------------------------------------- 1 | https://www.boost.org 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/eigen3/url: -------------------------------------------------------------------------------- 1 | https://gitlab.com/libeigen/eigen 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/fmt/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | --- Optional exception to the license --- 10 | 11 | As an exception, if, as a result of your compiling your source code, portions of this Software are embedded into a machine-executable object form of such source code, you may redistribute such embedded portions in such object form without including the above copyright and permission notices. 12 | 13 | -------------------------------------------------------------------------------- /gladius/components/licenses/fmt/url: -------------------------------------------------------------------------------- 1 | https://github.com/fmtlib/fmt 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/glad/url: -------------------------------------------------------------------------------- 1 | https://github.com/Dav1dde/glad 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/glew/url: -------------------------------------------------------------------------------- 1 | http://glew.sourceforge.net/ 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/glfw3/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /gladius/components/licenses/glfw3/url: -------------------------------------------------------------------------------- 1 | https://github.com/glfw/glfw 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/gtest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /gladius/components/licenses/gtest/url: -------------------------------------------------------------------------------- 1 | https://github.com/google/googletest 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/imgui-node-editor/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Michał Cichoń 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /gladius/components/licenses/imgui-node-editor/url: -------------------------------------------------------------------------------- 1 | https://github.com/thedmd/imgui-node-editor 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/imgui/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2021 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /gladius/components/licenses/imgui/url: -------------------------------------------------------------------------------- 1 | https://github.com/ocornut/imgui 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/jsoncpp/url: -------------------------------------------------------------------------------- 1 | https://github.com/open-source-parsers/jsoncpp 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/lodepng/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2005-2018 Lode Vandevenne 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | 22 | -------------------------------------------------------------------------------- /gladius/components/licenses/lodepng/url: -------------------------------------------------------------------------------- 1 | https://github.com/lvandeve/lodepng 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/lz4/LICENSE: -------------------------------------------------------------------------------- 1 | LZ4 Library 2 | Copyright (c) 2011-2020, Yann Collet 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, this 12 | list of conditions and the following disclaimer in the documentation and/or 13 | other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /gladius/components/licenses/lz4/url: -------------------------------------------------------------------------------- 1 | http://www.lz4.org/ 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/nanovdb/url: -------------------------------------------------------------------------------- 1 | https://github.com/AcademySoftwareFoundation/openvdb/tree/feature/nanovdb 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/nlopt/url: -------------------------------------------------------------------------------- 1 | https://github.com/stevengj/nlopt 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/opencl/url: -------------------------------------------------------------------------------- 1 | https://github.com/KhronosGroup/OpenCL-Headers 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/openexr/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | 3 | Copyright (c) Contributors to the OpenEXR Project. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 9 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | 11 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | 15 | -------------------------------------------------------------------------------- /gladius/components/licenses/openexr/url: -------------------------------------------------------------------------------- 1 | https://github.com/AcademySoftwareFoundation/openexr 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/openmesh/LICENSE: -------------------------------------------------------------------------------- 1 | OpenMesh 2 | Copyright (c) 2001-2019, RWTH-Aachen University 3 | Department of Computer Graphics and Multimedia 4 | All rights reserved. 5 | www.openmesh.org 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 8 | 9 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 10 | 11 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 12 | 13 | Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16 | -------------------------------------------------------------------------------- /gladius/components/licenses/openmesh/url: -------------------------------------------------------------------------------- 1 | https://www.graphics.rwth-aachen.de/software/openmesh/ 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/openvdb/url: -------------------------------------------------------------------------------- 1 | https://github.com/AcademySoftwareFoundation/openvdb 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/platform_folders/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Poul Sander 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /gladius/components/licenses/platform_folders/url: -------------------------------------------------------------------------------- 1 | https://github.com/sago007/PlatformFolders 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/psimpl/url: -------------------------------------------------------------------------------- 1 | http://psimpl.sourceforge.net/ 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/stb/url: -------------------------------------------------------------------------------- 1 | https://github.com/nothings/stb 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/tbb/url: -------------------------------------------------------------------------------- 1 | https://github.com/oneapi-src/oneTBB 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/tinyfiledialogs/LICENSE: -------------------------------------------------------------------------------- 1 | This software is provided 'as-is', without any express or implied 2 | warranty. In no event will the authors be held liable for any damages 3 | arising from the use of this software. 4 | 5 | Permission is granted to anyone to use this software for any purpose, 6 | including commercial applications, and to alter it and redistribute it 7 | freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not 10 | claim that you wrote the original software. If you use this software 11 | in a product, an acknowledgment in the product documentation would be 12 | appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be 14 | misrepresented as being the original software. 15 | 3. This notice may not be removed or altered from any source distribution. 16 | 17 | -------------------------------------------------------------------------------- /gladius/components/licenses/tinyfiledialogs/url: -------------------------------------------------------------------------------- 1 | https://sourceforge.net/projects/tinyfiledialogs/ 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/zlib/LICENSE: -------------------------------------------------------------------------------- 1 | version 1.2.11, January 15th, 2017 2 | 3 | Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Jean-loup Gailly Mark Adler 22 | jloup@gzip.org madler@alumni.caltech.edu 23 | -------------------------------------------------------------------------------- /gladius/components/licenses/zlib/url: -------------------------------------------------------------------------------- 1 | https://www.zlib.net/ 2 | -------------------------------------------------------------------------------- /gladius/components/licenses/zstd/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For Zstandard software 4 | 5 | Copyright (c) 2016-present, Facebook, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Facebook nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /gladius/components/licenses/zstd/url: -------------------------------------------------------------------------------- 1 | https://github.com/facebook/zstd 2 | -------------------------------------------------------------------------------- /gladius/documentation/img/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/banner.png -------------------------------------------------------------------------------- /gladius/documentation/img/dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/dialog.png -------------------------------------------------------------------------------- /gladius/documentation/img/difference.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/difference.jpg -------------------------------------------------------------------------------- /gladius/documentation/img/eyecatcher.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/eyecatcher.jpg -------------------------------------------------------------------------------- /gladius/documentation/img/eyecatcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/eyecatcher.png -------------------------------------------------------------------------------- /gladius/documentation/img/gladius.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/gladius.ico -------------------------------------------------------------------------------- /gladius/documentation/img/gladius_animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/gladius_animation.gif -------------------------------------------------------------------------------- /gladius/documentation/img/gladius_screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/documentation/img/gladius_screenshot.jpg -------------------------------------------------------------------------------- /gladius/examples/implicit/3mf-implicit.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/3mf-implicit.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/RadialRadiator.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/RadialRadiator.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/SphereInACage.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/SphereInACage.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/keyboard/2x_tpu_attachablefoot.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/keyboard/2x_tpu_attachablefoot.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/keyboard/2x_tpu_bottomcover.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/keyboard/2x_tpu_bottomcover.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/keyboard/2x_tpu_pla_jogwheel_color.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/keyboard/2x_tpu_pla_jogwheel_color.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/keyboard/2x_wing.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/keyboard/2x_wing.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/keyboard/2xmirrored_honeycombecase.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/keyboard/2xmirrored_honeycombecase.3mf -------------------------------------------------------------------------------- /gladius/examples/implicit/keyboard/buzzingbeekeyboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/implicit/keyboard/buzzingbeekeyboard.jpg -------------------------------------------------------------------------------- /gladius/examples/template.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/template.3mf -------------------------------------------------------------------------------- /gladius/examples/volumetric/3mf-image3d.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/examples/volumetric/3mf-image3d.3mf -------------------------------------------------------------------------------- /gladius/src/Application.cpp: -------------------------------------------------------------------------------- 1 | #include "Application.h" 2 | #include "ui/MainWindow.h" 3 | 4 | #include 5 | 6 | namespace gladius 7 | { 8 | Application::Application() 9 | { 10 | m_mainWindow.startMainLoop(); 11 | } 12 | 13 | Application::Application(int argc, char ** argv) 14 | { 15 | // the first argument is the executable name 16 | if (argc >= 2) 17 | { 18 | std::filesystem::path filename{argv[1]}; 19 | 20 | // because this is a console application, we print to the console 21 | std::cout << "Opening file: " << filename << std::endl; 22 | if (std::filesystem::exists(filename)) 23 | { 24 | m_mainWindow.open(filename); 25 | } 26 | else 27 | { 28 | std::cout << "File does not exist: " << filename << std::endl; 29 | } 30 | } 31 | else 32 | { 33 | std::cout << "No file specified" << std::endl; 34 | } 35 | m_mainWindow.startMainLoop(); 36 | } 37 | 38 | Application::Application(std::filesystem::path const & filename) 39 | { 40 | if (std::filesystem::exists(filename)) 41 | { 42 | m_mainWindow.open(filename); 43 | } 44 | else 45 | { 46 | std::cout << "File does not exist: " << filename << std::endl; 47 | } 48 | m_mainWindow.startMainLoop(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /gladius/src/Application.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ui/MainWindow.h" 4 | 5 | namespace gladius 6 | { 7 | class Application 8 | { 9 | public: 10 | Application(); 11 | Application(int argc, char ** argv); 12 | Application(std::filesystem ::path const & filename); 13 | private: 14 | ui::MainWindow m_mainWindow; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /gladius/src/BBox.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace gladius 8 | { 9 | class BBox 10 | { 11 | public: 12 | void extend(Eigen::Vector3f pos); 13 | 14 | [[nodiscard]] Eigen::Vector3f getMax() const; 15 | [[nodiscard]] Eigen::Vector3f getMin() const; 16 | 17 | private: 18 | Eigen::Vector3f m_max{-FLT_MAX,-FLT_MAX, -FLT_MAX}; 19 | Eigen::Vector3f m_min{FLT_MAX, FLT_MAX, FLT_MAX}; 20 | }; 21 | 22 | inline void BBox::extend(Eigen::Vector3f pos) 23 | { 24 | m_min.x() = std::min(m_min.x(), pos.x()); 25 | m_min.y() = std::min(m_min.y(), pos.y()); 26 | m_min.z() = std::min(m_min.z(), pos.z()); 27 | m_max.x() = std::max(m_max.x(), pos.x()); 28 | m_max.y() = std::max(m_max.y(), pos.y()); 29 | m_max.z() = std::max(m_max.z(), pos.z()); 30 | } 31 | 32 | [[nodiscard]] inline Eigen::Vector3f BBox::getMax() const 33 | { 34 | return m_max; 35 | } 36 | 37 | [[nodiscard]] inline Eigen::Vector3f BBox::getMin() const 38 | { 39 | return m_min; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /gladius/src/BitmapChannel.cpp: -------------------------------------------------------------------------------- 1 | #include "BitmapChannel.h" 2 | 3 | #include 4 | 5 | namespace gladius 6 | { 7 | std::string const& BitmapChannel::getName() const 8 | { 9 | return m_name; 10 | } 11 | 12 | BitmapLayer BitmapChannel::generate(float z_mm, Vector2 pixelSize) const 13 | { 14 | return m_generator(z_mm, std::move(pixelSize)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /gladius/src/BitmapChannel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "BitmapLayer.h" 9 | #include "Contour.h" 10 | 11 | namespace gladius 12 | { 13 | // Alias for a function that generates a BitmapLayer 14 | using BitmapGenerator = std::function; 15 | 16 | class BitmapChannel 17 | { 18 | public: 19 | // Constructor initializes the name and generator 20 | BitmapChannel(std::string_view name, BitmapGenerator generator) 21 | : m_name(name) 22 | , m_generator(std::move(generator)) 23 | { 24 | } 25 | 26 | // Returns the name of the BitmapChannel 27 | [[nodiscard]] std::string const & getName() const; 28 | 29 | // Generates a BitmapLayer based on the provided parameters 30 | [[nodiscard]] BitmapLayer generate(float z_mm, Vector2 pixelSize) const; 31 | 32 | private: 33 | std::string m_name; // Name of the BitmapChannel 34 | BitmapGenerator m_generator; // Function to generate BitmapLayer 35 | }; 36 | 37 | // Alias for a collection of BitmapChannel objects 38 | using BitmapChannels = std::vector; 39 | } -------------------------------------------------------------------------------- /gladius/src/BitmapLayer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Contour.h" 3 | 4 | #include 5 | 6 | namespace gladius 7 | { 8 | struct BitmapLayer 9 | { 10 | Vector2 position{}; // Position of the bitmap layer 11 | std::vector bitmapData; // Bitmap data stored as a vector of floats 12 | Vector2 pixelSize{}; // Size of each pixel 13 | size_t width_px{}; // Width of the bitmap in pixels 14 | size_t height_px{}; // Height of the bitmap in pixels 15 | }; 16 | } -------------------------------------------------------------------------------- /gladius/src/CLMath.cpp: -------------------------------------------------------------------------------- 1 | #include "CLMath.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace gladius 7 | { 8 | float lerp(float s, float e, float t) 9 | { 10 | return s + (e - s) * t; 11 | } 12 | 13 | float blerp(float c00, float c10, float c01, float c11, float tx, float ty) 14 | { 15 | return lerp(lerp(c00, c10, tx), lerp(c01, c11, tx), ty); 16 | } 17 | 18 | float length(cl_float2 vector) 19 | { 20 | return std::sqrt(vector.x * vector.x + vector.y * vector.y); 21 | } 22 | 23 | float distBetween(cl_float2 vector1, cl_float2 vector2) 24 | { 25 | return length({{vector1.x - vector2.x, vector1.y - vector2.y}}); 26 | } 27 | 28 | auto normalize(cl_float2 vector) -> cl_float2 29 | { 30 | auto const magnitude = length(vector); 31 | if (magnitude < std::numeric_limits::epsilon()) 32 | { 33 | return vector; 34 | } 35 | return cl_float2{{vector.x / magnitude, vector.y / magnitude}}; 36 | } 37 | 38 | cl_float2 normal(cl_float2 vector) 39 | { 40 | vector = normalize(vector); 41 | return {{vector.y, -vector.x}}; 42 | } 43 | 44 | cl_float2 normal(cl_float2 start, cl_float2 end) 45 | { 46 | cl_float2 const vector{{end.x - start.x, end.y - start.y}}; 47 | return normal(vector); 48 | } 49 | 50 | float angle(cl_float2 vectorA, cl_float2 vectorB) 51 | { 52 | auto const dot = vectorA.x * vectorB.x + vectorA.y * vectorB.y; 53 | auto const det = vectorA.x * vectorB.y - vectorA.y * vectorB.x; 54 | return atan2(det, dot); 55 | } 56 | } -------------------------------------------------------------------------------- /gladius/src/CLMath.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "gpgpu.h" 4 | 5 | namespace gladius 6 | { 7 | 8 | template 9 | auto sign(T value) -> T 10 | { 11 | return static_cast((T(0) < value) - (value < T(0))); 12 | } 13 | 14 | float lerp(float s, float e, float t); 15 | float blerp(float c00, float c10, float c01, float c11, float tx, float ty); 16 | 17 | float length(cl_float2 vector); 18 | 19 | auto distBetween(cl_float2 vector1, cl_float2 vector2) -> float; 20 | 21 | auto normalize(cl_float2 vector) -> cl_float2; 22 | 23 | cl_float2 normal(cl_float2 vector); 24 | 25 | cl_float2 normal(cl_float2 start, cl_float2 end); 26 | 27 | float angle(cl_float2 vectorA, cl_float2 vectorB); 28 | } -------------------------------------------------------------------------------- /gladius/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(BINARY ${CMAKE_PROJECT_NAME}) 3 | file(GLOB SOURCES LIST_DIRECTORIES true *.h *.cpp) 4 | 5 | add_library(${BINARY}_lib STATIC ${SOURCES}) 6 | 7 | if (MSVC) 8 | add_executable(${BINARY} WIN32 ${SOURCES} ) 9 | set_property(TARGET ${BINARY} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") 10 | set_property(TARGET ${BINARY}_lib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") 11 | else() 12 | add_executable(${BINARY} ${SOURCES} ) 13 | endif() 14 | 15 | set (INCLUDE_PATHS 16 | ../ 17 | ../components/IconFontCppHeaders 18 | ../components/psimpl/lib 19 | ${STB_INCLUDE_DIRS} 20 | ${OPENMESH_INCLUDE_DIRS} 21 | ${AdditionalIncludes} 22 | ) 23 | target_include_directories(${BINARY}_lib PUBLIC ${INCLUDE_PATHS}) 24 | target_include_directories(${BINARY} PUBLIC ${INCLUDE_PATHS}) 25 | 26 | set(DEPENDENCIES 27 | OpenCL::OpenCL 28 | ${X11_LIBRARIES} 29 | ${OPENGL_LIBRARIES} 30 | glfw 31 | glad::glad 32 | fmt::fmt-header-only 33 | Eigen3::Eigen 34 | tinyfiledialogs::tinyfiledialogs 35 | Threads::Threads 36 | sago::platform_folders 37 | OpenVDB::openvdb 38 | ZLIB::ZLIB 39 | gladius::rc 40 | lodepng 41 | pugixml::pugixml 42 | ${OPENMESH_LIBRARIES} 43 | lib3mf::lib3mf 44 | unofficial::minizip::minizip 45 | imgui::imgui 46 | unofficial::imgui-node-editor::imgui-node-editor 47 | ) 48 | 49 | if (WIN32) 50 | set(DEPENDENCIES ${DEPENDENCIES} blosc_shared) 51 | else() 52 | set(DEPENDENCIES ${DEPENDENCIES} blosc_static) 53 | endif() 54 | 55 | if (ENABLE_TRACY) 56 | set(DEPENDENCIES ${DEPENDENCIES} Tracy::TracyClient) 57 | endif() 58 | 59 | 60 | target_link_libraries(${BINARY}_lib PUBLIC ${DEPENDENCIES}) 61 | target_link_libraries(${BINARY} PUBLIC ${BINARY}_lib) 62 | 63 | install(TARGETS ${BINARY} RUNTIME DESTINATION ${INSTALL_PREFIX}/) 64 | -------------------------------------------------------------------------------- /gladius/src/CliReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Primitives.h" 4 | #include 5 | #include 6 | 7 | namespace gladius 8 | { 9 | /// Quick and dirty ASCII CLI Reader that only reads Hatches (of all layers) 10 | class CliReader 11 | { 12 | public: 13 | /** 14 | * Reads the specified file and populates the provided Primitives object. 15 | * @param fileName The path to the file to be read. 16 | * @param primitives The Primitives object to be populated. 17 | */ 18 | void read(const std::filesystem::path & fileName, Primitives & primitives); 19 | 20 | private: 21 | /** 22 | * Calculates the bounding volumes for the provided Primitives object. 23 | * @param primitives The Primitives object for which to calculate bounding volumes. 24 | */ 25 | static void calculateBoundingVolumes(Primitives & primitives); 26 | 27 | std::ifstream m_file; ///< Input file stream for reading the file. 28 | }; 29 | } -------------------------------------------------------------------------------- /gladius/src/CliWriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "compute/ComputeCore.h" 4 | #include "ContourExtractor.h" 5 | 6 | #include 7 | #include 8 | 9 | namespace gladius 10 | { 11 | class CliWriter 12 | { 13 | public: 14 | void saveCurrentLayer(const std::filesystem::path & fileName, ComputeCore & generator); 15 | void save(const std::filesystem::path & fileName, ComputeCore & generator); 16 | [[nodiscard]] std::filesystem::path getFilename() const; 17 | 18 | void beginExport(const std::filesystem::path & fileName, ComputeCore & generator); 19 | bool advanceExport(ComputeCore & generator); 20 | void finalizeExport(); 21 | [[nodiscard]] float getProgress() const; 22 | 23 | private: 24 | void writeHeader(); 25 | void writeLayer(const PolyLines & polyLines, double z_mm); 26 | void writePolyLine(const PolyLine & polyLine); 27 | [[nodiscard]] float roundToLayerThickness(float value) const; 28 | std::ofstream m_file; 29 | std::filesystem::path m_fileName; 30 | float m_layerThickness_mm = 0.01f; 31 | int modelId{0}; 32 | float m_progress = 0.; 33 | float m_startHeight_mm = 0.f; 34 | float m_endHeight_mm = 0.f; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /gladius/src/Contour.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace gladius 9 | { 10 | using Vector2 = Eigen::Vector2f; 11 | 12 | enum class ContourMode 13 | { 14 | Inner = 0, 15 | Outer = 1, 16 | OpenLine = 2, 17 | ExcludeFromSlice 18 | }; 19 | using ShellIndex = int; 20 | 21 | using Vertices2d = std::vector; 22 | 23 | struct PolyLine 24 | { 25 | ContourMode contourMode = ContourMode::ExcludeFromSlice; 26 | Vertices2d vertices; 27 | bool isClosed = false; 28 | bool hasIntersections = false; 29 | float area = 0.f; 30 | Vertices2d selfIntersections; 31 | }; 32 | 33 | using PolyLines = std::vector; 34 | using SharedPolyLines = std::shared_ptr; 35 | } 36 | -------------------------------------------------------------------------------- /gladius/src/EventLogger.cpp: -------------------------------------------------------------------------------- 1 | #include "EventLogger.h" 2 | 3 | #include 4 | 5 | namespace gladius::events 6 | { 7 | Event::Event(std::string msg, Severity severity) 8 | : m_timestamp(std::chrono::system_clock::now()) 9 | , m_msg(std::move(msg)) 10 | , m_severity(severity) 11 | { 12 | } 13 | 14 | std::chrono::system_clock::time_point Event::getTimeStamp() const 15 | { 16 | return m_timestamp; 17 | } 18 | 19 | std::string Event::getMessage() const 20 | { 21 | return m_msg; 22 | } 23 | 24 | Severity Event::getSeverity() const 25 | { 26 | return m_severity; 27 | } 28 | 29 | void Logger::addEvent(Event const & event) 30 | { 31 | if (event.getSeverity() == Severity::Error || event.getSeverity() == Severity::FatalError) 32 | { 33 | m_countErrors++; 34 | } 35 | m_events.push_back(event); 36 | #ifdef _DEBUG 37 | std::cout << event.getMessage() << "\n"; 38 | #endif 39 | } 40 | 41 | void Logger::clear() 42 | { 43 | m_events.clear(); 44 | } 45 | 46 | Events::iterator Logger::begin() 47 | { 48 | return m_events.begin(); 49 | } 50 | 51 | Events::iterator Logger::end() 52 | { 53 | return m_events.end(); 54 | } 55 | 56 | Events::const_iterator Logger::cbegin() const 57 | { 58 | return m_events.cbegin(); 59 | } 60 | 61 | Events::const_iterator Logger::cend() const 62 | { 63 | return m_events.cend(); 64 | } 65 | 66 | size_t Logger::size() const 67 | { 68 | return m_events.size(); 69 | } 70 | 71 | size_t Logger::getErrorCount() const 72 | { 73 | return m_countErrors; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /gladius/src/EventLogger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace gladius::events 9 | { 10 | enum class Severity 11 | { 12 | Info, 13 | Warning, 14 | Error, 15 | FatalError 16 | }; 17 | 18 | class Event 19 | { 20 | public: 21 | Event(std::string msg, Severity severity = Severity::Warning); 22 | 23 | [[nodiscard]] std::chrono::system_clock::time_point getTimeStamp() const; 24 | 25 | [[nodiscard]] std::string getMessage() const; 26 | 27 | [[nodiscard]] Severity getSeverity() const; 28 | 29 | private: 30 | std::chrono::system_clock::time_point m_timestamp; 31 | std::string m_msg; 32 | Severity m_severity; 33 | }; 34 | 35 | using Events = std::vector; 36 | class Logger 37 | { 38 | public: 39 | void addEvent(Event const & event); 40 | 41 | void clear(); 42 | 43 | [[nodiscard]] Events::iterator begin(); 44 | 45 | [[nodiscard]] Events::iterator end(); 46 | 47 | [[nodiscard]] Events::const_iterator cbegin() const; 48 | 49 | [[nodiscard]] Events::const_iterator cend() const; 50 | 51 | [[nodiscard]] size_t size() const; 52 | 53 | [[nodiscard]] size_t getErrorCount() const; 54 | private: 55 | Events m_events; 56 | size_t m_countErrors{}; 57 | }; 58 | 59 | using SharedLogger = std::shared_ptr; 60 | } -------------------------------------------------------------------------------- /gladius/src/FileSystemUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "FileSystemUtils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #ifndef _MSVC_LANG 10 | #include 11 | #endif 12 | 13 | namespace gladius 14 | { 15 | std::filesystem::path getAppDir() 16 | { 17 | #ifdef WIN32 18 | char * executablePath; 19 | if (_get_pgmptr(&executablePath) != 0) 20 | { 21 | return {}; 22 | } 23 | return std::filesystem::path{executablePath}.parent_path(); 24 | #else 25 | char executablePath[PATH_MAX]; 26 | ssize_t len = ::readlink("/proc/self/exe", executablePath, sizeof(executablePath)); 27 | if (len == -1 || len >= sizeof(executablePath)) 28 | len = 0; 29 | executablePath[len] = '\0'; 30 | 31 | return std::filesystem::path{executablePath}.parent_path(); 32 | #endif 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /gladius/src/FileSystemUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace gladius 5 | { 6 | std::filesystem::path getAppDir(); 7 | } 8 | -------------------------------------------------------------------------------- /gladius/src/GLImageBuffer.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "ComputeContext.h" 5 | 6 | #include "ImageRGBA.h" 7 | 8 | #include 9 | 10 | namespace gladius 11 | { 12 | class GLImageBuffer final : public ImageRGBA 13 | { 14 | public: 15 | explicit GLImageBuffer(ComputeContext& context) 16 | : ImageRGBA(context) 17 | { 18 | } 19 | 20 | GLImageBuffer(ComputeContext& context, size_t width, size_t height) 21 | : ImageRGBA(context, width, height) 22 | { 23 | } 24 | 25 | ~GLImageBuffer() override; 26 | 27 | void allocateOnDevice() override; 28 | 29 | void bind(); 30 | 31 | static void unbind(); 32 | 33 | [[nodiscard]] GLuint GetTextureId() const; 34 | 35 | void transferPixelInReadPixelMode(); 36 | 37 | void invalidateContent(); 38 | 39 | private: 40 | void setupForInterOp(); 41 | void setupForReadPixel(); 42 | 43 | void transferPixels(); 44 | 45 | GLuint m_textureID = 0; 46 | bool m_dirty{true}; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /gladius/src/ImageBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ComputeContext.h" 4 | #include 5 | 6 | namespace gladius 7 | { 8 | class ImageBuffer 9 | { 10 | 11 | private: 12 | size_t m_width{}; 13 | size_t m_height{}; 14 | size_t m_depth{1}; 15 | size_t m_size{}; 16 | 17 | SharedComputeContext m_ComputeContext; 18 | std::unique_ptr 7 | #include 8 | 9 | namespace gladius 10 | { 11 | int getNumChannels(io::PixelFormat format); 12 | using Image3dRGBA = ImageImpl; 13 | 14 | class ImageStackOCL 15 | { 16 | public: 17 | explicit ImageStackOCL(ComputeContext & context); 18 | 19 | void initializeFromImageStack(io::ImageStack const & stack); 20 | 21 | cl::ImageFormat getFormat() const; 22 | 23 | void allocateOnDevice(); 24 | 25 | void write(); 26 | 27 | std::string const & getName() const; 28 | 29 | cl::Image & getBuffer() const; 30 | 31 | private: 32 | ComputeContext & m_ComputeContext; 33 | size_t m_width{}; 34 | size_t m_height{}; 35 | size_t m_numSheets{}; 36 | size_t m_numChannels{}; 37 | io::PixelFormat m_format{}; 38 | std::string m_name; 39 | 40 | bool m_isUploaded{false}; 41 | 42 | std::unique_ptr m_image3dRGBA; 43 | }; 44 | } -------------------------------------------------------------------------------- /gladius/src/ImageStackOCLBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ComputeContext.h" 3 | 4 | #include "ResourceManager.h" 5 | #include "Buffer.h" 6 | #include "io/3mf/ImageStack.h" 7 | #include 8 | #include 9 | 10 | namespace gladius 11 | { 12 | // int getNumChannels(io::PixelFormat format); 13 | using buffer3dRGBA = Buffer; 14 | 15 | class ImageStackOCLBuffer 16 | { 17 | public: 18 | explicit ImageStackOCLBuffer(ComputeContext & context); 19 | 20 | void initializeFromImageStack(io::ImageStack const & stack); 21 | 22 | cl::ImageFormat getFormat() const; 23 | 24 | void allocateOnDevice(); 25 | 26 | void write(); 27 | 28 | std::string const & getName() const; 29 | 30 | cl::Buffer const& getBuffer() const; 31 | 32 | private: 33 | ComputeContext & m_ComputeContext; 34 | size_t m_width{}; 35 | size_t m_height{}; 36 | size_t m_numSheets{}; 37 | size_t m_numChannels{}; 38 | io::PixelFormat m_format{}; 39 | std::string m_name; 40 | 41 | bool m_isUploaded{false}; 42 | 43 | std::unique_ptr m_buffer; 44 | }; 45 | } -------------------------------------------------------------------------------- /gladius/src/ImageStackResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ResourceManager.h" 4 | #include "io/3mf/ImageStack.h" 5 | 6 | namespace gladius 7 | { 8 | class ImageStackResource : public ResourceBase 9 | { 10 | public: 11 | explicit ImageStackResource(ResourceKey key, io::ImageStack && stack); 12 | 13 | ~ImageStackResource() = default; 14 | 15 | size_t getWidth() const 16 | { 17 | return m_width; 18 | } 19 | 20 | size_t getHeight() const 21 | { 22 | return m_height; 23 | } 24 | 25 | size_t getNumSheets() const 26 | { 27 | return m_numSheets; 28 | } 29 | 30 | size_t getNumChannels() const 31 | { 32 | return m_numChannels; 33 | } 34 | private: 35 | size_t m_width{}; 36 | size_t m_height{}; 37 | size_t m_numSheets{}; 38 | size_t m_numChannels{}; 39 | io::PixelFormat m_format{}; 40 | 41 | 42 | io::ImageStack m_stack; 43 | 44 | void loadImpl() override; 45 | 46 | 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /gladius/src/KernelReplacements.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace gladius 6 | { 7 | using KernelReplacements = std::unordered_map; 8 | using SharedKernelReplacements = std::shared_ptr; 9 | } -------------------------------------------------------------------------------- /gladius/src/MeshResource.cpp: -------------------------------------------------------------------------------- 1 | #include "MeshResource.h" 2 | #include "io/VdbImporter.h" 3 | 4 | namespace gladius 5 | { 6 | void MeshResource::loadImpl() 7 | { 8 | m_payloadData.meta.clear(); 9 | m_payloadData.data.clear(); 10 | vdb::VdbImporter const reader; 11 | reader.writeMesh(m_mesh, m_payloadData); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /gladius/src/MeshResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ResourceManager.h" 4 | #include "io/VdbImporter.h" 5 | 6 | namespace gladius 7 | { 8 | class MeshResource : public ResourceBase 9 | { 10 | public: 11 | MeshResource(ResourceKey key, vdb::TriangleMesh && mesh) 12 | : ResourceBase(std::move(key)) 13 | , m_mesh(std::move(mesh)) 14 | { 15 | 16 | }; 17 | 18 | vdb::TriangleMesh const & getMesh() const 19 | { 20 | return m_mesh; 21 | } 22 | 23 | private: 24 | vdb::TriangleMesh m_mesh; 25 | 26 | void loadImpl() override; 27 | }; 28 | } -------------------------------------------------------------------------------- /gladius/src/ModelState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gladius 4 | { 5 | enum class CompilationState 6 | { 7 | UpToDate, 8 | CompilationRequested, 9 | CompilationInProgress 10 | }; 11 | 12 | class ModelState 13 | { 14 | public: 15 | void signalCompilationRequired() 16 | { 17 | m_compilationState = CompilationState::CompilationRequested; 18 | } 19 | 20 | void signalCompilationFinished() 21 | { 22 | if (m_compilationState == CompilationState::CompilationInProgress) 23 | { 24 | m_compilationState = CompilationState::UpToDate; 25 | } 26 | } 27 | 28 | void signalCompilationStarted() 29 | { 30 | m_compilationState = CompilationState::CompilationInProgress; 31 | } 32 | 33 | [[nodiscard]] bool isCompilationRequired() const 34 | { 35 | if (m_compilationState == CompilationState::CompilationRequested) 36 | { 37 | return true; 38 | } 39 | 40 | return false; 41 | } 42 | 43 | [[nodiscard]] bool isModelUpToDate() const 44 | { 45 | return m_compilationState == CompilationState::UpToDate; 46 | } 47 | 48 | private: 49 | CompilationState m_compilationState{CompilationState::UpToDate}; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /gladius/src/PathBuilder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Contour.h" 4 | #include "Primitives.h" 5 | 6 | namespace gladius 7 | { 8 | class PathBuilder 9 | { 10 | public: 11 | PathBuilder(); 12 | void moveTo(Vector2 point); 13 | void lineTo(Vector2 point); 14 | void quadricBezier(Vector2 point, Vector2 controlPoint); 15 | void closePath(); 16 | 17 | void addToPrimitives(PrimitiveBuffer & primitives); 18 | 19 | private: 20 | PolyLines m_polyLines; 21 | PolyLine m_currentPolyLine; 22 | void flush(); 23 | void determineContourModiAndSort(); 24 | Vector2 m_start; 25 | }; 26 | Vector2 quadricBezierFunc(Vector2 const & start, 27 | Vector2 const & end, 28 | Vector2 const & controlPoint, 29 | float k); 30 | float calcArea(const PolyLine & polyLine); 31 | float vertexAngle(Vector2 const & a, Vector2 const & b, Vector2 const & c); 32 | 33 | enum class OrientationMeaning 34 | { 35 | clockWiseIsInner, 36 | clockWiseIsOuter 37 | }; 38 | 39 | void determineContourMode( 40 | PolyLine & target, 41 | OrientationMeaning orientationMeaning = OrientationMeaning::clockWiseIsOuter); 42 | 43 | void simplifyPolyline(PolyLine & polyline, float tolerance); 44 | } -------------------------------------------------------------------------------- /gladius/src/Profiling.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace gladius 8 | { 9 | class ScopedProfilingFrame 10 | { 11 | public: 12 | ScopedProfilingFrame(const std::string & name) 13 | : m_name(name) 14 | { 15 | FrameMarkStart(m_name.c_str()); 16 | } 17 | 18 | ~ScopedProfilingFrame() 19 | { 20 | FrameMarkEnd(m_name.c_str()); 21 | } 22 | 23 | private: 24 | const std::string m_name; 25 | }; 26 | 27 | #define LOG_LOCATION 28 | //#define LOG_LOCATION std::cout << "Method: " << __FUNCTION__ << " line: " << __LINE__ << ", 29 | //Thread ID: " << std::this_thread::get_id() << std::endl; #define ProfileFunction ZoneScoped; 30 | 31 | class ScopedTimeLogger 32 | { 33 | public: 34 | ScopedTimeLogger(const std::string & name) 35 | : m_name(name) 36 | { 37 | m_start = std::chrono::high_resolution_clock::now(); 38 | } 39 | 40 | ~ScopedTimeLogger() 41 | { 42 | auto end = std::chrono::high_resolution_clock::now(); 43 | auto duration = std::chrono::duration_cast(end - m_start); 44 | constexpr int64_t threshold = 1; 45 | 46 | if (duration.count() > threshold) 47 | { 48 | std::cout << m_name << " took " << duration.count() << "ms" << std::endl; 49 | } 50 | } 51 | 52 | private: 53 | std::string m_name; 54 | std::chrono::time_point m_start; 55 | }; 56 | #define LOG_SCOPE_DURATION ScopedTimeLogger scopedTimeLogger(__FUNCTION__); 57 | #define LOG_SCOPE_DURATION_NAMED(name) ScopedTimeLogger scopedTimeLogger(name); 58 | //#define ProfileFunction LOG_SCOPE_DURATION 59 | #define ProfileFunction ZoneScoped; 60 | } -------------------------------------------------------------------------------- /gladius/src/ProgramBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Buffer.h" 4 | #include "CLProgram.h" 5 | #include "ResourceContext.h" 6 | 7 | #include 8 | 9 | namespace gladius 10 | { 11 | class ProgramBase 12 | { 13 | public: 14 | explicit ProgramBase(SharedComputeContext context, const SharedResources resources); 15 | void recompileNonBlocking(); 16 | void recompileBlocking(); 17 | void buildKernelLib() const; 18 | 19 | void setOnProgramSwapCallBack(const std::function& callBack); 20 | bool isCompilationInProgress() const; 21 | bool isValid() const; 22 | 23 | void setModelKernel(const std::string& newModelKernelSource); 24 | void setEnableVdb(bool enableVdb); 25 | 26 | void waitForCompilation() const; 27 | 28 | void dumpSource(std::filesystem::path const & path) const; 29 | 30 | protected: 31 | void swapProgramsIfNeeded(); 32 | static void noOp() 33 | { 34 | } 35 | SharedComputeContext m_ComputeContext; 36 | std::unique_ptr m_programFront; 37 | std::atomic_bool m_programSwapRequired{false}; 38 | 39 | SharedResources m_resoures; 40 | BuildCallBack m_buildFinishedCallBack; 41 | std::function m_onProgramSwapCallBack{noOp}; 42 | 43 | std::string m_modelKernel; 44 | bool m_isFirstBuild = true; 45 | 46 | bool m_enableVdb = false; 47 | 48 | FileNames m_sourceFilesProgram; 49 | FileNames m_sourceFilesLib; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /gladius/src/RenderProgram.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "GLImageBuffer.h" 4 | #include "Primitives.h" 5 | #include "ResourceContext.h" 6 | #include "src/ProgramBase.h" 7 | 8 | namespace gladius 9 | { 10 | class RenderProgram : public ProgramBase 11 | { 12 | public: 13 | explicit RenderProgram(SharedComputeContext context, const SharedResources & resources); 14 | 15 | void renderScene(const Primitives & lines, 16 | ImageRGBA & targetImage, 17 | cl_float z_mm, 18 | size_t startHeight, 19 | size_t endHeight); 20 | 21 | void resample(ImageRGBA & sourceImage, 22 | ImageRGBA & targetImage, 23 | size_t startHeight, 24 | size_t endHeight); 25 | 26 | bool isSdfVisualizationEnabled() const; 27 | void setSdfVisualizationEnabled(bool value) 28 | { 29 | m_enableSdfVisualization = value; 30 | if (m_enableSdfVisualization) 31 | { 32 | m_programFront->addSymbol("RENDER_SDF"); 33 | } 34 | else 35 | { 36 | m_programFront->removeSymbol("RENDER_SDF"); 37 | } 38 | } 39 | private: 40 | bool m_enableSdfVisualization = true; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /gladius/src/StlResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ResourceManager.h" 4 | #include "io/VdbImporter.h" 5 | 6 | namespace gladius 7 | { 8 | class StlResource : public ResourceBase 9 | { 10 | public: 11 | StlResource(ResourceKey filename) 12 | : ResourceBase(std::move(filename)) 13 | { 14 | load(); 15 | } 16 | 17 | private: 18 | void loadImpl() override; 19 | }; 20 | } -------------------------------------------------------------------------------- /gladius/src/SvgWriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "compute/ComputeCore.h" 4 | #include "ContourExtractor.h" 5 | 6 | #include 7 | #include 8 | 9 | namespace gladius 10 | { 11 | class SvgWriter 12 | { 13 | public: 14 | void saveCurrentLayer(const std::filesystem::path & fileName, ComputeCore & generator); 15 | 16 | private: 17 | void writeHeader(); 18 | void writeLayer(const PolyLines & polyLines); 19 | void writePolyLine(const PolyLine & polyLine); 20 | [[nodiscard]] float roundToLayerThickness(float value) const; 21 | std::ofstream m_file; 22 | std::filesystem::path m_fileName; 23 | float m_layerThickness_mm = 0.05f; 24 | int modelId{0}; 25 | float m_progress = 0.; 26 | float m_startHeight_mm = 0.f; 27 | float m_endHeight_mm = 0.f; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /gladius/src/TimeMeasurement.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | template 7 | 8 | // usage: auto time = measure::execution([&](){ /* code */ }); // returns time in milliseconds 9 | struct measure 10 | { 11 | template 12 | static typename TimeT::rep execution(F && func, Args &&... args) 13 | { 14 | const auto start = std::chrono::steady_clock::now(); 15 | std::forward(func)(std::forward(args)...); 16 | auto duration = std::chrono::duration_cast(std::chrono::steady_clock::now() - start); 17 | return duration.count(); 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /gladius/src/VdbResource.cpp: -------------------------------------------------------------------------------- 1 | #include "VdbResource.h" 2 | 3 | #include "VdbImporter.h" 4 | 5 | namespace gladius 6 | { 7 | VdbResource::VdbResource(ResourceKey key, openvdb::GridBase::Ptr && grid) 8 | : ResourceBase(std::move(key)) 9 | , m_grid(std::move(grid)) 10 | { 11 | ResourceBase::load(); 12 | } 13 | 14 | nodes::float3 VdbResource::getGridSize() const 15 | { 16 | 17 | if (m_grid) 18 | { 19 | auto bbox = m_grid->evalActiveVoxelBoundingBox(); 20 | 21 | return nodes::float3{static_cast(bbox.max().x() - bbox.min().x()), 22 | static_cast(bbox.max().y() - bbox.min().y()), 23 | static_cast(bbox.max().z() - bbox.min().z())}; 24 | } 25 | 26 | return nodes::float3(); 27 | } 28 | 29 | void VdbResource::loadImpl() 30 | { 31 | if (!m_grid) 32 | { 33 | return; 34 | } 35 | 36 | m_payloadData.meta.clear(); 37 | 38 | PrimitiveMeta metaData{}; 39 | metaData.primitiveType = SDF_VDB; 40 | metaData.start = static_cast(m_payloadData.data.size()); 41 | 42 | vdb::importFromGrid(m_grid, m_payloadData, 1.0f); 43 | 44 | metaData.end = static_cast(m_payloadData.data.size()); 45 | m_payloadData.meta.push_back(metaData); 46 | } 47 | } -------------------------------------------------------------------------------- /gladius/src/VdbResource.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ResourceManager.h" 4 | #include "io/3mf/ImageStack.h" 5 | #include "nodes/types.h" 6 | 7 | #include 8 | 9 | namespace gladius 10 | { 11 | class VdbResource : public ResourceBase 12 | { 13 | public: 14 | explicit VdbResource(ResourceKey key, openvdb::GridBase::Ptr && grid); 15 | 16 | ~VdbResource() = default; 17 | 18 | nodes::float3 getGridSize() const; 19 | 20 | private: 21 | openvdb::GridBase::Ptr m_grid; 22 | 23 | void loadImpl() override; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /gladius/src/api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(GladiusLib_component/Implementations/Cpp) 3 | 4 | install(DIRECTORY GladiusLib_component/Bindings/ DESTINATION ${INSTALL_PREFIX}/bindings/) 5 | install(DIRECTORY GladiusLib_component/Implementations/Cpp/Interfaces/ DESTINATION ${INSTALL_PREFIX}/bindings/CppDynamic/) 6 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CDynamic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[[++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated CMake Project that demonstrates the 10 | usage of the C bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | 15 | ]] 16 | 17 | cmake_minimum_required(VERSION 3.5) 18 | 19 | set(CMAKE_CURRENT_BINDING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../Bindings/CDynamic) 20 | 21 | project(GladiusLibExample_CDynamic C) 22 | 23 | SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_BINDING_DIR}/gladiuslib_dynamic.cc" PROPERTIES LANGUAGE C) 24 | add_executable(GladiusLibExample_CDynamic 25 | "${CMAKE_CURRENT_SOURCE_DIR}/GladiusLib_example.c" 26 | "${CMAKE_CURRENT_BINDING_DIR}/gladiuslib_dynamic.cc" 27 | 28 | ) 29 | set_property(TARGET GladiusLibExample_CDynamic PROPERTY C_STANDARD 99) 30 | if (UNIX) 31 | target_link_libraries(GladiusLibExample_CDynamic ${CMAKE_DL_LIBS}) 32 | endif (UNIX) 33 | target_include_directories(GladiusLibExample_CDynamic PRIVATE "${CMAKE_CURRENT_BINDING_DIR}") 34 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CDynamic/GladiusLib_example.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated C application that demonstrates the 10 | usage of the C bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | */ 15 | 16 | #include 17 | #include 18 | #include "gladius_dynamic.h" 19 | 20 | 21 | void releaseWrapper(sGladiusLibDynamicWrapperTable* pWrapperTable) { 22 | GladiusLibResult eResult = ReleaseGladiusLibWrapperTable(pWrapperTable); 23 | if (GLADIUSLIB_SUCCESS != eResult) { 24 | printf_s("Failed to release wrapper table\n"); 25 | } 26 | } 27 | 28 | int main() 29 | { 30 | // TODO: put a path to GladiusLib binary file here: 31 | const char* libpath = ""; 32 | sGladiusLibDynamicWrapperTable sWrapperTable; 33 | GladiusLibResult eResult = GLADIUSLIB_SUCCESS; 34 | 35 | eResult = InitGladiusLibWrapperTable(&sWrapperTable); 36 | if (GLADIUSLIB_SUCCESS != eResult) { 37 | printf_s("Failed to initialize wrapper table\n"); 38 | return eResult; 39 | } 40 | 41 | eResult = LoadGladiusLibWrapperTable(&sWrapperTable, libpath); 42 | if (GLADIUSLIB_SUCCESS != eResult) { 43 | printf_s("Failed to load gladius-binary\n"); 44 | return eResult; 45 | } 46 | GladiusLib_uint32 nMajor, nMinor, nMicro; 47 | eResult = sWrapperTable.m_GetVersion(&nMajor, &nMinor, &nMicro); 48 | if (GLADIUSLIB_SUCCESS != eResult) { 49 | printf_s("Failed to get version\n"); 50 | releaseWrapper(&sWrapperTable); 51 | return eResult; 52 | } 53 | printf_s("GladiusLib.Version = %d.%d.%d", nMajor, nMinor, nMicro); 54 | 55 | printf_s("\n"); 56 | 57 | eResult = ReleaseGladiusLibWrapperTable(&sWrapperTable); 58 | if (GLADIUSLIB_SUCCESS != eResult) { 59 | printf_s("Failed to release wrapper table\n"); 60 | return eResult; 61 | } 62 | 63 | return 0; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/GladiusLib_Example.cs: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated CSharp application that demonstrates the 10 | usage of the CSharp bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | */ 15 | 16 | 17 | using System; 18 | namespace GladiusLib_Example 19 | { 20 | class GladiusLib_Example 21 | { 22 | static void Main() 23 | { 24 | try 25 | { 26 | UInt32 nMajor, nMinor, nMicro; 27 | GladiusLib.Wrapper.GetVersion(out nMajor, out nMinor, out nMicro); 28 | string versionString = string.Format("GladiusLib.version = {0}.{1}.{2}", nMajor, nMinor, nMicro); 29 | Console.WriteLine(versionString); 30 | } 31 | catch (Exception e) 32 | { 33 | Console.WriteLine("Exception: \"" + e.Message + "\""); 34 | } 35 | Console.WriteLine("Press any key to exit."); 36 | Console.ReadKey(); 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/GladiusLib_Example.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | GladiusLib_Example.GladiusLib_Example 7 | 8 | x64 9 | 10 | 11 | true 12 | 13 | 14 | true 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/GladiusLib_Example.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.539 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("1cb5996e-af70-4c29-975f-7c38b25d6d2b") = "GladiusLib_Example", "GladiusLib_Example.csproj", "10cd2f9a-4753-4964-86e9-614104242c46" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | 10cd2f9a-4753-4964-86e9-614104242c46.Debug|x64.ActiveCfg = Debug|x64 15 | 10cd2f9a-4753-4964-86e9-614104242c46.Debug|x64.Build.0 = Debug|x64 16 | 10cd2f9a-4753-4964-86e9-614104242c46.Release|x64.ActiveCfg = Release|x64 17 | 10cd2f9a-4753-4964-86e9-614104242c46.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = 36558588-1b34-4be3-8fe1-6841187a91db 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Debug/netcoreapp2.0/.NETCoreApp,Version=v2.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v2.0", FrameworkDisplayName = ".NET Core 2.0")] 5 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Debug/netcoreapp2.0/GladiusLib_Example.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("GladiusLib_Example")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("GladiusLib_Example")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("GladiusLib_Example")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Debug/netcoreapp2.0/GladiusLib_Example.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | bce65efa3fcedc664b58de75f6135c307fcaa6d7 2 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Debug/netcoreapp2.0/GladiusLib_Example.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.RootNamespace = GladiusLib_Example 3 | build_property.ProjectDir = D:\orj\projects\gladius\gladius\src\api\GladiusLib_component\Examples\CSharp\ 4 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Release/netcoreapp2.0/.NETCoreApp,Version=v2.0.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v2.0", FrameworkDisplayName = ".NET Core 2.0")] 5 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Release/netcoreapp2.0/GladiusLib_Example.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("GladiusLib_Example")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("GladiusLib_Example")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("GladiusLib_Example")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Release/netcoreapp2.0/GladiusLib_Example.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | e569cebe3fc90af935cc01c001c86ea6ba5dd57d 2 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CSharp/obj/x64/Release/netcoreapp2.0/GladiusLib_Example.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.RootNamespace = GladiusLib_Example 3 | build_property.ProjectDir = D:\orj\projects\gladius\gladius\src\api\GladiusLib_component\Examples\CSharp\ 4 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/Cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[[++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated CMake Project that demonstrates the 10 | usage of the C++ bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | 15 | ]] 16 | 17 | cmake_minimum_required(VERSION 3.5) 18 | 19 | set(CMAKE_CURRENT_BINDING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../Bindings/Cpp) 20 | project(GladiusLibExample_CPPImplicit) 21 | add_executable(GladiusLibExample_CPPImplicit "${CMAKE_CURRENT_SOURCE_DIR}/GladiusLib_example.cpp") 22 | find_library(GLADIUSLOCATION gladius "${CMAKE_CURRENT_SOURCE_DIR}/../../Implementations/*/*/*") 23 | target_link_libraries(GladiusLibExample_CPPImplicit ${GLADIUSLOCATION}) 24 | target_include_directories(GladiusLibExample_CPPImplicit PRIVATE "${CMAKE_CURRENT_BINDING_DIR}") 25 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/Cpp/GladiusLib_example.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated C++ application that demonstrates the 10 | usage of the C++ bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | */ 15 | 16 | #include 17 | #include 18 | 19 | #include "gladius_implicit.hpp" 20 | 21 | 22 | int main() 23 | { 24 | std::cout << "Welcome to the GladiusLib (CppDynamic) Example\n"; 25 | 26 | try 27 | { 28 | auto wrapper = GladiusLib::CWrapper::loadLibrary(); 29 | GladiusLib_uint32 nMajor, nMinor, nMicro; 30 | wrapper->GetVersion(nMajor, nMinor, nMicro); 31 | std::cout << "GladiusLib.Version = " << nMajor << "." << nMinor << "." << nMicro; 32 | std::cout << std::endl; 33 | auto gladius = wrapper->CreateGladius(); 34 | gladius->LoadAssembly("D:/gladiusModels/brioMirandaTrack/BrioMirandaTrack_144_mm_M_F.json"); 35 | } 36 | catch (std::exception &e) 37 | { 38 | std::cout << e.what() << std::endl; 39 | return 1; 40 | } 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/CppDynamic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #[[++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated CMake Project that demonstrates the 10 | usage of the Dynamic C++ bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | 15 | ]] 16 | 17 | cmake_minimum_required(VERSION 3.5) 18 | 19 | set(CMAKE_CURRENT_BINDING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../Bindings/CppDynamic) 20 | project(GladiusLibExample_CPPDynamic) 21 | add_executable(GladiusLibExample_CPPDynamic "${CMAKE_CURRENT_SOURCE_DIR}/GladiusLib_example.cpp") 22 | if (UNIX) 23 | target_link_libraries(GladiusLibExample_CPPDynamic ${CMAKE_DL_LIBS}) 24 | endif (UNIX) 25 | target_include_directories(GladiusLibExample_CPPDynamic PRIVATE "${CMAKE_CURRENT_BINDING_DIR}") 26 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/Python/GladiusLib_Example.py: -------------------------------------------------------------------------------- 1 | '''++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated Python application that demonstrates the 10 | usage of the Python bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | ''' 15 | 16 | 17 | import os 18 | import sys 19 | sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "Bindings", "Python")) 20 | import GladiusLib 21 | 22 | 23 | def main(): 24 | cwd = os.getcwd() 25 | origDir = cwd 26 | os.chdir(cwd + "/../../Implementations/Cpp") 27 | cwd = os.getcwd() 28 | print("Current working directory: {0}".format(cwd)) 29 | libpath = cwd 30 | wrapper = GladiusLib.Wrapper(libraryName = os.path.join(libpath, "gladiuslib")) 31 | 32 | major, minor, micro = wrapper.GetVersion() 33 | print("GladiusLib version: {:d}.{:d}.{:d}".format(major, minor, micro), end="") 34 | print("") 35 | 36 | gladius = wrapper.CreateGladius() 37 | gladius.LoadAssembly("D:/gladiusModels/gravitrax/spacer.json") 38 | 39 | for height_mm in [20, 40, 80]: 40 | gladius.SetFloatParameter("Assembly", "Part_5", "part_height", height_mm) 41 | filename = origDir + "/spacer{:1.1f}_mm.stl".format(height_mm) 42 | gladius.ExportSTL(filename) 43 | #z_height = 10.0 44 | #contour = gladius.GenerateContour(z_height, 0.0) 45 | #print("Number of polygons in contour: {}".format(contour.GetSize())) 46 | 47 | 48 | 49 | if __name__ == "__main__": 50 | try: 51 | main() 52 | except GladiusLib.EGladiusLibException as e: 53 | print(e) 54 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/Python/ToyTrack.py: -------------------------------------------------------------------------------- 1 | '''++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated Python application that demonstrates the 10 | usage of the Python bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | ''' 15 | 16 | 17 | import os 18 | import sys 19 | sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "Bindings", "Python")) 20 | import GladiusLib 21 | 22 | 23 | def main(): 24 | cwd = os.getcwd() 25 | origDir = cwd 26 | os.chdir(cwd + "/../../Implementations/Cpp") 27 | cwd = os.getcwd() 28 | print("Current working directory: {0}".format(cwd)) 29 | libpath = cwd 30 | wrapper = GladiusLib.Wrapper(libraryName = os.path.join(libpath, "gladiuslib")) 31 | 32 | major, minor, micro = wrapper.GetVersion() 33 | print("GladiusLib version: {:d}.{:d}.{:d}".format(major, minor, micro), end="") 34 | print("") 35 | 36 | gladius = wrapper.CreateGladius() 37 | gladius.LoadAssembly("D:/gladiusModels/brioMirandaTrack/BrioMirandaTrack_144_mm_M_F.json") 38 | 39 | for partLength in [20,120]: 40 | gladius.SetFloatParameter("Assembly", "Part_9", "part_length", partLength) 41 | filename = origDir + "/track_{:1.1f}_mm.stl".format(partLength) 42 | for z in [0, 1, 2, 3, 4] : 43 | contour = gladius.GenerateContour(z, 0.0) 44 | print("Number of polygons in contour: {}".format(contour.GetSize())) 45 | # gladius.ExportSTL(filename) 46 | 47 | 48 | 49 | if __name__ == "__main__": 50 | try: 51 | main() 52 | except GladiusLib.EGladiusLibException as e: 53 | print(e) 54 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Examples/Python/VCore3PanelRight.py: -------------------------------------------------------------------------------- 1 | '''++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated Python application that demonstrates the 10 | usage of the Python bindings of GladiusLib 11 | 12 | Interface version: 1.0.0 13 | 14 | ''' 15 | 16 | 17 | import os 18 | import sys 19 | sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "Bindings", "Python")) 20 | import GladiusLib 21 | 22 | 23 | def main(): 24 | cwd = os.getcwd() 25 | origDir = cwd 26 | os.chdir(cwd + "/../../Implementations/Cpp") 27 | cwd = os.getcwd() 28 | print("Current working directory: {0}".format(cwd)) 29 | libpath = cwd 30 | wrapper = GladiusLib.Wrapper(libraryName = os.path.join(libpath, "gladiuslib")) 31 | 32 | major, minor, micro = wrapper.GetVersion() 33 | print("GladiusLib version: {:d}.{:d}.{:d}".format(major, minor, micro), end="") 34 | print("") 35 | 36 | gladius = wrapper.CreateGladius() 37 | gladius.LoadAssembly("D:/gladiusModels/vcore3case/sidepanel_right_hexagon.json") 38 | for y in range(5): 39 | for x in range(6): 40 | gladius.SetFloatParameter("Assembly", "Part_5", "part_col", x) 41 | gladius.SetFloatParameter("Assembly", "Part_5", "part_row", y) 42 | filename = origDir + "/tile_{}_{}.stl".format(x, y) 43 | gladius.ExportSTL(filename) 44 | print("After Export col : {} row: {}".format(gladius.GetFloatParameter("Assembly", "Part_5", "part_col"), gladius.GetFloatParameter("Assembly", "Part_5", "part_row"))) 45 | 46 | 47 | 48 | if __name__ == "__main__": 49 | try: 50 | main() 51 | except GladiusLib.EGladiusLibException as e: 52 | print(e) 53 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Interfaces/gladius_interfaceexception.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2023 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated C++ Implementation file with the basic internal 10 | exception type in order to allow an easy use of GladiusLib 11 | 12 | Interface version: 1.2.0 13 | 14 | */ 15 | 16 | 17 | #include 18 | 19 | #include "gladius_interfaceexception.hpp" 20 | 21 | /************************************************************************************************************************* 22 | Class EGladiusLibInterfaceException 23 | **************************************************************************************************************************/ 24 | EGladiusLibInterfaceException::EGladiusLibInterfaceException(GladiusLibResult errorCode) 25 | : m_errorMessage("GladiusLib Error " + std::to_string (errorCode)) 26 | { 27 | m_errorCode = errorCode; 28 | } 29 | 30 | EGladiusLibInterfaceException::EGladiusLibInterfaceException(GladiusLibResult errorCode, std::string errorMessage) 31 | : m_errorMessage(errorMessage + " (" + std::to_string (errorCode) + ")") 32 | { 33 | m_errorCode = errorCode; 34 | } 35 | 36 | GladiusLibResult EGladiusLibInterfaceException::getErrorCode () 37 | { 38 | return m_errorCode; 39 | } 40 | 41 | const char * EGladiusLibInterfaceException::what () const noexcept 42 | { 43 | return m_errorMessage.c_str(); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Interfaces/gladius_interfaceexception.hpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2023 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated C++ Header file with the basic internal 10 | exception type in order to allow an easy use of GladiusLib 11 | 12 | Interface version: 1.2.0 13 | 14 | */ 15 | 16 | #ifndef __GLADIUSLIB_INTERFACEEXCEPTION_HEADER 17 | #define __GLADIUSLIB_INTERFACEEXCEPTION_HEADER 18 | 19 | #include 20 | #include 21 | #include "gladius_types.hpp" 22 | 23 | /************************************************************************************************************************* 24 | Class EGladiusLibInterfaceException 25 | **************************************************************************************************************************/ 26 | 27 | 28 | class EGladiusLibInterfaceException : public std::exception { 29 | protected: 30 | /** 31 | * Error code for the Exception. 32 | */ 33 | GladiusLibResult m_errorCode; 34 | /** 35 | * Error message for the Exception. 36 | */ 37 | std::string m_errorMessage; 38 | 39 | public: 40 | /** 41 | * Exception Constructor. 42 | */ 43 | EGladiusLibInterfaceException(GladiusLibResult errorCode); 44 | 45 | /** 46 | * Custom Exception Constructor. 47 | */ 48 | EGladiusLibInterfaceException(GladiusLibResult errorCode, std::string errorMessage); 49 | 50 | /** 51 | * Returns error code 52 | */ 53 | GladiusLibResult getErrorCode(); 54 | /** 55 | * Returns error message 56 | */ 57 | const char* what() const noexcept override; 58 | }; 59 | 60 | #endif // __GLADIUSLIB_INTERFACEEXCEPTION_HEADER 61 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | This file has been generated by the Automatic Component Toolkit (ACT) version 1.6.0. 8 | 9 | Abstract: This is an autogenerated C++ implementation file in order to allow easy 10 | development of GladiusLib. It needs to be generated only once. 11 | 12 | Interface version: 1.0.0 13 | 14 | */ 15 | 16 | #include "gladius_abi.hpp" 17 | #include "gladius_gladius.hpp" 18 | #include "gladius_interfaces.hpp" 19 | #include "gladius_interfaceexception.hpp" 20 | 21 | using namespace GladiusLib; 22 | using namespace GladiusLib::Impl; 23 | 24 | void CWrapper::GetVersion(GladiusLib_uint32 & nMajor, GladiusLib_uint32 & nMinor, GladiusLib_uint32 & nMicro) 25 | { 26 | nMajor = GLADIUSLIB_VERSION_MAJOR; 27 | nMinor = GLADIUSLIB_VERSION_MINOR; 28 | nMicro = GLADIUSLIB_VERSION_MICRO; 29 | } 30 | 31 | bool CWrapper::GetLastError(IBase* pInstance, std::string & sErrorMessage) 32 | { 33 | return pInstance->GetLastErrorMessage(sErrorMessage); 34 | } 35 | 36 | void CWrapper::AcquireInstance(IBase* pInstance) 37 | { 38 | IBase::AcquireBaseClassInterface(pInstance); 39 | } 40 | 41 | void CWrapper::ReleaseInstance(IBase* pInstance) 42 | { 43 | IBase::ReleaseBaseClassInterface(pInstance); 44 | } 45 | 46 | IGladius * CWrapper::CreateGladius() 47 | { 48 | return new CGladius(); 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_base.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is a stub class definition of CBase 8 | 9 | */ 10 | 11 | #include "gladius_base.hpp" 12 | #include "gladius_interfaceexception.hpp" 13 | 14 | // Include custom headers here. 15 | 16 | 17 | using namespace GladiusLib::Impl; 18 | 19 | /************************************************************************************************************************* 20 | Class definition of CBase 21 | **************************************************************************************************************************/ 22 | 23 | bool CBase::GetLastErrorMessage(std::string & sErrorMessage) 24 | { 25 | if (m_pErrors && !m_pErrors->empty()) { 26 | sErrorMessage = m_pErrors->back(); 27 | return true; 28 | } else { 29 | sErrorMessage = ""; 30 | return false; 31 | } 32 | } 33 | 34 | void CBase::ClearErrorMessages() 35 | { 36 | m_pErrors.reset(); 37 | } 38 | 39 | void CBase::RegisterErrorMessage(const std::string & sErrorMessage) 40 | { 41 | if (!m_pErrors) { 42 | m_pErrors.reset(new std::list()); 43 | } 44 | m_pErrors->clear(); 45 | m_pErrors->push_back(sErrorMessage); 46 | } 47 | 48 | void CBase::IncRefCount() 49 | { 50 | ++m_nReferenceCount; 51 | } 52 | 53 | bool CBase::DecRefCount() 54 | { 55 | m_nReferenceCount--; 56 | if (!m_nReferenceCount) { 57 | delete this; 58 | return true; 59 | } 60 | return false; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_base.hpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is the class declaration of CBase 8 | 9 | */ 10 | 11 | 12 | #ifndef __GLADIUSLIB_BASE 13 | #define __GLADIUSLIB_BASE 14 | 15 | #include "gladius_interfaces.hpp" 16 | #include 17 | #include 18 | #include 19 | 20 | 21 | // Include custom headers here. 22 | 23 | 24 | namespace GladiusLib { 25 | namespace Impl { 26 | 27 | 28 | /************************************************************************************************************************* 29 | Class declaration of CBase 30 | **************************************************************************************************************************/ 31 | 32 | class CBase : public virtual IBase { 33 | private: 34 | 35 | std::unique_ptr> m_pErrors; 36 | GladiusLib_uint32 m_nReferenceCount = 1; 37 | 38 | /** 39 | * Put private members here. 40 | */ 41 | 42 | protected: 43 | 44 | /** 45 | * Put protected members here. 46 | */ 47 | 48 | public: 49 | 50 | /** 51 | * Put additional public members here. They will not be visible in the external API. 52 | */ 53 | 54 | bool GetLastErrorMessage(std::string & sErrorMessage) override; 55 | 56 | void ClearErrorMessages() override; 57 | 58 | void RegisterErrorMessage(const std::string & sErrorMessage) override; 59 | 60 | void IncRefCount() override; 61 | 62 | bool DecRefCount() override; 63 | 64 | 65 | /** 66 | * Public member functions to implement. 67 | */ 68 | 69 | }; 70 | 71 | } // namespace Impl 72 | } // namespace GladiusLib 73 | 74 | #endif // __GLADIUSLIB_BASE 75 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_boundingbox.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is a stub class definition of CBoundingBox 8 | 9 | */ 10 | 11 | #include "gladius_boundingbox.hpp" 12 | #include "gladius_interfaceexception.hpp" 13 | 14 | // Include custom headers here. 15 | 16 | 17 | using namespace GladiusLib::Impl; 18 | 19 | /************************************************************************************************************************* 20 | Class definition of CBoundingBox 21 | **************************************************************************************************************************/ 22 | 23 | GladiusLib::sVector3f CBoundingBox::GetMin() 24 | { 25 | return m_min; 26 | } 27 | 28 | GladiusLib::sVector3f CBoundingBox::GetMax() 29 | { 30 | return m_max; 31 | } 32 | 33 | void CBoundingBox::setMin(sGladiusLibVector3f min) 34 | { 35 | m_min = min; 36 | } 37 | 38 | void CBoundingBox::setMax(sGladiusLibVector3f max) 39 | { 40 | m_max = max; 41 | } 42 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_boundingbox.hpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is the class declaration of CBoundingBox 8 | 9 | */ 10 | 11 | #ifndef __GLADIUSLIB_BOUNDINGBOX 12 | #define __GLADIUSLIB_BOUNDINGBOX 13 | 14 | #include "gladius_interfaces.hpp" 15 | 16 | // Parent classes 17 | #include "gladius_base.hpp" 18 | #ifdef _MSC_VER 19 | #pragma warning(push) 20 | #pragma warning(disable : 4250) 21 | #endif 22 | 23 | // Include custom headers here. 24 | 25 | namespace GladiusLib 26 | { 27 | namespace Impl 28 | { 29 | 30 | /************************************************************************************************************************* 31 | Class declaration of CBoundingBox 32 | **************************************************************************************************************************/ 33 | 34 | class CBoundingBox : public virtual IBoundingBox, public virtual CBase 35 | { 36 | public: 37 | GladiusLib::sVector3f GetMin() override; 38 | GladiusLib::sVector3f GetMax() override; 39 | 40 | void setMin(sGladiusLibVector3f min); 41 | void setMax(sGladiusLibVector3f max); 42 | private: 43 | sGladiusLibVector3f m_min; 44 | sGladiusLibVector3f m_max; 45 | 46 | }; 47 | 48 | } // namespace Impl 49 | } // namespace GladiusLib 50 | 51 | #ifdef _MSC_VER 52 | #pragma warning(pop) 53 | #endif 54 | #endif // __GLADIUSLIB_BOUNDINGBOX 55 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_contouraccessor.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is a stub class definition of CContourAccessor 8 | 9 | */ 10 | 11 | #include "gladius_contouraccessor.hpp" 12 | 13 | #include 14 | 15 | #include "gladius_interfaceexception.hpp" 16 | #include "gladius_polygonaccessor.hpp" 17 | 18 | // Include custom headers here. 19 | 20 | 21 | using namespace GladiusLib::Impl; 22 | 23 | /************************************************************************************************************************* 24 | Class definition of CContourAccessor 25 | **************************************************************************************************************************/ 26 | 27 | void CContourAccessor::setContour(gladius::SharedPolyLines resource) 28 | { 29 | m_polyLines = std::move(resource); 30 | m_iter = m_polyLines->cbegin(); 31 | } 32 | 33 | IPolygonAccessor * CContourAccessor::GetCurrentPolygon() 34 | { 35 | if (m_polyLines->empty()) 36 | { 37 | throw std::out_of_range("Contour is empty"); 38 | } 39 | auto * const accessor = new CPolygonAccessor(); 40 | accessor->setPolygon(m_polyLines, m_iter); 41 | return accessor; 42 | } 43 | 44 | GladiusLib_uint64 CContourAccessor::GetSize() 45 | { 46 | return m_polyLines->size(); 47 | } 48 | 49 | bool CContourAccessor::Next() 50 | { 51 | if (m_polyLines->empty() || std::next(m_iter) == std::cend(*m_polyLines)) 52 | { 53 | return false; 54 | } 55 | ++m_iter; 56 | return true; 57 | } 58 | 59 | bool CContourAccessor::Prev() 60 | { 61 | if (m_iter == std::cbegin(*m_polyLines)) 62 | { 63 | return false; 64 | } 65 | --m_iter; 66 | return true; 67 | } 68 | 69 | void CContourAccessor::Begin() 70 | { 71 | m_iter = std::cbegin(*m_polyLines); 72 | } 73 | 74 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_face.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is a stub class definition of CFace 8 | 9 | */ 10 | 11 | #include "gladius_face.hpp" 12 | 13 | #include "gladius_interfaceexception.hpp" 14 | #include 15 | 16 | // Include custom headers here. 17 | 18 | using namespace GladiusLib::Impl; 19 | 20 | /************************************************************************************************************************* 21 | Class definition of CFace 22 | **************************************************************************************************************************/ 23 | 24 | GladiusLib::sVector3f toSVector3f(gladius::Vector3 vector) 25 | { 26 | return GladiusLib::sVector3f{vector.x(), vector.y(), vector.z()}; 27 | } 28 | 29 | CFace::CFace(gladius::Face face) 30 | : m_face(std::move(face)) 31 | { 32 | } 33 | 34 | GladiusLib::sVector3f CFace::GetVertexA() 35 | { 36 | return toSVector3f(m_face.vertices[0]); 37 | } 38 | 39 | GladiusLib::sVector3f CFace::GetVertexB() 40 | { 41 | return toSVector3f(m_face.vertices[1]); 42 | } 43 | 44 | GladiusLib::sVector3f CFace::GetVertexC() 45 | { 46 | return toSVector3f(m_face.vertices[2]); 47 | } 48 | 49 | GladiusLib::sVector3f CFace::GetNormal() 50 | { 51 | return toSVector3f(m_face.normal); 52 | } 53 | 54 | GladiusLib::sVector3f CFace::GetNormalA() 55 | { 56 | return toSVector3f(m_face.vertexNormals[0]); 57 | } 58 | 59 | GladiusLib::sVector3f CFace::GetNormalB() 60 | { 61 | return toSVector3f(m_face.vertexNormals[1]); 62 | } 63 | 64 | GladiusLib::sVector3f CFace::GetNormalC() 65 | { 66 | return toSVector3f(m_face.vertexNormals[2]); 67 | } 68 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_faceaccessor.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is a stub class definition of CFaceAccessor 8 | 9 | */ 10 | 11 | #include "gladius_faceaccessor.hpp" 12 | 13 | #include 14 | 15 | #include "gladius_face.hpp" 16 | #include "gladius_interfaceexception.hpp" 17 | 18 | // Include custom headers here. 19 | 20 | 21 | using namespace GladiusLib::Impl; 22 | 23 | /************************************************************************************************************************* 24 | Class definition of CFaceAccessor 25 | **************************************************************************************************************************/ 26 | 27 | void CFaceAccessor::setMesh(gladius::SharedMesh mesh) 28 | { 29 | m_mesh = std::move(mesh); 30 | } 31 | 32 | IFace * CFaceAccessor::GetCurrentFace() 33 | { 34 | return new CFace(m_mesh->getFace(m_index)); 35 | } 36 | 37 | GladiusLib_uint64 CFaceAccessor::GetSize() 38 | { 39 | return m_mesh->getNumberOfFaces(); 40 | } 41 | 42 | bool CFaceAccessor::Next() 43 | { 44 | if (m_index + 2 < GetSize()) 45 | { 46 | ++m_index; 47 | return true; 48 | } 49 | 50 | 51 | return false; 52 | } 53 | 54 | bool CFaceAccessor::Prev() 55 | { 56 | if (m_index > 0) 57 | { 58 | --m_index; 59 | return true; 60 | } 61 | 62 | return false; 63 | } 64 | 65 | void CFaceAccessor::Begin() 66 | { 67 | m_index = 0u; 68 | } 69 | 70 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_faceaccessor.hpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is the class declaration of CFaceAccessor 8 | 9 | */ 10 | 11 | #ifndef __GLADIUSLIB_FACEACCESSOR 12 | #define __GLADIUSLIB_FACEACCESSOR 13 | 14 | #include "gladius_interfaces.hpp" 15 | 16 | // Parent classes 17 | #include "Mesh.h" 18 | #include "gladius_face.hpp" 19 | #include "gladius_resourceaccessor.hpp" 20 | #ifdef _MSC_VER 21 | #pragma warning(push) 22 | #pragma warning(disable : 4250) 23 | #endif 24 | 25 | // Include custom headers here. 26 | 27 | namespace GladiusLib 28 | { 29 | namespace Impl 30 | { 31 | 32 | /************************************************************************************************************************* 33 | Class declaration of CFaceAccessor 34 | **************************************************************************************************************************/ 35 | 36 | class CFaceAccessor : public virtual IFaceAccessor, public virtual CResourceAccessor 37 | { 38 | public: 39 | /** 40 | * Put additional public members here. They will not be visible in the external API. 41 | */ 42 | 43 | void setMesh(gladius::SharedMesh mesh); 44 | /** 45 | * Public member functions to implement. 46 | */ 47 | 48 | IFace * GetCurrentFace() override; 49 | GladiusLib_uint64 GetSize() override; 50 | bool Next() override; 51 | bool Prev() override; 52 | void Begin() override; 53 | 54 | private: 55 | gladius::SharedMesh m_mesh{}; 56 | size_t m_index{}; 57 | }; 58 | 59 | } // namespace Impl 60 | } // namespace GladiusLib 61 | 62 | #ifdef _MSC_VER 63 | #pragma warning(pop) 64 | #endif 65 | #endif // __GLADIUSLIB_FACEACCESSOR 66 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_resourceaccessor.cpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is a stub class definition of CResourceAccessor 8 | 9 | */ 10 | 11 | #include "gladius_resourceaccessor.hpp" 12 | #include "gladius_interfaceexception.hpp" 13 | 14 | // Include custom headers here. 15 | 16 | 17 | using namespace GladiusLib::Impl; 18 | 19 | /************************************************************************************************************************* 20 | Class definition of CResourceAccessor 21 | **************************************************************************************************************************/ 22 | 23 | GladiusLib_uint64 CResourceAccessor::GetSize() 24 | { 25 | throw EGladiusLibInterfaceException(GLADIUSLIB_ERROR_NOTIMPLEMENTED); 26 | } 27 | 28 | bool CResourceAccessor::Next() 29 | { 30 | throw EGladiusLibInterfaceException(GLADIUSLIB_ERROR_NOTIMPLEMENTED); 31 | } 32 | 33 | bool CResourceAccessor::Prev() 34 | { 35 | throw EGladiusLibInterfaceException(GLADIUSLIB_ERROR_NOTIMPLEMENTED); 36 | } 37 | 38 | void CResourceAccessor::Begin() 39 | { 40 | throw EGladiusLibInterfaceException(GLADIUSLIB_ERROR_NOTIMPLEMENTED); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/Implementations/Cpp/Stub/gladius_resourceaccessor.hpp: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (C) 2021 Jan Orend 4 | 5 | All rights reserved. 6 | 7 | Abstract: This is the class declaration of CResourceAccessor 8 | 9 | */ 10 | 11 | 12 | #ifndef __GLADIUSLIB_RESOURCEACCESSOR 13 | #define __GLADIUSLIB_RESOURCEACCESSOR 14 | 15 | #include "gladius_interfaces.hpp" 16 | 17 | // Parent classes 18 | #include "gladius_base.hpp" 19 | #ifdef _MSC_VER 20 | #pragma warning(push) 21 | #pragma warning(disable : 4250) 22 | #endif 23 | 24 | // Include custom headers here. 25 | 26 | 27 | namespace GladiusLib { 28 | namespace Impl { 29 | 30 | 31 | /************************************************************************************************************************* 32 | Class declaration of CResourceAccessor 33 | **************************************************************************************************************************/ 34 | 35 | class CResourceAccessor : public virtual IResourceAccessor, public virtual CBase { 36 | private: 37 | 38 | /** 39 | * Put private members here. 40 | */ 41 | 42 | protected: 43 | 44 | /** 45 | * Put protected members here. 46 | */ 47 | 48 | public: 49 | 50 | /** 51 | * Put additional public members here. They will not be visible in the external API. 52 | */ 53 | 54 | 55 | /** 56 | * Public member functions to implement. 57 | */ 58 | 59 | GladiusLib_uint64 GetSize() override; 60 | 61 | bool Next() override; 62 | 63 | bool Prev() override; 64 | 65 | void Begin() override; 66 | }; 67 | 68 | } // namespace Impl 69 | } // namespace GladiusLib 70 | 71 | #ifdef _MSC_VER 72 | #pragma warning(pop) 73 | #endif 74 | #endif // __GLADIUSLIB_RESOURCEACCESSOR 75 | -------------------------------------------------------------------------------- /gladius/src/api/GladiusLib_component/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2023 Jan Orend 2 | 3 | All rights reserved. 4 | 5 | 6 | -------------------------------------------------------------------------------- /gladius/src/compute/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(BINARY ${CMAKE_PROJECT_NAME}) 3 | file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS LIST_DIRECTORIES true *.h *.cpp) 4 | target_sources(${BINARY}_lib PRIVATE ${SOURCES}) 5 | target_sources(${BINARY} PRIVATE ${SOURCES}) 6 | 7 | target_include_directories(${BINARY}_lib PRIVATE ./) 8 | target_include_directories(${BINARY} PRIVATE ./) -------------------------------------------------------------------------------- /gladius/src/compute/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace gladius 8 | { 9 | 10 | using ComputeToken = std::lock_guard; 11 | using OptionalComputeToken = std::optional; 12 | enum class RequiredCapabilities 13 | { 14 | ComputeOnly, 15 | OpenGLInterop 16 | }; 17 | 18 | struct PlainImage 19 | { 20 | std::vector data; 21 | size_t width; 22 | size_t height; 23 | }; 24 | 25 | enum class CodeGenerator 26 | { 27 | Code, 28 | CommandStream, 29 | Automatic 30 | }; 31 | 32 | } -------------------------------------------------------------------------------- /gladius/src/contour/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(BINARY ${CMAKE_PROJECT_NAME}) 3 | file(GLOB_RECURSE SOURCES LIST_DIRECTORIES true *.h *.cpp) 4 | target_sources(${BINARY}_lib PRIVATE ${SOURCES}) 5 | target_sources(${BINARY} PRIVATE ${SOURCES}) 6 | 7 | target_include_directories(${BINARY}_lib PRIVATE ./) 8 | target_include_directories(${BINARY} PRIVATE ./) 9 | -------------------------------------------------------------------------------- /gladius/src/contour/ContourValidator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "../Contour.h" 6 | 7 | 8 | namespace gladius::contour 9 | { 10 | struct ValidationResult 11 | { 12 | bool intersectionFree = false; 13 | }; 14 | 15 | 16 | 17 | bool endCrossesStart(PolyLine & polyLine); 18 | 19 | ValidationResult validate(PolyLine & polyLine, size_t numberOfNeighbors = 50u); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /gladius/src/contour/PointsToContour.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "QuadTree.h" 3 | #include "utils.h" 4 | 5 | 6 | namespace gladius::contour 7 | { 8 | 9 | float determineConnectionCost(PointWithNormal const & start, PointWithNormal const & end); 10 | 11 | PolyLines convertToPolylines(QuadTree & pointCloud, float maxVertexDistance); 12 | } 13 | -------------------------------------------------------------------------------- /gladius/src/contour/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Contour.h" 4 | 5 | #include 6 | 7 | namespace gladius::contour::utils 8 | { 9 | std::optional intersectionOfTwoLineSegments(Vector2 p1, 10 | Vector2 p2, 11 | Vector2 p3, 12 | Vector2 p4, 13 | double tolerance = 5.E-2); 14 | 15 | std::optional 16 | intersectionOfTwoLines(Vector2 const p1, Vector2 const p2, Vector2 const p3, Vector2 const p4); 17 | } 18 | -------------------------------------------------------------------------------- /gladius/src/exceptions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace gladius 7 | { 8 | std::string getOpenCLErrorName(int error); 9 | std::string getOpenCLErrorDescription(int error); 10 | 11 | class GladiusException : public std::runtime_error 12 | { 13 | public: 14 | explicit GladiusException(std::string msg); 15 | }; 16 | 17 | class OpenCLError : public GladiusException 18 | { 19 | public: 20 | explicit OpenCLError(int ocl_error); 21 | }; 22 | 23 | class NoSuitableOpenCLDevicesFound : public GladiusException 24 | { 25 | public: 26 | NoSuitableOpenCLDevicesFound() 27 | : GladiusException( 28 | "Could not find any suitable OpenCL device. Please check if an OpenCL device (e.g. " 29 | "GPU) is " 30 | "installed as well as proper drivers for this device. Some devices may need an " 31 | "additional OpenCL runtime. If you are running Gladius inside a virtual machine " 32 | "lacking a GPU you may try to install a CPU based OpenCL runtime.") 33 | { 34 | } 35 | }; 36 | 37 | using NoValidBinaryStlFile = GladiusException; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /gladius/src/gladius.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/src/gladius.ico -------------------------------------------------------------------------------- /gladius/src/gladius.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE gladius.ico -------------------------------------------------------------------------------- /gladius/src/gladius.rc.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/src/gladius.rc.res -------------------------------------------------------------------------------- /gladius/src/gpgpu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define GPGPU_H 3 | #ifdef WIN32 4 | #ifndef NOMINMAX 5 | #define NOMINMAX 6 | #endif 7 | 8 | #include 9 | #include 10 | #endif 11 | 12 | #define GLFW_INCLUDE_NONE 13 | #include 14 | 15 | #include 16 | #define CL_HPP_TARGET_OPENCL_VERSION 120 17 | #define CL_HPP_MINIMUM_OPENCL_VERSION 120 18 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 19 | 20 | #ifndef CL_TARGET_OPENCL_VERSION 21 | #define CL_TARGET_OPENCL_VERSION 120 22 | #endif 23 | 24 | #include 25 | #include 26 | 27 | #ifdef __linux__ 28 | #include 29 | #endif 30 | 31 | #ifdef Success 32 | #undef Success 33 | #endif 34 | #ifdef Status 35 | #undef Status 36 | #endif 37 | #ifdef None 38 | #undef None 39 | #endif 40 | #ifdef Bool 41 | #undef Bool 42 | #endif 43 | -------------------------------------------------------------------------------- /gladius/src/io/3mf/ImageExtractor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ImageStack.h" 4 | #include "src/io/vdb.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace lodepng 14 | { 15 | LodePNGInfo getPNGHeaderInfo(const std::vector & png); 16 | } 17 | 18 | namespace gladius::io 19 | { 20 | 21 | std::filesystem::path removeLeadingSlash(std::filesystem::path const & path); 22 | 23 | using FileList = std::vector; 24 | 25 | 26 | class ImageExtractor 27 | { 28 | public: 29 | ImageExtractor() = default; 30 | ~ImageExtractor(); 31 | 32 | bool open(std::filesystem::path const & filename); 33 | void close(); 34 | std::vector loadFile(std::filesystem::path const & filename) const; 35 | ImageStack loadImageStack(FileList const & filenames); 36 | 37 | openvdb::GridBase::Ptr loadAsVdbGrid(FileList const & filenames) const; 38 | void printAllFiles() const; 39 | 40 | PixelFormat determinePixelFormat(std::filesystem::path const & filename) const; 41 | 42 | LodePNGInfo const & getPNGInfo() const; 43 | 44 | private: 45 | unzFile m_archive = nullptr; 46 | LodePNGInfo m_pngInfo{}; 47 | }; 48 | } // namespace gladius::io -------------------------------------------------------------------------------- /gladius/src/io/3mf/ImageStackCreator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace gladius::io 7 | { 8 | using Files = std::vector; 9 | 10 | 11 | 12 | class ImageStackCreator 13 | { 14 | public: 15 | Lib3MF::PFunctionFromImage3D importDirectoryAsFunctionFromImage3D(Lib3MF::PModel model, std::filesystem::path const& path); 16 | private: 17 | unsigned m_rows = 0; 18 | unsigned m_cols = 0; 19 | unsigned m_numSheets = 0; 20 | 21 | Files getFiles(std::filesystem::path const& path) const; 22 | 23 | void determineImageStackSize(Files const& files); 24 | Lib3MF::PImageStack addImageStackFromDirectory(Lib3MF::PModel model, std::filesystem::path const& path); 25 | }; 26 | } -------------------------------------------------------------------------------- /gladius/src/io/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(BINARY ${CMAKE_PROJECT_NAME}) 3 | file(GLOB_RECURSE SOURCES LIST_DIRECTORIES true *.h *.cpp) 4 | target_sources(${BINARY}_lib PRIVATE ${SOURCES}) 5 | target_sources(${BINARY} PRIVATE ${SOURCES}) 6 | 7 | target_include_directories(${BINARY}_lib PRIVATE ./ ../../components/nanovdb) 8 | target_include_directories(${BINARY} PRIVATE ./ ../../components/nanovdb) -------------------------------------------------------------------------------- /gladius/src/io/IExporter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace gladius 5 | { 6 | class ComputeCore; 7 | } 8 | namespace gladius::io 9 | { 10 | class IExporter 11 | { 12 | public: 13 | virtual ~IExporter() = default; 14 | 15 | virtual void beginExport(const std::filesystem::path & fileName, 16 | ComputeCore & generator) = 0; 17 | 18 | virtual bool advanceExport(ComputeCore & generator) = 0; 19 | 20 | virtual void finalize() = 0; 21 | 22 | [[nodiscard]] virtual double getProgress() const = 0; 23 | }; 24 | } -------------------------------------------------------------------------------- /gladius/src/io/ImageStackExporter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IExporter.h" 3 | 4 | #include "EventLogger.h" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace gladius::io 13 | { 14 | class ImageStackExporter : public IExporter 15 | { 16 | public: 17 | explicit ImageStackExporter(events::SharedLogger logger); 18 | 19 | void beginExport(const std::filesystem::path & fileName, ComputeCore & generator) override; 20 | bool advanceExport(ComputeCore & generator) override; 21 | 22 | [[nodiscard]] double getProgress() const override; 23 | 24 | void finalize() override; 25 | 26 | void setQualityLevel(size_t qualityLevel); 27 | 28 | private: 29 | void setLayerIncrement(float increment_mm); 30 | 31 | std::filesystem::path m_outputFilename{}; 32 | 33 | float m_layerIncrement_mm = 0.1f; 34 | float m_bandwidth_mm = m_layerIncrement_mm * 2.f; 35 | size_t m_qualityLevel = 1; // 3 = best quality, but insane high memory usage 36 | double m_progress = 0.; 37 | float m_startHeight_mm = 0.f; 38 | float m_endHeight_mm = 0.f; 39 | 40 | unsigned int m_currentSlice = 0; 41 | 42 | Lib3MF::PWrapper m_wrapper{}; 43 | Lib3MF::PModel m_model3mf; 44 | Lib3MF::PImageStack m_imageStack; 45 | Lib3MF_uint32 m_sheetcount = 0u; 46 | Lib3MF_uint32 m_columnCount = 0u; 47 | Lib3MF_uint32 m_rowCount = 0u; 48 | 49 | events::SharedLogger m_logger; 50 | }; 51 | } -------------------------------------------------------------------------------- /gladius/src/io/ImporterVdb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Parameter.h" 3 | #include "src/Primitives.h" 4 | #include 5 | 6 | namespace gladius 7 | { 8 | class Document; 9 | } 10 | 11 | namespace gladius::nodes 12 | { 13 | class Builder; 14 | } 15 | 16 | namespace gladius::io 17 | { 18 | class ImporterVdb 19 | { 20 | public: 21 | void load(std::filesystem::path const & filename, Document & doc); 22 | }; 23 | 24 | void loadFromOpenVdbFile(std::filesystem::path const filename, Document & doc); 25 | } -------------------------------------------------------------------------------- /gladius/src/io/vdb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef _MSC_VER 3 | #pragma warning(disable : 4244 4996 4251 4275 4267) 4 | #endif 5 | 6 | #ifdef __clang__ 7 | #pragma clang diagnostic push 8 | #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" 9 | #pragma clang diagnostic ignored "-Wnested-anon-types" 10 | #pragma clang diagnostic ignored "-Wdeprecated-copy" 11 | #pragma clang diagnostic ignored "-Wmissing-braces" 12 | #endif 13 | 14 | #define NANOVDB_USE_OPENVDB 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace gladius::io 30 | { 31 | using UnsignedCharTree = openvdb::tree::Tree4::Type; 32 | using OneChannelCharGrid = openvdb::Grid; 33 | } 34 | 35 | #ifdef __clang__ 36 | #pragma clang diagnostic pop 37 | #endif -------------------------------------------------------------------------------- /gladius/src/kernel/.clang-format: -------------------------------------------------------------------------------- 1 | #Features requiring a newer clang-format version than the one provided by VS2017 are commented out 2 | 3 | #AllowAllArgumentsOnNextLine: false 4 | #AllowAllConstructorInitializersOnNextLine: false 5 | #AllowShortLambdasOnASingleLine: All 6 | #BasedOnStyle: Microsoft 7 | #BreakInheritanceList: BeforeColon 8 | #IncludeBlocksStyle: Preserve 9 | #SpaceAfterLogicalNot: false 10 | #SpaceBeforeCpp11BracedList: true 11 | #SpaceBeforeInheritanceColon: true 12 | #SpaceBeforeRangeBasedForLoopColon: true 13 | #SpaceInEmptyBlock: false 14 | #Standard: Latest 15 | 16 | AlignAfterOpenBracket: true 17 | AllowAllParametersOfDeclarationOnNextLine: false 18 | AllowShortBlocksOnASingleLine: true 19 | AllowShortCaseLabelsOnASingleLine: false 20 | AllowShortFunctionsOnASingleLine: None 21 | AllowShortIfStatementsOnASingleLine: false 22 | AllowShortLoopsOnASingleLine: false 23 | AlwaysBreakAfterReturnType: None 24 | AlwaysBreakTemplateDeclarations: true 25 | BinPackArguments: false 26 | BinPackParameters: false 27 | BreakBeforeBraces: Allman 28 | BreakBeforeTernaryOperators: true 29 | BreakConstructorInitializers: BeforeComma 30 | ColumnLimit: 100 31 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 32 | ContinuationIndentWidth: 2 33 | DerivePointerAlignment: false 34 | FixNamespaceComments: false 35 | IndentWidth: 4 36 | Language: Cpp 37 | NamespaceIndentation: All 38 | PointerAlignment: Left 39 | PointerAlignment: Middle 40 | SortIncludes: true 41 | SpaceAfterCStyleCast: true 42 | SpaceAfterTemplateKeyword: true 43 | SpaceBeforeAssignmentOperators: true 44 | SpaceBeforeParens: ControlStatements 45 | SpaceInEmptyParentheses: false 46 | SpacesInAngles: false 47 | SpacesInCStyleCastParentheses: false 48 | SpacesInSquareBrackets: false 49 | UseTab: Never 50 | 51 | IncludeCategories: 52 | - Regex: 'EOSPreComp' 53 | Priority: 0 54 | # SortPriority: 0 55 | -------------------------------------------------------------------------------- /gladius/src/kernel/arguments.h: -------------------------------------------------------------------------------- 1 | #ifndef PAYLOAD_ARGS 2 | #define PAYLOAD_ARGS \ 3 | float4 buildArea, __global struct PrimitiveMeta *primitives, int primitivesSize, \ 4 | __global float *data, int dataSize, struct RenderingSettings renderingSettings, \ 5 | __read_only image3d_t preCompSdf, __global float *parameter, __global struct Command *cmds, \ 6 | int sizeOfCmds, struct BoundingBox preCompSdfBBox 7 | #define PASS_PAYLOAD_ARGS \ 8 | buildArea, primitives, primitivesSize, data, dataSize, renderingSettings, preCompSdf, \ 9 | parameter, cmds, sizeOfCmds, preCompSdfBBox 10 | #endif 11 | -------------------------------------------------------------------------------- /gladius/src/kernel/commands.cl: -------------------------------------------------------------------------------- 1 | float4 processCommands(PAYLOAD_ARGS) 2 | { 3 | 4 | return (float4)(parameter[1], parameter[2], parameter[3], parameter[0]); 5 | } -------------------------------------------------------------------------------- /gladius/src/kernel/renderer.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void kernel resample(__write_only image2d_t result, __read_only image2d_t source); 4 | 5 | void kernel renderScene(__write_only image2d_t result, // 0 6 | PAYLOAD_ARGS, // 2 - 9 7 | float3 eyePosition, // 10 8 | float16 modelViewPerspectiveMat // 11 9 | ); 10 | -------------------------------------------------------------------------------- /gladius/src/kernel/rendering.h: -------------------------------------------------------------------------------- 1 | 2 | float4 cachedSdf(float3 pos, PAYLOAD_ARGS); 3 | float4 modelInternal(float3 pos, PAYLOAD_ARGS); 4 | struct DistanceColor map(float3 pos, PAYLOAD_ARGS); 5 | struct DistanceColor mapCached(float3 pos, PAYLOAD_ARGS); 6 | 7 | struct RayCastResult 8 | rayCast(float3 eyePostion, float3 rayDirection, float startDistance, PAYLOAD_ARGS); 9 | 10 | float3 surfaceNormal(float3 pos, PAYLOAD_ARGS); 11 | float calcSoftshadow(float3 pos, float3 rayDirection, float mint, float tmax, PAYLOAD_ARGS); 12 | 13 | float calcAmbientOcclusion(float3 pos, float3 normal, PAYLOAD_ARGS); 14 | 15 | float3 reflect(float3 inVector, float3 normal); 16 | 17 | float4 18 | shadingMetal(float3 pos, float3 col, float3 normalOfSurface, float3 rayDirection, PAYLOAD_ARGS); 19 | 20 | float4 shadingWhitePolymer(float3 pos, float3 normalOfSurface, float3 rayDirection, PAYLOAD_ARGS); 21 | 22 | float3 Uncharted2ToneMapping(float3 color); 23 | 24 | float3 fusion(float x); 25 | float3 distanceMeter(float dist, float rayLength, float3 rayDir, float camHeight); 26 | 27 | float4 28 | shadingIsolines(float3 pos, float rayLength, float3 rayDirection, float height, PAYLOAD_ARGS); 29 | 30 | float4 shadingBluePolymer(float3 pos, float3 normalOfSurface, float3 rayDirection, PAYLOAD_ARGS); 31 | 32 | float4 determineColor(struct RayCastResult raycastingResult, 33 | float3 eyePosition, 34 | float3 rayDirection, 35 | PAYLOAD_ARGS); 36 | float16 modelViewPerspectiveMatrix(float3 eyePosition, float3 lookAt, float roll); 37 | -------------------------------------------------------------------------------- /gladius/src/kernel/sampler.h: -------------------------------------------------------------------------------- 1 | 2 | __constant sampler_t samplerNearestCoord = 3 | CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST; 4 | 5 | __constant sampler_t samplerNearestPos = 6 | CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST; 7 | 8 | __constant sampler_t samplerLinearPos = 9 | CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_LINEAR; 10 | 11 | __constant sampler_t samplerLinearPosClamp = 12 | CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR; 13 | 14 | __constant sampler_t samplerTexture = 15 | CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_LINEAR; 16 | 17 | __constant sampler_t samplerImage3DLinear = 18 | CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_LINEAR; 19 | 20 | __constant sampler_t samplerImage3DNearest = 21 | CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_NEAREST; 22 | 23 | 24 | -------------------------------------------------------------------------------- /gladius/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Application.h" 2 | #include 3 | 4 | using namespace std; 5 | 6 | void start(int argc, char ** argv) 7 | { 8 | std::filesystem::current_path(std::filesystem::path(argv[0]).parent_path()); 9 | gladius::Application app{{}}; 10 | } 11 | 12 | int main(int argc, char ** argv) 13 | { 14 | // get filename from command line 15 | if (argc < 2) 16 | { 17 | std::cout << "No file specified" << std::endl; 18 | start(argc, argv); 19 | return 0; 20 | } 21 | std::filesystem::path filename{argv[1]}; 22 | filename = std::filesystem::absolute(filename); 23 | if (!std::filesystem::exists(filename)) 24 | { 25 | std::cout << "File does not exist: " << filename << std::endl; 26 | start(argc, argv); 27 | return 0; 28 | } 29 | std::filesystem::current_path(std::filesystem::path(argv[0]).parent_path()); gladius::Application app{filename}; 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /gladius/src/nodes/BuildItem.cpp: -------------------------------------------------------------------------------- 1 | #include "BuildItem.h" 2 | 3 | namespace gladius::nodes 4 | { 5 | 6 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/BuildItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Components.h" 4 | #include "Object.h" 5 | 6 | #include "types.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace gladius::nodes 13 | { 14 | 15 | class BuildItem 16 | { 17 | public: 18 | BuildItem() = default; 19 | 20 | BuildItem(ResourceId id, Matrix4x4 const & transform, std::string const & partNumber) 21 | : m_id(id) 22 | , m_transform(transform) 23 | , m_partNumber(partNumber) 24 | { 25 | m_name = fmt::format("BuildItem_{}", id); 26 | } 27 | 28 | [[nodiscard]] Matrix4x4 const & getTransform() const 29 | { 30 | return m_transform; 31 | } 32 | 33 | [[nodiscard]] ResourceId getId() const 34 | { 35 | return m_id; 36 | } 37 | 38 | [[nodiscard]] std::string const & getName() const 39 | { 40 | return m_name; 41 | } 42 | 43 | [[nodiscard]] std::string const & getPartNumber() const 44 | { 45 | return m_partNumber; 46 | } 47 | 48 | Components::iterator addComponent(Component && component) 49 | { 50 | m_components.emplace_back(std::move(component)); 51 | return std::prev(m_components.end()); 52 | } 53 | 54 | [[nodiscard]] Components const & getComponents() const 55 | { 56 | return m_components; 57 | } 58 | 59 | private: 60 | Matrix4x4 m_transform; 61 | // Object m_object; 62 | ResourceId m_id{}; 63 | std::string m_name; 64 | std::string m_partNumber; 65 | 66 | Components m_components; 67 | }; 68 | 69 | using BuildItems = std::vector; 70 | 71 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/BuildParameter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace gladius::nodes 6 | { 7 | enum class ContourSorting 8 | { 9 | None, 10 | FromInsideToOutside 11 | }; 12 | 13 | struct SliceParameter 14 | { 15 | ContourSorting sortingPolicy = ContourSorting::None; 16 | float simplifytolerance = 5E-1f; 17 | float zHeight_mm = 0.f; 18 | bool adoptGradientBased = true; 19 | }; 20 | } -------------------------------------------------------------------------------- /gladius/src/nodes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(BINARY ${CMAKE_PROJECT_NAME}) 3 | file(GLOB_RECURSE SOURCES LIST_DIRECTORIES true *.h *.cpp) 4 | target_sources(${BINARY}_lib PRIVATE ${SOURCES}) 5 | target_sources(${BINARY} PRIVATE ${SOURCES}) 6 | 7 | target_include_directories(${BINARY}_lib PRIVATE ./) 8 | target_include_directories(${BINARY} PRIVATE ./) 9 | -------------------------------------------------------------------------------- /gladius/src/nodes/ClonableNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "NodeBase.h" 6 | #include "Visitor.h" 7 | #include "nodesfwd.h" 8 | 9 | namespace gladius::nodes 10 | { 11 | 12 | template 13 | class ClonableNode : public NodeBase 14 | { 15 | public: 16 | ClonableNode(const NodeName & baseName, NodeId internalId, Category category) 17 | : NodeBase(baseName, internalId, category) 18 | { 19 | } 20 | 21 | void accept(Visitor & visitor) override 22 | { 23 | visitor.visit(static_cast(*this)); 24 | } 25 | private: 26 | ClonableNode * cloneImpl() const override 27 | { 28 | return new Derived(static_cast(*this)); 29 | } 30 | }; 31 | } // namespace gladius::nodes 32 | -------------------------------------------------------------------------------- /gladius/src/nodes/Commands.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | #include "Model.h" 7 | #include "nodesfwd.h" 8 | 9 | namespace gladius 10 | { 11 | template 12 | int getCommandId() 13 | { 14 | 15 | static nodes::NodeTypes nodeTypes; 16 | int id = 0; 17 | int commandId = -1; 18 | nodes::staticFor(nodeTypes, [&](auto, auto & node) { 19 | ++id; 20 | 21 | if (typeid(node) == typeid(NodeType)) 22 | { 23 | commandId = id; 24 | } 25 | }); 26 | if (commandId < 0) 27 | { 28 | throw std::runtime_error(std::string{typeid(NodeType).name()} + 29 | std::string{" is not a valid node type"}); 30 | } 31 | return commandId; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /gladius/src/nodes/Component.cpp: -------------------------------------------------------------------------------- 1 | #include "Component.h" 2 | 3 | namespace gladius::nodes 4 | { 5 | 6 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/Component.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "types.h" 3 | 4 | 5 | namespace gladius::nodes 6 | { 7 | class Component 8 | { 9 | private: 10 | public: 11 | ResourceId id {}; 12 | Matrix4x4 transform; 13 | }; 14 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/Components.cpp: -------------------------------------------------------------------------------- 1 | #include "Components.h" 2 | 3 | namespace gladius::nodes 4 | { 5 | 6 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/Components.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Component.h" 4 | #include 5 | 6 | namespace gladius::nodes 7 | { 8 | using Components = std::vector; 9 | 10 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/GraphFlattener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Assembly.h" 4 | 5 | namespace gladius::nodes 6 | { 7 | class GraphFlattener 8 | { 9 | public: 10 | GraphFlattener(Assembly const & assembly); 11 | 12 | /** 13 | * @brief Flatten the graph, so the assembly will only have one single function (model) 14 | */ 15 | Assembly flatten(); 16 | 17 | private: 18 | Assembly m_assembly; 19 | 20 | void integrateFunctionCall(nodes::FunctionCall const & functionCall, Model & target); 21 | void flattenRecursive(Model & model); 22 | void deleteFunctions(); 23 | void deleteFunctionCallNodes(); 24 | 25 | // Integrate one node into the target model 26 | template 27 | void integrateNode(NodeType & node, Model & target) 28 | { 29 | target.insert(node); 30 | } 31 | 32 | /** 33 | * @brief Integrate a model into the target model 34 | * @param model The model to integrate 35 | * @param target The target model 36 | * @param functionCall The function call that references the model 37 | */ 38 | void integrateModel(Model & model, Model & target, nodes::FunctionCall const & functionCall); 39 | 40 | void rerouteOutputs(Model & model, Model & target, nodes::FunctionCall const & functionCall, std::unordered_map const & nameMapping); 41 | 42 | size_t m_flatteningDepth = 0; 43 | }; 44 | } -------------------------------------------------------------------------------- /gladius/src/nodes/History.cpp: -------------------------------------------------------------------------------- 1 | #include "History.h" 2 | #include "Assembly.h" 3 | #include "nodesfwd.h" 4 | 5 | namespace gladius::nodes 6 | { 7 | void History::storeState(Assembly const & assembly, std::string const & description) 8 | { 9 | storeStateInternal(assembly, description); 10 | m_redoStack.clear(); 11 | } 12 | 13 | void History::undo(Assembly * assembly) 14 | { 15 | m_redoStack.push_back({*assembly, "Undo"}); 16 | applyPreviousState(assembly, m_undoStack); 17 | } 18 | 19 | void History::redo(Assembly * assembly) 20 | { 21 | storeStateInternal(*assembly, "Redo"); 22 | applyPreviousState(assembly, m_redoStack); 23 | } 24 | 25 | bool History::canUnDo() const 26 | { 27 | return !m_undoStack.empty(); 28 | } 29 | 30 | bool History::canReDo() const 31 | { 32 | return !m_redoStack.empty(); 33 | } 34 | 35 | void History::applyPreviousState(Assembly * assembly, UndoStack & stack) 36 | { 37 | if (assembly == nullptr || stack.empty()) 38 | { 39 | std::cout << "Warning: Stack is empty (or assembly is null) \n"; 40 | return; 41 | } 42 | 43 | *assembly = stack.back().assembly; 44 | stack.pop_back(); 45 | } 46 | 47 | void History::storeStateInternal(Assembly const & assembly, std::string const & description) 48 | { 49 | if (!m_undoStack.empty()) 50 | { 51 | if (m_undoStack.back().assembly.equals(assembly)) 52 | { 53 | return; 54 | } 55 | } 56 | m_undoStack.push_back({assembly, description}); 57 | } 58 | 59 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/History.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Assembly.h" 4 | #include "nodesfwd.h" 5 | 6 | #include 7 | #include 8 | 9 | namespace gladius::nodes 10 | { 11 | struct HistoryItem 12 | { 13 | Assembly assembly; 14 | std::string description = {"unknown action"}; 15 | }; 16 | 17 | using UndoStack = std::vector; 18 | 19 | class History 20 | { 21 | public: 22 | void storeState(Assembly const & assembly, std::string const & description); 23 | void undo(Assembly * assembly); 24 | void redo(Assembly * assembly); 25 | 26 | [[nodiscard]] bool canUnDo() const; 27 | [[nodiscard]] bool canReDo() const; 28 | 29 | private: 30 | static void applyPreviousState(Assembly * assembly, UndoStack & stack); 31 | void storeStateInternal(Assembly const & assembly, std::string const & description); 32 | 33 | UndoStack m_undoStack; 34 | UndoStack m_redoStack; 35 | }; 36 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/Object.cpp: -------------------------------------------------------------------------------- 1 | #include "Object.h" 2 | 3 | namespace gladius::nodes 4 | { 5 | 6 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/Object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Components.h" 4 | 5 | #include 6 | 7 | namespace gladius::nodes 8 | { 9 | 10 | class Object 11 | { 12 | public: 13 | private: 14 | Components m_components; 15 | std::string m_name; 16 | }; 17 | 18 | } // namespace gladius::nodes -------------------------------------------------------------------------------- /gladius/src/nodes/OptimizeOutputs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace gladius::nodes 5 | { 6 | class Assembly; 7 | class Model; 8 | } 9 | 10 | namespace gladius::nodes 11 | { 12 | class OptimizeOutputs 13 | { 14 | public: 15 | OptimizeOutputs(Assembly * assembly); 16 | void optimize(); 17 | private: 18 | Assembly * m_assembly{nullptr}; 19 | 20 | 21 | void markFunctionOutputsAsUnused(Model & model); 22 | void markUsedOutputs(Model & model); 23 | void propagateUsedFunctionOutputs(Model & model); 24 | }; 25 | } // namespace gladius::nodes 26 | -------------------------------------------------------------------------------- /gladius/src/nodes/Parameter.cpp: -------------------------------------------------------------------------------- 1 | #include "Parameter.h" 2 | 3 | namespace gladius::nodes 4 | { 5 | VariantParameter createVariantTypeFromTypeIndex(std::type_index typeIndex) 6 | { 7 | if (typeIndex == ParameterTypeIndex::Float) 8 | { 9 | return VariantParameter(0.f); 10 | } 11 | else if (typeIndex == ParameterTypeIndex::Float3) 12 | { 13 | return VariantParameter(float3{}); 14 | } 15 | else if (typeIndex == ParameterTypeIndex::Matrix4) 16 | { 17 | return VariantParameter(Matrix4x4{}); 18 | } 19 | else if (typeIndex == ParameterTypeIndex::Int) 20 | { 21 | return VariantParameter(0); 22 | } 23 | else if (typeIndex == ParameterTypeIndex::String) 24 | { 25 | return VariantParameter(std::string{}); 26 | } 27 | else if (typeIndex == ParameterTypeIndex::ResourceId) 28 | { 29 | return VariantParameter(ResourceId{}); 30 | } 31 | return VariantParameter(0); 32 | } 33 | 34 | std::string to_string(const float3 & val) 35 | { 36 | return std::to_string(val.x) + "f, " + // 37 | std::to_string(val.y) + "f, " + // 38 | std::to_string(val.z) + "f"; 39 | } 40 | 41 | std::string var_to_string(const VariantType & val) 42 | { 43 | if (const auto pval = std::get_if(&val)) 44 | { 45 | return std::to_string(*pval); 46 | } 47 | 48 | if (const auto pval = std::get_if(&val)) 49 | { 50 | return to_string(*pval); 51 | } 52 | 53 | if (const auto pval = std::get_if(&val)) 54 | { 55 | return (*pval); 56 | } 57 | 58 | return "unknown type"; 59 | } 60 | } // namespace gladius::nodes 61 | -------------------------------------------------------------------------------- /gladius/src/nodes/Port.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "nodesfwd.h" 3 | 4 | #include 5 | 6 | namespace gladius::nodes 7 | { 8 | class Port 9 | { 10 | public: 11 | virtual ~Port() = default; 12 | [[nodiscard]] virtual auto getDescription() const -> std::string; 13 | 14 | void setUniqueName(const std::string & name); 15 | void setTypeIndex(std::type_index typeIndex); 16 | [[nodiscard]] auto getUniqueName() const -> PortName const &; 17 | [[nodiscard]] auto getShortName() const -> PortName const &; 18 | void setShortName(const std::string & name); 19 | void setId(PortId id); 20 | [[nodiscard]] auto getId() const -> PortId; 21 | [[nodiscard]] auto getParentId() const -> NodeId; 22 | void hide(); 23 | void show(); 24 | [[nodiscard]] bool isVisible() const; 25 | [[nodiscard]] std::type_index getTypeIndex() const; 26 | void setParent(NodeBase * parent); 27 | [[nodiscard]] auto getParent() const -> NodeBase *; 28 | 29 | void setIsUsed(bool isUsed); 30 | [[nodiscard]] bool isUsed() const; 31 | private: 32 | std::string m_uniqueName{}; 33 | std::string m_shortName{}; // "e.g. FieldNames::Shape, FieldNames::Pos etc. 34 | PortId m_id{}; 35 | NodeId m_parentId{}; 36 | NodeBase * m_parent{nullptr}; 37 | bool m_visible{true}; 38 | std::type_index m_typeIndex = std::type_index(typeid(float)); 39 | bool m_isused{false}; 40 | }; 41 | } // namespace gladius::nodes 42 | -------------------------------------------------------------------------------- /gladius/src/nodes/Validator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Assembly.h" 4 | #include "Parameter.h" 5 | #include "nodesfwd.h" 6 | 7 | namespace gladius::nodes 8 | { 9 | struct ValidationError 10 | { 11 | std::string message; 12 | std::string model; 13 | std::string node; 14 | std::string port; 15 | std::string parameter; 16 | }; 17 | 18 | using ValidationErrors = std::vector; 19 | 20 | class Validator 21 | { 22 | public: 23 | Validator() = default; 24 | ~Validator() = default; 25 | 26 | [[nodiscard]] bool validate(Assembly & assembly); 27 | 28 | [[nodiscard]] ValidationErrors const & getErrors() const; 29 | 30 | private: 31 | void validateModel(Model & model, Assembly & assembly); 32 | void validateNode(NodeBase & node, Model & model, Assembly & assembly); 33 | void validateNodeImpl(NodeBase & node, Model & model); 34 | 35 | void validateNode(FunctionCall & node, Model & model, Assembly & assembly); 36 | ValidationErrors m_errors; 37 | }; 38 | } -------------------------------------------------------------------------------- /gladius/src/nodes/graph/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(BINARY ${CMAKE_PROJECT_NAME}) 3 | file(GLOB_RECURSE SOURCES LIST_DIRECTORIES true *.h *.cpp) 4 | target_sources(${BINARY}_lib PRIVATE ${SOURCES}) 5 | target_sources(${BINARY}_run PRIVATE ${SOURCES}) 6 | 7 | if(MSVC) 8 | target_compile_options(${BINARY}_run PRIVATE /W3 /WX /D_USE_MATH_DEFINES) 9 | target_compile_options(${BINARY}_lib PRIVATE /W3 /WX /D_USE_MATH_DEFINES) 10 | else() 11 | target_compile_options(${BINARY}_run PRIVATE ) 12 | target_compile_options(${BINARY}_lib PRIVATE ) 13 | endif() 14 | 15 | target_include_directories(${BINARY}_lib PRIVATE ./) 16 | target_include_directories(${BINARY}_run PRIVATE ./) -------------------------------------------------------------------------------- /gladius/src/nodes/graph/DirectedGraph.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IDirectedGraph.h" 3 | 4 | namespace gladius::nodes::graph 5 | { 6 | class DirectedGraph : public IDirectedGraph 7 | { 8 | public: 9 | explicit DirectedGraph(std::size_t size); 10 | void addDependency(Identifier id, Identifier idOfDependency) override; 11 | void removeDependency(Identifier id, Identifier idOfDependency) override; 12 | [[nodiscard]] auto isDirectlyDependingOn(Identifier id, 13 | Identifier dependencyInQuestion) const 14 | -> bool override; 15 | 16 | [[nodiscard]] auto getSize() const -> std::size_t override; 17 | 18 | void removeVertex(Identifier id) override; 19 | 20 | [[nodiscard]] auto getVertices() const -> const DependencySet & override; 21 | void addVertex(Identifier id) override; 22 | 23 | private: 24 | std::vector m_graphData; 25 | std::size_t m_size; 26 | 27 | DependencySet m_vertices; // Possible performance improvement: We could try out a std::set 28 | 29 | using PredecessorList = std::vector; 30 | std::vector m_predecessors; 31 | 32 | // Inherited via IDirectedGraph 33 | [[nodiscard]] auto hasPredecessors(Identifier id) const -> bool override; 34 | }; 35 | } // namespace gladius::nodes::graph 36 | -------------------------------------------------------------------------------- /gladius/src/nodes/graph/GraphAlgorithms.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IDirectedGraph.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace gladius::nodes::graph 10 | { 11 | using Depth = int; 12 | 13 | struct BfsItem 14 | { 15 | Identifier identifier{}; 16 | int depth{}; 17 | }; 18 | 19 | using DepthMap = std::unordered_map; 20 | 21 | auto determineDirectDependencies(const IDirectedGraph & graph, Identifier id) -> DependencySet; 22 | 23 | auto determineAllDependencies(const IDirectedGraph & graph, Identifier id) -> DependencySet; 24 | 25 | auto determineSuccessor(const IDirectedGraph & graph, Identifier predecessor) -> VertexList; 26 | 27 | auto graphToString(const IDirectedGraph & graph) -> std::string; 28 | 29 | auto graphToGraphVizStr(const IDirectedGraph & graph) -> std::string; 30 | 31 | auto isDependingOn(const IDirectedGraph & graph, Identifier id, Identifier dependencyInQuestion) 32 | -> bool; 33 | 34 | auto addDependencyIfConflictFree(IDirectedGraph & graph, 35 | Identifier id, 36 | Identifier idOfDependency) -> bool; 37 | 38 | auto topologicalSort(const IDirectedGraph & graph) -> VertexList; 39 | 40 | auto determineDepth(const IDirectedGraph & graph, Identifier start) -> DepthMap; 41 | 42 | auto inDegreeZeroVertices(const IDirectedGraph & graph) -> VertexList; 43 | 44 | auto isCyclic(const IDirectedGraph & graph) -> bool; 45 | } // namespace gladius::nodes::graph 46 | -------------------------------------------------------------------------------- /gladius/src/nodes/graph/IDirectedGraph.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace gladius::nodes::graph 7 | { 8 | using Identifier = int; 9 | using DependencySet = std::set; 10 | using VertexList = std::vector; 11 | 12 | class IDirectedGraph 13 | { 14 | public: 15 | explicit IDirectedGraph(std::size_t const /*unused*/){}; 16 | virtual ~IDirectedGraph() = default; 17 | virtual void addDependency(Identifier id, Identifier idOfDependency) = 0; 18 | virtual void removeDependency(Identifier id, Identifier idOfDependency) = 0; 19 | [[nodiscard]] virtual auto isDirectlyDependingOn(Identifier id, 20 | Identifier dependencyInQuestion) const 21 | -> bool = 0; 22 | 23 | [[nodiscard]] virtual auto getSize() const -> std::size_t = 0; 24 | virtual void removeVertex(Identifier id) = 0; 25 | virtual void addVertex(Identifier id) = 0; 26 | [[nodiscard]] virtual auto hasPredecessors(Identifier id) const -> bool = 0; 27 | 28 | [[nodiscard]] virtual auto getVertices() const -> const DependencySet & = 0; 29 | }; 30 | } // namespace gladius::nodes::graph 31 | -------------------------------------------------------------------------------- /gladius/src/nodes/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace gladius::nodes 7 | { 8 | struct float3 9 | { 10 | float3() = default; 11 | float3(float x, float y, float z) 12 | : x(x) 13 | , y(y) 14 | , z(z) 15 | { 16 | } 17 | 18 | float x = 0.f; 19 | float y = 0.f; 20 | float z = 0.f; 21 | }; 22 | 23 | struct float2 24 | { 25 | float2() = default; 26 | float x = 0.f; 27 | float y = 0.f; 28 | }; 29 | 30 | using Matrix4x4 = std::array, 4>; 31 | 32 | enum class ContentType 33 | { 34 | Generic, 35 | Color, 36 | Length, 37 | Amount, 38 | Angle, 39 | Text, 40 | Index, 41 | Part, 42 | Transformation 43 | }; 44 | 45 | using ResourceId = uint32_t; 46 | 47 | } -------------------------------------------------------------------------------- /gladius/src/nodes/utils.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "types.h" 3 | #include "utils.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace gladius 10 | { 11 | std::string toLowerCase(std::string text) 12 | { 13 | std::transform(text.begin(), text.end(), text.begin(), [](unsigned char c) { 14 | return std::tolower(static_cast(c)); 15 | }); 16 | return text; 17 | } 18 | 19 | nodes::Matrix4x4 zeroMatrix() 20 | { 21 | nodes::Matrix4x4 matrix; 22 | for (int row = 0; row < 4; ++row) 23 | { 24 | for (int col = 0; col < 4; ++col) 25 | { 26 | matrix[row][col] = 0.0f; 27 | } 28 | } 29 | return matrix; 30 | } 31 | 32 | nodes::Matrix4x4 identityMatrix() 33 | { 34 | nodes::Matrix4x4 matrix = zeroMatrix(); 35 | for (int i = 0; i < 4; ++i) 36 | { 37 | matrix[i][i] = 1.0f; 38 | } 39 | return matrix; 40 | } 41 | 42 | nodes::Matrix4x4 inverseMatrix(const nodes::Matrix4x4& matrix) 43 | { 44 | Eigen::Matrix4f eigenMatrix; 45 | for (int row = 0; row < 4; ++row) 46 | { 47 | for (int col = 0; col < 4; ++col) 48 | { 49 | eigenMatrix(row, col) = matrix[row][col]; 50 | } 51 | } 52 | 53 | Eigen::Matrix4f inverted = eigenMatrix.inverse(); 54 | 55 | nodes::Matrix4x4 result; 56 | for (int row = 0; row < 4; ++row) 57 | { 58 | for (int col = 0; col < 4; ++col) 59 | { 60 | result[row][col] = inverted(row, col); 61 | } 62 | } 63 | 64 | return result; 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /gladius/src/nodes/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.h" 4 | #include 5 | 6 | namespace gladius 7 | { 8 | std::string toLowerCase(std::string text); 9 | 10 | nodes::Matrix4x4 zeroMatrix(); 11 | nodes::Matrix4x4 identityMatrix(); 12 | nodes::Matrix4x4 inverseMatrix(const nodes::Matrix4x4 & matrix); 13 | } 14 | -------------------------------------------------------------------------------- /gladius/src/scopeguard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace gladius 6 | { 7 | struct scope_guard 8 | { 9 | std::function onExit; 10 | ~scope_guard() 11 | { 12 | onExit(); 13 | } 14 | 15 | scope_guard(scope_guard const &) = delete; 16 | scope_guard & operator=(scope_guard const &) = delete; 17 | 18 | scope_guard(std::function onExit) 19 | : onExit(onExit) 20 | { 21 | } 22 | }; 23 | } -------------------------------------------------------------------------------- /gladius/src/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace gladius 6 | { 7 | using Vector3 = Eigen::Vector3f; 8 | } 9 | -------------------------------------------------------------------------------- /gladius/src/ui/AboutDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace gladius::ui 7 | { 8 | std::string readFileOrReturnEmpty(const std::filesystem::path& path); 9 | 10 | class CopyRightInfo 11 | { 12 | public: 13 | explicit CopyRightInfo(std::filesystem::path path); 14 | 15 | [[nodiscard]] const std::string& getName() const; 16 | 17 | [[nodiscard]] std::string getOrLoadUrl(); 18 | 19 | [[nodiscard]] std::string getOrLoadCopyrightText(); 20 | 21 | private: 22 | std::filesystem::path m_path; 23 | std::string m_name{m_path.filename().string()}; 24 | std::optional m_licenseText; 25 | std::optional m_url; 26 | }; 27 | 28 | class CopyRightInfoCache 29 | { 30 | using CopyRigths = std::vector; 31 | public: 32 | explicit CopyRightInfoCache(std::filesystem::path licenseDir); 33 | 34 | [[nodiscard]] CopyRigths::iterator begin(); 35 | [[nodiscard]] CopyRigths::iterator end(); 36 | 37 | [[nodiscard]] CopyRigths::const_iterator cbegin() const; 38 | [[nodiscard]] CopyRigths::const_iterator cend() const; 39 | 40 | private: 41 | std::vector m_licenses; 42 | }; 43 | 44 | class AboutDialog 45 | { 46 | public: 47 | AboutDialog(); 48 | void show(); 49 | void hide(); 50 | void render(); 51 | 52 | private: 53 | bool m_visible = false; 54 | std::filesystem::path m_appDir; 55 | CopyRightInfoCache m_copyRightInfoCache; 56 | CopyRightInfo m_copyRight; 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /gladius/src/ui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(BINARY ${CMAKE_PROJECT_NAME}) 3 | file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS LIST_DIRECTORIES true *.h *.cpp) 4 | target_sources(${BINARY}_lib PRIVATE ${SOURCES}) 5 | target_sources(${BINARY} PRIVATE ${SOURCES}) 6 | 7 | target_include_directories(${BINARY}_lib PRIVATE ./) 8 | target_include_directories(${BINARY} PRIVATE ./) -------------------------------------------------------------------------------- /gladius/src/ui/CliExportDialog.cpp: -------------------------------------------------------------------------------- 1 | #include "CliExportDialog.h" 2 | 3 | #include "imgui.h" 4 | 5 | namespace gladius::ui 6 | { 7 | void CliExportDialog::beginExport(std::filesystem::path stlFilename, 8 | gladius::ComputeCore & core) 9 | { 10 | m_visible = true; 11 | m_cliWriter.beginExport(stlFilename, core); 12 | } 13 | 14 | void CliExportDialog::render(gladius::ComputeCore & core) 15 | { 16 | if (!m_visible) 17 | { 18 | return; 19 | } 20 | ImGui::Begin("CLI-Export", &m_visible); 21 | 22 | ImGui::TextUnformatted("Exporting to cli file"); 23 | ImGui::ProgressBar(m_cliWriter.getProgress()); 24 | if (!m_cliWriter.advanceExport(core)) 25 | { 26 | m_cliWriter.finalizeExport(); 27 | 28 | #ifdef WIN32 29 | ShellExecuteW( 30 | nullptr, L"open", m_cliWriter.getFilename().c_str(), nullptr, nullptr, SW_SHOW); 31 | #endif 32 | m_visible = false; 33 | } 34 | if (ImGui::Button("Cancel")) 35 | { 36 | m_visible = false; 37 | } 38 | ImGui::End(); 39 | } 40 | 41 | bool CliExportDialog::isVisible() const 42 | { 43 | return m_visible; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /gladius/src/ui/CliExportDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../CliWriter.h" 3 | 4 | #include 5 | 6 | namespace gladius::ui 7 | { 8 | class CliExportDialog 9 | { 10 | public: 11 | void beginExport(std::filesystem::path stlFilename, gladius::ComputeCore & core); 12 | void render(gladius::ComputeCore & core); 13 | [[nodiscard]] bool isVisible() const; 14 | 15 | private: 16 | gladius::CliWriter m_cliWriter; 17 | bool m_visible{false}; 18 | }; 19 | } // namespace gladius::ui 20 | -------------------------------------------------------------------------------- /gladius/src/ui/FileChooser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace gladius 9 | { 10 | using QueriedFilename = std::optional; 11 | 12 | using FilePatterns = std::vector; 13 | auto querySaveFilename(FilePatterns const & filePattern, 14 | std::filesystem::path baseDir = {}) 15 | -> QueriedFilename; 16 | 17 | auto queryLoadFilename(FilePatterns const & filePattern, std::filesystem::path baseDir = {}) 18 | -> QueriedFilename; 19 | 20 | auto queryDirectory(std::filesystem::path baseDir = {}) -> QueriedFilename; 21 | } -------------------------------------------------------------------------------- /gladius/src/ui/ImageStackExportDialog.cpp: -------------------------------------------------------------------------------- 1 | #include "ImageStackExportDialog.h" 2 | 3 | #include "imgui.h" 4 | 5 | namespace gladius::ui 6 | { 7 | void ImageStackExportDialog::beginExport(std::filesystem::path stlFilename, 8 | gladius::ComputeCore & core) 9 | { 10 | m_visible = true; 11 | m_imageStackExporter.beginExport(stlFilename, core); 12 | } 13 | 14 | void ImageStackExportDialog::render(gladius::ComputeCore & core) 15 | { 16 | if (!m_visible) 17 | { 18 | return; 19 | } 20 | ImGui::Begin("ImageStack-Export", &m_visible); 21 | 22 | ImGui::TextUnformatted("Exporting to image stack"); 23 | ImGui::ProgressBar(static_cast(m_imageStackExporter.getProgress())); 24 | if (!m_imageStackExporter.advanceExport(core)) 25 | { 26 | m_imageStackExporter.finalize(); 27 | m_visible = false; 28 | } 29 | if (ImGui::Button("Cancel")) 30 | { 31 | m_visible = false; 32 | } 33 | ImGui::End(); 34 | } 35 | } -------------------------------------------------------------------------------- /gladius/src/ui/ImageStackExportDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "io/ImageStackExporter.h" 3 | #include "compute/ComputeCore.h" 4 | 5 | #include 6 | 7 | namespace gladius::ui 8 | { 9 | class ImageStackExportDialog 10 | { 11 | public: 12 | void beginExport(std::filesystem::path stlFilename, gladius::ComputeCore & core); 13 | void render(gladius::ComputeCore & core); 14 | [[nodiscard]] bool isVisible() const; 15 | 16 | private: 17 | gladius::io::ImageStackExporter m_imageStackExporter; 18 | bool m_visible{false}; 19 | }; 20 | } // namespace gladius::ui 21 | -------------------------------------------------------------------------------- /gladius/src/ui/InputList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace gladius::ui 6 | { 7 | using OptionalPortId = std::optional; 8 | auto inputMenu(nodes::Model & nodes, nodes::ParameterId targetId) -> OptionalPortId; 9 | } // namespace gladius::ui 10 | -------------------------------------------------------------------------------- /gladius/src/ui/LogView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../EventLogger.h" 4 | 5 | 6 | #include "imgui.h" 7 | 8 | namespace gladius::ui 9 | { 10 | class LogView 11 | { 12 | public: 13 | void show(); 14 | 15 | void hide(); 16 | 17 | void render(events::Logger & logger); 18 | 19 | private: 20 | void updateCache(events::Logger & logger); 21 | 22 | bool m_visible = false; 23 | bool m_autoScroll = true; 24 | ImGuiTextFilter m_filter; 25 | events::Events m_filteredEvents; 26 | size_t m_logSizeWhenCacheWasGenerated = 0u; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /gladius/src/ui/MeshExportDialog.cpp: -------------------------------------------------------------------------------- 1 | #include "MeshExportDialog.h" 2 | 3 | 4 | #include "imgui.h" 5 | 6 | namespace gladius::ui 7 | { 8 | void MeshExportDialog::beginExport(std::filesystem::path stlFilename, ComputeCore & core) 9 | { 10 | m_visible = true; 11 | m_exporter.setQualityLevel(2); 12 | m_exporter.beginExport(stlFilename, core); 13 | } 14 | 15 | void MeshExportDialog::render(ComputeCore & core) 16 | { 17 | if (!m_visible) 18 | { 19 | return; 20 | } 21 | ImGui::Begin("Export in progress", &m_visible); 22 | 23 | ImGui::TextUnformatted("Exporting to stl file"); 24 | ImGui::ProgressBar(static_cast(m_exporter.getProgress())); 25 | if (!m_exporter.advanceExport(core)) 26 | { 27 | m_exporter.finalizeExportSTL(core); 28 | m_visible = false; 29 | } 30 | if (ImGui::Button("Cancel")) 31 | { 32 | m_visible = false; 33 | } 34 | ImGui::End(); 35 | } 36 | 37 | bool MeshExportDialog::isVisible() const 38 | { 39 | return m_visible; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /gladius/src/ui/MeshExportDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | 6 | namespace gladius::ui 7 | { 8 | class MeshExportDialog 9 | { 10 | public: 11 | void beginExport(std::filesystem::path stlFilename, ComputeCore & core); 12 | void render(ComputeCore & core); 13 | [[nodiscard]] bool isVisible() const; 14 | 15 | private: 16 | vdb::MeshExporter m_exporter; 17 | bool m_visible{false}; 18 | }; 19 | } // namespace gladius::ui 20 | -------------------------------------------------------------------------------- /gladius/src/ui/OrbitalCamera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../kernel/types.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace gladius::ui 10 | { 11 | 12 | using Position = Eigen::Vector3f; 13 | class OrbitalCamera 14 | { 15 | public: 16 | void mouseInputHandler(int button, int state, float x, float y); 17 | auto mouseMotionHandler(float x, float y) -> bool; 18 | [[nodiscard]] auto getEyePosition() const -> cl_float3; 19 | auto getLookAt() -> cl_float3; 20 | void setLookAt(Position const & lookAt); 21 | 22 | void zoom(float increment); 23 | 24 | auto computeModelViewPerspectiveMatrix() const -> cl_float16; 25 | bool update(float deltaTime_ms); 26 | 27 | void centerView(BoundingBox const & bbox); 28 | 29 | void adjustDistanceToTarget(BoundingBox const & bbox); 30 | void setAngle(float pitch, float yaw); 31 | void rotate(float pitch, float yaw); 32 | private: 33 | auto computeEyePosition() const -> Position; 34 | 35 | float m_eyeDist = 100.0f; 36 | float m_eyeDistTarget = 800.0f; 37 | 38 | float m_pitch = 0.f; 39 | float m_yaw = 0.f; 40 | 41 | float m_pitchTarget = 0.6f; 42 | float m_yawTarget = -1.6f; 43 | 44 | float m_prevMousPosX = 0.f; 45 | float m_prevMousPosY = 0.f; 46 | int m_mouseButton = -1; 47 | Position m_lookAt{0.f, 0.f, 0.f}; 48 | Position m_lookAtTarget{200.f, 200.f, 10.f}; 49 | }; 50 | } -------------------------------------------------------------------------------- /gladius/src/ui/Outline.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Document.h" 3 | 4 | //forward declaration 5 | namespace gladius::nodes 6 | { 7 | class BuildItem; 8 | } 9 | 10 | namespace gladius::ui 11 | { 12 | class Outline 13 | { 14 | public: 15 | Outline() = default; 16 | Outline(SharedDocument document) 17 | : m_document(std::move(document)) 18 | { 19 | } 20 | 21 | void setDocument(SharedDocument document); 22 | 23 | void render() const; 24 | void renderBuildItem(gladius::nodes::BuildItem const & item) const; 25 | 26 | private: 27 | SharedDocument m_document; 28 | }; 29 | } // namespace gladius::ui 30 | -------------------------------------------------------------------------------- /gladius/src/ui/ResourceView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Document.h" 4 | 5 | namespace gladius::ui 6 | { 7 | class ResourceView 8 | { 9 | public: 10 | void render(SharedDocument document) const; 11 | 12 | private: 13 | }; 14 | } -------------------------------------------------------------------------------- /gladius/src/ui/SliceView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "compute/ComputeCore.h" 4 | 5 | #include "imgui.h" 6 | #include "src/Contour.h" 7 | #include 8 | 9 | namespace gladius 10 | { 11 | class GLView; 12 | } 13 | 14 | namespace gladius::ui 15 | { 16 | 17 | struct DistanceMeasurement 18 | { 19 | std::optional start; 20 | std::optional end; 21 | bool measurementInProgress = false; 22 | }; 23 | 24 | class SliceView 25 | { 26 | public: 27 | void show(); 28 | void hide(); 29 | bool isVisible() const; 30 | /// \returns Returns true, if the window was rendered 31 | [[nodiscard]] bool render(ComputeCore & core, GLView & view); 32 | 33 | private: 34 | bool m_visible{false}; 35 | 36 | float m_zoom = 4.f; 37 | float m_zoomTarget = 4.f; 38 | ImVec2 m_scrolling = {0.0f, 250.0f}; 39 | ImVec2 m_origin = {}; 40 | 41 | DistanceMeasurement m_distanceMeasurement; 42 | 43 | bool m_renderNormals = false; 44 | bool m_renderSourceVertices = false; 45 | bool m_showJumps = false; 46 | bool m_showSelfIntersections = false; 47 | bool m_hideDeveloperTools = true; 48 | 49 | std::optional m_contours; 50 | 51 | [[nodiscard]] ImVec2 worldToCanvasPos(ImVec2 WorldPos) const; 52 | [[nodiscard]] ImVec2 worldToCanvasPos(gladius::Vector2 WorldPos) const; 53 | [[nodiscard]] ImVec2 screenToWorldPos(ImVec2 screenPos) const; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /gladius/src/ui/Widgets.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #pragma once 4 | #include 5 | 6 | #include "Parameter.h" 7 | 8 | struct ImVec4; 9 | 10 | namespace gladius::ui 11 | { 12 | void loadingIndicatorCircle(const char * label, 13 | float radius, 14 | const ImVec4 & main_color, 15 | const ImVec4 & backdrop_color, 16 | int numberOfDots, 17 | float speed); 18 | 19 | bool angleEdit(const char * label, float * const angleInRadians); 20 | 21 | 22 | void hyperlink(std::string const & label, std::string const & url); 23 | 24 | void toggleButton(std::string const & label, bool * state); 25 | 26 | bool matrixEdit(std::string const & label, gladius::nodes::Matrix4x4 & matrix); 27 | 28 | bool floatEdit(std::string const & label, float & value); 29 | } -------------------------------------------------------------------------------- /gladius/src/ui/imguinodeeditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef __clang__ 3 | #pragma clang diagnostic push 4 | #pragma clang diagnostic ignored "-Wunused-but-set-variable" 5 | #pragma clang diagnostic ignored "-Wunused-variable" 6 | #endif 7 | 8 | #include "imgui.h" 9 | #include "imgui_internal.h" 10 | #ifdef IMGUI_DISABLE_OBSOLETE_KEYIO 11 | static_assert(false, "imgui node editor requires legacy key io functions, but "); 12 | #endif 13 | 14 | #include 15 | 16 | #ifdef __clang__ 17 | #pragma clang diagnostic pop 18 | #endif 19 | -------------------------------------------------------------------------------- /gladius/src/ui/wordwarp.cpp: -------------------------------------------------------------------------------- 1 | #include "wordwarp.h" 2 | 3 | namespace gladius 4 | { 5 | std::string warpTextAfter(std::string str, size_t wrapAfter) 6 | { 7 | for (size_t currentWrapPosition = str.find_first_of(' ', wrapAfter); 8 | currentWrapPosition != std::string::npos; 9 | currentWrapPosition = str.find_first_of(' ', currentWrapPosition + wrapAfter)) 10 | { 11 | str.at(currentWrapPosition) = '\n'; 12 | } 13 | return str; 14 | } 15 | } -------------------------------------------------------------------------------- /gladius/src/ui/wordwarp.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace gladius 4 | { 5 | std::string warpTextAfter(std::string str, size_t wrapAfter); 6 | } 7 | -------------------------------------------------------------------------------- /gladius/src/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gladius 4 | { 5 | struct Version 6 | { 7 | static int constexpr major = 1; 8 | static int constexpr minor = 2; 9 | static int constexpr revision = 10; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /gladius/src/version.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace gladius 4 | { 5 | struct Version 6 | { 7 | static int constexpr major = @CPACK_PACKAGE_VERSION_MAJOR@; 8 | static int constexpr minor = @CPACK_PACKAGE_VERSION_MINOR@; 9 | static int constexpr revision = @CPACK_PACKAGE_VERSION_PATCH@; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /gladius/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(unittests) 3 | add_subdirectory(integrationtests) 4 | 5 | -------------------------------------------------------------------------------- /gladius/tests/integrationtests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 3.5) 3 | 4 | set(CMAKE_CURRENT_BINDING_DIR ${CMAKE_SOURCE_DIR}/src/api/GladiusLib_component/Bindings/CppDynamic/) 5 | 6 | set(BINARY ${CMAKE_PROJECT_NAME}_integrationtest) 7 | file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false *.h *.cpp) 8 | set(SOURCES ${TEST_SOURCES}) 9 | add_executable(${BINARY} ${TEST_SOURCES}) 10 | if (MSVC) 11 | set_property(TARGET ${BINARY} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") 12 | endif() 13 | 14 | set_property(TARGET ${BINARY} PROPERTY CXX_STANDARD 20) 15 | 16 | 17 | 18 | message("CMAKE_CURRENT_BINDING_DIR=${CMAKE_CURRENT_BINDING_DIR}") 19 | if (UNIX) 20 | target_link_libraries(${BINARY} PRIVATE ${CMAKE_DL_LIBS}) 21 | endif (UNIX) 22 | 23 | set(DEPENDENCIES ${CMAKE_PROJECT_NAME}_lib GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main Eigen3::Eigen lodepng fmt::fmt) 24 | 25 | if (ENABLE_TRACY) 26 | set(DEPENDENCIES ${DEPENDENCIES} Tracy::TracyClient) 27 | endif() 28 | 29 | 30 | target_link_libraries(${BINARY} PRIVATE ${CMAKE_PROJECT_NAME}_lib ${DEPENDENCIES}) 31 | target_include_directories(${BINARY} PUBLIC ../../src ${CMAKE_CURRENT_BINDING_DIR}) 32 | 33 | file(GLOB TEST_FILES 34 | "testdata/*.*" 35 | ) 36 | 37 | file(COPY ${TEST_FILES} DESTINATION "testdata") 38 | 39 | file(GLOB FONT_FILES 40 | "../../components/imgui/misc/fonts/*.*" 41 | ) 42 | file(COPY ${FONT_FILES} DESTINATION "misc/fonts/") 43 | 44 | gtest_add_tests(TARGET ${BINARY}) -------------------------------------------------------------------------------- /gladius/tests/integrationtests/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | auto main(int argc, char ** argv) -> int 4 | { 5 | ::testing::InitGoogleTest(&argc, argv); 6 | return RUN_ALL_TESTS(); 7 | } -------------------------------------------------------------------------------- /gladius/tests/integrationtests/testdata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | namespace gladius_integration_tests 5 | { 6 | struct FileNames 7 | { 8 | static auto constexpr ImplicitGyroid = "testdata/ImplicitGyroid.3mf"; 9 | static auto constexpr F360 = "testdata/F360.3mf"; 10 | }; 11 | } -------------------------------------------------------------------------------- /gladius/tests/integrationtests/testdata/F360.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/tests/integrationtests/testdata/F360.3mf -------------------------------------------------------------------------------- /gladius/tests/integrationtests/testdata/ImplicitGyroid.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/tests/integrationtests/testdata/ImplicitGyroid.3mf -------------------------------------------------------------------------------- /gladius/tests/integrationtests/testhelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | namespace gladius_integration_tests 8 | { 9 | [[nodiscard]] std::optional findGladiusSharedLib(); 10 | 11 | void saveBitmapLayer(std::filesystem::path const & filename, 12 | std::vector & data, 13 | unsigned int width_px, 14 | unsigned int height_px); 15 | } 16 | -------------------------------------------------------------------------------- /gladius/tests/unittests/Assembly_tests.cpp: -------------------------------------------------------------------------------- 1 | #include "testhelper.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #define CL_TARGET_OPENCL_VERSION 120 7 | #include 8 | #include 9 | #include 10 | 11 | namespace gladius_tests 12 | { 13 | 14 | using namespace gladius; 15 | 16 | class Assembly_Test : public ::testing::Test 17 | { 18 | void SetUp() override 19 | { 20 | m_logger = std::make_shared(); 21 | } 22 | 23 | protected: 24 | nodes::SharedAssembly load3mf(std::filesystem::path const & path) 25 | { 26 | 27 | auto context = std::make_shared(EnableGLOutput::disabled); 28 | 29 | if (!context->isValid()) 30 | { 31 | throw std::runtime_error( 32 | "Failed to create OpenCL Context. Did you install proper GPU drivers?"); 33 | } 34 | 35 | m_core = 36 | std::make_shared(context, RequiredCapabilities::ComputeOnly, m_logger); 37 | m_doc = std::make_shared(m_core); 38 | 39 | m_doc->load(path); 40 | 41 | return m_doc->getAssembly(); 42 | } 43 | 44 | private: 45 | std::shared_ptr m_doc; 46 | std::shared_ptr m_core; 47 | events::SharedLogger m_logger; 48 | }; 49 | 50 | TEST_F(Assembly_Test, CopyAssigment_LoadedAssembly_EqualsOriginal) 51 | { 52 | nodes::Assembly dolly; 53 | auto source = load3mf("testdata/ImplicitGyroid.3mf"); 54 | dolly = *source; 55 | 56 | EXPECT_TRUE(dolly.equals(*source)); 57 | } 58 | } -------------------------------------------------------------------------------- /gladius/tests/unittests/Builder_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define CL_TARGET_OPENCL_VERSION 120 6 | #include 7 | 8 | namespace gladius_tests 9 | { 10 | 11 | using namespace gladius; 12 | 13 | class Builder_Test : public ::testing::Test 14 | { 15 | void SetUp() override 16 | { 17 | } 18 | }; 19 | 20 | TEST_F(Builder_Test, 21 | AddTransformationToInputCs_ModelWithBeginAndEnd_ReturnsPortIdOfTransformedPos) 22 | { 23 | nodes::Model model; 24 | model.createBeginEndWithDefaultInAndOuts(); 25 | nodes::Builder builder; 26 | nodes::Matrix4x4 trafo; 27 | auto const transformedPosId = builder.addTransformationToInputCs(model, trafo); 28 | 29 | EXPECT_EQ(transformedPosId.getId(), 10001); 30 | } 31 | 32 | TEST_F(Builder_Test, AddResoureRef_EmptyModel_ModelIncludesTransformationAndPart) 33 | { 34 | nodes::Model model; 35 | model.createBeginEndWithDefaultInAndOuts(); 36 | nodes::Builder builder; 37 | nodes::Matrix4x4 trafo; 38 | auto port = builder.addTransformationToInputCs(model, trafo); 39 | builder.addResourceRef(model, ResourceKey{1}, port); 40 | 41 | EXPECT_EQ(model.getSize(), 5); // Begin, End, Transformation, ResourceId and FunctionCall-Node 42 | } 43 | 44 | TEST_F(Builder_Test, AddComponentRef_EmptyModel_ModelIncludesTransformationAndPart) 45 | { 46 | nodes::Model model; 47 | model.createBeginEndWithDefaultInAndOuts(); 48 | nodes::Builder builder; 49 | nodes::Matrix4x4 trafo; 50 | nodes::Model referencedModel; 51 | referencedModel.createBeginEndWithDefaultInAndOuts(); 52 | 53 | builder.addComponentRef(model, referencedModel, trafo); 54 | 55 | EXPECT_EQ(model.getSize(), 56 | 5); // Begin, End, Transformation, ResourceId and FunctionCall-Node 57 | } 58 | } -------------------------------------------------------------------------------- /gladius/tests/unittests/CLPrgram_tests.cpp: -------------------------------------------------------------------------------- 1 | #include "CLProgram.h" 2 | #include 3 | 4 | namespace gladius_tests 5 | { 6 | using namespace gladius; 7 | 8 | TEST(CLProgramTest, ApplyKernelReplacements) 9 | { 10 | std::string source = "Hello, World!"; 11 | KernelReplacements replacements = {{"Hello", "Hi"}, {"World", "Universe"}}; 12 | 13 | applyKernelReplacements(source, replacements); 14 | 15 | EXPECT_EQ(source, "Hi, Universe!"); 16 | } 17 | 18 | TEST(CLProgramTest, ApplyKernelReplacements_NoReplacements) 19 | { 20 | std::string source = "Hello, World!"; 21 | KernelReplacements replacements; 22 | 23 | applyKernelReplacements(source, replacements); 24 | 25 | EXPECT_EQ(source, "Hello, World!"); 26 | } 27 | 28 | TEST(CLProgramTest, ApplyKernelReplacements_MultipleReplacements) 29 | { 30 | std::string source = "Hello, World!"; 31 | KernelReplacements replacements = {{"Hello", "Hi"}, {"World", "Universe"}, {"!", "?"}}; 32 | 33 | applyKernelReplacements(source, replacements); 34 | 35 | EXPECT_EQ(source, "Hi, Universe?"); 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /gladius/tests/unittests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | include(GoogleTest) 4 | 5 | set(BINARY ${CMAKE_PROJECT_NAME}_test) 6 | file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES false *.h *.cpp) 7 | set(SOURCES ${TEST_SOURCES}) 8 | add_executable(${BINARY} ${TEST_SOURCES}) 9 | 10 | if(MSVC) 11 | target_compile_options(${BINARY} PRIVATE /W3 /WX /D_USE_MATH_DEFINES) 12 | set_property(TARGET ${BINARY} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") 13 | endif() 14 | target_include_directories(${BINARY} PUBLIC ../../src ../../components/nanovdb) 15 | 16 | set(DEPENDENCIES ${CMAKE_PROJECT_NAME}_lib GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main ${FMT_LIBRARY} ${OPENMESH_LIBRARIES} Eigen3::Eigen lodepng Boost::boost unofficial::minizip::minizip) 17 | 18 | if (ENABLE_TRACY) 19 | set(DEPENDENCIES ${DEPENDENCIES} Tracy::TracyClient) 20 | endif() 21 | 22 | target_link_libraries(${BINARY} PUBLIC 23 | ${CMAKE_PROJECT_NAME}_lib 24 | ${DEPENDENCIES} 25 | ) 26 | 27 | 28 | 29 | file(GLOB TEST_FILES 30 | "testdata/*.*" 31 | ) 32 | 33 | file(COPY ${TEST_FILES} DESTINATION "testdata") 34 | 35 | file(GLOB FONT_FILES 36 | "../../components/imgui/misc/fonts/*.*" 37 | ) 38 | file(COPY ${FONT_FILES} DESTINATION "misc/fonts/") 39 | 40 | # if(WIN32 AND NOT UNIX) 41 | # configure_file(${CMAKE_SOURCE_DIR}/components/lib3mf/Bin/lib3mf.dll lib3mf.dll COPYONLY) 42 | # endif() 43 | 44 | # if(WIN32 AND NOT UNIX) 45 | # configure_file(${CMAKE_SOURCE_DIR}/components/lib3mf/Bin/lib3mf.dll src/lib3mf.dll COPYONLY) 46 | # else() 47 | # configure_file(${CMAKE_SOURCE_DIR}/components/lib3mf/Bin/lib3mf.so src/lib3mf.so COPYONLY) 48 | # configure_file(${CMAKE_SOURCE_DIR}/components/lib3mf/Bin/lib3mf.so src/lib3mf.so.2 COPYONLY) 49 | # endif() 50 | 51 | gtest_add_tests(TARGET ${BINARY}) -------------------------------------------------------------------------------- /gladius/tests/unittests/CliReader_tests.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace gladius_tests 8 | { 9 | TEST(CliReader, Read_CliWithQuad_PrimitivesContainQuad) 10 | { 11 | gladius::CliReader testee; 12 | gladius::ComputeContext computecontext{}; 13 | gladius::Primitives result{computecontext}; 14 | 15 | testee.read({"testdata/quad.cli"}, result); 16 | EXPECT_EQ(1, result.primitives.getSize()); 17 | EXPECT_EQ(8, result.data.getData().size()); 18 | } 19 | } -------------------------------------------------------------------------------- /gladius/tests/unittests/Writer3mf_tests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "io/3mf/Writer3mf.h" 3 | #include "nodes/types.h" 4 | #include "nodes/utils.h" 5 | 6 | #include 7 | 8 | namespace gladius_tests 9 | { 10 | 11 | using namespace gladius; 12 | 13 | TEST(Writer3mfTest, ConvertMatrix4x4) 14 | { 15 | // Test case 1: Identity matrix 16 | gladius::nodes::Matrix4x4 identityMat = identityMatrix(); 17 | 18 | Lib3MF::sMatrix4x4 convertedMatrix = io::convertMatrix4x4(identityMat); 19 | for (int row = 0; row < 4; ++row) 20 | { 21 | for (int col = 0; col < 4; ++col) 22 | { 23 | if (row == col) 24 | EXPECT_EQ(convertedMatrix.m_Field[row][col], 1.0); 25 | else 26 | EXPECT_EQ(convertedMatrix.m_Field[row][col], 0.0); 27 | } 28 | } 29 | 30 | // Test case 2: Arbitrary matrix 31 | gladius::nodes::Matrix4x4 arbitraryMatrix = zeroMatrix(); 32 | 33 | arbitraryMatrix[0] [0] = 1.0; 34 | arbitraryMatrix[1] [1] = 2.0; 35 | arbitraryMatrix[2] [2] = 3.0; 36 | arbitraryMatrix[3] [3] = 4.0; 37 | 38 | convertedMatrix = io::convertMatrix4x4(arbitraryMatrix); 39 | for (int row = 0; row < 4; ++row) 40 | { 41 | for (int col = 0; col < 4; ++col) 42 | { 43 | if (row == col) 44 | EXPECT_EQ(convertedMatrix.m_Field[row][col], arbitraryMatrix[row][col]); 45 | else 46 | EXPECT_EQ(convertedMatrix.m_Field[row][col], 0.0); 47 | } 48 | } 49 | } 50 | } // namespace gladius_tests -------------------------------------------------------------------------------- /gladius/tests/unittests/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | auto main(int argc, char ** argv) -> int 4 | { 5 | ::testing::InitGoogleTest(&argc, argv); 6 | return RUN_ALL_TESTS(); 7 | } -------------------------------------------------------------------------------- /gladius/tests/unittests/testdata/Boundary.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/tests/unittests/testdata/Boundary.3mf -------------------------------------------------------------------------------- /gladius/tests/unittests/testdata/ImplicitGyroid.3mf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3MFConsortium/gladius/308fec193c5dd8d522048d57e9c6cd2d192cb8be/gladius/tests/unittests/testdata/ImplicitGyroid.3mf -------------------------------------------------------------------------------- /gladius/tests/unittests/testdata/cube.json: -------------------------------------------------------------------------------- 1 | { 2 | "Assembly" : 3 | [ 4 | { 5 | "displayName" : "Begin_1", 6 | "id" : 1, 7 | "name" : "Begin_1", 8 | "out" : 9 | { 10 | "cs" : 11 | { 12 | "name" : "Begin_1_cs" 13 | } 14 | }, 15 | "screenPos" : 16 | { 17 | "x" : 0.0, 18 | "y" : 0.0 19 | }, 20 | "type" : "Begin" 21 | }, 22 | { 23 | "displayName" : "Box_5", 24 | "id" : 5, 25 | "in" : 26 | { 27 | "cs" : 28 | { 29 | "source" : "Begin_1_cs" 30 | }, 31 | "dimensions" : 32 | { 33 | "isArgument" : false, 34 | "x" : 10.0, 35 | "y" : 10.0, 36 | "z" : 10.0 37 | } 38 | }, 39 | "name" : "Box_5", 40 | "out" : 41 | { 42 | "shape" : 43 | { 44 | "name" : "Box_5_shape" 45 | } 46 | }, 47 | "screenPos" : 48 | { 49 | "x" : 627.0, 50 | "y" : 15.0 51 | }, 52 | "type" : "Box" 53 | }, 54 | { 55 | "displayName" : "End_2", 56 | "id" : 4, 57 | "in" : 58 | { 59 | "color" : 60 | { 61 | "isArgument" : false, 62 | "x" : 0.5, 63 | "y" : 0.5, 64 | "z" : 0.5 65 | }, 66 | "shape" : 67 | { 68 | "source" : "Box_5_shape" 69 | } 70 | }, 71 | "name" : "End_2", 72 | "screenPos" : 73 | { 74 | "x" : 1499.0, 75 | "y" : 0.0 76 | }, 77 | "type" : "End" 78 | } 79 | ] 80 | } 81 | -------------------------------------------------------------------------------- /gladius/tests/unittests/testhelper.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "testhelper.h" 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace gladius_tests::helper 9 | { 10 | auto sphere(float3 pos, float radius) -> float 11 | { 12 | return std::sqrt(pos.x() * pos.x() + pos.y() * pos.y() + pos.z() * pos.z()) - radius; 13 | } 14 | 15 | auto testModel(float3 pos) -> float 16 | { 17 | auto sdf = sphere(pos, 50.f); 18 | sdf = std::min(sdf, sphere(pos - float3{15.f, 15.f, 15.f}, 30.)); 19 | return sdf; 20 | } 21 | 22 | auto testModel2(float3 pos) -> float 23 | { 24 | auto sdf = sphere(pos, 50.f); 25 | sdf = std::min(sdf, sphere(pos - float3{15.f, 15.f, 15.f}, 30.)); 26 | return sdf; 27 | } 28 | } -------------------------------------------------------------------------------- /gladius/tests/unittests/testhelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "nodes/Model.h" 7 | 8 | #include 9 | 10 | namespace gladius_tests 11 | { 12 | using namespace gladius; 13 | using float3 = Eigen::Vector3f; 14 | using float2 = Eigen::Vector2f; 15 | using ShapeFunction = std::function; 16 | namespace helper 17 | { 18 | template 19 | auto countNumberOfNodesOfType(nodes::Model & model) 20 | { 21 | int count = 0; 22 | auto visitor = gladius::nodes::OnTypeVisitor([&](T &) { ++count; }); 23 | model.visitNodes(visitor); 24 | return count; 25 | } 26 | 27 | auto sphere(float3 pos, float radius) -> float; 28 | auto testModel(float3 pos) -> float; 29 | auto testModel2(float3 pos) -> float; 30 | 31 | template 32 | auto computeHash(Iterator cbegin, Iterator cend) 33 | { 34 | std::hash::value_type> hasher; 35 | size_t hash = 0; 36 | for (auto it = cbegin; it != cend; ++it) 37 | { 38 | hash ^= hasher(*it) + 0x9e3779b9 + (hash << 6) + (hash >> 2); 39 | } 40 | return hash; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /gladius/url: -------------------------------------------------------------------------------- 1 | https://github.com/3MFConsortium/gladius 2 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/imgui-node-editor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(imgui-node-editor) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | find_package(imgui CONFIG REQUIRED) 7 | get_target_property(IMGUI_INCLUDE_DIRS imgui::imgui 8 | INTERFACE_INCLUDE_DIRECTORIES 9 | ) 10 | 11 | add_library(${PROJECT_NAME} "") 12 | 13 | target_include_directories( 14 | ${PROJECT_NAME} 15 | PUBLIC 16 | $ 17 | $ 18 | PRIVATE 19 | ${IMGUI_INCLUDE_DIRS} 20 | ) 21 | 22 | target_sources( 23 | ${PROJECT_NAME} 24 | PRIVATE 25 | crude_json.cpp 26 | imgui_canvas.cpp 27 | imgui_node_editor.cpp 28 | imgui_node_editor_api.cpp 29 | ) 30 | 31 | install( 32 | TARGETS ${PROJECT_NAME} 33 | EXPORT unofficial-${PROJECT_NAME}-target 34 | ARCHIVE DESTINATION lib 35 | ARCHIVE DESTINATION lib 36 | RUNTIME DESTINATION bin 37 | ) 38 | 39 | if (NOT IMGUI_NODE_EDITOR_SKIP_HEADERS) 40 | install( 41 | FILES 42 | crude_json.h 43 | imgui_bezier_math.h 44 | imgui_bezier_math.inl 45 | imgui_canvas.h 46 | imgui_extra_math.h 47 | imgui_extra_math.inl 48 | imgui_node_editor.h 49 | imgui_node_editor_internal.h 50 | imgui_node_editor_internal.inl 51 | DESTINATION include/${PROJECT_NAME} 52 | ) 53 | endif() 54 | 55 | install( 56 | EXPORT unofficial-${PROJECT_NAME}-target 57 | NAMESPACE unofficial::${PROJECT_NAME}:: 58 | FILE unofficial-${PROJECT_NAME}-config.cmake 59 | DESTINATION share/unofficial-${PROJECT_NAME} 60 | ) 61 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/imgui-node-editor/fix-vec2-math-operators.patch: -------------------------------------------------------------------------------- 1 | diff --git a/imgui_extra_math.h b/imgui_extra_math.h 2 | index 5c46cc4..18f6dad 100644 3 | --- a/imgui_extra_math.h 4 | +++ b/imgui_extra_math.h 5 | @@ -30,8 +30,10 @@ struct ImLine 6 | 7 | 8 | //------------------------------------------------------------------------------ 9 | +# if IMGUI_VERSION_NUM < 19002 10 | inline bool operator==(const ImVec2& lhs, const ImVec2& rhs); 11 | inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs); 12 | +#endif 13 | inline ImVec2 operator*(const float lhs, const ImVec2& rhs); 14 | # if IMGUI_VERSION_NUM < 18955 15 | inline ImVec2 operator-(const ImVec2& lhs); 16 | diff --git a/imgui_extra_math.inl b/imgui_extra_math.inl 17 | index 8b1b071..acc1254 100644 18 | --- a/imgui_extra_math.inl 19 | +++ b/imgui_extra_math.inl 20 | @@ -19,6 +19,7 @@ 21 | 22 | 23 | //------------------------------------------------------------------------------ 24 | +# if IMGUI_VERSION_NUM < 19002 25 | inline bool operator==(const ImVec2& lhs, const ImVec2& rhs) 26 | { 27 | return lhs.x == rhs.x && lhs.y == rhs.y; 28 | @@ -28,6 +29,7 @@ inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs) 29 | { 30 | return lhs.x != rhs.x || lhs.y != rhs.y; 31 | } 32 | +#endif 33 | 34 | inline ImVec2 operator*(const float lhs, const ImVec2& rhs) 35 | { 36 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/imgui-node-editor/portfile.cmake: -------------------------------------------------------------------------------- 1 | vcpkg_check_linkage(ONLY_STATIC_LIBRARY) 2 | 3 | vcpkg_from_github( 4 | OUT_SOURCE_PATH SOURCE_PATH 5 | REPO thedmd/imgui-node-editor 6 | REF v0.9.2 7 | SHA512 7dbc34a7af1554a7e683e0b55d18fc08cf5832bf5d6a57a30820e7ef98a6fbb5a65a7287f6250d3b6f47b89ac0499f51fbe19d9c11850e26f74e3b0e806abb1b 8 | HEAD_REF master 9 | PATCHES 10 | fix-vec2-math-operators.patch 11 | ) 12 | 13 | file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") 14 | 15 | vcpkg_cmake_configure( 16 | SOURCE_PATH "${SOURCE_PATH}" 17 | OPTIONS_DEBUG 18 | -DIMGUI_NODE_EDITOR_SKIP_HEADERS=ON 19 | ) 20 | 21 | vcpkg_cmake_install() 22 | 23 | vcpkg_copy_pdbs() 24 | vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT}) 25 | 26 | vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") 27 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/imgui-node-editor/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "imgui-node-editor", 3 | "version": "0.9.3", 4 | "port-version": 1, 5 | "description": "Node Editor built using Dear ImGui", 6 | "homepage": "https://github.com/thedmd/imgui-node-editor", 7 | "license": "MIT", 8 | "dependencies": [ 9 | "imgui", 10 | { 11 | "name": "vcpkg-cmake", 12 | "host": true 13 | }, 14 | { 15 | "name": "vcpkg-cmake-config", 16 | "host": true 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/imgui/imgui-config.cmake.in: -------------------------------------------------------------------------------- 1 | cmake_policy(SET CMP0012 NEW) 2 | 3 | @PACKAGE_INIT@ 4 | 5 | include(CMakeFindDependencyMacro) 6 | 7 | if (@IMGUI_BUILD_GLFW_BINDING@) 8 | if (NOT "@EMSCRIPTEN@") 9 | find_dependency(glfw3 CONFIG) 10 | endif() 11 | endif() 12 | 13 | if (@IMGUI_BUILD_GLUT_BINDING@) 14 | find_dependency(GLUT) 15 | endif() 16 | 17 | if (@IMGUI_BUILD_SDL2_BINDING@ OR @IMGUI_BUILD_SDL2_RENDERER_BINDING@) 18 | find_dependency(SDL2 CONFIG) 19 | endif() 20 | 21 | if (@IMGUI_BUILD_VULKAN_BINDING@) 22 | find_dependency(Vulkan) 23 | endif() 24 | 25 | if (@IMGUI_FREETYPE@) 26 | find_dependency(freetype CONFIG) 27 | endif() 28 | 29 | if (@IMGUI_FREETYPE_LUNASVG@) 30 | find_dependency(unofficial-lunasvg CONFIG) 31 | endif() 32 | 33 | if (@IMGUI_BUILD_ALLEGRO5_BINDING@) 34 | find_dependency(Allegro CONFIG) 35 | endif() 36 | 37 | if (@IMGUI_TEST_ENGINE@) 38 | find_dependency(Stb) 39 | endif() 40 | 41 | include("${CMAKE_CURRENT_LIST_DIR}/imgui-targets.cmake") 42 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/lib3mf/updateToLatestCommit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fetch the latest commit SHA from the 'implicit' branch of the '3MFConsortium/lib3mf' repository 4 | commit_sha=$(curl -s "https://api.github.com/repos/3MFConsortium/lib3mf/commits/implicit" | grep sha | head -n 1 | cut -d '"' -f 4) 5 | 6 | # Replace the REF value in the portfile.cmake file with the fetched commit SHA 7 | sed -i "0,/REF .*/s/REF .*/REF $commit_sha/" portfile.cmake 8 | 9 | # Store previous directory 10 | old_dir=$(pwd) 11 | cd /tmp/ 12 | 13 | vcpkg remove lib3mf 14 | 15 | # Capture the output of the vcpkg install command 16 | output=$(vcpkg install lib3mf) 17 | 18 | # Extract the actual hash from the output 19 | actual_hash=$(echo "$output" | grep 'Actual hash:' | cut -d ' ' -f 3) 20 | echo "Actual hash: $actual_hash" 21 | 22 | # Replace the expected hash in the portfile.cmake file with the actual hash 23 | sed -i "0,/SHA512 .*/s//SHA512 $actual_hash/" $old_dir/portfile.cmake 24 | 25 | vcpkg install lib3mf 26 | 27 | # Restore the previous directory 28 | cd $old_dir -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/lib3mf/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lib3mf", 3 | "version": "2.4.0", 4 | "description": "lib3mf is a C++ implementation of the 3D Manufacturing Format file standard.", 5 | "homepage": "https://github.com/3MFConsortium/lib3mf", 6 | "dependencies": [ 7 | { 8 | "name": "vcpkg-cmake", 9 | "host": true 10 | }, 11 | { 12 | "name": "vcpkg-cmake-config", 13 | "host": true 14 | }, 15 | "openssl", 16 | "zlib", 17 | "libzip", 18 | "gtest", 19 | "pkgconf", 20 | "vcpkg-cmake" 21 | ] 22 | } -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/openvdb/fix_nanovdb.patch: -------------------------------------------------------------------------------- 1 | diff --git a/nanovdb/nanovdb/CMakeLists.txt b/nanovdb/nanovdb/CMakeLists.txt 2 | index 7bb3ab86..9311ed17 100644 3 | --- a/nanovdb/nanovdb/CMakeLists.txt 4 | +++ b/nanovdb/nanovdb/CMakeLists.txt 5 | @@ -127,7 +127,7 @@ if(NANOVDB_USE_TBB AND NOT TARGET TBB::tbb) 6 | endif() 7 | 8 | if(NANOVDB_USE_BLOSC AND NOT TARGET Blosc::blosc) 9 | - find_package(Blosc REQUIRED) 10 | + find_package(Blosc REQUIRED NAMES blosc) 11 | endif() 12 | 13 | if(NANOVDB_USE_ZLIB AND NOT TARGET ZLIB::ZLIB) 14 | @@ -236,7 +236,7 @@ if(NANOVDB_USE_TBB) 15 | endif() 16 | 17 | if(NANOVDB_USE_BLOSC) 18 | - target_link_libraries(nanovdb INTERFACE Blosc::blosc) 19 | + target_link_libraries(nanovdb INTERFACE $,blosc_shared,blosc_static>) 20 | target_compile_definitions(nanovdb INTERFACE -DNANOVDB_USE_BLOSC) 21 | endif() 22 | 23 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/openvdb/usage: -------------------------------------------------------------------------------- 1 | The package openvdb provides CMake targets: 2 | 3 | find_package(OpenVDB CONFIG REQUIRED) 4 | target_link_libraries(main PRIVATE OpenVDB::openvdb) 5 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/openvdb/vcpkg-cmake-wrapper.cmake.in: -------------------------------------------------------------------------------- 1 | set(OPENVDB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) 2 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) 3 | 4 | list(REMOVE_ITEM ARGS "NO_MODULE") 5 | list(REMOVE_ITEM ARGS "CONFIG") 6 | list(REMOVE_ITEM ARGS "MODULE") 7 | 8 | set(OPENVDB_USE_STATIC_LIBS @OPENVDB_STATIC@) 9 | 10 | _find_package(${ARGS}) 11 | 12 | set(CMAKE_MODULE_PATH ${OPENVDB_PREV_MODULE_PATH}) 13 | -------------------------------------------------------------------------------- /gladius/vcpkg-overlay-ports/openvdb/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openvdb", 3 | "version": "11.0.0", 4 | "description": "Sparse volume data structure and tools", 5 | "homepage": "https://github.com/dreamworksanimation/openvdb", 6 | "license": "MPL-2.0", 7 | "supports": "!xbox", 8 | "dependencies": [ 9 | "blosc", 10 | "boost-any", 11 | "boost-date-time", 12 | "boost-interprocess", 13 | "boost-iostreams", 14 | "boost-ptr-container", 15 | "boost-system", 16 | "boost-thread", 17 | "boost-uuid", 18 | "imath", 19 | "openexr", 20 | "tbb", 21 | { 22 | "name": "vcpkg-cmake", 23 | "host": true 24 | }, 25 | { 26 | "name": "vcpkg-cmake-config", 27 | "host": true 28 | } 29 | ], 30 | "features": { 31 | "ax": { 32 | "description": "Provides a powerful and easy way of interacting with OpenVDB volume and point data.", 33 | "supports": "!windows", 34 | "dependencies": [ 35 | { 36 | "name": "llvm", 37 | "default-features": false 38 | } 39 | ] 40 | }, 41 | "nanovdb": { 42 | "description": "A lightweight GPU friendly version of VDB initially targeting rendering applications" 43 | }, 44 | "tools": { 45 | "description": "OpenVDB utilities: view, print and render", 46 | "dependencies": [ 47 | "glew", 48 | "glfw3" 49 | ] 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /gladius/vcpkg-triplets/x64-windows-gladius.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE dynamic) 4 | set(VCPKG_PLATFORM_TOOLSET v143) 5 | 6 | if ("${VCPKG_CURRENT_PACKAGE}" STREQUAL "minizip") 7 | set(VCPKG_LIBRARY_LINKAGE static) 8 | endif() 9 | 10 | if ("${VCPKG_CURRENT_PACKAGE}" STREQUAL "lz4") 11 | set(VCPKG_LIBRARY_LINKAGE static) 12 | endif() 13 | 14 | if ("${VCPKG_CURRENT_PACKAGE}" STREQUAL "zlib") 15 | set(VCPKG_LIBRARY_LINKAGE static) 16 | endif() -------------------------------------------------------------------------------- /gladius/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | "fmt", 4 | "openmesh", 5 | "glad", 6 | "glfw3", 7 | "eigen3", 8 | "tinyfiledialogs", 9 | "gtest", 10 | "platform-folders", 11 | "opencl", 12 | { 13 | "name": "openvdb", 14 | "features": 15 | [ 16 | "nanovdb" 17 | ] 18 | }, 19 | { 20 | "name": "imgui", 21 | "platform": "windows", 22 | "features": 23 | [ 24 | "docking-experimental", 25 | "glfw-binding", 26 | "opengl2-binding", 27 | "win32-binding" 28 | ] 29 | }, 30 | { 31 | "name": "imgui", 32 | "platform": "!windows", 33 | "features": 34 | [ 35 | "docking-experimental", 36 | "glfw-binding", 37 | "opengl2-binding" 38 | ] 39 | }, 40 | "imgui-node-editor", 41 | "cmakerc", 42 | "blosc", 43 | "zlib", 44 | "lodepng", 45 | "minizip", 46 | "pugixml", 47 | "lib3mf", 48 | "minizip", 49 | "tracy" 50 | ], 51 | "overrides": [ 52 | { 53 | "name": "imgui", 54 | "version": "1.89.9" 55 | }, 56 | { 57 | "name": "imgui-node-editor", 58 | "version": "0.9.2" 59 | } 60 | ], 61 | "name": "gladius", 62 | "builtin-baseline": "e590c2b30c08caf1dd8d612ec602a003f9784b7d", 63 | "version-string": "1.2.10" 64 | } 65 | -------------------------------------------------------------------------------- /gladius/vcpkg.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | "fmt", 4 | "openmesh", 5 | "glad", 6 | "glfw3", 7 | "eigen3", 8 | "tinyfiledialogs", 9 | "gtest", 10 | "platform-folders", 11 | "opencl", 12 | { 13 | "name": "openvdb", 14 | "features": 15 | [ 16 | "nanovdb" 17 | ] 18 | }, 19 | { 20 | "name": "imgui", 21 | "platform": "windows", 22 | "features": 23 | [ 24 | "docking-experimental", 25 | "glfw-binding", 26 | "opengl2-binding", 27 | "win32-binding" 28 | ] 29 | }, 30 | { 31 | "name": "imgui", 32 | "platform": "!windows", 33 | "features": 34 | [ 35 | "docking-experimental", 36 | "glfw-binding", 37 | "opengl2-binding" 38 | ] 39 | }, 40 | "imgui-node-editor", 41 | "cmakerc", 42 | "blosc", 43 | "zlib", 44 | "lodepng", 45 | "minizip", 46 | "pugixml", 47 | "lib3mf", 48 | "minizip", 49 | "tracy" 50 | ], 51 | "overrides": [ 52 | { 53 | "name": "imgui", 54 | "version": "1.89.9" 55 | }, 56 | { 57 | "name": "imgui-node-editor", 58 | "version": "0.9.2" 59 | } 60 | ], 61 | "name": "gladius", 62 | "builtin-baseline": "e590c2b30c08caf1dd8d612ec602a003f9784b7d", 63 | "version-string": "@CPACK_PACKAGE_VERSION_MAJOR@.@CPACK_PACKAGE_VERSION_MINOR@.@CPACK_PACKAGE_VERSION_PATCH@" 64 | } 65 | --------------------------------------------------------------------------------