[Bf-blender-cvs] [6e39445f80b] master: GPencil: Cleanup - Split BKE_gpencil.h geometry functions into BKE_gpencil_geom.h

Antonio Vazquez noreply at git.blender.org
Thu Mar 19 11:38:40 CET 2020


Commit: 6e39445f80bea7abf19c9a82d0dcc3cc3dddc7d2
Author: Antonio Vazquez
Date:   Thu Mar 19 11:35:17 2020 +0100
Branches: master
https://developer.blender.org/rB6e39445f80bea7abf19c9a82d0dcc3cc3dddc7d2

GPencil: Cleanup - Split BKE_gpencil.h geometry functions into BKE_gpencil_geom.h

This split prepare the code for future geometry functions.

===================================================================

M	source/blender/blenkernel/BKE_gpencil.h
A	source/blender/blenkernel/BKE_gpencil_geom.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/gpencil.c
A	source/blender/blenkernel/intern/gpencil_geom.c
M	source/blender/blenkernel/intern/gpencil_modifier.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/draw/intern/draw_cache_impl_gpencil.c
M	source/blender/editors/gpencil/gpencil_add_monkey.c
M	source/blender/editors/gpencil/gpencil_add_stroke.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/editors/gpencil/gpencil_merge.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_primitive.c
M	source/blender/editors/gpencil/gpencil_sculpt_paint.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/gpencil/gpencil_uv.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/object/object_transform.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
M	source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/makesrna/intern/rna_object_api.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 5d23029df9e..8cd3081389e 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -28,7 +28,6 @@
 extern "C" {
 #endif
 
-struct BoundBox;
 struct Brush;
 struct CurveMapping;
 struct Depsgraph;
@@ -226,18 +225,8 @@ struct Material *BKE_gpencil_object_material_ensure_from_active_input_brush(stru
                                                                             struct Brush *brush);
 struct Material *BKE_gpencil_object_material_ensure_from_active_input_material(struct Object *ob);
 
-/* object boundbox */
-bool BKE_gpencil_data_minmax(const struct bGPdata *gpd, float r_min[3], float r_max[3]);
-bool BKE_gpencil_stroke_minmax(const struct bGPDstroke *gps,
-                               const bool use_select,
-                               float r_min[3],
-                               float r_max[3]);
 bool BKE_gpencil_stroke_select_check(const struct bGPDstroke *gps);
 
-struct BoundBox *BKE_gpencil_boundbox_get(struct Object *ob);
-void BKE_gpencil_centroid_3d(struct bGPdata *gpd, float r_centroid[3]);
-void BKE_gpencil_stroke_boundingbox_calc(struct bGPDstroke *gps);
-
 /* vertex groups */
 void BKE_gpencil_dvert_ensure(struct bGPDstroke *gps);
 void BKE_gpencil_vgroup_remove(struct Object *ob, struct bDeformGroup *defgroup);
@@ -246,66 +235,10 @@ void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGP
 /* Set active frame by layer. */
 void BKE_gpencil_frame_active_set(struct Depsgraph *depsgraph, struct bGPdata *gpd);
 
-/* stroke geometry utilities */
-void BKE_gpencil_stroke_normal(const struct bGPDstroke *gps, float r_normal[3]);
-void BKE_gpencil_stroke_simplify_adaptive(struct bGPDstroke *gps, float factor);
-void BKE_gpencil_stroke_simplify_fixed(struct bGPDstroke *gps);
-void BKE_gpencil_stroke_subdivide(struct bGPDstroke *gps, int level, int type);
-bool BKE_gpencil_stroke_trim(struct bGPDstroke *gps);
-void BKE_gpencil_stroke_merge_distance(struct bGPDframe *gpf,
-                                       struct bGPDstroke *gps,
-                                       const float threshold,
-                                       const bool use_unselected);
-
-void BKE_gpencil_stroke_2d_flat(const struct bGPDspoint *points,
-                                int totpoints,
-                                float (*points2d)[2],
-                                int *r_direction);
-void BKE_gpencil_stroke_2d_flat_ref(const struct bGPDspoint *ref_points,
-                                    int ref_totpoints,
-                                    const struct bGPDspoint *points,
-                                    int totpoints,
-                                    float (*points2d)[2],
-                                    const float scale,
-                                    int *r_direction);
-void BKE_gpencil_stroke_fill_triangulate(struct bGPDstroke *gps);
-void BKE_gpencil_stroke_geometry_update(struct bGPDstroke *gps);
-void BKE_gpencil_stroke_uv_update(struct bGPDstroke *gps);
-
-void BKE_gpencil_transform(struct bGPdata *gpd, float mat[4][4]);
-
-bool BKE_gpencil_stroke_sample(struct bGPDstroke *gps, const float dist, const bool select);
-bool BKE_gpencil_stroke_smooth(struct bGPDstroke *gps, int i, float inf);
-bool BKE_gpencil_stroke_smooth_strength(struct bGPDstroke *gps, int point_index, float influence);
-bool BKE_gpencil_stroke_smooth_thickness(struct bGPDstroke *gps, int point_index, float influence);
-bool BKE_gpencil_stroke_smooth_uv(struct bGPDstroke *gps, int point_index, float influence);
-bool BKE_gpencil_stroke_close(struct bGPDstroke *gps);
-void BKE_gpencil_dissolve_points(struct bGPDframe *gpf, struct bGPDstroke *gps, const short tag);
-
-bool BKE_gpencil_stroke_stretch(struct bGPDstroke *gps, const float dist, const float tip_length);
-bool BKE_gpencil_stroke_trim_points(struct bGPDstroke *gps,
-                                    const int index_from,
-                                    const int index_to);
-bool BKE_gpencil_stroke_split(struct bGPDframe *gpf,
-                              struct bGPDstroke *gps,
-                              const int before_index,
-                              struct bGPDstroke **remaining_gps);
-bool BKE_gpencil_stroke_shrink(struct bGPDstroke *gps, const float dist);
-
-float BKE_gpencil_stroke_length(const struct bGPDstroke *gps, bool use_3d);
-
 void BKE_gpencil_frame_range_selected(struct bGPDlayer *gpl, int *r_initframe, int *r_endframe);
 float BKE_gpencil_multiframe_falloff_calc(
     struct bGPDframe *gpf, int actnum, int f_init, int f_end, struct CurveMapping *cur_falloff);
 
-void BKE_gpencil_convert_curve(struct Main *bmain,
-                               struct Scene *scene,
-                               struct Object *ob_gp,
-                               struct Object *ob_cu,
-                               const bool gpencil_lines,
-                               const bool use_collections,
-                               const bool only_stroke);
-
 void BKE_gpencil_palette_ensure(struct Main *bmain, struct Scene *scene);
 
 bool BKE_gpencil_from_image(struct SpaceImage *sima,
diff --git a/source/blender/blenkernel/BKE_gpencil_geom.h b/source/blender/blenkernel/BKE_gpencil_geom.h
new file mode 100644
index 00000000000..8c52e6d458b
--- /dev/null
+++ b/source/blender/blenkernel/BKE_gpencil_geom.h
@@ -0,0 +1,113 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2008, Blender Foundation
+ * This is a new part of Blender
+ */
+
+#ifndef __BKE_GPENCIL_GEOM_H__
+#define __BKE_GPENCIL_GEOM_H__
+
+/** \file
+ * \ingroup bke
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct BoundBox;
+struct Depsgraph;
+struct Main;
+struct Object;
+struct Scene;
+struct bGPDframe;
+struct bGPDlayer;
+struct bGPDspoint;
+struct bGPDstroke;
+struct bGPdata;
+
+/* Object boundbox. */
+bool BKE_gpencil_data_minmax(const struct bGPdata *gpd, float r_min[3], float r_max[3]);
+bool BKE_gpencil_stroke_minmax(const struct bGPDstroke *gps,
+                               const bool use_select,
+                               float r_min[3],
+                               float r_max[3]);
+
+struct BoundBox *BKE_gpencil_boundbox_get(struct Object *ob);
+void BKE_gpencil_centroid_3d(struct bGPdata *gpd, float r_centroid[3]);
+void BKE_gpencil_stroke_boundingbox_calc(struct bGPDstroke *gps);
+
+/* stroke geometry utilities */
+void BKE_gpencil_stroke_normal(const struct bGPDstroke *gps, float r_normal[3]);
+void BKE_gpencil_stroke_simplify_adaptive(struct bGPDstroke *gps, float factor);
+void BKE_gpencil_stroke_simplify_fixed(struct bGPDstroke *gps);
+void BKE_gpencil_stroke_subdivide(struct bGPDstroke *gps, int level, int type);
+bool BKE_gpencil_stroke_trim(struct bGPDstroke *gps);
+void BKE_gpencil_stroke_merge_distance(struct bGPDframe *gpf,
+                                       struct bGPDstroke *gps,
+                                       const float threshold,
+                                       const bool use_unselected);
+
+void BKE_gpencil_stroke_2d_flat(const struct bGPDspoint *points,
+                                int totpoints,
+                                float (*points2d)[2],
+                                int *r_direction);
+void BKE_gpencil_stroke_2d_flat_ref(const struct bGPDspoint *ref_points,
+                                    int ref_totpoints,
+                                    const struct bGPDspoint *points,
+                                    int totpoints,
+                                    float (*points2d)[2],
+                                    const float scale,
+                                    int *r_direction);
+void BKE_gpencil_stroke_fill_triangulate(struct bGPDstroke *gps);
+void BKE_gpencil_stroke_geometry_update(struct bGPDstroke *gps);
+void BKE_gpencil_stroke_uv_update(struct bGPDstroke *gps);
+
+void BKE_gpencil_transform(struct bGPdata *gpd, float mat[4][4]);
+
+bool BKE_gpencil_stroke_sample(struct bGPDstroke *gps, const float dist, const bool select);
+bool BKE_gpencil_stroke_smooth(struct bGPDstroke *gps, int i, float inf);
+bool BKE_gpencil_stroke_smooth_strength(struct bGPDstroke *gps, int point_index, float influence);
+bool BKE_gpencil_stroke_smooth_thickness(struct bGPDstroke *gps, int point_index, float influence);
+bool BKE_gpencil_stroke_smooth_uv(struct bGPDstroke *gps, int point_index, float influence);
+bool BKE_gpencil_stroke_close(struct bGPDstroke *gps);
+void BKE_gpencil_dissolve_points(struct bGPDframe *gpf, struct bGPDstroke *gps, const short tag);
+
+bool BKE_gpencil_stroke_stretch(struct bGPDstroke *gps, const float dist, const float tip_length);
+bool BKE_gpencil_stroke_trim_points(struct bGPDstroke *gps,
+                                    const int index_from,
+                                    const int index_to);
+bool BKE_gpencil_stroke_split(struct bGPDframe *gpf,
+                              struct bGPDstroke *gps,
+                              const int before_index,
+                              struct bGPDstroke **remaining_gps);
+bool BKE_gpencil_stroke_shrink(struct bGPDstroke *gps, const float dist);
+
+float BKE_gpencil_stroke_length(const struct bGPDstroke *gps, bool use_3d);
+
+void BKE_gpencil_convert_curve(struct Main *bmain,
+                               struct Scene *scene,
+                               struct Object *ob_gp,
+                               struct 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list