Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform.h
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| #include "DNA_listBase.h" | #include "DNA_listBase.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| /* ************************** Types ***************************** */ | /* ************************** Types ***************************** */ | ||||
| struct Depsgraph; | struct Depsgraph; | ||||
| struct TransInfo; | struct TransInfo; | ||||
| struct TransDataContainer; | |||||
| struct TransData; | struct TransData; | ||||
| struct TransformOrientation; | struct TransformOrientation; | ||||
| struct TransSnap; | struct TransSnap; | ||||
| struct NumInput; | struct NumInput; | ||||
| struct Object; | struct Object; | ||||
| struct View3D; | struct View3D; | ||||
| struct ScrArea; | struct ScrArea; | ||||
| struct Scene; | struct Scene; | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | typedef struct TransSnap { | ||||
| void (*calcSnap)(struct TransInfo *, float *); | void (*calcSnap)(struct TransInfo *, float *); | ||||
| void (*targetSnap)(struct TransInfo *); | void (*targetSnap)(struct TransInfo *); | ||||
| /** | /** | ||||
| * Get the transform distance between two points (used by Closest snap) | * Get the transform distance between two points (used by Closest snap) | ||||
| * | * | ||||
| * \note Return value can be anything, | * \note Return value can be anything, | ||||
| * where the smallest absolute value defines whats closest. | * where the smallest absolute value defines whats closest. | ||||
| */ | */ | ||||
| float (*distance)(struct TransInfo *, const float p1[3], const float p2[3]); | float (*distance)(struct TransInfo *t, const float p1[3], const float p2[3]); | ||||
| /** | /** | ||||
| * Re-usable snap context data. | * Re-usable snap context data. | ||||
| */ | */ | ||||
| struct SnapObjectContext *object_context; | struct SnapObjectContext *object_context; | ||||
| } TransSnap; | } TransSnap; | ||||
| typedef struct TransCon { | typedef struct TransCon { | ||||
| short orientation; /**/ | short orientation; /**/ | ||||
| char text[50]; /* Description of the Constraint for header_print */ | char text[50]; /* Description of the Constraint for header_print */ | ||||
| float mtx[3][3]; /* Matrix of the Constraint space */ | float mtx[3][3]; /* Matrix of the Constraint space */ | ||||
| float imtx[3][3]; /* Inverse Matrix of the Constraint space */ | float imtx[3][3]; /* Inverse Matrix of the Constraint space */ | ||||
| float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */ | float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */ | ||||
| int imval[2]; /* initial mouse value for visual calculation */ | int imval[2]; /* initial mouse value for visual calculation */ | ||||
| /* the one in TransInfo is not garanty to stay the same (Rotates change it) */ | /* the one in TransInfo is not garanty to stay the same (Rotates change it) */ | ||||
| int mode; /* Mode flags of the Constraint */ | int mode; /* Mode flags of the Constraint */ | ||||
| void (*drawExtra)(struct TransInfo *t); | void (*drawExtra)(struct TransInfo *t); | ||||
| /* Note: if 'th' is NULL, 'td' must also be NULL. */ | |||||
| /* For constraints that needs to draw differently from the other | /* For constraints that needs to draw differently from the other | ||||
| * uses this instead of the generic draw function */ | * uses this instead of the generic draw function */ | ||||
| void (*applyVec)(struct TransInfo *t, struct TransData *td, const float in[3], float out[3], float pvec[3]); | void (*applyVec)(struct TransInfo *t, struct TransDataContainer *tc, struct TransData *td, const float in[3], float out[3], float pvec[3]); | ||||
| /* Apply function pointer for linear vectorial transformation */ | /* Apply function pointer for linear vectorial transformation */ | ||||
| /* The last three parameters are pointers to the in/out/printable vectors */ | /* The last three parameters are pointers to the in/out/printable vectors */ | ||||
| void (*applySize)(struct TransInfo *t, struct TransData *td, float smat[3][3]); | void (*applySize)(struct TransInfo *t, struct TransDataContainer *tc, struct TransData *td, float smat[3][3]); | ||||
| /* Apply function pointer for size transformation */ | /* Apply function pointer for size transformation */ | ||||
| void (*applyRot)(struct TransInfo *t, struct TransData *td, float vec[3], float *angle); | void (*applyRot)(struct TransInfo *t, struct TransDataContainer *tc, struct TransData *td, float vec[3], float *angle); | ||||
| /* Apply function pointer for rotation transformation */ | /* Apply function pointer for rotation transformation */ | ||||
| } TransCon; | } TransCon; | ||||
| typedef struct TransDataExtension { | typedef struct TransDataExtension { | ||||
| float drot[3]; /* Initial object drot */ | float drot[3]; /* Initial object drot */ | ||||
| // float drotAngle; /* Initial object drotAngle, TODO: not yet implemented */ | // float drotAngle; /* Initial object drotAngle, TODO: not yet implemented */ | ||||
| // float drotAxis[3]; /* Initial object drotAxis, TODO: not yet implemented */ | // float drotAxis[3]; /* Initial object drotAxis, TODO: not yet implemented */ | ||||
| float dquat[4]; /* Initial object dquat */ | float dquat[4]; /* Initial object dquat */ | ||||
| ▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | typedef struct EdgeSlideData { | ||||
| TransDataEdgeSlideVert *sv; | TransDataEdgeSlideVert *sv; | ||||
| int totsv; | int totsv; | ||||
| int mval_start[2], mval_end[2]; | int mval_start[2], mval_end[2]; | ||||
| struct BMEditMesh *em; | struct BMEditMesh *em; | ||||
| SlideOrigData orig_data; | SlideOrigData orig_data; | ||||
| float perc; | |||||
| bool use_even; | |||||
| bool flipped; | |||||
| int curr_sv_index; | int curr_sv_index; | ||||
| /** when un-clamped - use this index: #TransDataEdgeSlideVert.dir_side */ | /** when un-clamped - use this index: #TransDataEdgeSlideVert.dir_side */ | ||||
| int curr_side_unclamp; | int curr_side_unclamp; | ||||
| } EdgeSlideData; | } EdgeSlideData; | ||||
| typedef struct EdgeSlideParams { | |||||
| float perc; | |||||
| bool use_even; | |||||
| bool flipped; | |||||
| } EdgeSlideParams; | |||||
| typedef struct TransDataVertSlideVert { | typedef struct TransDataVertSlideVert { | ||||
| /* TransDataGenericSlideVert */ | /* TransDataGenericSlideVert */ | ||||
| struct BMVert *v; | struct BMVert *v; | ||||
| struct LinkNode **cd_loop_groups; | struct LinkNode **cd_loop_groups; | ||||
| float co_orig_3d[3]; | float co_orig_3d[3]; | ||||
| /* end generic */ | /* end generic */ | ||||
| Show All 16 Lines | typedef struct VertSlideData { | ||||
| bool flipped; | bool flipped; | ||||
| int curr_sv_index; | int curr_sv_index; | ||||
| /* result of ED_view3d_ob_project_mat_get */ | /* result of ED_view3d_ob_project_mat_get */ | ||||
| float proj_mat[4][4]; | float proj_mat[4][4]; | ||||
| } VertSlideData; | } VertSlideData; | ||||
| typedef struct VertSlideParams { | |||||
| float perc; | |||||
| bool use_even; | |||||
| bool flipped; | |||||
| } VertSlideParams; | |||||
| typedef struct BoneInitData { | typedef struct BoneInitData { | ||||
| struct EditBone *bone; | struct EditBone *bone; | ||||
| float tail[3]; | float tail[3]; | ||||
| float rad_tail; | float rad_tail; | ||||
| float roll; | float roll; | ||||
| float head[3]; | float head[3]; | ||||
| float dist; | float dist; | ||||
| float xwidth; | float xwidth; | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | typedef struct MouseInput { | ||||
| struct { | struct { | ||||
| double prev[2]; | double prev[2]; | ||||
| double accum[2]; | double accum[2]; | ||||
| } virtual_mval; | } virtual_mval; | ||||
| } MouseInput; | } MouseInput; | ||||
| typedef struct TransCustomData { | typedef struct TransCustomData { | ||||
| void *data; | void *data; | ||||
| void (*free_cb)(struct TransInfo *, struct TransCustomData *); | void (*free_cb)(struct TransInfo *, struct TransDataContainer *tc, struct TransCustomData *custom_data); | ||||
| unsigned int use_free : 1; | unsigned int use_free : 1; | ||||
| } TransCustomData; | } TransCustomData; | ||||
| typedef struct TransCenterData { | typedef struct TransCenterData { | ||||
| float local[3], global[3]; | float global[3]; | ||||
| unsigned int is_set : 1; | unsigned int is_set : 1; | ||||
| } TransCenterData; | } TransCenterData; | ||||
| /** | |||||
| * Rule of thumb for choosing between mode/type: | |||||
| * - If transform mode uses the data, assign to `mode` | |||||
| * (typically in transform.c). | |||||
| * - If conversion uses the data as an extension to the #TransData, assign to `type` | |||||
| * (typically in transform_conversion.c). | |||||
| */ | |||||
| typedef struct TransCustomDataContainer { | |||||
| /** Owned by the mode (grab, scale, bend... ).*/ | |||||
| union { | |||||
| TransCustomData mode, first_elem; | |||||
| }; | |||||
| TransCustomData type; | |||||
| } TransCustomDataContainer; | |||||
| #define TRANS_CUSTOM_DATA_ELEM_MAX (sizeof(TransCustomDataContainer) / sizeof(TransCustomData)) | |||||
| typedef struct TransDataContainer { | |||||
| /** | |||||
| * Use for cases we care about the active, eg: active vert of active mesh. | |||||
| * if set this will _always_ be the first item in the array. | |||||
| */ | |||||
| bool is_active; | |||||
| /** Transformed data (array). */ | |||||
| TransData *data; | |||||
| /** Total number of transformed data. */ | |||||
| int data_len; | |||||
| /** Transformed data extension (array). */ | |||||
| TransDataExtension *data_ext; | |||||
| /** Transformed data for 2d (array). */ | |||||
| TransData2D *data_2d; | |||||
| struct Object *obedit; | |||||
| /** Normalized editmode matrix ('T_EDIT' only). */ | |||||
| float obedit_mat[3][3]; | |||||
| /** if 't->flag & T_POSE', this denotes pose object */ | |||||
| struct Object *poseobj; | |||||
| /** Center of transformation (in local-space), Calculated from #TransInfo.center_global. */ | |||||
| float center_local[3]; | |||||
| TransCustomDataContainer custom; | |||||
| } TransDataContainer; | |||||
| typedef struct TransInfo { | typedef struct TransInfo { | ||||
| TransDataContainer *data_container; | |||||
| int data_container_len; | |||||
| /** Combine length of all #TransDataContainer.data_len | |||||
| * Use to check if nothing is selected or if we have a single selection. */ | |||||
| int data_len_all; | |||||
| int mode; /* current mode */ | int mode; /* current mode */ | ||||
| int flag; /* generic flags for special behaviors */ | int flag; /* generic flags for special behaviors */ | ||||
| int modifiers; /* special modifiers, by function, not key */ | int modifiers; /* special modifiers, by function, not key */ | ||||
| short state; /* current state (running, canceled,...)*/ | short state; /* current state (running, canceled,...)*/ | ||||
| int options; /* current context/options for transform */ | int options; /* current context/options for transform */ | ||||
| float val; /* init value for some transformations (and rotation angle) */ | float val; /* init value for some transformations (and rotation angle) */ | ||||
| void (*transform)(struct TransInfo *, const int[2]); | void (*transform)(struct TransInfo *, const int[2]); | ||||
| /* transform function pointer */ | /* transform function pointer */ | ||||
| eRedrawFlag (*handleEvent)(struct TransInfo *, const struct wmEvent *); | eRedrawFlag (*handleEvent)(struct TransInfo *, const struct wmEvent *); | ||||
| /* event handler function pointer RETURN 1 if redraw is needed */ | /* event handler function pointer RETURN 1 if redraw is needed */ | ||||
| int total; /* total number of transformed data */ | |||||
| TransData *data; /* transformed data (array) */ | |||||
| TransDataExtension *ext; /* transformed data extension (array) */ | |||||
| TransData2D *data2d; /* transformed data for 2d (array) */ | |||||
| TransCon con; /* transformed constraint */ | TransCon con; /* transformed constraint */ | ||||
| TransSnap tsnap; | TransSnap tsnap; | ||||
| NumInput num; /* numerical input */ | NumInput num; /* numerical input */ | ||||
| MouseInput mouse; /* mouse input */ | MouseInput mouse; /* mouse input */ | ||||
| eRedrawFlag redraw; /* redraw flag */ | eRedrawFlag redraw; /* redraw flag */ | ||||
| float prop_size; /* proportional circle radius */ | float prop_size; /* proportional circle radius */ | ||||
| char proptext[20]; /* proportional falloff text */ | char proptext[20]; /* proportional falloff text */ | ||||
| float aspect[3]; /* spaces using non 1:1 aspect, (uv's, f-curve, movie-clip... etc) | float aspect[3]; /* spaces using non 1:1 aspect, (uv's, f-curve, movie-clip... etc) | ||||
| * use for conversion and snapping. */ | * use for conversion and snapping. */ | ||||
| float center[3]; /* center of transformation (in local-space) */ | |||||
| float center_global[3]; /* center of transformation (in global-space) */ | float center_global[3]; /* center of transformation (in global-space) */ | ||||
| float center2d[2]; /* center in screen coordinates */ | float center2d[2]; /* center in screen coordinates */ | ||||
| /* Lazy initialize center data for when we need other center values. | /* Lazy initialize center data for when we need other center values. | ||||
| * V3D_AROUND_ACTIVE + 1 (static assert checks this) */ | * V3D_AROUND_ACTIVE + 1 (static assert checks this) */ | ||||
| TransCenterData center_cache[5]; | TransCenterData center_cache[5]; | ||||
| short idx_max; /* maximum index on the input vector */ | short idx_max; /* maximum index on the input vector */ | ||||
| float snap[3]; /* Snapping Gears */ | float snap[3]; /* Snapping Gears */ | ||||
| float snap_spatial[3]; /* Spatial snapping gears(even when rotating, scaling... etc) */ | float snap_spatial[3]; /* Spatial snapping gears(even when rotating, scaling... etc) */ | ||||
| char frame_side; /* Mouse side of the cfra, 'L', 'R' or 'B' */ | char frame_side; /* Mouse side of the cfra, 'L', 'R' or 'B' */ | ||||
| float viewmat[4][4]; /* copy from G.vd, prevents feedback, */ | float viewmat[4][4]; /* copy from G.vd, prevents feedback, */ | ||||
| float viewinv[4][4]; /* and to make sure we don't have to */ | float viewinv[4][4]; /* and to make sure we don't have to */ | ||||
| float persmat[4][4]; /* access G.vd from other space types */ | float persmat[4][4]; /* access G.vd from other space types */ | ||||
| float persinv[4][4]; | float persinv[4][4]; | ||||
| short persp; | short persp; | ||||
| short around; | short around; | ||||
| char spacetype; /* spacetype where transforming is */ | char spacetype; /* spacetype where transforming is */ | ||||
| char helpline; /* helpline modes (not to be confused with hotline) */ | char helpline; /* helpline modes (not to be confused with hotline) */ | ||||
| short obedit_type; /* Avoid looking inside TransDataContainer obedit. */ | |||||
| float vec[3]; /* translation, to show for widget */ | float vec[3]; /* translation, to show for widget */ | ||||
| float mat[3][3]; /* rot/rescale, to show for widget */ | float mat[3][3]; /* rot/rescale, to show for widget */ | ||||
| float spacemtx[3][3]; /* orientation matrix of the current space */ | float spacemtx[3][3]; /* orientation matrix of the current space */ | ||||
| char spacename[64]; /* name of the current space, MAX_NAME */ | char spacename[64]; /* name of the current space, MAX_NAME */ | ||||
| struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */ | |||||
| /** | |||||
| * Rule of thumb for choosing between mode/type: | |||||
| * - If transform mode uses the data, assign to `mode` | |||||
| * (typically in transform.c). | |||||
| * - If conversion uses the data as an extension to the #TransData, assign to `type` | |||||
| * (typically in transform_conversion.c). | |||||
| */ | |||||
| struct { | |||||
| /* owned by the mode (grab, scale, bend... )*/ | |||||
| union { | |||||
| TransCustomData mode, first_elem; | |||||
| }; | |||||
| /* owned by the type (mesh, armature, nla...) */ | |||||
| TransCustomData type; | |||||
| } custom; | |||||
| #define TRANS_CUSTOM_DATA_ELEM_MAX (sizeof(((TransInfo *)NULL)->custom) / sizeof(TransCustomData)) | |||||
| /*************** NEW STUFF *********************/ | /*************** NEW STUFF *********************/ | ||||
| short launch_event; /* event type used to launch transform */ | short launch_event; /* event type used to launch transform */ | ||||
| short current_orientation; | short current_orientation; | ||||
| TransformOrientation *custom_orientation; /* this gets used when current_orientation is V3D_MANIP_CUSTOM */ | TransformOrientation *custom_orientation; /* this gets used when current_orientation is V3D_MANIP_CUSTOM */ | ||||
| short twtype; /* backup from view3d, to restore on end */ | short twtype; /* backup from view3d, to restore on end */ | ||||
| short prop_mode; | short prop_mode; | ||||
| Show All 17 Lines | typedef struct TransInfo { | ||||
| struct ViewLayer *view_layer; | struct ViewLayer *view_layer; | ||||
| struct RenderEngineType *engine_type; | struct RenderEngineType *engine_type; | ||||
| struct ToolSettings *settings; | struct ToolSettings *settings; | ||||
| struct wmTimer *animtimer; | struct wmTimer *animtimer; | ||||
| struct wmKeyMap *keymap; /* so we can do lookups for header text */ | struct wmKeyMap *keymap; /* so we can do lookups for header text */ | ||||
| struct ReportList *reports; /* assign from the operator, or can be NULL */ | struct ReportList *reports; /* assign from the operator, or can be NULL */ | ||||
| int mval[2]; /* current mouse position */ | int mval[2]; /* current mouse position */ | ||||
| float zfac; /* use for 3d view */ | float zfac; /* use for 3d view */ | ||||
| struct Object *obedit; | |||||
| float obedit_mat[3][3]; /* normalized editmode matrix (T_EDIT only) */ | |||||
| void *draw_handle_apply; | void *draw_handle_apply; | ||||
| void *draw_handle_view; | void *draw_handle_view; | ||||
| void *draw_handle_pixel; | void *draw_handle_pixel; | ||||
| void *draw_handle_cursor; | void *draw_handle_cursor; | ||||
| /** Typically for mode settings. */ | |||||
| TransCustomDataContainer custom; | |||||
| } TransInfo; | } TransInfo; | ||||
| /* ******************** Macros & Prototypes *********************** */ | /* ******************** Macros & Prototypes *********************** */ | ||||
| /* transinfo->state */ | /* transinfo->state */ | ||||
| #define TRANS_STARTING 0 | #define TRANS_STARTING 0 | ||||
| #define TRANS_RUNNING 1 | #define TRANS_RUNNING 1 | ||||
| ▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
| void flushTransParticles(TransInfo *t); | void flushTransParticles(TransInfo *t); | ||||
| bool clipUVTransform(TransInfo *t, float vec[2], const bool resize); | bool clipUVTransform(TransInfo *t, float vec[2], const bool resize); | ||||
| void clipUVData(TransInfo *t); | void clipUVData(TransInfo *t); | ||||
| void flushTransNodes(TransInfo *t); | void flushTransNodes(TransInfo *t); | ||||
| void flushTransSeq(TransInfo *t); | void flushTransSeq(TransInfo *t); | ||||
| void flushTransTracking(TransInfo *t); | void flushTransTracking(TransInfo *t); | ||||
| void flushTransMasking(TransInfo *t); | void flushTransMasking(TransInfo *t); | ||||
| void flushTransPaintCurve(TransInfo *t); | void flushTransPaintCurve(TransInfo *t); | ||||
| void restoreBones(TransInfo *t); | void restoreBones(TransDataContainer *tc); | ||||
| /*********************** transform_manipulator.c ********** */ | /*********************** transform_manipulator.c ********** */ | ||||
| #define MANIPULATOR_AXIS_LINE_WIDTH 2.0f | #define MANIPULATOR_AXIS_LINE_WIDTH 2.0f | ||||
| /* return 0 when no gimbal for selection */ | /* return 0 when no gimbal for selection */ | ||||
| bool gimbal_axis(struct Object *ob, float gmat[3][3]); | bool gimbal_axis(struct Object *ob, float gmat[3][3]); | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
| eRedrawFlag handleMouseInput(struct TransInfo *t, struct MouseInput *mi, const struct wmEvent *event); | eRedrawFlag handleMouseInput(struct TransInfo *t, struct MouseInput *mi, const struct wmEvent *event); | ||||
| void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]); | void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]); | ||||
| void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]); | void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]); | ||||
| void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float values[3])); | void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float values[3])); | ||||
| /*********************** Generics ********************************/ | /*********************** Generics ********************************/ | ||||
| void initTransDataContainers_FromObjectData(TransInfo *t); | |||||
| void initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, const struct wmEvent *event); | void initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, const struct wmEvent *event); | ||||
| void postTrans(struct bContext *C, TransInfo *t); | void postTrans(struct bContext *C, TransInfo *t); | ||||
| void resetTransModal(TransInfo *t); | void resetTransModal(TransInfo *t); | ||||
| void resetTransRestrictions(TransInfo *t); | void resetTransRestrictions(TransInfo *t); | ||||
| void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options); | void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis, short options); | ||||
| /* DRAWLINE options flags */ | /* DRAWLINE options flags */ | ||||
| #define DRAWLIGHT 1 | #define DRAWLIGHT 1 | ||||
| void applyTransObjects(TransInfo *t); | void applyTransObjects(TransInfo *t); | ||||
| void restoreTransObjects(TransInfo *t); | void restoreTransObjects(TransInfo *t); | ||||
| void recalcData(TransInfo *t); | void recalcData(TransInfo *t); | ||||
| void calculateCenter2D(TransInfo *t); | void calculateCenter2D(TransInfo *t); | ||||
| void calculateCenterGlobal( | void calculateCenterLocal(TransInfo *t, const float center_global[3]); | ||||
| TransInfo *t, const float center_local[3], | |||||
| float r_center_global[3]); | |||||
| const TransCenterData *transformCenter_from_type(TransInfo *t, int around); | const TransCenterData *transformCenter_from_type(TransInfo *t, int around); | ||||
| void calculateCenter(TransInfo *t); | void calculateCenter(TransInfo *t); | ||||
| /* API functions for getting center points */ | /* API functions for getting center points */ | ||||
| void calculateCenterBound(TransInfo *t, float r_center[3]); | void calculateCenterBound(TransInfo *t, float r_center[3]); | ||||
| void calculateCenterMedian(TransInfo *t, float r_center[3]); | void calculateCenterMedian(TransInfo *t, float r_center[3]); | ||||
| void calculateCenterCursor(TransInfo *t, float r_center[3]); | void calculateCenterCursor(TransInfo *t, float r_center[3]); | ||||
| Show All 24 Lines | |||||
| #define ORIENTATION_VERT 2 | #define ORIENTATION_VERT 2 | ||||
| #define ORIENTATION_EDGE 3 | #define ORIENTATION_EDGE 3 | ||||
| #define ORIENTATION_FACE 4 | #define ORIENTATION_FACE 4 | ||||
| int getTransformOrientation_ex(const struct bContext *C, float normal[3], float plane[3], const short around); | int getTransformOrientation_ex(const struct bContext *C, float normal[3], float plane[3], const short around); | ||||
| int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3]); | int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3]); | ||||
| void freeEdgeSlideTempFaces(EdgeSlideData *sld); | void freeEdgeSlideTempFaces(EdgeSlideData *sld); | ||||
| void freeEdgeSlideVerts(TransInfo *t, TransCustomData *custom_data); | void freeEdgeSlideVerts(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data); | ||||
| void projectEdgeSlideData(TransInfo *t, bool is_final); | void projectEdgeSlideData(TransInfo *t, bool is_final); | ||||
| void freeVertSlideTempFaces(VertSlideData *sld); | void freeVertSlideTempFaces(VertSlideData *sld); | ||||
| void freeVertSlideVerts(TransInfo *t, TransCustomData *custom_data); | void freeVertSlideVerts(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data); | ||||
| void projectVertSlideData(TransInfo *t, bool is_final); | void projectVertSlideData(TransInfo *t, bool is_final); | ||||
| /* TODO. transform_queries.c */ | /* TODO. transform_queries.c */ | ||||
| bool checkUseAxisMatrix(TransInfo *t); | bool checkUseAxisMatrix(TransInfo *t); | ||||
| #define TRANSFORM_DIST_MAX_PX 1000.0f | #define TRANSFORM_DIST_MAX_PX 1000.0f | ||||
| #define TRANSFORM_SNAP_MAX_PX 100.0f | #define TRANSFORM_SNAP_MAX_PX 100.0f | ||||
| #define TRANSFORM_DIST_INVALID -FLT_MAX | #define TRANSFORM_DIST_INVALID -FLT_MAX | ||||
| /* Temp macros. */ | |||||
| /* This is to be replaced, just to get things compiling early on. */ | |||||
| #define TRANS_DATA_CONTAINER_FIRST_EVIL(t) (&(t)->data_container[0]) | |||||
| #define TRANS_DATA_CONTAINER_FIRST_OK(t) (&(t)->data_container[0]) | |||||
| /* For cases we _know_ there is only one handle. */ | |||||
| #define TRANS_DATA_CONTAINER_FIRST_SINGLE(t) (BLI_assert((t)->data_container_len == 1), (&(t)->data_container[0])) | |||||
| #define FOREACH_TRANS_DATA_CONTAINER(t, th) \ | |||||
| for (TransDataContainer *tc = t->data_container, *tc_end = t->data_container + t->data_container_len; \ | |||||
| th != tc_end; \ | |||||
| th++) | |||||
| #define FOREACH_TRANS_DATA_CONTAINER_INDEX(t, th, i) \ | |||||
| for (TransDataContainer *tc = ((i = 0), t->data_container), *tc_end = t->data_container + t->data_container_len; \ | |||||
| th != tc_end; \ | |||||
| th++, i++) | |||||
| #endif | #endif | ||||