Development Tutorial
Overview
This tutorial introduces how to perform module development and testing based on the Open3DGMBE framework.
1. Project Structure
open-tsinghua/
├── CMakeLists.txt # Root CMake configuration
├── src/ # Source code directory
│ ├── CMakeLists.txt # Source build configuration
│ ├── base/ # Base module
│ ├── kernel/ # Kernel module
│ ├── laws/ # Law module
│ ├── intersectors/ # Intersector module
│ ├── constructors/ # Constructor module
│ ├── booleans/ # Boolean module
│ └── _deps/ # Third-party dependencies
├── tests/ # Testing directory
│ ├── CMakeLists.txt # Test build configuration
│ ├── boundary/ # Boundary testing
│ ├── functional/ # Functional testing
│ ├── performance/ # Performance testing
│ ├── regression/ # Regression testing
│ ├── security/ # Security testing
├── docs/ # Documentation
2. Module System
The core modules include:
- base: Base module
- kernel: Geometry kernel
- laws: Mathematical representation
- intersectors: Intersection calculations
- constructors: Entity construction
- booleans: Boolean operations
3. Workflow for Adding a New Module
Step 1: Create Module Directory
src/new_module/
Step 2: Add Source Code
// new_module.cpp
Step 3: Modify CMakeLists
if(GLOBAL_BUILD_NEW_MODULE)
add_subdirectory(new_module)
endif()
4. Adding Tests
Create test files in the following directory:
tests/functional/new_module/
Example:
TEST(NewModuleTest, Basic)
{
EXPECT_EQ(1, 1);
}
5. Compilation and Execution
cmake --build build
ctest