2026-03-11 23:40:06 +08:00

47 lines
1.8 KiB
C

#ifndef ERROR_CODES_H
#define ERROR_CODES_H
/**
* @brief Error codes for hole detection algorithm
*/
// Success
#define HD_SUCCESS 0 // Operation successful
// Input validation errors
#define HD_ERR_INVALID_INPUT -1 // Invalid input parameters
#define HD_ERR_NOT_GRID_FORMAT -2 // Input is not in grid format
#define HD_ERR_INSUFFICIENT_POINTS -3 // Too few points for operation
// Algorithm errors
#define HD_ERR_ELLIPSE_FITTING_FAILED -4 // Ellipse fitting failed
#define HD_ERR_PLANE_FITTING_FAILED -5 // Plane fitting failed
#define HD_ERR_NO_PITS_DETECTED -6 // No pits detected in point cloud
#define HD_ERR_NO_CLUSTERS_FOUND -7 // No clusters found after DBSCAN
// Numerical errors
#define HD_ERR_SINGULAR_MATRIX -8 // Singular matrix encountered
#define HD_ERR_NUMERICAL_INSTABILITY -9 // Numerical instability detected
#define HD_ERR_MEMORY_ALLOCATION -10 // Memory allocation failed
// File I/O errors
#define HD_ERR_FILE_IO -11 // File I/O error
#define HD_ERR_FILE_NOT_FOUND -17 // File not found
#define HD_ERR_FILE_TOO_LARGE -18 // File too large
#define HD_ERR_INVALID_FILE_FORMAT -16 // Invalid file format
// Filtering errors
#define HD_ERR_ALL_HOLES_FILTERED -12 // All detected holes were filtered out
#define HD_ERR_NO_VALID_HOLES -13 // No valid holes after quality check
// Parameter validation errors
#define HD_ERR_INVALID_PARAMETERS -19 // Invalid parameters
#define HD_ERR_PARAM_OUT_OF_RANGE -20 // Parameter out of range
#define HD_ERR_PARAM_LOGICAL_ERROR -21 // Logical inconsistency in parameters
#define HD_ERR_CONFIG_FILE_ERROR -22 // Configuration file error
// Other errors
#define HD_ERR_UNKNOWN -99 // Unknown error
#endif // ERROR_CODES_H