Blender V4.3
view3d_navigate.cc File Reference
#include "DNA_curve_types.h"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.hh"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.hh"
#include "BLI_rect.h"
#include "BKE_context.hh"
#include "BKE_layer.hh"
#include "BKE_object.hh"
#include "BKE_paint.hh"
#include "BKE_vfont.hh"
#include "DEG_depsgraph_query.hh"
#include "ED_screen.hh"
#include "ED_transform.hh"
#include "WM_api.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "view3d_intern.hh"
#include "view3d_navigate.hh"

Go to the source code of this file.

Classes

struct  ViewOpsData_Utility
 

Functions

static eViewOpsFlag viewops_flag_from_prefs ()
 
Navigation Utilities
static const ViewOpsTypeview3d_navigation_type_from_idname (const char *idname)
 
ViewOpsDataED_view3d_navigation_init (bContext *C, const wmKeyMapItem *kmi_merge)
 
bool ED_view3d_navigation_do (bContext *C, ViewOpsData *vod, const wmEvent *event, const float depth_loc_override[3])
 
void ED_view3d_navigation_free (bContext *C, ViewOpsData *vod)
 
ViewOpsData definition
static eViewOpsFlag navigate_pivot_get (bContext *C, Depsgraph *depsgraph, ARegion *region, View3D *v3d, const wmEvent *event, eViewOpsFlag viewops_flag, const float dyn_ofs_override[3], float r_pivot[3])
 
Generic Operator Callback Utils
static bool view3d_navigation_poll_impl (bContext *C, const char viewlock)
 
static eV3D_OpEvent view3d_navigate_event (ViewOpsData *vod, const wmEvent *event)
 
static int view3d_navigation_invoke_generic (bContext *C, ViewOpsData *vod, const wmEvent *event, PointerRNA *ptr, const ViewOpsType *nav_type, const float dyn_ofs_override[3])
 
int view3d_navigate_invoke_impl (bContext *C, wmOperator *op, const wmEvent *event, const ViewOpsType *nav_type)
 
Generic Callbacks
bool view3d_location_poll (bContext *C)
 
bool view3d_rotation_poll (bContext *C)
 
bool view3d_zoom_or_dolly_poll (bContext *C)
 
int view3d_navigate_modal_fn (bContext *C, wmOperator *op, const wmEvent *event)
 
void view3d_navigate_cancel_fn (bContext *C, wmOperator *op)
 
Generic View Operator Properties
void view3d_operator_properties_common (wmOperatorType *ot, const enum eV3D_OpPropFlag flag)
 
Generic View Operator Custom-Data
void calctrackballvec (const rcti *rect, const int event_xy[2], float r_dir[3])
 
void view3d_orbit_apply_dyn_ofs (float r_ofs[3], const float ofs_old[3], const float viewquat_old[4], const float viewquat_new[4], const float dyn_ofs[3])
 
static void view3d_orbit_apply_dyn_ofs_ortho_correction (float ofs[3], const float viewquat_old[4], const float viewquat_new[4], const float dyn_ofs[3])
 
void viewrotate_apply_dyn_ofs (ViewOpsData *vod, const float viewquat_new[4])
 
bool view3d_orbit_calc_center (bContext *C, float r_dyn_ofs[3])
 
ViewOpsDataviewops_data_create (bContext *C, const wmEvent *event, const ViewOpsType *nav_type, const bool use_cursor_init)
 
void viewops_data_free (bContext *C, ViewOpsData *vod)
 
Generic View Operator Utilities
void axis_set_view (bContext *C, View3D *v3d, ARegion *region, const float quat_[4], char view, char view_axis_roll, int perspo, const float *align_to_quat, const int smooth_viewtx)
 
void viewmove_apply (ViewOpsData *vod, int x, int y)
 

Function Documentation

◆ axis_set_view()

◆ calctrackballvec()

void calctrackballvec ( const rcti * rect,
const int event_xy[2],
float r_dir[3] )

◆ ED_view3d_navigation_do()

◆ ED_view3d_navigation_free()

void ED_view3d_navigation_free ( bContext * C,
ViewOpsData * vod )

