Blender V5.3
view3d_gizmo_ruler.cc File Reference
#include "BLI_listbase.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix.hh"
#include "BLI_math_matrix_types.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string_utf8.hh"
#include "BLI_utildefines.hh"
#include "BKE_annotations.h"
#include "BKE_context.hh"
#include "BKE_layer.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "BKE_unit.hh"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_object_types.h"
#include "DNA_view3d_types.h"
#include "ED_gizmo_library.hh"
#include "ED_gizmo_utils.hh"
#include "ED_screen.hh"
#include "ED_transform.hh"
#include "ED_transform_snap_object_context.hh"
#include "ED_view3d.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "MEM_guardedalloc.h"
#include "RNA_access.hh"
#include "WM_api.hh"
#include "WM_toolsystem.hh"
#include "WM_types.hh"
#include "DEG_depsgraph_query.hh"
#include "view3d_intern.hh"
#include "GPU_immediate.hh"
#include "GPU_immediate_util.hh"
#include "GPU_matrix.hh"
#include "GPU_state.hh"
#include "BLF_api.hh"

Go to the source code of this file.

Classes

struct  blender::RulerInfo
struct  blender::RulerItem
struct  blender::RulerInteraction

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define USE_AXIS_CONSTRAINTS
#define MVAL_MAX_PX_DIST   12.0f
#define RULER_PICK_DIST   12.0f
#define RULER_PICK_DIST_SQ   (RULER_PICK_DIST * RULER_PICK_DIST)
#define PART_LINE   0xff

Enumerations

enum  { blender::RULERITEM_USE_ANGLE = (1 << 0) , blender::RULERITEM_USE_ANGLE_ACTIVE = (1 << 1) }
enum  { blender::RULER_STATE_NORMAL = 0 , blender::RULER_STATE_DRAG }
enum  { blender::CONSTRAIN_AXIS_NONE = -1 , blender::CONSTRAIN_AXIS_X = 0 , blender::CONSTRAIN_AXIS_Y = 1 , blender::CONSTRAIN_AXIS_Z = 2 }
enum  { blender::CONSTRAIN_MODE_OFF = 0 , blender::CONSTRAIN_MODE_1 = 1 , blender::CONSTRAIN_MODE_2 = 2 }

Functions

Internal Ruler Utilities
static RulerItem * blender::ruler_item_add (wmGizmoGroup *gzgroup)
static void blender::ruler_item_remove (bContext *C, wmGizmoGroup *gzgroup, RulerItem *ruler_item)
static void blender::ruler_item_as_string (RulerItem *ruler_item, const UnitSettings &unit, char *numstr, size_t numstr_maxncpy, int prec)
static bool blender::view3d_ruler_pick (wmGizmoGroup *gzgroup, RulerItem *ruler_item, const float2 mval, int *r_co_index)
static void blender::ruler_state_set (RulerInfo *ruler_info, int state)
static void blender::view3d_ruler_item_project (RulerInfo *ruler_info, float3 &r_co, const int xy[2])
static bool blender::view3d_ruler_item_mousemove (const bContext *C, Depsgraph *depsgraph, RulerInfo *ruler_info, RulerItem *ruler_item, const int mval[2], const bool do_thickness, const bool do_snap)
static bool blender::gizmo_ruler_check_for_operator (const wmGizmoGroup *gzgroup)
Ruler Item Gizmo Type
static void blender::gizmo_ruler_draw (const bContext *C, wmGizmo *gz)
static int blender::gizmo_ruler_test_select (bContext *, wmGizmo *gz, const int mval[2])
static wmOperatorStatus blender::gizmo_ruler_modal (bContext *C, wmGizmo *gz, const wmEvent *event, eWM_GizmoFlagTweak tweak_flag)
static wmOperatorStatus blender::gizmo_ruler_invoke (bContext *C, wmGizmo *gz, const wmEvent *event)
static void blender::gizmo_ruler_exit (bContext *C, wmGizmo *gz, const bool cancel)
static int blender::gizmo_ruler_cursor_get (wmGizmo *gz)
void blender::VIEW3D_GT_ruler_item (wmGizmoType *gzt)
Ruler Gizmo Group
static void blender::WIDGETGROUP_ruler_setup (const bContext *C, wmGizmoGroup *gzgroup)
void blender::VIEW3D_GGT_ruler (wmGizmoGroupType *gzgt)
Add Ruler Operator
static bool blender::view3d_ruler_poll (bContext *C)
static wmOperatorStatus blender::view3d_ruler_add_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::VIEW3D_OT_ruler_add (wmOperatorType *ot)
Remove Ruler Operator
static wmOperatorStatus blender::view3d_ruler_remove_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::VIEW3D_OT_ruler_remove (wmOperatorType *ot)

Variables

static const char * blender::view3d_gzgt_ruler_id = "VIEW3D_GGT_ruler"

Ruler/Grease Pencil Conversion

#define RULER_ID   "RulerData3D"
static bGPDlayer * blender::view3d_ruler_layer_get (bGPdata *gpd)
static RulerItem * blender::gzgroup_ruler_item_first_get (wmGizmoGroup *gzgroup)
static void blender::view3d_ruler_gpencil_ensure (bContext *C)
static bool blender::view3d_ruler_to_gpencil (bContext *C, wmGizmoGroup *gzgroup)
static bool blender::view3d_ruler_from_gpencil (const bContext *C, wmGizmoGroup *gzgroup)
void blender::ED_view3d_gizmo_ruler_remove_by_gpencil_layer (struct bContext *C, bGPDlayer *gpl)

Macro Definition Documentation

◆ MVAL_MAX_PX_DIST

#define MVAL_MAX_PX_DIST   12.0f

Definition at line 69 of file view3d_gizmo_ruler.cc.

◆ PART_LINE

#define PART_LINE   0xff

◆ RULER_ID

#define RULER_ID   "RulerData3D"

Definition at line 510 of file view3d_gizmo_ruler.cc.

Referenced by blender::view3d_ruler_to_gpencil().

◆ RULER_PICK_DIST

#define RULER_PICK_DIST   12.0f

Definition at line 82 of file view3d_gizmo_ruler.cc.

◆ RULER_PICK_DIST_SQ

#define RULER_PICK_DIST_SQ   (RULER_PICK_DIST * RULER_PICK_DIST)

Definition at line 83 of file view3d_gizmo_ruler.cc.

Referenced by blender::view3d_ruler_pick().

◆ USE_AXIS_CONSTRAINTS

#define USE_AXIS_CONSTRAINTS

Supporting transform features could be removed if the actual transform system is used. Keep the option open since each transform feature is duplicating logic.

Definition at line 65 of file view3d_gizmo_ruler.cc.