Cleanup: Move transform_snap_object.c to C++

This is meant to allow using C++ data structures in this file
as a performance improvement. Particularly `Vector` instead
of `ListBase` for `duplilist`.

Differential Revision: https://developer.blender.org/D14475
This commit is contained in:
Hans Goudey 2022-03-28 14:59:42 -05:00
parent 21e72496a6
commit 037f789111
3 changed files with 247 additions and 207 deletions

View File

@ -21,11 +21,11 @@ struct Object;
struct Scene;
struct View3D;
/* transform_snap_object.c */
/* transform_snap_object.cc */
/* ED_transform_snap_object_*** API */
typedef enum {
typedef enum eSnapSelect {
SNAP_ALL = 0,
SNAP_NOT_SELECTED = 1,
SNAP_NOT_ACTIVE = 2,
@ -33,7 +33,7 @@ typedef enum {
SNAP_SELECTABLE = 4,
} eSnapSelect;
typedef enum {
typedef enum eSnapEditType {
SNAP_GEOM_FINAL = 0,
SNAP_GEOM_CAGE = 1,
SNAP_GEOM_EDIT = 2, /* Bmesh for mesh-type. */
@ -59,13 +59,13 @@ struct SnapObjectHitDepth {
/** parameters that define which objects will be used to snap. */
struct SnapObjectParams {
/* Special context sensitive handling for the active or selected object. */
char snap_select;
eSnapSelect snap_select;
/* Geometry for snapping in edit mode. */
char edit_mode_type;
eSnapEditType edit_mode_type;
/* snap to the closest element, use when using more than one snap type */
unsigned int use_occlusion_test : 1;
bool use_occlusion_test : true;
/* exclude back facing geometry from snapping */
unsigned int use_backface_culling : 1;
bool use_backface_culling : true;
};
typedef struct SnapObjectContext SnapObjectContext;

View File

@ -90,7 +90,7 @@ set(SRC
transform_orientations.c
transform_snap.c
transform_snap_animation.c
transform_snap_object.c
transform_snap_object.cc
transform_snap_sequencer.c
transform.h