Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
6254341
Merge pull request #1 from hasselmm/bugfix/cmake-fixes
hasselmm Nov 1, 2023
c0df8f3
Remove misleading comment
hasselmm Nov 1, 2023
95b9c96
Allow transformations for QtCSG geometries
hasselmm Nov 1, 2023
9b32174
Merge pull request #2 from hasselmm/feature/transformations
hasselmm Nov 1, 2023
6380515
Repair union test
hasselmm Nov 2, 2023
4a0942b
Also test union for adjacent cubes
hasselmm Nov 2, 2023
30b8515
Fix clazy issue in unit tests
hasselmm Nov 2, 2023
149e175
Visualize union test in demo app
hasselmm Nov 2, 2023
e6b275c
Enable automatic builds for github
hasselmm Nov 2, 2023
d87b9e1
Merge pull request #3 from hasselmm/improvement/enable-autobuilds
hasselmm Nov 2, 2023
b2ac450
Allow to use local CMake modules
hasselmm Dec 3, 2023
f8c85aa
Extract backports for versionless Qt
hasselmm Dec 3, 2023
6439ddb
Enable alternate, faster linkers
hasselmm Dec 3, 2023
febb501
Report which Qt version is used
hasselmm Dec 3, 2023
3dbd8fe
Pin the aqtversion used for github builds
hasselmm Dec 3, 2023
d9dab20
Upgrade the Qt version used in autobuilds
hasselmm Dec 3, 2023
edc7a3a
Also build a Qt5 version on Linux
hasselmm Dec 3, 2023
1e00f40
Merge pull request #4 from hasselmm/improvement/cmake-fixes
hasselmm Dec 3, 2023
858e4c2
Wrap way too long line
hasselmm Dec 3, 2023
de0150d
Unify some method names
hasselmm Dec 3, 2023
0d1a909
Provide proper methods for geometry transformation
hasselmm Dec 3, 2023
9035035
Add nodiscard attributes where needed
hasselmm Dec 3, 2023
dadbf4f
Move constructors and attributes to the top
hasselmm Dec 3, 2023
cfcd5e1
Minimally improve efficency of Polygon::split()
hasselmm Dec 3, 2023
03a5699
Merge pull request #5 from hasselmm/improvement/some-housekeeping
hasselmm Dec 3, 2023
d5391cd
Add tests found in github:crabmusket/csg.ts
hasselmm Nov 2, 2023
275d18f
Move test utilities into a separate header
hasselmm Dec 3, 2023
2c575e6
Start moving math functions into separate header
hasselmm Dec 3, 2023
bb5873b
Add some utility functions for matrices
hasselmm Dec 3, 2023
d6acacf
Allow to use QtCSG types as QtTest data
hasselmm Dec 3, 2023
93ca98c
Properly transform normal vectors
hasselmm Dec 3, 2023
e18b867
Add convenience check for empty polygon
hasselmm Dec 3, 2023
e080bff
More CMake paranoid for proper selection of Qt
hasselmm Dec 3, 2023
ca30a28
Merge pull request #6 from hasselmm/improvement/more-testing
hasselmm Dec 3, 2023
5106d4b
Use separate ccache for GCC builds
hasselmm Dec 3, 2023
86debb3
Merge pull request #7 from hasselmm/bugfix/use-proper-ccache-for-qt5
hasselmm Dec 3, 2023
5e013e8
Preallocate when converting Qt3D geometry
hasselmm Dec 3, 2023
d02bd49
Report if invalid Qt3D objects get passed
hasselmm Dec 3, 2023
6d40e8a
Merge pull request #8 from hasselmm/bugfix/qt3d-crash-for-empty-geometry
hasselmm Dec 4, 2023
cde9df1
Add CMake debug helpers
hasselmm Dec 5, 2023
1589db7
Allow to limit recursion level
hasselmm Dec 3, 2023
65a781b
Report arrangement errors to the API user
hasselmm Dec 5, 2023
4ad5cd3
Merge pull request #9 from hasselmm/improvement/add-error-reporting
hasselmm Dec 5, 2023
1c07877
Just check QT_VERSION_MAJOR < 6
hasselmm Dec 5, 2023
51d504d
Merge pull request #11 from hasselmm/improvement/simplify-qt6-version…
hasselmm Dec 5, 2023
26a1e32
Make Geometry constructors explicit
hasselmm Dec 5, 2023
84ce5a2
Add minimal support for OFF file format
hasselmm Dec 3, 2023
1c80dfa
Merge pull request #10 from hasselmm/improvement/mesh-loading
hasselmm Dec 5, 2023
1c0456e
Move QtCSG demo into namespace
hasselmm Dec 7, 2023
7749179
Move generic matrix factories into header
hasselmm Dec 7, 2023
962eb77
Merge pull request #14 from hasselmm/improvement/move-generic-matrix-…
hasselmm Dec 7, 2023
ba2f4d1
Report error for functions without declaration
hasselmm Dec 7, 2023
9879ab7
Merge pull request #15 from hasselmm/bugfix/report-errors-for-functio…
hasselmm Dec 7, 2023
cad6dc9
Increase recursion limit
hasselmm Dec 7, 2023
dfe70da
Also catch (recursion) errors during node creation
hasselmm Dec 7, 2023
d882cf9
Use proper category name for lcNode
hasselmm Dec 8, 2023
1957244
Add some facilities for canonical error reporting
hasselmm Dec 8, 2023
08abb87
Merge pull request #16 from hasselmm/bugfix/recursion-fixes
hasselmm Dec 8, 2023
d48d451
Enable colorful logging for the QtCSG demo
hasselmm Dec 8, 2023
bad4648
Merge pull request #17 from hasselmm/improvement/colorful-logging
hasselmm Dec 8, 2023
73dc363
Use std::vector to build vertex buffers
hasselmm Dec 8, 2023
a5e4b0a
Preallocate vertex buffers
hasselmm Dec 8, 2023
ae19fff
Merge pull request #18 from hasselmm/improvement/vertex-buffer-alloca…
hasselmm Dec 8, 2023
2125bd4
Give focus to 3D scene to enable keyboard navigation
hasselmm Dec 7, 2023
9e8331a
Replace first person controller by orbital one
hasselmm Dec 7, 2023
9b75722
Attach the scene's light to the camera
hasselmm Dec 7, 2023
fbc3fdc
Merge pull request #19 from hasselmm/improvement/orbital-camera-contr…
hasselmm Dec 8, 2023
07252df
Remove redudant blank line
hasselmm Dec 9, 2023
4660db2
Mark UI strings as translatable
hasselmm Dec 9, 2023
9fadc77
Use color constant instead of literal string
hasselmm Dec 9, 2023
9d32727
Merge pull request #20 from hasselmm/improvement/minor-codestyle-fixes
hasselmm Dec 9, 2023
3ea4548
Build fix for Qt5 and clang
hasselmm Dec 10, 2023
98a8f52
Merge pull request #21 from hasselmm/bugfix/build-fix-for-qt5-and-clang
hasselmm Dec 10, 2023
d807235
Add missing [[nodiscard]] attribute
hasselmm Dec 10, 2023
c9af370
Enable toolbar behavior for mode buttons in demo
hasselmm Dec 10, 2023
cbac041
Merge pull request #22 from hasselmm/improvement/some-more-minor-demo…
hasselmm Dec 10, 2023
2d404e1
Avoid redudant normalized() call
hasselmm Dec 10, 2023
550435f
Merge pull request #23 from hasselmm/bugfix/avoid-redudant-normalized…
hasselmm Dec 10, 2023
9025f31
Enable more compiler warnings
hasselmm Dec 11, 2023
17332ec
Remove unused state argument
hasselmm Dec 11, 2023
09e1e03
Avoid possible memory leaks for Qt3DCSG::Geometry
hasselmm Dec 11, 2023
f53769f
Be more careful about number signs
hasselmm Dec 11, 2023
27b850e
Replace another local QList by std::vector
hasselmm Dec 13, 2023
6af8faa
Merge pull request #24 from hasselmm/bugfix/code-quality
hasselmm Dec 13, 2023
a0a2562
Fix CRLF line endings
hasselmm Dec 13, 2023
86d8764
Merge pull request #25 from hasselmm/bugfix/fix-crlf-line-endings
hasselmm Dec 13, 2023
098bfb6
Allow to build geometries from string
hasselmm Dec 15, 2023
feaf246
Support compilers without full concepts support
hasselmm Dec 15, 2023
b6d3c17
Support compilers without std::source_location
hasselmm Dec 15, 2023
14815d0
Merge pull request #26 from hasselmm/improvement/geometries-from-string
hasselmm Dec 16, 2023
ad2b968
Merge pull request #27 from hasselmm/improvement/support-old-compilers
hasselmm Dec 16, 2023
86a881a
Add freestanding alternatives to Vector operations
hasselmm Dec 17, 2023
40372c7
Make Geometry::fromExpression() freestanding
hasselmm Dec 17, 2023
3684ffe
Merge pull request #28 from hasselmm/improvement/freestanding-love
hasselmm Dec 17, 2023
f16e588
Replace phong material by wireframe material
hasselmm Dec 7, 2023
6c72484
Add licenses to toplevel CMakeLists.txt
hasselmm Dec 9, 2023
2202846
Add copyright information to wireframe shaders
hasselmm Dec 9, 2023
4508264
Fix codestyle of wireframe shaders
hasselmm Dec 9, 2023
88967c5
Allow to toggle visibility of wireframes
hasselmm Dec 9, 2023
93a4cf1
Use proper lighting model from Qt3D
hasselmm Dec 10, 2023
64f9ae5
Make the wireframes transparent
hasselmm Dec 10, 2023
8ee8ec2
Merge pull request #32 from hasselmm/improvement/wireframes-for-qtcsg…
hasselmm Dec 20, 2023
d45ae5d
Hopefully make Github understand license info
hasselmm Dec 20, 2023
e8a12c4
Merge pull request #33 from hasselmm/bugfix/license-information-for-g…
hasselmm Dec 20, 2023
f4e8a8b
Another attempt to fix license information
hasselmm Dec 20, 2023
fd035f5
Merge pull request #34 from hasselmm/bugfix/license-information-for-g…
hasselmm Dec 20, 2023
8c4e6bb
Fix broken license link
hasselmm Dec 20, 2023
1480d7c
Merge pull request #35 from hasselmm/bugfix/license-information-for-g…
hasselmm Dec 20, 2023
8ae6a6d
Extract QtCSGAppSupport library
hasselmm Dec 10, 2023
25e3b01
Properly name sources for OrbitCameraController
hasselmm Dec 17, 2023
d59d15e
Failing tests really shall fail CI
hasselmm Dec 5, 2023
74d54ff
Check polygons for convexity on construction
hasselmm Dec 5, 2023
7c2c0d0
Add test for failing subtraction
hasselmm Dec 3, 2023
a3e8f79
Introduce MultiEnum template
hasselmm Dec 17, 2023
c2e154e
Allow more complex options for algorithms
hasselmm Dec 17, 2023
852f5a2
Hide Polygon::split() from public API
hasselmm Dec 17, 2023
566d914
Provide an introspection interface
hasselmm Dec 15, 2023
cd2659e
WIP: Introduce interactive geometry inspector
hasselmm Dec 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: Continuous Integration
on:
push:
branches: [ main ]

