[Bf-blender-cvs] [b96c04b53ad] temp-lineart-contained: LineArt: Naming and comments clean up.

YimingWu noreply at git.blender.org
Fri Mar 12 02:47:08 CET 2021


Commit: b96c04b53ad9d1e938bf6b40809b17b197e46d8a
Author: YimingWu
Date:   Fri Mar 12 09:09:53 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBb96c04b53ad9d1e938bf6b40809b17b197e46d8a

LineArt: Naming and comments clean up.

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

M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M	source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
M	source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 71e6a6ddd2f..7d42e2526b8 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -155,7 +155,7 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec
     return;
   }
 
-  ED_lineart_compute_feature_lines_internal(depsgraph, lmd);
+  ED_lineart_compute_feature_lines(depsgraph, lmd);
 
   generate_strokes_actual(md, depsgraph, ob, gpl, gpf);
 
@@ -181,7 +181,7 @@ static void bakeModifier(Main *UNUSED(bmain),
     return;
   }
 
-  ED_lineart_compute_feature_lines_internal(depsgraph, lmd);
+  ED_lineart_compute_feature_lines(depsgraph, lmd);
 
   generate_strokes_actual(md, depsgraph, ob, gpl, gpf);
 
@@ -392,7 +392,7 @@ static void baking_panel_draw(const bContext *UNUSED(C), Panel *panel)
   uiItemO(layout,
           IFACE_("Bake All Line Art Objects"),
           ICON_NONE,
-          "OBJECT_OT_lineart_bake_strokes_all");
+          "OBJECT_OT_lineart_bake_strokes_all_targets");
   uiItemO(layout, IFACE_("Clear Current Object"), ICON_NONE, "OBJECT_OT_lineart_clear_strokes");
   uiItemO(layout, IFACE_("Clear All Objects"), ICON_NONE, "OBJECT_OT_lineart_clear_strokes_all");
 }
diff --git a/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h b/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
index e6235e4f286..6e403eb497a 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
@@ -110,6 +110,7 @@ typedef struct LineartRenderVert {
   double gloc[3];
   double fbcoord[4];
 
+  /* Scene global index. */
   int index;
 
   /** Intersection data flag is here, when LRT_VERT_HAS_INTERSECTION_DATA is set,
@@ -275,6 +276,7 @@ typedef struct LineartRenderBuffer {
   bool fuzzy_intersections;
   bool fuzzy_everything;
   bool allow_boundaries;
+  bool allow_overlapping_edges;
   bool remove_doubles;
 
   /** Keep an copy of these data so when line art is running it's self-contained. */
@@ -490,43 +492,34 @@ BLI_INLINE int lineart_LineIntersectTest2d(
 #endif
 }
 
-int ED_lineart_point_inside_triangle(const double v[2],
-                                     const double v0[2],
-                                     const double v1[2],
-                                     const double v2[2]);
-
 struct Depsgraph;
 struct Scene;
 struct LineartRenderBuffer;
 struct LineartGpencilModifierData;
 
-struct LineartRenderBuffer *ED_lineart_create_render_buffer(
-    struct Scene *s, struct LineartGpencilModifierData *lmd);
 void ED_lineart_destroy_render_data(struct LineartGpencilModifierData *lmd);
 
-int ED_lineart_object_collection_usage_check(struct Collection *c, struct Object *o);
-
 void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb);
 void ED_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb);
-void ED_lineart_chain_connect(LineartRenderBuffer *rb, const int do_geometry_space);
+void ED_lineart_chain_connect(LineartRenderBuffer *rb, const bool do_geometry_space);
 void ED_lineart_chain_discard_short(LineartRenderBuffer *rb, const float threshold);
 void ED_lineart_chain_split_angle(LineartRenderBuffer *rb, float angle_threshold_rad);
 
 int ED_lineart_chain_count(const LineartRenderLineChain *rlc);
 void ED_lineart_chain_clear_picked_flag(struct LineartRenderBuffer *rb);
 
-int ED_lineart_compute_feature_lines_internal(struct Depsgraph *depsgraph,
-                                              struct LineartGpencilModifierData *lmd);
+int ED_lineart_compute_feature_lines(struct Depsgraph *depsgraph,
+                                     struct LineartGpencilModifierData *lmd);
 
 struct Scene;
 
-LineartBoundingArea *ED_lineart_get_point_bounding_area(LineartRenderBuffer *rb,
-                                                        double x,
-                                                        double y);
+LineartBoundingArea *ED_lineart_get_point_bounding_area_rb(LineartRenderBuffer *rb,
+                                                           double x,
+                                                           double y);
 
-LineartBoundingArea *ED_lineart_get_point_bounding_area_deep(LineartRenderBuffer *rb,
-                                                             double x,
-                                                             double y);
+LineartBoundingArea *ED_lineart_get_point_bounding_area_recursive_rb(LineartRenderBuffer *rb,
+                                                                     double x,
+                                                                     double y);
 
 struct bGPDlayer;
 struct bGPDframe;
@@ -579,8 +572,8 @@ struct wmOperatorType;
 
 /* Operator types */
 void OBJECT_OT_lineart_bake_strokes(struct wmOperatorType *ot);
-void OBJECT_OT_lineart_bake_strokes_all(struct wmOperatorType *ot);
+void OBJECT_OT_lineart_bake_strokes_all_targets(struct wmOperatorType *ot);
 void OBJECT_OT_lineart_clear_strokes(struct wmOperatorType *ot);