◆ ED_view3d_navigation_init()

ViewOpsData * ED_view3d_navigation_init ( bContext * C,
const wmKeyMapItem * kmi_merge )

Utilities to perform navigation. Call ED_view3d_navigation_init to create a context and ED_view3d_navigation_do to perform navigation in modal operators.

Note
modal map events can also be used in ED_view3d_navigation_do.

Definition at line 1063 of file view3d_navigate.cc.

References CTX_wm_region_view3d().

Referenced by blender::ed::greasepencil::grease_pencil_primitive_invoke(), and initTransInfo().

◆ navigate_pivot_get()

◆ view3d_location_poll()

◆ view3d_navigate_cancel_fn()

void view3d_navigate_cancel_fn ( bContext * C,
wmOperator * op )

◆ view3d_navigate_event()

◆ view3d_navigate_invoke_impl()

◆ view3d_navigate_modal_fn()

◆ view3d_navigation_invoke_generic()

◆ view3d_navigation_poll_impl()

static bool view3d_navigation_poll_impl ( bContext * C,
const char viewlock )
static

◆ view3d_navigation_type_from_idname()

static const ViewOpsType * view3d_navigation_type_from_idname ( const char * idname)
static

◆ view3d_operator_properties_common()

◆ view3d_orbit_apply_dyn_ofs()

void view3d_orbit_apply_dyn_ofs ( float r_ofs[3],
const float ofs_old[3],
const float viewquat_old[4],
const float viewquat_new[4],
const float dyn_ofs[3] )

◆ view3d_orbit_apply_dyn_ofs_ortho_correction()

static void view3d_orbit_apply_dyn_ofs_ortho_correction ( float ofs[3],
const float viewquat_old[4],
const float viewquat_new[4],
const float dyn_ofs[3] )
static

◆ view3d_orbit_calc_center()

◆ view3d_rotation_poll()

bool view3d_rotation_poll ( bContext * C)

Definition at line 588 of file view3d_navigate.cc.

References RV3D_LOCK_ROTATION, and view3d_navigation_poll_impl().

Referenced by VIEW3D_OT_dolly(), and VIEW3D_OT_rotate().

◆ view3d_zoom_or_dolly_poll()

bool view3d_zoom_or_dolly_poll ( bContext * C)

◆ viewmove_apply()

◆ viewops_data_create()

ViewOpsData * viewops_data_create ( bContext * C,
const wmEvent * event,
const ViewOpsType * nav_type,
const bool use_cursor_init )

Allocate, fill in context pointers and calculate the values for ViewOpsData

Definition at line 856 of file view3d_navigate.cc.

References ViewOpsData::init_context(), and ViewOpsData::init_navigation().

Referenced by viewdolly_invoke(), and viewroll_invoke().

◆ viewops_data_free()

◆ viewops_flag_from_prefs()

static eViewOpsFlag viewops_flag_from_prefs ( )
static

If the mode requires it, always set the VIEWOPS_FLAG_PERSP_ENSURE. The function ED_view3d_persp_ensure already handles the checking of the preferences. And even with the option disabled, in some modes, it is still necessary to exit the camera view.

const bool use_auto_persp = (U.uiflag & USER_AUTOPERSP) != 0;
if (use_auto_persp) {
}
@ USER_AUTOPERSP
unsigned int U
Definition btGjkEpa3.h:78
@ VIEWOPS_FLAG_PERSP_ENSURE
uint8_t flag
Definition wm_window.cc:138

Definition at line 40 of file view3d_navigate.cc.

References flag, USER_DEPTH_NAVIGATE, USER_ORBIT_SELECTION, USER_ZOOM_TO_MOUSEPOS, VIEWOPS_FLAG_DEPTH_NAVIGATE, VIEWOPS_FLAG_INIT_ZFAC, VIEWOPS_FLAG_ORBIT_SELECT, VIEWOPS_FLAG_PERSP_ENSURE, and VIEWOPS_FLAG_ZOOM_TO_MOUSE.

Referenced by ViewOpsData::init_navigation().

◆ viewrotate_apply_dyn_ofs()