前言

为了提高算法性能,所以决定自己写个底层图形框架。

工具

  • 项目构建:XMake。
  • 版本控制:Github。
  • 文档生成:Doxygen。

XMake 需知

常用命令

1
2
3
4
5
6
7
8
9
10
11
xmake config -m debug # 设置 debug 模式

xmake f --debugger=gdb # 在 linux 下设置 gdb 做为调试器

xmake build

xmake run

xmake project -k vsxmake -a x64 # 生成 Visual Studio 项目文件,直接用 Visual Studio 打开的项目依赖是有问题的(切记)

xmake install -P . -o install # 构建项目,生成 .exe

常用脚本

1
2
3
-- 添加包,被下载到 AppData/Local 里了
-- 官方相关文档:https://xmake.io/#/package/remote_package,官方远程包库地址:https://github.com/xmake-io/xmake-repo/tree/master/packages
add_requires("spdlog 1.11.0")

Doxygen 需知

Doxygen C/C++代码注释格式

Doxygen 生成类图

框架

直接看 Doxygen 生成的文档吧。

求交的部分可以看这里

思考

1. Point and Vector

Vector 作为辅助结构,不应该引用 Point.h,不然会造成结构的混乱。

2. template

虽然很想都写成模板,屏蔽 value_type 层,但有点难做到,所以暂时不考虑。