From a52eb7489f8daad8f68625b773276906a8fffd24 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Fri, 28 Feb 2020 21:25:47 -0300 Subject: Cleanup: Move transform_constraints declarations to its own header --- source/blender/editors/transform/CMakeLists.txt | 1 + source/blender/editors/transform/transform.c | 1 + source/blender/editors/transform/transform.h | 28 ------------- .../editors/transform/transform_constraints.c | 3 ++ .../editors/transform/transform_constraints.h | 48 ++++++++++++++++++++++ .../transform/transform_mode_bbone_resize.c | 1 + .../editors/transform/transform_mode_push_pull.c | 1 + .../editors/transform/transform_mode_resize.c | 1 + .../editors/transform/transform_mode_skin_resize.c | 1 + 9 files changed, 57 insertions(+), 28 deletions(-) create mode 100644 source/blender/editors/transform/transform_constraints.h (limited to 'source/blender/editors') diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt index e7d5a52bf42..5f5a173932c 100644 --- a/source/blender/editors/transform/CMakeLists.txt +++ b/source/blender/editors/transform/CMakeLists.txt @@ -102,6 +102,7 @@ set(SRC transform_snap_object.c transform.h + transform_constraints.h transform_convert.h transform_draw_cursors.h transform_mode.h diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ed42a0e35f3..253df915d8f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -61,6 +61,7 @@ #include "BLT_translation.h" #include "transform.h" +#include "transform_constraints.h" #include "transform_convert.h" #include "transform_draw_cursors.h" #include "transform_mode.h" diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 5efa562a4e4..826e22bbace 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -829,8 +829,6 @@ void projectFloatView(TransInfo *t, const float vec[3], float adr[2]); void applyAspectRatio(TransInfo *t, float vec[2]); void removeAspectRatio(TransInfo *t, float vec[2]); -void drawPropCircle(const struct bContext *C, TransInfo *t); - struct wmKeyMap *transform_modal_keymap(struct wmKeyConfig *keyconf); /*********************** transform_gizmo.c ********** */ @@ -844,32 +842,6 @@ void drawDial3d(const TransInfo *t); /*********************** TransData Creation and General Handling *********** */ bool transdata_check_local_islands(TransInfo *t, short around); -/*********************** Constraints *****************************/ - -void drawConstraint(TransInfo *t); - -void getConstraintMatrix(TransInfo *t); -void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]); -void setAxisMatrixConstraint(TransInfo *t, int mode, const char text[]); -void setLocalConstraint(TransInfo *t, int mode, const char text[]); -void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]); - -void constraintNumInput(TransInfo *t, float vec[3]); - -bool isLockConstraint(TransInfo *t); -int getConstraintSpaceDimension(TransInfo *t); -int constraintModeToIndex(const TransInfo *t); -char constraintModeToChar(const TransInfo *t); - -void startConstraint(TransInfo *t); -void stopConstraint(TransInfo *t); - -void initSelectConstraint(TransInfo *t, float mtx[3][3]); -void selectConstraint(TransInfo *t); -void postSelectConstraint(TransInfo *t); - -void setNearestAxis(TransInfo *t); - /********************** Mouse Input ******************************/ typedef enum { diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 572d10eee0a..5bcc1387a1b 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -52,6 +52,9 @@ #include "transform.h" #include "transform_snap.h" +/* Own include. */ +#include "transform_constraints.h" + static void drawObjectConstraint(TransInfo *t); /* ************************** CONSTRAINTS ************************* */ diff --git a/source/blender/editors/transform/transform_constraints.h b/source/blender/editors/transform/transform_constraints.h new file mode 100644 index 00000000000..8938ca93ad8 --- /dev/null +++ b/source/blender/editors/transform/transform_constraints.h @@ -0,0 +1,48 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. + * All rights reserved. + */ + +/** \file + * \ingroup edtransform + */ + +#ifndef __TRANSFORM_CONSTRAINTS_H__ +#define __TRANSFORM_CONSTRAINTS_H__ + +struct TransInfo; + +void constraintNumInput(TransInfo *t, float vec[3]); +void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]); +void setAxisMatrixConstraint(TransInfo *t, int mode, const char text[]); +void setLocalConstraint(TransInfo *t, int mode, const char text[]); +void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]); +void drawConstraint(TransInfo *t); +void drawPropCircle(const struct bContext *C, TransInfo *t); +void startConstraint(TransInfo *t); +void stopConstraint(TransInfo *t); +void getConstraintMatrix(TransInfo *t); +void initSelectConstraint(TransInfo *t, float mtx[3][3]); +void selectConstraint(TransInfo *t); +void postSelectConstraint(TransInfo *t); +void setNearestAxis(TransInfo *t); +int constraintModeToIndex(const TransInfo *t); +char constraintModeToChar(const TransInfo *t); +bool isLockConstraint(TransInfo *t); +int getConstraintSpaceDimension(TransInfo *t); + +#endif diff --git a/source/blender/editors/transform/transform_mode_bbone_resize.c b/source/blender/editors/transform/transform_mode_bbone_resize.c index 9ca1857f011..93d4bee4a12 100644 --- a/source/blender/editors/transform/transform_mode_bbone_resize.c +++ b/source/blender/editors/transform/transform_mode_bbone_resize.c @@ -36,6 +36,7 @@ #include "BLT_translation.h" #include "transform.h" +#include "transform_constraints.h" #include "transform_snap.h" #include "transform_mode.h" diff --git a/source/blender/editors/transform/transform_mode_push_pull.c b/source/blender/editors/transform/transform_mode_push_pull.c index f2496c8d331..c3edcdcf65c 100644 --- a/source/blender/editors/transform/transform_mode_push_pull.c +++ b/source/blender/editors/transform/transform_mode_push_pull.c @@ -36,6 +36,7 @@ #include "BLT_translation.h" #include "transform.h" +#include "transform_constraints.h" #include "transform_snap.h" #include "transform_mode.h" diff --git a/source/blender/editors/transform/transform_mode_resize.c b/source/blender/editors/transform/transform_mode_resize.c index c94f0e3999a..3071c8f351e 100644 --- a/source/blender/editors/transform/transform_mode_resize.c +++ b/source/blender/editors/transform/transform_mode_resize.c @@ -33,6 +33,7 @@ #include "UI_interface.h" #include "transform.h" +#include "transform_constraints.h" #include "transform_convert.h" #include "transform_snap.h" #include "transform_mode.h" diff --git a/source/blender/editors/transform/transform_mode_skin_resize.c b/source/blender/editors/transform/transform_mode_skin_resize.c index ccac7aea3e7..0cb774bc4a0 100644 --- a/source/blender/editors/transform/transform_mode_skin_resize.c +++ b/source/blender/editors/transform/transform_mode_skin_resize.c @@ -33,6 +33,7 @@ #include "UI_interface.h" #include "transform.h" +#include "transform_constraints.h" #include "transform_snap.h" #include "transform_mode.h" -- cgit v1.2.3