-void OBJECT_OT_lineart_clear_strokes_all(struct wmOperatorType *ot);
+void OBJECT_OT_lineart_clear_strokes_all_targets(struct wmOperatorType *ot);
 
 void ED_operatortypes_lineart(void);
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
index 171577016d3..41fdfc8b1ad 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
@@ -230,7 +230,7 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
     }
 
     /*  step 1: grow left. */
-    ba = ED_lineart_get_point_bounding_area_deep(rb, rl->l->fbcoord[0], rl->l->fbcoord[1]);
+    ba = ED_lineart_get_point_bounding_area_recursive_rb(rb, rl->l->fbcoord[0], rl->l->fbcoord[1]);
     new_rv = rl->l;
     rls = rl->segments.first;
     VERT_COORD_TO_FLOAT(new_rv);
@@ -317,7 +317,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
                                  last_transparency,
                                  new_rl->r_obindex);
       }
-      ba = ED_lineart_get_point_bounding_area_deep(rb, new_rv->fbcoord[0], new_rv->fbcoord[1]);
+      ba = ED_lineart_get_point_bounding_area_recursive_rb(
+          rb, new_rv->fbcoord[0], new_rv->fbcoord[1]);
     }
 
     /* Restore normal value. */
@@ -369,7 +370,7 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
                                rl->r_obindex);
 
     /*  step 3: grow right. */
-    ba = ED_lineart_get_point_bounding_area_deep(rb, rl->r->fbcoord[0], rl->r->fbcoord[1]);
+    ba = ED_lineart_get_point_bounding_area_recursive_rb(rb, rl->r->fbcoord[0], rl->r->fbcoord[1]);
     new_rv = rl->r;
     /*  below already done in step 2. */
     /*  lineart_chain_push_point(rb,rlc,new_rv->fbcoord[0],new_rv->fbcoord[1],rl->flags,0);
@@ -456,7 +457,8 @@ void ED_lineart_chain_feature_lines(LineartRenderBuffer *rb)
                                    last_transparency,
                                    new_rl->r_obindex);
       }
-      ba = ED_lineart_get_point_bounding_area_deep(rb, new_rv->fbcoord[0], new_rv->fbcoord[1]);
+      ba = ED_lineart_get_point_bounding_area_recursive_rb(
+          rb, new_rv->fbcoord[0], new_rv->fbcoord[1]);
     }
     if (rb->fuzzy_everything) {
       rlc->type = LRT_EDGE_FLAG_CONTOUR;
@@ -501,7 +503,8 @@ static LineartBoundingArea *lineart_bounding_area_get_end_point(LineartRenderBuf
   if (!rlci) {
     return NULL;
   }
-  LineartBoundingArea *root = ED_lineart_get_point_bounding_area(rb, rlci->pos[0], rlci->pos[1]);
+  LineartBoundingArea *root = ED_lineart_get_point_bounding_area_rb(
+      rb, rlci->pos[0], rlci->pos[1]);
   if (root == NULL) {
     return NULL;
   }
@@ -555,8 +558,8 @@ static void lineart_bounding_area_link_chain(LineartRenderBuffer *rb, LineartRen
 {
   LineartRenderLineChainItem *pl = rlc->chain.first;
   LineartRenderLineChainItem *pr = rlc->chain.last;
-  LineartBoundingArea *ba1 = ED_lineart_get_point_bounding_area(rb, pl->pos[0], pl->pos[1]);
-  LineartBoundingArea *ba2 = ED_lineart_get_point_bounding_area(rb, pr->pos[0], pr->pos[1]);
+  LineartBoundingArea *ba1 = ED_lineart_get_point_bounding_area_rb(rb, pl->pos[0], pl->pos[1]);
+  LineartBoundingArea *ba2 = ED_lineart_get_point_bounding_area_rb(rb, pr->pos[0], pr->pos[1]);
 
   if (ba1) {
     lineart_bounding_area_link_point_recursive(rb, ba1, rlc, pl);
@@ -783,7 +786,7 @@ static LineartChainRegisterEntry *lineart_chain_get_closest_cre(LineartRenderBuf
 
 /*  this only does head-tail connection. */
 /*  overlapping / tiny isolated segment / loop reduction not implemented here yet. */
-void ED_lineart_chain_connect(LineartRenderBuffer *rb, const int do_geometry_space)
+void ED_lineart_chain_connect(LineartRenderBuffer *rb, const bool do_geometry_space)
 {
   LineartRenderLineChain *rlc;
   LineartRenderLineChainItem *rlci_l, *rlci_r;
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index f107d443ff2..1b5074532c2 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -80,8 +80,8 @@
 
 /* static function declarations. */
 
-static LineartBoundingArea *linear_bounding_areat_first_possible(LineartRenderBuffer *rb,
-                                                                 LineartRenderLine *rl);
+static LineartBoundingArea *lineart_line_first_bounding_area(LineartRenderBuffer *rb,
+                                                             LineartRenderLine *rl);
 
 static void lineart_bounding_area_link_line(LineartRenderBuffer *rb,
                                             LineartBoundingArea *root_ba,
@@ -116,7 +116,8 @@ static int lineart_triangle_line_imagespace_intersection_v2(SpinLock *spl,
                                                             const LineartRenderTriangle *rt,
                                                             const LineartRenderLine *rl,


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list