[Bf-blender-cvs] [237175e7470] master: Cleanup: use doxy sections

Campbell Barton noreply at git.blender.org
Sun Feb 14 02:20:39 CET 2021


Commit: 237175e7470c7a7bda7a5bd128bcbcb059c84073
Author: Campbell Barton
Date:   Sun Feb 14 11:59:31 2021 +1100
Branches: master
https://developer.blender.org/rB237175e7470c7a7bda7a5bd128bcbcb059c84073

Cleanup: use doxy sections

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

M	source/blender/blenlib/intern/noise.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/space_nla/nla_edit.c
M	source/blender/editors/space_view3d/view3d_draw.c

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

diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index b770a267eee..996a1622239 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -36,6 +36,10 @@ static float noise3_perlin(const float vec[3]);
 /* UNUSED */
 // #define HASHVEC(x, y, z) hashvectf + 3 * hash[(hash[(hash[(z) & 255] + (y)) & 255] + (x)) & 255]
 
+/* -------------------------------------------------------------------- */
+/** \name Static Data
+ * \{ */
+
 /* needed for voronoi */
 #define HASHPNT(x, y, z) hashpntf + 3 * hash[(hash[(hash[(z)&255] + (y)) & 255] + (x)) & 255]
 static const float hashpntf[768] = {
@@ -263,9 +267,11 @@ static const float hashvectf[768] = {
     0.64801,   -0.100586, 0.114716,  0.044525,  -0.992371, 0.966003,  0.244873,  -0.082764,
 };
 
-/**************************/
-/*  IMPROVED PERLIN NOISE */
-/**************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Improved Perlin Noise Implementation (New)
+ * \{ */
 
 BLI_INLINE float lerp(float t, float a, float b)
 {
@@ -328,9 +334,11 @@ static float newPerlinU(float x, float y, float z)
   return (0.5f + 0.5f * newPerlin(x, y, z));
 }
 
-/**************************/
-/* END OF IMPROVED PERLIN */
-/**************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Improved Perlin Noise Implementation (Original)
+ * \{ */
 
 /* Was BLI_noise_hnoise(), removed noisesize, so other functions can call it without scaling. */
 static float orgBlenderNoise(float x, float y, float z)
@@ -855,9 +863,11 @@ float BLI_noise_hnoisep(float noisesize, float x, float y, float z)
   return noise3_perlin(vec);
 }
 
-/******************/
-/* VORONOI/WORLEY */
-/******************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Voronoi/Worley Implementation
+ * \{ */
 
 /* distance metrics for voronoi, e parameter only used in Minkowski */
 /* Camberra omitted, didn't seem useful */
@@ -1105,13 +1115,11 @@ static float voronoi_CrS(float x, float y, float z)
   return (2.0f * t - 1.0f);
 }
 
-/***************/
-/* voronoi end */
-/***************/
+/** \} */
 
-/*************/
-/* CELLNOISE */
-/*************/
+/* -------------------------------------------------------------------- */
+/** \name Cell-Noise Implementation
+ * \{ */
 
 /* returns unsigned cellnoise */
 static float BLI_cellNoiseU(float x, float y, float z)
@@ -1152,9 +1160,11 @@ void BLI_noise_cell_v3(float x, float y, float z, float ca[3])
   ca[2] = p[2];
 }
 