pull_request:
branches: [ main ]

jobs:
Build-on-Ubuntu-Qt5:
name: "Build on Ubuntu for Qt5"
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '5.15.2'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
tools: 'tools_ninja'
cache: true

- name: Set up compiler cache
uses: chocobo1/setup-ccache-action@v1
with:
ccache_options: |
max_size=100M
override_cache_key: ccache-linux-gcc-x86_64
update_packager_index: false

- name: Configure project
run: >
mkdir build && cd build && cmake -GNinja
-DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc
-DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++
-DCMAKE_MAKE_PROGRAM:FILEPATH=$IQTA_TOOLS/Ninja/ninja
..

- name: Build project
run: cd build && cmake --build . --target all -- -k0

- name: Test project
run: cd build && ctest --rerun-failed --output-on-failure
env:
QT_QPA_PLATFORM: offscreen

Build-on-Ubuntu-Qt6:
name: "Build on Ubuntu for Qt6"
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.6.1'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
modules: 'qt3d'
tools: 'tools_ninja'
cache: true

- name: Set up compiler cache
uses: chocobo1/setup-ccache-action@v1
with:
ccache_options: |
max_size=100M
override_cache_key: ccache-linux-clang-x86_64
update_packager_index: false

- name: Configure project
run: >
mkdir build && cd build && cmake -GNinja
-DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang-15
-DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++-15
-DCMAKE_MAKE_PROGRAM:FILEPATH=$IQTA_TOOLS/Ninja/ninja
..

