Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
view3d_navigate.h File Reference

Go to the source code of this file.

Classes

struct  ViewOpsData
 
struct  V3D_SmoothParams
 

Macros

#define V3D_OP_TRACKBALLSIZE   (1.1f)
 

Typedefs

typedef struct ViewOpsData ViewOpsData
 
typedef struct V3D_SmoothParams V3D_SmoothParams
 

Enumerations

enum  eV3D_OpPropFlag { V3D_OP_PROP_MOUSE_CO = (1 << 0) , V3D_OP_PROP_DELTA = (1 << 1) , V3D_OP_PROP_USE_ALL_REGIONS = (1 << 2) , V3D_OP_PROP_USE_MOUSE_INIT = (1 << 3) }
 
enum  { VIEW_PASS = 0 , VIEW_APPLY , VIEW_CONFIRM }
 
enum  {
  VIEW_MODAL_CONFIRM = 1 , VIEWROT_MODAL_AXIS_SNAP_ENABLE = 2 , VIEWROT_MODAL_AXIS_SNAP_DISABLE = 3 , VIEWROT_MODAL_SWITCH_ZOOM = 4 ,
  VIEWROT_MODAL_SWITCH_MOVE = 5 , VIEWROT_MODAL_SWITCH_ROTATE = 6
}
 
enum  eViewOpsFlag { VIEWOPS_FLAG_ORBIT_SELECT = (1 << 0) , VIEWOPS_FLAG_DEPTH_NAVIGATE = (1 << 1) , VIEWOPS_FLAG_PERSP_ENSURE = (1 << 2) , VIEWOPS_FLAG_USE_MOUSE_INIT = (1 << 3) }
 

Functions

bool view3d_location_poll (struct bContext *C)
 
bool view3d_rotation_poll (struct bContext *C)
 
bool view3d_zoom_or_dolly_poll (struct bContext *C)
 
enum eViewOpsFlag viewops_flag_from_prefs (void)
 
void calctrackballvec (const struct rcti *rect, const int event_xy[2], float r_dir[3])
 
void viewmove_apply (ViewOpsData *vod, int x, int y)
 
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])
 
void viewrotate_apply_dyn_ofs (ViewOpsData *vod, const float viewquat_new[4])
 
bool view3d_orbit_calc_center (struct bContext *C, float r_dyn_ofs[3])
 
void view3d_operator_properties_common (struct wmOperatorType *ot, const enum eV3D_OpPropFlag flag)
 
void viewops_data_free (struct bContext *C, ViewOpsData *vod)
 
ViewOpsDataviewops_data_create (struct bContext *C, const struct wmEvent *event, enum eViewOpsFlag viewops_flag)
 
