Files
ViewDesignEngine/docs/04-编码实现/02-目录结构.md
T

126 lines
4.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 工程目录结构
## 目录
1. [完整目录树](#1-完整目录树)
2. [CMakeLists.txt 骨架](#2-cmakeliststxt-骨架)
---
## 1. 完整目录树
```
ViewDesignEngine/
├── CMakeLists.txt # 根 CMake 配置
├── README.md # 项目说明
├── .clang-format # 代码格式化配置
├── .gitignore
├── cmake/ # CMake 模块
│ └── CompilerSettings.cmake # 编译器警告/优化配置
├── include/ # 公开头文件
│ └── vde/ # 命名空间 vde::
│ ├── foundation/ # 基础设施层
│ │ ├── math_types.h
│ │ ├── tolerance.h
│ │ ├── error_codes.h
│ │ ├── exact_predicates.h
│ │ ├── memory_pool.h
│ │ ├── io_obj.h
│ │ └── io_stl.h
│ ├── core/ # 几何核心层
│ │ ├── point.h
│ │ ├── line.h
│ │ ├── plane.h
│ │ ├── triangle.h
│ │ ├── polygon.h
│ │ ├── aabb.h
│ │ ├── transform.h
│ │ ├── distance.h
│ │ └── convex_hull.h
│ ├── curves/ # 曲线曲面层
│ │ ├── bezier_curve.h
│ │ ├── bspline_curve.h
│ │ ├── nurbs_curve.h
│ │ ├── bezier_surface.h
│ │ ├── bspline_surface.h
│ │ └── tessellation.h
│ ├── mesh/ # 网格处理层
│ │ ├── halfedge_mesh.h
│ │ ├── delaunay_2d.h
│ │ ├── mesh_simplify.h
│ │ ├── mesh_smooth.h
│ │ ├── mesh_boolean.h
│ │ ├── mesh_quality.h
│ │ └── mesh_repair.h
│ ├── spatial/ # 空间索引层
│ │ ├── spatial_index.h
│ │ ├── bvh.h
│ │ ├── octree.h
│ │ ├── kd_tree.h
│ │ └── r_tree.h
│ ├── boolean/ # 布尔运算层
│ │ ├── boolean_2d.h
│ │ └── boolean_mesh.h
│ └── collision/ # 碰撞检测层
│ ├── gjk.h
│ ├── sat.h
│ ├── ray_intersect.h
│ └── tri_intersect.h
├── src/ # 实现文件(与 include 镜像)
├── tests/ # 单元测试
│ ├── core/ # 测试几何核心
│ ├── curves/ # 测试曲线曲面
│ ├── mesh/ # 测试网格处理
│ ├── spatial/ # 测试空间索引
│ ├── collision/ # 测试碰撞检测
│ └── boolean/ # 测试布尔运算
├── examples/ # 示例程序
│ ├── 01_hello_triangle/
│ ├── 02_bezier/
│ ├── 03_mesh/
│ ├── 04_delaunay/
│ ├── 05_boolean/
│ └── 06_collision/
├── benchmarks/ # 性能测试
├── data/ # 测试数据
│ ├── meshes/
│ └── curves/
└── docs/ # 工程文档
```
---
## 2. CMakeLists.txt 骨架
```cmake
cmake_minimum_required(VERSION 3.16)
project(ViewDesignEngine VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 选项
option(BUILD_TESTS "构建单元测试" ON)
option(BUILD_EXAMPLES "构建示例程序" ON)
# 依赖(自动 FetchContent
find_package(Eigen3 3.3 QUIET)
# 若未找到,使用 FetchContent 下载
# 子目录
add_subdirectory(src)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
```