[Bf-blender-cvs] [e0cb0258701] newboolean: Cleanup: mostly comments, use doxy syntax & typos

Campbell Barton noreply at git.blender.org
Thu Aug 27 10:53:28 CEST 2020


Commit: e0cb02587012b4b2f4b18363dc7d0a7da2c02093
Author: Campbell Barton
Date:   Thu Aug 27 18:18:47 2020 +1000
Branches: newboolean
https://developer.blender.org/rBe0cb02587012b4b2f4b18363dc7d0a7da2c02093

Cleanup: mostly comments, use doxy syntax & typos

- Use doxy syntax for functions.
- Use `pragma once` for header guard.

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

M	build_files/build_environment/cmake/versions.cmake
M	source/blender/blenlib/BLI_delaunay_2d.h
M	source/blender/blenlib/BLI_double2.hh
M	source/blender/blenlib/BLI_double3.hh
M	source/blender/blenlib/BLI_math_mpq.hh
M	source/blender/blenlib/BLI_mesh_boolean.hh
M	source/blender/blenlib/BLI_mesh_intersect.hh
M	source/blender/blenlib/BLI_mpq2.hh
M	source/blender/blenlib/BLI_mpq3.hh
M	source/blender/blenlib/intern/delaunay_2d.cc
M	source/blender/blenlib/intern/math_vec.cc
M	source/blender/blenlib/intern/math_vector.c
M	source/blender/blenlib/intern/mesh_boolean.cc
M	source/blender/blenlib/intern/mesh_intersect.cc
M	source/blender/blenlib/tests/BLI_mesh_intersect_test.cc
M	source/blender/bmesh/tools/bmesh_boolean.cc
M	source/blender/bmesh/tools/bmesh_boolean.h

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

diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index 37bfac8bfba..30a0b1184c2 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -317,6 +317,5 @@ set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
 set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
 
 set(GMP_VERSION 6.2.0)
-
 set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
 set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
diff --git a/source/blender/blenlib/BLI_delaunay_2d.h b/source/blender/blenlib/BLI_delaunay_2d.h
index cd5838d9b29..7027477ac7f 100644
--- a/source/blender/blenlib/BLI_delaunay_2d.h
+++ b/source/blender/blenlib/BLI_delaunay_2d.h
@@ -239,9 +239,10 @@ template<typename Arith_t> class CDT_result {
   Array<vec2<Arith_t>> vert;
   Array<std::pair<int, int>> edge;
   Array<Vector<int>> face;
-  /* For each output vert, which input verts correspond to it? */
+  /** For each output vert, which input verts correspond to it? */
   Array<Vector<int>> vert_orig;
-  /* For each output edge, which input edges does it overlap?
+  /**
+   * For each output edge, which input edges does it overlap?
    * The input edge ids are encoded as follows:
    *   if the value is less than face_edge_offset, then it is
    *      an index into the input edge[] array.
@@ -250,9 +251,9 @@ template<typename Arith_t> class CDT_result {
    *      and "b" will be a position within that face.
    */
   Array<Vector<int>> edge_orig;
-  /* For each output face, which original faces does it overlap? */
+  /** For each output face, which original faces does it overlap? */
   Array<Vector<int>> face_orig;
-  /* Used to encode edge_orig (see above). */
+  /** Used to encode edge_orig (see above). */
   int face_edge_offset;
 };
 
@@ -265,4 +266,4 @@ CDT_result<mpq_class> delaunay_2d_calc(const CDT_input<mpq_class> &input,
 
 } /* namespace blender::meshintersect */
 
-#endif /* __cplusplus */
\ No newline at end of file
+#endif /* __cplusplus */
diff --git a/source/blender/blenlib/BLI_double2.hh b/source/blender/blenlib/BLI_double2.hh
index 654207d98f1..37584729498 100644
--- a/source/blender/blenlib/BLI_double2.hh
+++ b/source/blender/blenlib/BLI_double2.hh
@@ -16,6 +16,10 @@
 
 #pragma once
 