- name: Build project
run: cd build && cmake --build . --target all -- -k0

- name: Test project
run: cd build && ctest --rerun-failed --output-on-failure
env:
QT_QPA_PLATFORM: offscreen

Build-on-Windows-Qt6:
name: "Build on Windows for Qt6"
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.6.1'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
modules: 'qt3d'
tools: 'tools_mingw90 tools_ninja'
cache: true

- name: Set up compiler cache
uses: chocobo1/setup-ccache-action@v1
with:
ccache_options: |
max_size=100M
override_cache_key: ccache-windows-mingw64
windows_compile_environment: msvc # guess "windows_package_manager: choco" would be a better name

- name: Configure project
run: >
mkdir build && cd build && cmake -GNinja
-DCMAKE_C_COMPILER:FILEPATH=$env:IQTA_TOOLS/mingw1120_64/bin/gcc.exe
-DCMAKE_CXX_COMPILER:FILEPATH=$env:IQTA_TOOLS/mingw1120_64/bin/g++.exe
-DCMAKE_MAKE_PROGRAM:FILEPATH=$env:IQTA_TOOLS/Ninja/ninja.exe
..

- name: Build project
run: cd build && cmake --build . --target all -- -k0

- name: Test project
run: cd build && ctest --rerun-failed --output-on-failure
67 changes: 47 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.18)

