|
Blender V5.0
|
#include <cfloat>#include "BLI_math_matrix.hh"#include "MEM_guardedalloc.h"#include "BLI_array_utils.h"#include "BLI_bitmap.h"#include "BLI_bitmap_draw_2d.h"#include "BLI_math_matrix.h"#include "BLI_rect.h"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_view3d_types.h"#include "GPU_framebuffer.hh"#include "GPU_select.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "DRW_engine.hh"#include "DRW_render.hh"#include "DRW_select_buffer.hh"#include "../engines/select/select_engine.hh"Go to the source code of this file.
Classes | |
| struct | PolyMaskData |
| struct | SelectReadData |
Typedefs | |
| using | int2 |
Functions | |
Buffer of select ID's | |
| uint * | DRW_select_buffer_read (Depsgraph *depsgraph, ARegion *region, View3D *v3d, const rcti *rect, uint *r_buf_len) |
Select Bitmap from ID's | |
Given a buffer of select ID's, fill in a booleans (true/false) per index. BLI_bitmap is used for memory efficiency. | |
| uint * | DRW_select_buffer_bitmap_from_rect (Depsgraph *depsgraph, ARegion *region, View3D *v3d, const rcti *rect, uint *r_bitmap_len) |
| uint * | DRW_select_buffer_bitmap_from_circle (Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2], const int radius, uint *r_bitmap_len) |
| static void | drw_select_mask_px_cb (int x, int x_end, int y, void *user_data) |
| uint * | DRW_select_buffer_bitmap_from_poly (Depsgraph *depsgraph, ARegion *region, View3D *v3d, const Span< int2 > poly, const rcti *rect, uint *r_bitmap_len) |
Find Single Select ID's | |
Given a buffer of select ID's, find the a single select id. | |
| uint | DRW_select_buffer_sample_point (Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2]) |
| static bool | select_buffer_test_fn (const void *__restrict value, void *__restrict userdata) |
| uint | DRW_select_buffer_find_nearest_to_point (Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2], const uint id_min, const uint id_max, uint *dist) |
Object Utils | |
| bool | DRW_select_buffer_elem_get (const uint sel_id, uint &r_elem, uint &r_base_index, char &r_elem_type) |
| uint | DRW_select_buffer_context_offset_for_object_elem (Depsgraph *depsgraph, Object *object, char elem_type) |
Context | |
| void | DRW_select_buffer_context_create (Depsgraph *depsgraph, const blender::Span< Base * > bases, short select_mode) |
Utilities to read id buffer created in select_engine.
Definition in file draw_select_buffer.cc.
| using blender::int2 |
Definition at line 601 of file BLI_math_vector_types.hh.
| uint * DRW_select_buffer_bitmap_from_circle | ( | Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| View3D * | v3d, | ||
| const int | center[2], | ||
| int | radius, | ||
| uint * | r_bitmap_len ) |
| center | Circle center. |
| radius | Circle radius. |
| r_bitmap_len | Number of indices in the selection id buffer. |
Definition at line 177 of file draw_select_buffer.cc.
References BLI_assert, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, depsgraph, DRW_select_buffer_read(), DRW_select_engine_context_get(), SELECTID_Context::max_index_drawn_len, MEM_freeN(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by mesh_circle_select(), paint_facesel_circle_select(), and paint_vertsel_circle_select().
| uint * DRW_select_buffer_bitmap_from_poly | ( | Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| View3D * | v3d, | ||
| const Span< int2 > | poly, | ||
| const rcti * | rect, | ||
| uint * | r_bitmap_len ) |
Definition at line 240 of file draw_select_buffer.cc.
References BLI_assert, BLI_bitmap_draw_2d_poly_v2i_n(), BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, depsgraph, DRW_select_buffer_read(), DRW_select_engine_context_get(), drw_select_mask_px_cb(), i, SELECTID_Context::max_index_drawn_len, MEM_freeN(), PolyMaskData::px, PolyMaskData::width, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
| uint * DRW_select_buffer_bitmap_from_rect | ( | Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| View3D * | v3d, | ||
| const rcti * | rect, | ||
| uint * | r_bitmap_len ) |
| rect | The rectangle to sample indices from (min/max inclusive). |
Definition at line 141 of file draw_select_buffer.cc.
References BLI_assert, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, depsgraph, DRW_select_buffer_read(), DRW_select_engine_context_get(), SELECTID_Context::max_index_drawn_len, MEM_freeN(), rcti::xmax, and rcti::ymax.
Referenced by do_mesh_box_select(), do_paintface_box_select(), and do_paintvert_box_select().
| void DRW_select_buffer_context_create | ( | Depsgraph * | depsgraph, |
| const blender::Span< Base * > | bases, | ||
| short | select_mode ) |
Definition at line 465 of file draw_select_buffer.cc.
References DEG_get_evaluated(), depsgraph, DRW_select_engine_context_get(), i, blender::Span< T >::index_range(), SELECTID_Context::objects, SELECTID_Context::persmat, Vector< T, InlineBufferCapacity, Allocator >::reinitialize(), SELECTID_Context::select_mode, blender::Span< T >::size(), and blender::MatBase< float, 4, 4 >::zero().
| uint DRW_select_buffer_context_offset_for_object_elem | ( | Depsgraph * | depsgraph, |
| Object * | object, | ||
| char | elem_type ) |
Assume it is called right after DRW_select_buffer_bitmap_from_* so that the same evaluated object is used for drawing and as parameter to this function.
Definition at line 435 of file draw_select_buffer.cc.
References BLI_assert, DEG_get_evaluated(), depsgraph, DRW_select_engine_context_get(), ElemIndexRanges::edge, SELECTID_Context::elem_ranges, ElemIndexRanges::face, Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), SCE_SELECT_EDGE, SCE_SELECT_FACE, SCE_SELECT_VERTEX, blender::IndexRange::start(), and ElemIndexRanges::vert.
Referenced by do_lasso_select_mesh(), do_mesh_box_select(), edbm_backbuf_check_and_select_edges(), edbm_backbuf_check_and_select_faces(), and edbm_backbuf_check_and_select_verts().
| bool DRW_select_buffer_elem_get | ( | const uint | sel_id, |
| uint & | r_elem, | ||
| uint & | r_base_index, | ||
| char & | r_elem_type ) |
Definition at line 400 of file draw_select_buffer.cc.
References blender::IndexRange::contains(), DRW_select_engine_context_get(), ElemIndexRanges::edge, SELECTID_Context::elem_ranges, ElemIndexRanges::face, Vector< T, InlineBufferCapacity, Allocator >::first_index_of_try(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), SELECTID_Context::objects, SCE_SELECT_EDGE, SCE_SELECT_FACE, SCE_SELECT_VERTEX, blender::IndexRange::start(), ElemIndexRanges::total, and ElemIndexRanges::vert.
Referenced by edbm_select_id_bm_elem_get().
| uint DRW_select_buffer_find_nearest_to_point | ( | Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| View3D * | v3d, | ||
| const int | center[2], | ||
| uint | id_min, | ||
| uint | id_max, | ||
| uint * | dist ) |
Find the selection id closest to center.
| dist | Use to initialize the distance, when found, this value is set to the distance of the selection that's returned. |
Definition at line 350 of file draw_select_buffer.cc.
References abs, BLI_array_iter_spiral_square, BLI_rcti_init_pt_radius(), BLI_rcti_size_x(), data, depsgraph, DRW_select_buffer_read(), MEM_freeN(), select_buffer_test_fn(), rcti::xmax, and rcti::ymax.
Referenced by ED_mesh_pick_edge(), ED_mesh_pick_face(), ED_mesh_pick_vert(), EDBM_edge_find_nearest_ex(), EDBM_face_find_nearest_ex(), and EDBM_vert_find_nearest_ex().
| uint * DRW_select_buffer_read | ( | Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| View3D * | v3d, | ||
| const rcti * | rect, | ||
| uint * | r_buf_len ) |
Main function to read a block of pixels from the select frame buffer.
Definition at line 67 of file draw_select_buffer.cc.
References BLI_assert, BLI_rcti_compare(), BLI_rcti_is_empty(), BLI_rcti_isect(), BLI_rcti_size_x(), BLI_rcti_size_y(), depsgraph, DRW_draw_select_id(), DRW_engine_select_framebuffer_get(), DRW_engine_select_texture_get(), DRW_gpu_context_disable(), DRW_gpu_context_enable(), DRW_select_engine_context_get(), GPU_DATA_UINT, GPU_framebuffer_bind(), GPU_framebuffer_read_color(), GPU_framebuffer_restore(), GPU_select_buffer_stride_realign(), GPU_texture_height(), GPU_texture_width(), SELECTID_Context::is_dirty(), SELECTID_Context::max_index_drawn_len, MEM_malloc_arrayN(), ARegion::regiondata, ARegion::winx, ARegion::winy, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by DRW_select_buffer_bitmap_from_circle(), DRW_select_buffer_bitmap_from_poly(), DRW_select_buffer_bitmap_from_rect(), DRW_select_buffer_find_nearest_to_point(), and DRW_select_buffer_sample_point().
| uint DRW_select_buffer_sample_point | ( | Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| View3D * | v3d, | ||
| const int | center[2] ) |
Samples a single pixel.
Definition at line 306 of file draw_select_buffer.cc.
References BLI_assert, depsgraph, DRW_select_buffer_read(), MEM_freeN(), ret, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ED_mesh_pick_edge(), ED_mesh_pick_face(), ED_mesh_pick_vert(), and EDBM_face_find_nearest_ex().
|
static |
Definition at line 229 of file draw_select_buffer.cc.
References BLI_BITMAP_ENABLE, data, i, x, and y.
Referenced by DRW_select_buffer_bitmap_from_poly().
|
static |
Definition at line 337 of file draw_select_buffer.cc.
References data.
Referenced by DRW_select_buffer_find_nearest_to_point().