#ifndef VOXEL_DISTANCE_API_H #define VOXEL_DISTANCE_API_H #include #include "CommonStructs.hpp" #ifdef __cplusplus extern "C" { #endif // ========== 平台相关的导出宏 ========== #ifdef _WIN32 #if defined(VOXEL_DISTANCE_EXPORTS) || defined(BUSBAR_PLANNER_EXPORTS) // 编译动态库时导出 #define VOXEL_API __declspec(dllexport) #elif defined(BUSBAR_ROUTER_STATIC) || !defined(VOXEL_DLL) // 新增:默认走静态分支 // 编译可执行文件/静态库,无导入导出 #define VOXEL_API #else // 使用动态库时导入(保留) #define VOXEL_API __declspec(dllimport) #endif #else #define VOXEL_API #endif // ========== 纯 C 接口 ========== /** * 计算飞行距离(在非障碍空间中的最短路径) */ VOXEL_API int CalculateFlightDistance( const int* component_A_coords, int component_A_count, const int* component_B_coords, int component_B_count, int xsize, int ysize, int zsize, const uint16_t* voxel_types, double threshold, const IniInPutStruct* inputDataA, size_t inputCountA, const IniInPutStruct* inputDataB, size_t inputCountB, const IniInPutStruct* pInputDataGlobal, size_t inputDataGlobalSize, float offset_x, float offset_y, float offset_z, float rangeXMin, float rangeXMax, float rangeYMin, float rangeYMax, float rangeZMin, float rangeZMax, double* out_distance, int* out_start_x, int* out_start_y, int* out_start_z, int* out_end_x, int* out_end_y, int* out_end_z, float* out_path_coords, int* out_path_count, float voxel_size ); /** * 计算爬行距离(在障碍物表面的最短路径) */ VOXEL_API int CalculateCreepDistance( const int* component_A_coords, int component_A_count, const int* component_B_coords, int component_B_count, int xsize, int ysize, int zsize, const bool* obstacles, double threshold, double* out_distance, int* out_start_x, int* out_start_y, int* out_start_z, int* out_end_x, int* out_end_y, int* out_end_z, float* out_path_coords, int* out_path_count ); /** * 获取最后一次错误信息 */ VOXEL_API const char* VoxelGetLastError(void); #ifdef __cplusplus } #endif #endif // VOXEL_DISTANCE_API_H