-/*****************/
-/* end cellnoise */
-/*****************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Public API's
+ * \{ */
 
 /* newnoise: generic noise function for use with different noisebases */
 float BLI_noise_generic_noise(
@@ -1747,6 +1757,4 @@ float BLI_noise_mg_variable_lacunarity(
   return noisefunc2(x + rv[0], y + rv[1], z + rv[2]); /* distorted-domain noise */
 }
 
-/****************/
-/* musgrave end */
-/****************/
+/** \} */
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index d7e30f2b65c..ec3eb9c6a3a 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -88,7 +88,9 @@
 
 #include "particle_edit_utildefines.h"
 
-/**************************** utilities *******************************/
+/* -------------------------------------------------------------------- */
+/** \name Public Utilities
+ * \{ */
 
 bool PE_poll(bContext *C)
 {
@@ -178,9 +180,56 @@ void PE_free_ptcache_edit(PTCacheEdit *edit)
   MEM_freeN(edit);
 }
 
-/************************************************/
-/*          Edit Mode Helpers                   */
-/************************************************/
+int PE_minmax(
+    Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, float min[3], float max[3])
+{
+  Object *ob = OBACT(view_layer);
+  PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
+  ParticleSystem *psys;
+  ParticleSystemModifierData *psmd_eval = NULL;
+  POINT_P;
+  KEY_K;
+  float co[3], mat[4][4];
+  int ok = 0;
+
+  if (!edit) {
+    return ok;
+  }
+
+  if ((psys = edit->psys)) {
+    psmd_eval = edit->psmd_eval;
+  }
+  else {
+    unit_m4(mat);
+  }
+
+  LOOP_VISIBLE_POINTS {
+    if (psys) {
+      psys_mat_hair_to_global(
+          ob, psmd_eval->mesh_final, psys->part->from, psys->particles + p, mat);
+    }
+
+    LOOP_SELECTED_KEYS {
+      copy_v3_v3(co, key->co);
+      mul_m4_v3(mat, co);
+      DO_MINMAX(co, min, max);
+      ok = 1;
+    }
+  }
+
+  if (!ok) {
+    BKE_object_minmax(ob, min, max, true);
+    ok = 1;
+  }
+
+  return ok;
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Edit Mode Helpers
+ * \{ */
 
 int PE_start_edit(PTCacheEdit *edit)
 {
@@ -409,7 +458,11 @@ static int pe_x_mirror(Object *ob)
   return 0;
 }
 
-/****************** common struct passed to callbacks ******************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Common Struct Passed to Callbacks
+ * \{ */
 
 typedef struct PEData {
   ViewContext vc;
@@ -519,7 +572,11 @@ static void PE_free_random_generator(PEData *data)
   }
 }
 
-/*************************** selection utilities *******************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Selection Utilities
+ * \{ */
 
 static bool key_test_depth(const PEData *data, const float co[3], const int screen_co[2])
 {
@@ -632,7 +689,11 @@ static bool point_is_selected(PTCacheEditPoint *point)
   return 0;
 }
 
-/*************************** iterators *******************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Iterators
+ * \{ */
 
 typedef void (*ForPointFunc)(PEData *data, int point_index);
 typedef void (*ForHitPointFunc)(PEData *data, int point_index, float mouse_distance);
@@ -905,9 +966,11 @@ static int count_selected_keys(Scene *scene, PTCacheEdit *edit)
   return sel;
 }
 
-/************************************************/
-/*          Particle Edit Mirroring             */
-/************************************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Particle Edit Mirroring
+ * \{ */
 
 static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
 {
@@ -1115,9 +1178,11 @@ static void PE_apply_mirror(Object *ob, ParticleSystem *psys)
   }
 }
 
-/************************************************/
-/*          Edit Calculation                    */
-/************************************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Edit Calculation
+ * \{ */
 
 typedef struct DeflectEmitterIter {
   Object *object;
@@ -1605,9 +1670,11 @@ void PE_update_object(Depsgraph *depsgraph, Scene *scene, Object *ob, int usefla
   }
 }
 
-/************************************************/
-/*          Edit Selections                     */
-/************************************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Edit Selections
+ * \{ */
 
 /*-----selection callbacks-----*/
 
@@ -1703,7 +1770,11 @@ static void toggle_key_select(PEData *data, int point_index, int key_index, bool
   data->is_changed = true;
 }
 
-/************************ de select all operator ************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name De-Select All Operator
+ * \{ */
 
 static bool select_action_apply(PTCacheEditPoint *point, PTCacheEditKey *key, int action)
 {
@@ -1794,7 +1865,11 @@ void PARTICLE_OT_select_all(wmOperatorType *ot)
   WM_operator_properties_select_all(ot);
 }
 
-/************************ pick select operator ************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Pick Select Operator
+ * \{ */
 
 bool PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
 {
@@ -1843,7 +1918,11 @@ bool PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool desele
   return true;
 }
 
-/************************ select root operator ************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Select Root Operator
+ * \{ */
 
 static void select_root(PEData *data, int point_index)
 {
@@ -1906,7 +1985,11 @@ void PARTICLE_OT_select_roots(wmOperatorType *ot)
   WM_operator_properties_select_action(ot, SEL_SELECT, false);
 }
 
-/************************ select tip operator ************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Select Tip Operator
+ * \{ */
 
 static void select_tip(PEData *data, int point_index)
 {
@@ -1977,7 +2060,11 @@ void PARTICLE_OT_select_tips(wmOperatorType *ot)
   WM_operator_properties_select_action(ot, SEL_SELECT, false);
 }
 
-/*********************** select random operator ************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Select Random Operator
+ * \{ */
 
 enum { RAN_HAIR, RAN_POINTS };
 
@@ -2064,7 +2151,11 @@ void PARTICLE_OT_select_random(wmOperatorType *ot)
                           "Select either hair or points");
 }
 
-/************************ select linked operator ************************/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Select Linked operator
+ * \{ */
 
 static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
 {
@@ -2146,7 +2237,12 @@ void PARTICLE_OT_select_linked_pick(wmOperatorType *ot)
   RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "", 0, 16384);
 }
 
-/************************ box select operator ************

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list