Utils/README.md
2026-02-19 00:45:00 +08:00

142 lines
3.5 KiB
Markdown
Raw Permalink 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.

# Utils 工具库模块
这是一个独立的 Qt 工具库模块,包含了项目中常用的基础工具类和实用功能。
## 模块结构
```
Utils/
├── VrCommon/ # 核心接口和数据结构
│ ├── Inc/ # 公共头文件
│ │ ├── VrCommon.h
│ │ ├── VrConfigCmd.h
│ │ └── VrError.h
│ └── Src/ # 源文件
├── VrUtils/ # 工具类库
│ ├── Inc/ # 工具类头文件
│ ├── Src/ # 工具类源文件
│ ├── jsoncpp/ # JSON 解析库
│ ├── log4cpp/ # 日志库
│ ├── tinyxml2/ # XML 解析库
│ ├── ini/ # INI 配置文件解析
│ ├── MD5/ # MD5 加密
│ └── crc/ # CRC 校验
├── CloudUtils/ # 点云工具
│ ├── Inc/
│ │ ├── LaserDataLoader.h
│ │ └── PointCloudImageUtils.h
│ └── Src/
├── DataUtils/ # 数据处理工具
│ ├── CloudMathClac/ # 点云数学计算
│ └── CoordinateTransform/ # 坐标转换
└── CloudView/ # 点云查看工具(独立应用)
├── Inc/
├── Src/
└── resource/
```
## 构建说明
### 作为子模块构建
在主项目的 .pro 文件中添加:
```qmake
Utils.file = ../Utils/Utils.pro
SUBDIRS += Utils
# 设置依赖关系
YourModule.depends = Utils
```
### 独立构建
```bash
cd Utils
qmake Utils.pro
make
```
## 模块说明
### VrCommon
核心接口和数据结构定义,包括:
- 配置接口定义
- 错误码定义
- 配置命令数据结构
### VrUtils
通用工具类库,包括:
- **日志工具**: 基于 log4cpp 的日志系统
- **JSON 解析**: jsoncpp 库
- **XML 解析**: tinyxml2 库
- **INI 配置**: SimpleIni 库
- **加密工具**: MD5、CRC 校验
- **时间工具**: 时间格式化、NTP 同步
- **网络工具**: 网络相关实用函数
- **文件工具**: 文件操作相关函数
- **字符串工具**: 字符串处理函数
### CloudUtils
点云数据处理工具,包括:
- 激光数据加载器
- 点云图像转换工具
### DataUtils
数据处理工具集,包括:
- **CloudMathClac**: 点云数学计算(曲线拟合等)
- **CoordinateTransform**: 坐标系转换工具
### CloudView
点云可视化查看工具(独立应用程序)
## 使用示例
### 在项目中引用
```qmake
# 包含路径
INCLUDEPATH += $$PWD/../Utils/VrCommon/Inc
INCLUDEPATH += $$PWD/../Utils/VrUtils/Inc
# 链接库
win32:CONFIG(release, debug|release): {
LIBS += -L$$PWD/../Utils/VrCommon/release -lVrCommon
LIBS += -L$$PWD/../Utils/VrUtils/release -lVrUtils
}
else:win32:CONFIG(debug, debug|release): {
LIBS += -L$$PWD/../Utils/VrCommon/debug -lVrCommon
LIBS += -L$$PWD/../Utils/VrUtils/debug -lVrUtils
}
else:unix:!macx {
LIBS += -L$$PWD/../Utils/VrCommon -lVrCommon
LIBS += -L$$PWD/../Utils/VrUtils -lVrUtils
}
```
## 依赖关系
- **VrUtils** 依赖 **VrCommon**
- **CloudUtils** 依赖 **VrCommon****VrUtils**
- **DataUtils** 依赖 **VrCommon**
- **CloudView** 依赖 **VrCommon**、**VrUtils** 和 **CloudUtils**
## 编译要求
- Qt 5.x 或更高版本
- C++11 或更高版本
- 支持平台Windows (MSVC/MinGW)、Linux (ARM/x86_64)
## 许可证
内部项目使用