void VIEW3D_OT_view_all (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_selected (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_center_cursor (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_center_pick (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_axis (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_camera (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_orbit (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_pan (struct wmOperatorType *ot)
 
void viewdolly_modal_keymap (struct wmKeyConfig *keyconf)
 
void VIEW3D_OT_dolly (struct wmOperatorType *ot)
 
void fly_modal_keymap (struct wmKeyConfig *keyconf)
 
void view3d_keymap (struct wmKeyConfig *keyconf)
 
void VIEW3D_OT_fly (struct wmOperatorType *ot)
 
void viewmove_modal_keymap (struct wmKeyConfig *keyconf)
 
void VIEW3D_OT_move (struct wmOperatorType *ot)
 
void VIEW3D_OT_view_roll (struct wmOperatorType *ot)
 
void viewrotate_modal_keymap (struct wmKeyConfig *keyconf)
 
void VIEW3D_OT_rotate (struct wmOperatorType *ot)
 
void ED_view3d_smooth_view_ex (const struct Depsgraph *depsgraph, struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area, struct View3D *v3d, struct ARegion *region, int smooth_viewtx, const V3D_SmoothParams *sview)
 
void ED_view3d_smooth_view (struct bContext *C, struct View3D *v3d, struct ARegion *region, int smooth_viewtx, const V3D_SmoothParams *sview)
 
void ED_view3d_smooth_view_undo_begin (struct bContext *C, struct ScrArea *area)
 
void ED_view3d_smooth_view_undo_end (struct bContext *C, struct ScrArea *area, const char *undo_str, bool undo_grouped)
 
void ED_view3d_smooth_view_force_finish (struct bContext *C, struct View3D *v3d, struct ARegion *region)
 
void VIEW3D_OT_smoothview (struct wmOperatorType *ot)
 
void walk_modal_keymap (struct wmKeyConfig *keyconf)
 
void VIEW3D_OT_walk (struct wmOperatorType *ot)
 
void viewzoom_modal_keymap (struct wmKeyConfig *keyconf)
 
void VIEW3D_OT_zoom (struct wmOperatorType *ot)
 
void VIEW3D_OT_zoom_border (struct wmOperatorType *ot)
 

Macro Definition Documentation

◆ V3D_OP_TRACKBALLSIZE

#define V3D_OP_TRACKBALLSIZE   (1.1f)

Size of the sphere being dragged for trackball rotation within the view bounds. also affects speed (smaller is faster).

Definition at line 14 of file view3d_navigate.h.

Typedef Documentation

◆ V3D_SmoothParams

Parameters for setting the new 3D Viewport state.

Each of the struct members may be NULL to signify they aren't to be adjusted.

◆ ViewOpsData

typedef struct ViewOpsData ViewOpsData

Generic View Operator Custom-Data

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VIEW_PASS 
VIEW_APPLY 
VIEW_CONFIRM 

Definition at line 36 of file view3d_navigate.h.

◆ anonymous enum

anonymous enum
Enumerator
VIEW_MODAL_CONFIRM 
VIEWROT_MODAL_AXIS_SNAP_ENABLE 
VIEWROT_MODAL_AXIS_SNAP_DISABLE 
VIEWROT_MODAL_SWITCH_ZOOM 
VIEWROT_MODAL_SWITCH_MOVE 
VIEWROT_MODAL_SWITCH_ROTATE 

Definition at line 43 of file view3d_navigate.h.

◆ eV3D_OpPropFlag

Enumerator
V3D_OP_PROP_MOUSE_CO 
V3D_OP_PROP_DELTA 
V3D_OP_PROP_USE_ALL_REGIONS 
V3D_OP_PROP_USE_MOUSE_INIT 

Definition at line 29 of file view3d_navigate.h.

◆ eViewOpsFlag

Enumerator
VIEWOPS_FLAG_ORBIT_SELECT 

When enabled, rotate around the selection.

VIEWOPS_FLAG_DEPTH_NAVIGATE 

When enabled, use the depth under the cursor for navigation.

VIEWOPS_FLAG_PERSP_ENSURE 

When enabled run ED_view3d_persp_ensure this may switch out of camera view when orbiting or switch from orthographic to perspective when auto-perspective is enabled. Some operations don't require this (view zoom/pan or NDOF where subtle rotation is common so we don't want it to trigger auto-perspective).

VIEWOPS_FLAG_USE_MOUSE_INIT 

When set, ignore any options that depend on initial cursor location.

Definition at line 52 of file view3d_navigate.h.

Function Documentation

◆ calctrackballvec()

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

◆ ED_view3d_smooth_view()

void ED_view3d_smooth_view ( struct bContext C,
struct View3D v3d,
struct ARegion region,
int  smooth_viewtx,
const V3D_SmoothParams sview 
)

◆ ED_view3d_smooth_view_ex()

void ED_view3d_smooth_view_ex ( const struct Depsgraph depsgraph,
struct wmWindowManager wm,
struct wmWindow win,
struct ScrArea area,
struct View3D v3d,
struct ARegion region,
int  smooth_viewtx,
const V3D_SmoothParams sview 
)

The arguments are the desired situation.

Referenced by view3d_localview_exit(), and view3d_localview_init().

◆ ED_view3d_smooth_view_force_finish()

void ED_view3d_smooth_view_force_finish ( struct bContext C,
struct View3D v3d,
struct ARegion region 
)

◆ ED_view3d_smooth_view_undo_begin()

void ED_view3d_smooth_view_undo_begin ( struct bContext C,
struct ScrArea area 
)

Call before multiple smooth-view operations begin to properly handle undo.

Note
Only use explicit undo calls when multiple calls to smooth-view are necessary or when calling ED_view3d_smooth_view_ex. Otherwise pass in V3D_SmoothParams.undo_str so an undo step is pushed as needed.

Definition at line 48 of file view3d_navigate_smoothview.c.

References blender::compositor::area(), C, View3D::camera, camera, ED_view3d_camera_lock_undo_test(), LIB_TAG_DOIT, LISTBASE_FOREACH, and RGN_TYPE_WINDOW.

Referenced by ED_view3d_smooth_view(), view3d_all_exec(), and viewselected_exec().

◆ ED_view3d_smooth_view_undo_end()

void ED_view3d_smooth_view_undo_end ( struct bContext C,
struct ScrArea area,
const char *  undo_str,
bool  undo_grouped 
)

◆ fly_modal_keymap()

void fly_modal_keymap ( struct wmKeyConfig keyconf)

◆ view3d_keymap()

void view3d_keymap ( struct wmKeyConfig keyconf)

◆ view3d_location_poll()

bool view3d_location_poll ( struct bContext C)

◆ view3d_operator_properties_common()

void view3d_operator_properties_common ( struct wmOperatorType ot,
const enum eV3D_OpPropFlag  flag 
)

◆ 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_calc_center()

bool view3d_orbit_calc_center ( struct bContext C,
float  r_dyn_ofs[3] 
)

◆ VIEW3D_OT_dolly()

void VIEW3D_OT_dolly ( struct wmOperatorType ot)

◆ VIEW3D_OT_fly()

void VIEW3D_OT_fly ( struct wmOperatorType ot)

◆ VIEW3D_OT_move()

void VIEW3D_OT_move ( struct wmOperatorType ot)

◆ VIEW3D_OT_rotate()

void VIEW3D_OT_rotate ( struct wmOperatorType ot)

◆ VIEW3D_OT_smoothview()

void VIEW3D_OT_smoothview ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_all()

void VIEW3D_OT_view_all ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_axis()

void VIEW3D_OT_view_axis ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_camera()

void VIEW3D_OT_view_camera ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_center_cursor()

void VIEW3D_OT_view_center_cursor ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_center_pick()

void VIEW3D_OT_view_center_pick ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_orbit()

void VIEW3D_OT_view_orbit ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_pan()

void VIEW3D_OT_view_pan ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_roll()

void VIEW3D_OT_view_roll ( struct wmOperatorType ot)

◆ VIEW3D_OT_view_selected()

void VIEW3D_OT_view_selected ( struct wmOperatorType ot)

◆ VIEW3D_OT_walk()

void VIEW3D_OT_walk ( struct wmOperatorType ot)

◆ VIEW3D_OT_zoom()

void VIEW3D_OT_zoom ( struct wmOperatorType ot)

◆ VIEW3D_OT_zoom_border()

void VIEW3D_OT_zoom_border ( struct wmOperatorType ot)

◆ view3d_rotation_poll()

bool view3d_rotation_poll ( struct bContext C)

Definition at line 65 of file view3d_navigate.c.

References C, 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 ( struct bContext C)

◆ viewdolly_modal_keymap()

void viewdolly_modal_keymap ( struct wmKeyConfig keyconf)

◆ viewmove_apply()

void viewmove_apply ( ViewOpsData vod,
int  x,
int  y 
)

◆ viewmove_modal_keymap()

void viewmove_modal_keymap ( struct wmKeyConfig keyconf)

◆ viewops_data_create()

ViewOpsData* viewops_data_create ( struct bContext C,
const struct wmEvent event,
enum eViewOpsFlag  viewops_flag 
)

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

◆ viewops_data_free()

void viewops_data_free ( struct bContext C,
ViewOpsData vod 
)

◆ viewops_flag_from_prefs()

enum eViewOpsFlag viewops_flag_from_prefs ( void  )

◆ viewrotate_apply_dyn_ofs()

void viewrotate_apply_dyn_ofs ( ViewOpsData vod,
const float  viewquat_new[4] 
)

◆ viewrotate_modal_keymap()

void viewrotate_modal_keymap ( struct wmKeyConfig keyconf)

◆ viewzoom_modal_keymap()

void viewzoom_modal_keymap ( struct wmKeyConfig keyconf)

◆ walk_modal_keymap()

void walk_modal_keymap ( struct wmKeyConfig keyconf)