Blender V4.3
transform_mode_edge_slide.cc File Reference
#include "BLI_math_matrix.h"
#include "BLI_string.h"
#include "BKE_editmesh.hh"
#include "BKE_editmesh_bvh.hh"
#include "BKE_unit.hh"
#include "GPU_immediate.hh"
#include "GPU_matrix.hh"
#include "DEG_depsgraph_query.hh"
#include "ED_mesh.hh"
#include "ED_screen.hh"
#include "WM_api.hh"
#include "RNA_access.hh"
#include "UI_interface.hh"
#include "UI_view2d.hh"
#include "BLT_translation.hh"
#include "transform.hh"
#include "transform_constraints.hh"
#include "transform_convert.hh"
#include "transform_mode.hh"
#include "transform_snap.hh"

Go to the source code of this file.

Classes

struct  EdgeSlideData
 
struct  EdgeSlideParams
 

Functions

Transform (Edge Slide)
static TransDataContaineredge_slide_container_first_ok (TransInfo *t)
 
static EdgeSlideDataedgeSlideFirstGet (TransInfo *t)
 
static void calcEdgeSlideCustomPoints (TransInfo *t)
 
static void interp_line_v3_v3v3v3 (float p[3], const float v1[3], const float v2[3], const float v3[3], float t)
 
static void edge_slide_data_init_mval (MouseInput *mi, EdgeSlideData *sld, float *mval_dir)
 
static bool is_vert_slide_visible_bmesh (TransInfo *t, TransDataContainer *tc, const View3D *v3d, const BMBVHTree *bmbvh, TransDataEdgeSlideVert *sv)
 
static void calcEdgeSlide_mval_range (TransInfo *t, TransDataContainer *tc, EdgeSlideData *sld, const int loop_nr, const float2 &mval, const bool use_calc_direction)
 
static EdgeSlideDatacreateEdgeSlideVerts (TransInfo *t, TransDataContainer *tc, const bool use_double_side)
 
static void freeEdgeSlideVerts (TransInfo *, TransDataContainer *, TransCustomData *custom_data)
 
static eRedrawFlag handleEventEdgeSlide (TransInfo *t, const wmEvent *event)
 
static void drawEdgeSlide (TransInfo *t)
 
static void edge_slide_snap_apply (TransInfo *t, float *value)
 
static void edge_slide_apply_elem (const TransDataEdgeSlideVert &sv, const float fac, const float curr_length_fac, const int curr_side_unclamp, const bool use_clamp, const bool use_even, const bool use_flip, float r_co[3])
 
static void doEdgeSlide (TransInfo *t, float perc)
 
static void applyEdgeSlide (TransInfo *t)
 
static void edge_slide_transform_matrix_fn (TransInfo *t, float mat_xform[4][4])
 
static void initEdgeSlide_ex (TransInfo *t, wmOperator *op, bool use_double_side, bool use_even, bool flipped, bool use_clamp)
 
static void initEdgeSlide (TransInfo *t, wmOperator *op)
 
Mouse Input Utilities
void transform_mode_edge_slide_reproject_input (TransInfo *t)
 

Variables

TransModeInfo TransMode_edgeslide
 

Function Documentation

◆ applyEdgeSlide()

◆ calcEdgeSlide_mval_range()

◆ calcEdgeSlideCustomPoints()

◆ createEdgeSlideVerts()

◆ doEdgeSlide()

◆ drawEdgeSlide()

◆ edge_slide_apply_elem()

static void edge_slide_apply_elem ( const TransDataEdgeSlideVert & sv,
const float fac,
const float curr_length_fac,
const int curr_side_unclamp,
const bool use_clamp,
const bool use_even,
const bool use_flip,
float r_co[3] )
static

NOTE(@ideasman42): Implementation note, even mode ignores the starting positions and uses only the a/b verts, this could be changed/improved so the distance is still met but the verts are moved along their original path (which may not be straight), however how it works now is OK and matches 2.4x.

Note
len_v3v3(curr_sv->dir_side[0], curr_sv->dir_side[1]) is the same as the distance between the original vert locations, same goes for the lines below.

Definition at line 669 of file transform_mode_edge_slide.cc.

References add_v3_v3v3(), copy_v3_v3(), TransDataEdgeSlideVert::dir_side, TransDataEdgeSlideVert::edge_len, fabsf, int, interp_line_v3_v3v3v3(), is_zero_v3(), madd_v3_v3fl(), min_ff(), and TransDataEdgeSlideVert::v_co_orig().

Referenced by doEdgeSlide(), and edge_slide_transform_matrix_fn().

◆ edge_slide_container_first_ok()

static TransDataContainer * edge_slide_container_first_ok ( TransInfo * t)
static

Get the first valid TransDataContainer *.

Note we cannot trust TRANS_DATA_CONTAINER_FIRST_OK because of multi-object that may leave items with invalid custom data in the transform data container.

Definition at line 103 of file transform_mode_edge_slide.cc.

References BLI_assert_msg, and FOREACH_TRANS_DATA_CONTAINER.

Referenced by edge_slide_snap_apply(), edge_slide_transform_matrix_fn(), and edgeSlideFirstGet().

◆ edge_slide_data_init_mval()

◆ edge_slide_snap_apply()

◆ edge_slide_transform_matrix_fn()

◆ edgeSlideFirstGet()

◆ freeEdgeSlideVerts()

static void freeEdgeSlideVerts ( TransInfo * ,
TransDataContainer * ,
TransCustomData * custom_data )
static

Definition at line 393 of file transform_mode_edge_slide.cc.

References TransCustomData::data.

Referenced by initEdgeSlide_ex().

◆ handleEventEdgeSlide()

◆ initEdgeSlide()

static void initEdgeSlide ( TransInfo * t,
wmOperator * op )
static

◆ initEdgeSlide_ex()

◆ interp_line_v3_v3v3v3()

static void interp_line_v3_v3v3v3 ( float p[3],
const float v1[3],
const float v2[3],
const float v3[3],
float t )
static

◆ is_vert_slide_visible_bmesh()

◆ transform_mode_edge_slide_reproject_input()

Variable Documentation

◆ TransMode_edgeslide

TransModeInfo TransMode_edgeslide
Initial value:
= {
}
@ T_NO_CONSTRAINT
Definition transform.hh:95
static void drawEdgeSlide(TransInfo *t)
static void applyEdgeSlide(TransInfo *t)
static void edge_slide_snap_apply(TransInfo *t, float *value)
static eRedrawFlag handleEventEdgeSlide(TransInfo *t, const wmEvent *event)
static void edge_slide_transform_matrix_fn(TransInfo *t, float mat_xform[4][4])
static void initEdgeSlide(TransInfo *t, wmOperator *op)
float transform_snap_distance_len_squared_fn(TransInfo *, const float p1[3], const float p2[3])

Definition at line 973 of file transform_mode_edge_slide.cc.

Referenced by mode_info_get().