Blender  V2.93
DRW_select_buffer.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2016, Blender Foundation.
17  */
18 
23 #pragma once
24 
25 #include "BLI_sys_types.h" /* for bool and uint */
26 
27 struct ARegion;
28 struct Base;
29 struct Depsgraph;
30 struct Object;
31 struct View3D;
32 struct rcti;
33 
34 typedef struct SELECTID_ObjectData {
36 
38  bool is_drawn;
40 
41 struct ObjectOffsets {
42  /* For convenience only. */
43  union {
46  };
47  union {
50  };
51  union {
54  };
56 };
57 
58 typedef struct SELECTID_Context {
59  /* All context objects */
60  struct Object **objects;
61 
62  /* Array with only drawn objects. When a new object is found within the rect,
63  * it is added to the end of the list.
64  * The list is reset to any viewport or context update. */
69 
72 
73  short select_mode;
74 
75  /* rect is used to check which objects whose indexes need to be drawn. */
77 
78  /* To check for updates. */
79  float persmat[4][4];
80  bool is_dirty;
82 
83 /* draw_select_buffer.c */
84 bool DRW_select_buffer_elem_get(const uint sel_id,
85  uint *r_elem,
86  uint *r_base_index,
87  char *r_elem_type);
89  struct Object *object,
90  char elem_type);
92  struct ARegion *region,
93  struct View3D *v3d,
94  const rcti *rect,
95  uint *r_buf_len);
97  struct ARegion *region,
98  struct View3D *v3d,
99  const struct rcti *rect,
100  uint *r_bitmap_len);
102  struct ARegion *region,
103  struct View3D *v3d,
104  const int center[2],
105  const int radius,
106  uint *r_bitmap_len);
108  struct ARegion *region,
109  struct View3D *v3d,
110  const int poly[][2],
111  const int poly_len,
112  const struct rcti *rect,
113  uint *r_bitmap_len);
115  struct ARegion *region,
116  struct View3D *v3d,
117  const int center[2]);
119  struct ARegion *region,
120  struct View3D *v3d,
121  const int center[2],
122  const uint id_min,
123  const uint id_max,
124  uint *dist);
125 void DRW_select_buffer_context_create(struct Base **bases,
126  const uint bases_len,
127  short select_mode);
unsigned int uint
Definition: BLI_sys_types.h:83
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
uint DRW_select_buffer_context_offset_for_object_elem(struct Depsgraph *depsgraph, struct Object *object, char elem_type)
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_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_poly(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int poly[][2], const 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)
uint * DRW_select_buffer_bitmap_from_circle(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2], const int radius, uint *r_bitmap_len)
uint DRW_select_buffer_find_nearest_to_point(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2], const uint id_min, const uint id_max, uint *dist)
void DRW_select_buffer_context_create(struct Base **bases, const uint bases_len, short select_mode)
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