已关闭
[utils] 新增选区几何矩形工具集 SelectionGeometryUtils #190
no86创建于 7月31日关闭于 7月31日
openharmony_ci
7月31日 评论:
7月31日 评论:
感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@Dufree](https://gitcode.com/Dufree) [@hwymlgitcode](https://gitcode.com/hwymlgitcode) [@zl_startup](https://gitcode.com/zl_startup) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。
Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.


7月31日 添加了label:waiting_for_assign
7月31日 关联了pull request:feat(utils): add selection geometry utils for rect/point operations
7月31日 关闭了 issue
7月31日 issue状态由 待办的 改变为 已完成
问题描述 / Description
selectionfwk 的 utils 工具库目前仅有
selection_timer,缺少选区矩形相关的几何运算工具。本次新增一个无状态纯函数工具集,用于选区矩形的规整化、集合运算、距离/邻接判定、变换、列表合并、行聚类、裁剪等场景,作为 utils 可复用能力储备。功能请求
utils/src下新增selection_geometry_utils.cpp(及配套头文件utils/include/selection_geometry_utils.h),提供SelectionGeometryUtils静态工具类与SelectionRectCombiner增量合并器。修改内容
utils/include/selection_geometry_utils.hutils/src/selection_geometry_utils.cppservice/BUILD.gn两处sources增加新文件(与selection_timer.cpp同模式接入)不影响主业务的保证
-fvisibility=hidden+--gc-sections,未引用符号被链接器 GC,二进制与运行时零影响;BUILD.gn的sources列表,未改任何业务文件逻辑。验证
g++ -std=c++17 -fsyntax-only -Wall -Wextra -Iutils/include utils/src/selection_geometry_utils.cpp通过(exit 0,零错误零警告)。int64_t中间值 +ClampToInt32,规避integer_overflow/INT32_MIN取反 UB。./build.sh --product-name rk3568 --ccache --build-target selectionfwk及 CFI/UBSan 运行时检查。