Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_gizmo.h
- This file was added.
| /* | |||||
campbellbarton: Prefer name `transform_gizmo_3d.h` (we may have a 2D version later).
Same for `transform_gizmo. | |||||
| * 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 | |||||
| */ | |||||
| #pragma once | |||||
| struct ARegion; | |||||
| struct bContext; | |||||
| struct bScreen; | |||||
| struct Object; | |||||
| struct RegionView3D; | |||||
| struct Scene; | |||||
| struct ScrArea; | |||||
| struct TransformBounds; | |||||
| struct TransformCalcParams; | |||||
| struct TransInfo; | |||||
| struct wmGizmoGroup; | |||||
| struct wmMsgBus; | |||||
| #define GIZMO_AXIS_LINE_WIDTH 2.0f | |||||
| /* return codes for select, and drawing flags */ | |||||
| #define MAN_TRANS_X (1 << 0) | |||||
| #define MAN_TRANS_Y (1 << 1) | |||||
| #define MAN_TRANS_Z (1 << 2) | |||||
| #define MAN_TRANS_C (MAN_TRANS_X | MAN_TRANS_Y | MAN_TRANS_Z) | |||||
| #define MAN_ROT_X (1 << 3) | |||||
| #define MAN_ROT_Y (1 << 4) | |||||
| #define MAN_ROT_Z (1 << 5) | |||||
| #define MAN_ROT_C (MAN_ROT_X | MAN_ROT_Y | MAN_ROT_Z) | |||||
| #define MAN_SCALE_X (1 << 8) | |||||
| #define MAN_SCALE_Y (1 << 9) | |||||
| #define MAN_SCALE_Z (1 << 10) | |||||
| #define MAN_SCALE_C (MAN_SCALE_X | MAN_SCALE_Y | MAN_SCALE_Z) | |||||
| /* axes as index */ | |||||
| enum { | |||||
| MAN_AXIS_TRANS_X = 0, | |||||
| MAN_AXIS_TRANS_Y, | |||||
| MAN_AXIS_TRANS_Z, | |||||
| MAN_AXIS_TRANS_C, | |||||
| MAN_AXIS_TRANS_XY, | |||||
| MAN_AXIS_TRANS_YZ, | |||||
| MAN_AXIS_TRANS_ZX, | |||||
| #define MAN_AXIS_RANGE_TRANS_START MAN_AXIS_TRANS_X | |||||
| #define MAN_AXIS_RANGE_TRANS_END (MAN_AXIS_TRANS_ZX + 1) | |||||
| MAN_AXIS_ROT_X, | |||||
| MAN_AXIS_ROT_Y, | |||||
| MAN_AXIS_ROT_Z, | |||||
| MAN_AXIS_ROT_C, | |||||
| MAN_AXIS_ROT_T, /* trackball rotation */ | |||||
| #define MAN_AXIS_RANGE_ROT_START MAN_AXIS_ROT_X | |||||
| #define MAN_AXIS_RANGE_ROT_END (MAN_AXIS_ROT_T + 1) | |||||
| MAN_AXIS_SCALE_X, | |||||
| MAN_AXIS_SCALE_Y, | |||||
| MAN_AXIS_SCALE_Z, | |||||
| MAN_AXIS_SCALE_C, | |||||
| MAN_AXIS_SCALE_XY, | |||||
| MAN_AXIS_SCALE_YZ, | |||||
| MAN_AXIS_SCALE_ZX, | |||||
| #define MAN_AXIS_RANGE_SCALE_START MAN_AXIS_SCALE_X | |||||
| #define MAN_AXIS_RANGE_SCALE_END (MAN_AXIS_SCALE_ZX + 1) | |||||
| MAN_AXIS_LAST = MAN_AXIS_SCALE_ZX + 1, | |||||
| }; | |||||
campbellbartonUnsubmitted Done Inline ActionsCan't this be kept private? campbellbarton: Can't this be kept private? | |||||
| /* axis types */ | |||||
| enum { | |||||
| MAN_AXES_ALL = 0, | |||||
| MAN_AXES_TRANSLATE, | |||||
| MAN_AXES_ROTATE, | |||||
| MAN_AXES_SCALE, | |||||
| }; | |||||
| bool gimbal_axis(struct Object *ob, float gmat[3][3]); | |||||
| void gizmo_prepare_mat(const struct bContext *C, | |||||
| struct RegionView3D *rv3d, | |||||
| const struct TransformBounds *tbounds); | |||||
| uint gizmo_orientation_axis(const int axis_idx, bool *r_is_plane); | |||||
| bool gizmo_is_axis_visible(const RegionView3D *rv3d, | |||||
| const int twtype, | |||||
| const float idot[3], | |||||
| const int axis_type, | |||||
| const int axis_idx); | |||||
| void gizmo_get_axis_color(const int axis_idx, | |||||
| const float idot[3], | |||||
| float r_col[4], | |||||
| float r_col_hi[4]); | |||||
| void drawDial3d(const struct TransInfo *t); | |||||
| void gizmo_xform_message_subscribe(struct wmGizmoGroup *gzgroup, | |||||
| struct wmMsgBus *mbus, | |||||
| struct Scene *scene, | |||||
| struct bScreen *screen, | |||||
| struct ScrArea *area, | |||||
| struct ARegion *region, | |||||
| const int orient_flag, | |||||
| const bool use_twtype_refresh, | |||||
| const void *type_fn); | |||||
Prefer name transform_gizmo_3d.h (we may have a 2D version later).
Same for transform_gizmo.c.