Blender V4.3
BKE_gpencil_geom_legacy.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11#include <optional>
12
13#include "BLI_bounds_types.hh"
15
16struct Depsgraph;
17struct Main;
18struct Object;
19struct Scene;
20struct bGPDcurve;
21struct bGPDlayer;
22struct bGPDframe;
23struct bGPDspoint;
24struct bGPDstroke;
25struct bGPdata;
26
27/* Object bound-box. */
28
36std::optional<blender::Bounds<blender::float3>> BKE_gpencil_data_minmax(const struct bGPdata *gpd);
46 bool use_select,
47 float r_min[3],
48 float r_max[3]);
49
55void BKE_gpencil_centroid_3d(struct bGPdata *gpd, float r_centroid[3]);
61
62/* Stroke geometry utilities. */
63
69void BKE_gpencil_stroke_normal(const struct bGPDstroke *gps, float r_normal[3]);
70
75bool BKE_gpencil_stroke_trim(struct bGPdata *gpd, struct bGPDstroke *gps);
76
85void BKE_gpencil_stroke_2d_flat(const struct bGPDspoint *points,
86 int totpoints,
87 float (*points2d)[2],
88 int *r_direction);
100void BKE_gpencil_stroke_2d_flat_ref(const struct bGPDspoint *ref_points,
101 int ref_totpoints,
102 const struct bGPDspoint *points,
103 int totpoints,
104 float (*points2d)[2],
105 float scale,
106 int *r_direction);
117void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps);
123
129void BKE_gpencil_transform(struct bGPdata *gpd, const float mat[4][4]);
130
132 /* This is used when doing "move only origin" in object_data_transform.cc.
133 * pressure is needs to be stored here as it is tied to object scale. */
134 float co[3];
135 float pressure;
137
149void BKE_gpencil_point_coords_apply(struct bGPdata *gpd, const GPencilPointCoordinates *elem_data);
154 const GPencilPointCoordinates *elem_data,
155 const float mat[4][4]);
156
168 int point_index,
169 float influence,
170 int iterations,
171 bool smooth_caps,
172 bool keep_shape,
173 struct bGPDstroke *r_gps);
183 int point_index,
184 float influence,
185 int iterations,
186 struct bGPDstroke *r_gps);
196 int point_index,
197 float influence,
198 int iterations,
199 struct bGPDstroke *r_gps);
209 int point_index,
210 float influence,
211 int iterations,
212 struct bGPDstroke *r_gps);
226 const float influence,
227 const int iterations,
228 const bool smooth_position,
229 const bool smooth_strength,
230 const bool smooth_thickness,
231 const bool smooth_uv,
232 const bool keep_shape,
233 const float *weights);
238bool BKE_gpencil_stroke_close(struct bGPDstroke *gps);
239
246 struct bGPDframe *gpf,
247 struct bGPDstroke *gps,
248 struct bGPDstroke *next_stroke,
249 int tag_flags,
250 bool select,
251 bool flat_cap,
252 int limit);
253
257void BKE_gpencil_stroke_flip(struct bGPDstroke *gps);
258
265float BKE_gpencil_stroke_length(const struct bGPDstroke *gps, bool use_3d);
268 int start_index,
269 int end_index,
270 bool use_3d);
271
277
282void BKE_gpencil_stroke_join(struct bGPDstroke *gps_a,
283 struct bGPDstroke *gps_b,
284 bool leave_gaps,
285 bool fit_thickness,
286 bool smooth,
287 bool auto_flip);
288
296 float viewmat[4][4],
297 const float diff_mat[4][4]);
305 float viewinv[4][4],
306 const float diff_mat[4][4]);
void BKE_gpencil_stroke_flip(struct bGPDstroke *gps)
void BKE_gpencil_stroke_fill_triangulate(struct bGPDstroke *gps)
float BKE_gpencil_stroke_average_pressure_get(struct bGPDstroke *gps)
void BKE_gpencil_stroke_2d_flat(const struct bGPDspoint *points, int totpoints, float(*points2d)[2], int *r_direction)
void BKE_gpencil_stroke_to_view_space(struct bGPDstroke *gps, float viewmat[4][4], const float diff_mat[4][4])
void BKE_gpencil_centroid_3d(struct bGPdata *gpd, float r_centroid[3])
void BKE_gpencil_stroke_2d_flat_ref(const struct bGPDspoint *ref_points, int ref_totpoints, const struct bGPDspoint *points, int totpoints, float(*points2d)[2], float scale, int *r_direction)
void BKE_gpencil_point_coords_apply(struct bGPdata *gpd, const GPencilPointCoordinates *elem_data)
void BKE_gpencil_stroke_normal(const struct bGPDstroke *gps, float r_normal[3])
float BKE_gpencil_stroke_length(const struct bGPDstroke *gps, bool use_3d)
bool BKE_gpencil_stroke_smooth_thickness(struct bGPDstroke *gps, int point_index, float influence, int iterations, struct bGPDstroke *r_gps)
std::optional< blender::Bounds< blender::float3 > > BKE_gpencil_data_minmax(const struct bGPdata *gpd)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
float BKE_gpencil_stroke_segment_length(const struct bGPDstroke *gps, int start_index, int end_index, bool use_3d)
void BKE_gpencil_transform(struct bGPdata *gpd, const float mat[4][4])
bool BKE_gpencil_stroke_smooth_strength(struct bGPDstroke *gps, int point_index, float influence, int iterations, struct bGPDstroke *r_gps)
void BKE_gpencil_stroke_smooth(struct bGPDstroke *gps, const float influence, const int iterations, const bool smooth_position, const bool smooth_strength, const bool smooth_thickness, const bool smooth_uv, const bool keep_shape, const float *weights)
struct GPencilPointCoordinates GPencilPointCoordinates
void BKE_gpencil_stroke_uv_update(struct bGPDstroke *gps)
bool BKE_gpencil_stroke_is_pressure_constant(struct bGPDstroke *gps)
bool BKE_gpencil_stroke_smooth_uv(struct bGPDstroke *gps, int point_index, float influence, int iterations, struct bGPDstroke *r_gps)
void BKE_gpencil_stroke_boundingbox_calc(struct bGPDstroke *gps)
struct bGPDstroke * BKE_gpencil_stroke_delete_tagged_points(struct bGPdata *gpd, struct bGPDframe *gpf, struct bGPDstroke *gps, struct bGPDstroke *next_stroke, int tag_flags, bool select, bool flat_cap, int limit)
void BKE_gpencil_point_coords_get(struct bGPdata *gpd, GPencilPointCoordinates *elem_data)
void BKE_gpencil_stroke_set_random_color(struct bGPDstroke *gps)
int BKE_gpencil_stroke_point_count(const struct bGPdata *gpd)
void BKE_gpencil_point_coords_apply_with_mat4(struct bGPdata *gpd, const GPencilPointCoordinates *elem_data, const float mat[4][4])
void BKE_gpencil_stroke_join(struct bGPDstroke *gps_a, struct bGPDstroke *gps_b, bool leave_gaps, bool fit_thickness, bool smooth, bool auto_flip)
bool BKE_gpencil_stroke_smooth_point(struct bGPDstroke *gps, int point_index, float influence, int iterations, bool smooth_caps, bool keep_shape, struct bGPDstroke *r_gps)
bool BKE_gpencil_stroke_close(struct bGPDstroke *gps)
void BKE_gpencil_stroke_from_view_space(struct bGPDstroke *gps, float viewinv[4][4], const float diff_mat[4][4])
bool BKE_gpencil_stroke_trim(struct bGPdata *gpd, struct bGPDstroke *gps)
bool BKE_gpencil_stroke_minmax(const struct bGPDstroke *gps, bool use_select, float r_min[3], float r_max[3])
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
struct Material ** mat