Blender V5.3
view3d_cursor_snap.cc File Reference

Snap cursor. More...

#include "DNA_object_types.h"
#include "BLI_listbase.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_vector_types.hh"
#include "MEM_guardedalloc.h"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_layer.hh"
#include "BKE_main.hh"
#include "BKE_object.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "GPU_immediate.hh"
#include "GPU_matrix.hh"
#include "GPU_state.hh"
#include "ED_screen.hh"
#include "ED_transform.hh"
#include "ED_transform_snap_object_context.hh"
#include "ED_view3d.hh"
#include "UI_resources.hh"
#include "RNA_access.hh"
#include "DEG_depsgraph_query.hh"
#include "WM_api.hh"

Go to the source code of this file.

Classes

struct  blender::SnapStateIntern
struct  blender::SnapCursorDataIntern

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define STATE_INTERN_GET(state)
#define FADE(v)

Functions

static void blender::v3d_cursor_poject_surface_normal (const float normal[3], const float obmat[4][4], float r_mat[3][3])
static bool blender::mat3_align_axis_to_v3 (float mat[3][3], const int axis_align, const float v[3])
V3DSnapCursorState * blender::ED_view3d_cursor_snap_state_active_get ()
void blender::ED_view3d_cursor_snap_state_active_set (V3DSnapCursorState *state)
static void blender::v3d_cursor_snap_activate ()
static void blender::v3d_cursor_snap_free ()
void blender::ED_view3d_cursor_snap_state_default_set (V3DSnapCursorState *state)
V3DSnapCursorState * blender::ED_view3d_cursor_snap_state_create ()
void blender::ED_view3d_cursor_snap_state_free (V3DSnapCursorState *state)
void blender::ED_view3d_cursor_snap_state_prevpoint_set (V3DSnapCursorState *state, const float prev_point[3])
void blender::ED_view3d_cursor_snap_data_update (V3DSnapCursorState *state, const bContext *C, const ARegion *region, const int2 &mval)
V3DSnapCursorData * blender::ED_view3d_cursor_snap_data_get ()
ed::transform::SnapObjectContext * blender::ED_view3d_cursor_snap_context_ensure (Scene *scene)
Drawings
static void blender::v3d_cursor_plane_draw_grid (const int resolution, const float scale, const float scale_fade, const float matrix[4][4], const int plane_axis, const float color[4])
static void blender::v3d_cursor_plane_draw (const RegionView3D *rv3d, const int plane_axis, const float matrix[4][4])
static void blender::cursor_box_draw (const float dimensions[3], uchar color[4])
static void blender::cursor_point_draw (uint attr_pos, const float loc[3], const float size, eSnapMode snap_type, const uchar color[4])
void blender::ED_view3d_cursor_snap_draw_util (RegionView3D *rv3d, const float source_loc[3], const float target_loc[3], const eSnapMode source_type, const eSnapMode target_type, const uchar source_color[4], const uchar target_color[4])
Event State
static bool blender::v3d_cursor_eventstate_has_changed (SnapCursorDataIntern *data_intern, V3DSnapCursorState *state, const int2 &mval, uint8_t event_modifier)
static void blender::v3d_cursor_eventstate_save_xy (SnapCursorDataIntern *cursor_snap, const int2 &mval)
static void blender::v3d_cursor_eventstate_save_modifier (SnapCursorDataIntern *data_intern, uint8_t event_modifier)
static bool blender::v3d_cursor_is_snap_invert (SnapCursorDataIntern *data_intern, uint8_t event_modifier)
Update
static eSnapMode blender::v3d_cursor_snap_elements (ToolSettings *tool_settings)
static void blender::v3d_cursor_snap_context_ensure (Scene *scene)
static bool blender::v3d_cursor_snap_calc_plane ()
static void blender::v3d_cursor_snap_update (V3DSnapCursorState *state, const bContext *C, Depsgraph *depsgraph, Scene *scene, const ARegion *region, View3D *v3d, const int2 &mval, uint8_t event_modifier)
Callbacks
static bool blender::v3d_cursor_snap_poll_fn (bContext *C)
static void blender::v3d_cursor_snap_draw_fn (bContext *C, const int2 &xy, const float2 &, void *)

Variables

static SnapCursorDataIntern blender::g_data_intern
static const float blender::eps_view_align = 1e-2f

Detailed Description

Snap cursor.

Definition in file view3d_cursor_snap.cc.

Macro Definition Documentation

◆ FADE

#define FADE ( v)
Value:
\
max_ff(0.0f, (1.0f - square_f(((len_v3v3(v, center) / scale_fade) + resolution_div) * 2.0f)))

Referenced by blender::v3d_cursor_plane_draw_grid().

◆ STATE_INTERN_GET

#define STATE_INTERN_GET ( state)
Value:
\
(SnapStateIntern *)((char *)state - offsetof(SnapStateIntern, snap_state))
#define offsetof(t, d)
const int state

Definition at line 47 of file view3d_cursor_snap.cc.

Referenced by blender::ED_view3d_cursor_snap_state_active_set(), and blender::ED_view3d_cursor_snap_state_free().