project(QtCSG VERSION 0.1 LANGUAGES CXX)
enable_testing()
Expand All @@ -10,36 +10,63 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_compile_options(-Werror=switch -Werror=unused)
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

option(QTCSG_IGNORE_ERRORS "Ignore errors when building CSG trees")

if (QTCSG_IGNORE_ERRORS)
add_compile_definitions(QTCSG_IGNORE_ERRORS=1)
endif()

add_compile_definitions(
QT_DISABLE_DEPRECATED_BEFORE=0x050f00
QT_NO_CONTEXTLESS_CONNECT=1
)

add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:-Werror=missing-declarations>
-Wall -Wextra
-Werror=parentheses
-Werror=sign-compare
-Werror=switch
-Werror=unused
-Werror=type-limits
)

include(QtCSGDebug)
include(QtCSGEnableAlternateLinker)
qtcsg_enable_alternate_linker()

# Find Qt5 or Qt6
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)

set(QT_MODULES Core Gui Test Widgets 3DCore 3DExtras 3DRender)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS ${QT_MODULES})
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QT_MODULES})

foreach(module ${QT_MODULES})
add_library(Qt::${module} ALIAS Qt${QT_VERSION_MAJOR}::${module})
endforeach()

# Very minimal backport of qt_add_executable for Qt
if (NOT COMMAND qt_add_executable)
function(qt_add_executable NAME)
if (ANDROID)
add_library(${NAME} SHARED ${ARGN})
else()
add_executable(${NAME} ${ARGN})
endif()
endfunction()
endif()
message(STATUS "Building for Qt ${QT_VERSION} from ${QT_DIR}")
set(Qt${QT_VERSION_MAJOR}_DIR "${QT_DIR}")

find_package(Qt${QT_VERSION_MAJOR} ${QT_VERSION} REQUIRED COMPONENTS ${QT_MODULES})

include(QtCSGBackports)

add_subdirectory(qtcsg)
add_subdirectory(qt3dcsg)

add_subdirectory(assets)
add_subdirectory(demo)
add_subdirectory(tests)

add_custom_target(docs SOURCES README.md docs/demo.png)
add_custom_target(
docs SOURCES
LICENSE.md
LICENSE.spdx
licenses/BSD-3-Clause.md
licenses/GPL-3.0-or-later.md
README.md
docs/demo.png
)
add_custom_target(
github SOURCES
.github/workflows/autobuild.yml
)
18 changes: 18 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensing information

Unless otherwise noted, the files in this project are provided under the
terms of the [GNU General Public License](licenses/GPL-3.0-or-later.md).

As an exception to this, the following files are provided under the
terms of the [revised BSD 3-Clause License](licenses/BSD-3-Clause.md):

- [demo/shaders/gl3/robustwireframe.frag](demo/shaders/gl3/robustwireframe.frag)
- [demo/shaders/gl3/robustwireframe.geom](demo/shaders/gl3/robustwireframe.geom)
- [demo/shaders/gl3/robustwireframe.vert](demo/shaders/gl3/robustwireframe.vert)

As with any licensing, the license offered here is a starting point
for negotiations. Contact me if this offer doesn't work for you:

Mathias Hasselmann <mathias+qtcsg@taschenorakel.de>

PackageLicenseDeclared: GPL-3.0-or-later AND BSD-3-Clause
18 changes: 18 additions & 0 deletions LICENSE.spdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SPDXVersion: SPDX-2.1
DataLicense: CC0-1.0
PackageName: QtCSG
PackageOriginator: Person: Mathias Hasselmann
PackageHomePage: https://github.com/hasselmm/qtcsg.git
PackageLicenseDeclared: GPL-3.0-or-later AND BSD-3-Clause

FileName: demo/shaders/gl3/robustwireframe.frag
FileContributor: Klaralvdalens Datakonsult AB (KDAB)
LicenseConcluded: BSD-3-Clause

FileName: demo/shaders/gl3/robustwireframe.geom
FileContributor: Klaralvdalens Datakonsult AB (KDAB)
LicenseConcluded: BSD-3-Clause

FileName: demo/shaders/gl3/robustwireframe.vert
FileContributor: Klaralvdalens Datakonsult AB (KDAB)
LicenseConcluded: BSD-3-Clause
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ The code has been tested with Qt 5.15 and Qt 6.2.

## Legal Notice

QtCSG is released under the terms of the GNU General Public License v3.0 or later
QtCSG is provided under the terms of the
[GNU General Public License v3.0 or later](licenses/GPL-3.0-or-later.md)

Copyright Ⓒ 2022 Mathias Hasselmann

SPDX-License-Identifier: GPL-3.0-or-later
See [LICENSE.md](LICENSE.md) for detailed licensing information.
1 change: 1 addition & 0 deletions assets/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
qt_add_library(QtCSGAssets OBJECT qtcsgassets.qrc)
Loading