+/** \file
+ * \ingroup bli
+ */
+
 #include "BLI_double3.hh"
 
 namespace blender {
diff --git a/source/blender/blenlib/BLI_double3.hh b/source/blender/blenlib/BLI_double3.hh
index 4884b8f287c..f783055590a 100644
--- a/source/blender/blenlib/BLI_double3.hh
+++ b/source/blender/blenlib/BLI_double3.hh
@@ -16,6 +16,10 @@
 
 #pragma once
 
+/** \file
+ * \ingroup bli
+ */
+
 #include <iostream>
 
 #include "BLI_math_vector.h"
@@ -237,11 +241,10 @@ struct double3 {
 
   static double3 cross_poly(Span<double3> poly);
 
-  /* orient3d gives the exact result, using multiprecision artihmetic when result
+  /* #orient3d gives the exact result, using multi-precision arithmetic when result
    * is close to zero. orient3d_fast just uses double arithmetic, so may be
    * wrong if the answer is very close to zero.
-   * Similarly, for insphere and insphere_fast.
-   */
+   * Similarly, for #insphere and #insphere_fast. */
   static int orient3d(const double3 &a, const double3 &b, const double3 &c, const double3 &d);
 
   static int orient3d_fast(const double3 &a, const double3 &b, const double3 &c, const double3 &d);
diff --git a/source/blender/blenlib/BLI_math_mpq.hh b/source/blender/blenlib/BLI_math_mpq.hh
index 2ed0c9549c8..dd973bf9f64 100644
--- a/source/blender/blenlib/BLI_math_mpq.hh
+++ b/source/blender/blenlib/BLI_math_mpq.hh
@@ -16,6 +16,10 @@
 
 #pragma once
 
+/** \file
+ * \ingroup bli
+ */
+
 #ifdef WITH_GMP
 
 /* This file uses an external file header to define the multiprecision
diff --git a/source/blender/blenlib/BLI_mesh_boolean.hh b/source/blender/blenlib/BLI_mesh_boolean.hh
index 2b5afb2bffc..693639f20f2 100644
--- a/source/blender/blenlib/BLI_mesh_boolean.hh
+++ b/source/blender/blenlib/BLI_mesh_boolean.hh
@@ -28,17 +28,19 @@
 
 namespace blender::meshintersect {
 
-/* Enum values after BOOLEAN_NONE need to match BMESH_ISECT_BOOLEAN_... values in
+/**
+ * Enum values after BOOLEAN_NONE need to match BMESH_ISECT_BOOLEAN_... values in
  * editmesh_intersect.c. */
 enum class BoolOpType {
   None = -1,
-  /* Aligned with BooleanModifierOp. */
+  /* Aligned with #BooleanModifierOp. */
   Intersect = 0,
   Union = 1,
   Difference = 2,
 };
 
-/* Do the boolean operation op on the mesh pm_in.
+/**
+ * Do the boolean operation op on the mesh pm_in.
  * The boolean operation has nshapes input shapes. Each is a disjoint subset of the input mesh.
  * The shape_fn argument, when applied to an input face argument, says which shape it is in
  * (should be a value from -1 to nshapes - 1: if -1, it is not part of any shape).
@@ -60,7 +62,8 @@ IMesh boolean_mesh(IMesh &imesh,
                    IMesh *pm_triangulated,
                    IMeshArena *arena);
 
-/* This is like boolean, but operates on IMesh's whose faces are all triangles.
+/**
+ * This is like boolean, but operates on IMesh's whose faces are all triangles.
  * It is exposed mainly for unit testing, at the moment: boolean_mesh() uses
  * it to do most of its work.
  */
diff --git a/source/blender/blenlib/BLI_mesh_intersect.hh b/source/blender/blenlib/BLI_mesh_intersect.hh
index 6e2a9a6424b..877363b998a 100644
--- a/source/blender/blenlib/BLI_mesh_intersect.hh
+++ b/source/blender/blenlib/BLI_mesh_intersect.hh
@@ -41,7 +41,8 @@ namespace blender::meshintersect {
 
 constexpr int NO_INDEX = -1;
 
-/* Vertex coordinates are stored both as double3 and mpq3, which should agree.
+/**
+ * Vertex coordinates are stored both as #double3 and #mpq3, which should agree.
  * Most calculations are done in exact arithmetic, using the mpq3 version,
  * but some predicates can be sped up by operating on doubles and using error analysis
  * to find the cases where that is good enough.
@@ -49,8 +50,8 @@ constexpr int NO_INDEX = -1;
  * is useful for making algorithms that don't depend on pointers.
  * Also, they are easier to read while debugging.
  * They also carry an orig index, which can be used to tie them back to
- * vertices that tha caller may have in a different way (e.g., BMVerts).
- * An orig index can be NO_INDEX, indicating the Vert was created by
+ * vertices that the caller may have in a different way (e.g., #BMVert).
+ * An orig index can be #NO_INDEX, indicating the Vert was created by
  * the algorithm and doesn't match an original Vert.
  * Vertices can be reliably compared for equality,
  * and hashed (on their co_exact field).
@@ -65,20 +66,21 @@ struct Vert {
   Vert(const mpq3 &mco, const double3 &dco, int id, int orig);
   ~Vert() = default;
 
-  /* Test equality on the co_exact field. */
+  /** Test equality on the co_exact field. */
   bool operator==(const Vert &other) const;
 
-  /* Hash on the co_exact field. */
+  /** Hash on the co_exact field. */
   uint64_t hash() const;
 };
 
 std::ostream &operator<<(std::ostream &os, const Vert *v);
 
-/* A Plane whose equation is dot(norm, p) + d = 0.
+/**
+ * A Plane whose equation is `dot(norm, p) + d = 0`.
  * The norm and d fields are always present, but the norm_exact
  * and d_exact fields may be lazily populated. Since we don't
  * store degenerate planes, we can tell if a the exact versions
- * are not populated yet by having norm_exact == 0.
+ * are not populated yet by having `norm_exact == 0`.
  */
 struct Plane {
   mpq3 norm_exact;
@@ -103,9 +105,10 @@ struct Plane {
 
 std::ostream &operator<<(std::ostream &os, const Plane *plane);
 
-/* A Face has a sequence of Verts that for a CCW ordering around them.
+/**
+ * A #Face has a sequence of Verts that for a CCW ordering around them.
  * Faces carry an index, created at allocation time, useful for making
- * pointer-indenpendent algorithms, and for debugging.
+ * pointer-independent algorithms, and for debugging.
  * They also carry an original index, meaningful to the caller.
  * And they carry original edge indices too: each is a number meaningful
  * to the caller for the edge starting from the corresponding face position.
@@ -115,7 +118,7 @@ std::ostream &operator<<(std::ostream &os, const Plane *plane);
  * for each edge whether or not it is the result of intersecting
  * with another face in the intersect algorithm.
  * Since the intersect algorithm needs the plane for each face,
- * a Face also stores the Plane of the face, but this is only
+ * a #Face also stores the Plane of the face, but this is only
  * populate later because not all faces will be intersected.
  */
 struct Face : NonCopyable {
@@ -189,11 +192,12 @@ struct Face : NonCopyable {
 
 std::ostream &operator<<(std::ostream &os, const Face *f);
 
-/* IMeshArena is the owner of the Vert and Face resources used
- * during a run of one of the meshintersect main functions.
+/**
+ * #IMeshArena is the owner of the Vert and Face resources used
+ * during a run of one of the mesh-intersect main functions.
  * It also keeps has a hash table of all Verts created so that it can
  * ensure that only one instance of a Vert with a given co_exact will
- * exist. I.e., it dedups the vertices.
+ * exist. I.e., it de-duplicates the vertices.
  */
 class IMeshArena : NonCopyable, NonMovable {
   class IMeshArenaImpl;
@@ -203,7 +207,8 @@ class IMeshArena : NonCopyable, NonMovable {
   IMeshArena();
   ~IMeshArena();
 
-  /* Provide hints to number of expected Verts and Faces expected
+  /**
+   * Provide hints to number of expected Verts and Faces expected
    * to be allocated.
    */
   void reserve(int vert_num_hint, int face_num_hint);
@@ -211,7 +216,8 @@ class IMeshArena : NonCopyable, NonMovable {
   int tot_allocated_verts() const;
   int tot_allocated_faces() const;
 
-  /* These add routines find and return an existing Vert with the same
+  /**
+   * These add routines find and return an existing Vert with the same
    * co_exact, if it exists (the orig argument is ignored in this case),
    * or else allocates and returns a new one. The index field of a
    * newly allocated Vert will be the index in creation ord

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list