From 81f23ad57a0156ee8fed44e372ff81d69d022e7b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 12 May 2022 10:04:02 +0200 Subject: Cleanup: Move tracking constants to be printable enums Replace old-style define with an enumerator values. Also move to the top of the file preparing for making those stronger typed. --- source/blender/blenkernel/BKE_tracking.h | 42 ++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h index 2d115cfb351..c6388c186f0 100644 --- a/source/blender/blenkernel/BKE_tracking.h +++ b/source/blender/blenkernel/BKE_tracking.h @@ -28,6 +28,32 @@ struct Scene; struct bGPDlayer; struct rcti; +/* -------------------------------------------------------------------- + * Common types and constants. + */ + +enum { + TRACK_CLEAR_UPTO = 0, + TRACK_CLEAR_REMAINED = 1, + TRACK_CLEAR_ALL = 2, +}; + +enum { + CLAMP_PAT_DIM = 1, + CLAMP_PAT_POS = 2, + CLAMP_SEARCH_DIM = 3, + CLAMP_SEARCH_POS = 4, +}; + +typedef enum eTrackArea { + TRACK_AREA_POINT = (1 << 0), + TRACK_AREA_PAT = (1 << 1), + TRACK_AREA_SEARCH = (1 << 2), + + TRACK_AREA_NONE = 0, + TRACK_AREA_ALL = (TRACK_AREA_POINT | TRACK_AREA_PAT | TRACK_AREA_SEARCH), +} eTrackArea; + /* -------------------------------------------------------------------- * Common functions. */ @@ -787,22 +813,6 @@ void BKE_tracking_get_rna_path_prefix_for_plane_track( (((marker)->flag & MARKER_DISABLED) == 0 || ((sc)->flag & SC_HIDE_DISABLED) == 0 || \ ((sc)->clip->tracking.act_track == track)) -#define TRACK_CLEAR_UPTO 0 -#define TRACK_CLEAR_REMAINED 1 -#define TRACK_CLEAR_ALL 2 - -#define CLAMP_PAT_DIM 1 -#define CLAMP_PAT_POS 2 -#define CLAMP_SEARCH_DIM 3 -#define CLAMP_SEARCH_POS 4 - -#define TRACK_AREA_NONE -1 -#define TRACK_AREA_POINT 1 -#define TRACK_AREA_PAT 2 -#define TRACK_AREA_SEARCH 4 - -#define TRACK_AREA_ALL (TRACK_AREA_POINT | TRACK_AREA_PAT | TRACK_AREA_SEARCH) - #ifdef __cplusplus } #endif -- cgit v1.2.3