Blender  V3.3
DRW_select_buffer.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 Blender Foundation. */
3 
8 #pragma once
9 
10 #include "BLI_sys_types.h" /* for bool and uint */
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 struct ARegion;
17 struct Base;
18 struct Depsgraph;
19 struct Object;
20 struct View3D;
21 struct rcti;
22 
23 typedef struct SELECTID_ObjectData {
25 
27  bool is_drawn;
29 
30 struct ObjectOffsets {
31  /* For convenience only. */
32  union {
35  };
36  union {
39  };
40  union {
43  };
45 };
46 
47 typedef struct SELECTID_Context {
48  /* All context objects */
49  struct Object **objects;
50 
51  /* Array with only drawn objects. When a new object is found within the rect,
52  * it is added to the end of the list.
53  * The list is reset to any viewport or context update. */
58 
61 
62  short select_mode;
63 
64  /* rect is used to check which objects whose indexes need to be drawn. */
66 
67  /* To check for updates. */
68  float persmat[4][4];
69  bool is_dirty;
71 
72 /* draw_select_buffer.c */
73 
74 bool DRW_select_buffer_elem_get(uint sel_id, uint *r_elem, uint *r_base_index, char *r_elem_type);
76  struct Object *object,
77  char elem_type);
82  struct ARegion *region,
83  struct View3D *v3d,
84  const rcti *rect,
85  uint *r_buf_len);
91  struct ARegion *region,
92  struct View3D *v3d,
93  const struct rcti *rect,
94  uint *r_bitmap_len);
102  struct ARegion *region,
103  struct View3D *v3d,
104  const int center[2],
105  int radius,
106  uint *r_bitmap_len);
114  struct ARegion *region,
115  struct View3D *v3d,
116  const int poly[][2],
117  int poly_len,
118  const struct rcti *rect,
119  uint *r_bitmap_len);
124  struct ARegion *region,
125  struct View3D *v3d,
126  const int center[2]);
133  struct ARegion *region,
134  struct View3D *v3d,
135  const int center[2],
136  uint id_min,
137  uint id_max,
138  uint *dist);
139 void DRW_select_buffer_context_create(struct Base **bases, uint bases_len, short select_mode);
140 
141 #ifdef __cplusplus
142 }
143 #endif
unsigned int uint
Definition: BLI_sys_types.h:67
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
uint DRW_select_buffer_find_nearest_to_point(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2], uint id_min, uint id_max, uint *dist)
uint DRW_select_buffer_context_offset_for_object_elem(struct Depsgraph *depsgraph, struct Object *object, char elem_type)
uint * DRW_select_buffer_bitmap_from_rect(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const struct rcti *rect, uint *r_bitmap_len)
uint * DRW_select_buffer_bitmap_from_circle(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2], int radius, uint *r_bitmap_len)
uint * DRW_select_buffer_bitmap_from_poly(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int poly[][2], int poly_len, const struct rcti *rect, uint *r_bitmap_len)
uint * DRW_select_buffer_read(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const rcti *rect, uint *r_buf_len)
void DRW_select_buffer_context_create(struct Base **bases, uint bases_len, short select_mode)
bool DRW_select_buffer_elem_get(uint sel_id, uint *r_elem, uint *r_base_index, char *r_elem_type)
struct SELECTID_ObjectData SELECTID_ObjectData
uint DRW_select_buffer_sample_point(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2])
struct SELECTID_Context SELECTID_Context
NSNotificationCenter * center
const Depsgraph * depsgraph
struct Object ** objects_drawn
struct ObjectOffsets * index_offsets
struct Object ** objects