[Bf-blender-cvs] [99fc01019a8] temp-D5423-update: Cleanup: use doxy docs
Campbell Barton
noreply at git.blender.org
Fri Aug 9 09:13:12 CEST 2019
Commit: 99fc01019a89e30616df01cd18c331e647dbe652
Author: Campbell Barton
Date: Fri Aug 9 06:23:17 2019 +1000
Branches: temp-D5423-update
https://developer.blender.org/rB99fc01019a89e30616df01cd18c331e647dbe652
Cleanup: use doxy docs
===================================================================
M source/blender/blenlib/BLI_delaunay_2d.h
M source/blender/blenlib/intern/delaunay_2d.c
===================================================================
diff --git a/source/blender/blenlib/BLI_delaunay_2d.h b/source/blender/blenlib/BLI_delaunay_2d.h
index 4ec52b41cf9..f0bfd65788f 100644
--- a/source/blender/blenlib/BLI_delaunay_2d.h
+++ b/source/blender/blenlib/BLI_delaunay_2d.h
@@ -21,17 +21,17 @@
* \ingroup bli
*/
-/*
+/**
* Interface for Constrained Delaunay Triangulation (CDT) in 2D.
*
* The input is a set of vertices, edges between those vertices,
* and faces using those vertices.
* Those inputs are called "constraints". The output must contain
- * those contraints, or at least edges, points, and vertices that
+ * those constraints, or at least edges, points, and vertices that
* may be pieced together to form the constraints. Part of the
* work of doing the CDT is to detect intersections and mergers
* among the input elements, so these routines are also useful
- * for doing 2d intersection
+ * for doing 2d intersection.
*
* The output is a triangulation of the plane that includes the
* constraints in the above sense, and also satisfies the
@@ -51,10 +51,10 @@
* beforehand a bounding box for all of the constraints.
* This code can be extended in the future to allow for
* deletion of constraints, if there is a use in Blender
- * for dynmically maintaining a triangulation.
+ * for dynamically maintaining a triangulation.
*/
-/*
+/**
* Input to Constrained Delaunay Triangulation.
* There are num_vertex vertices, whose coordinates
* are given by vert_coords. For the rest of tne input,
@@ -75,7 +75,7 @@
* and need not be put in the edges array, which is intended
* as a way to specify edges that are not part of any face.
*
- * epsilon is used for "is it near enough" distance calculations.
+ * Epsilon is used for "is it near enough" distance calculations.
*/
typedef struct CDT_input {
int num_verts;
@@ -89,7 +89,7 @@ typedef struct CDT_input {
float epsilon;
} CDT_input;
-/*
+/**
* A representation of the triangulation for output.
* See CDT_input for the representation of the output
* vertices, edges, and faces, all represented in
@@ -106,10 +106,11 @@ typedef struct CDT_input {
* a run-together array and a "start" and "len" extra array,
* similar triples are used to represent the output to input
* mapping of vertices, edges, and faces.
+ *
* Those triples are:
- * vert_orig, vert_orig_start, vert_orig_len
- * edge_eorig, edge_orig_start, edge_orig_len
- * face_orig, face_orig_start, face_orig_len
+ * - vert_orig, vert_orig_start, vert_orig_len
+ * - edge_eorig, edge_orig_start, edge_orig_len
+ * - face_orig, face_orig_start, face_orig_len
*
* For edges, the edge_orig triple can also say which original face
* edge is part of a given output edge. If an index in edge_orig
@@ -140,28 +141,28 @@ typedef struct CDT_result {
int *face_orig_len;
} CDT_result;
-/*
- * What triangles and edges of CDT are desired when getting output?
- *
- * CDT_FULL - all triangles, outer boundary is convex hull
- * CDT_INSIDE - all triangles fully enclosed by constraint edges or faces
- * CDT_CONSTRAINTS - only point, edge, and face constraints, and their intersections
- * CDT_CONSTRAINTS_VALID_BMESH - like CDT_CONSTRAINTS, but keep enough
- * edges so that any output faces that came from input faces can be made as valid
- * BMesh faces in Blender: that is, no vertex appears more than once and no isolated holes in
- * faces.
- */
+/** What triangles and edges of CDT are desired when getting output? */
typedef enum CDT_output_type {
+ /** All triangles, outer boundary is convex hull. */
CDT_FULL,
+ /** All triangles fully enclosed by constraint edges or faces. */
CDT_INSIDE,
+ /** Only point, edge, and face constraints, and their intersections. */
CDT_CONSTRAINTS,
+ /**
+ * Like CDT_CONSTRAINTS, but keep enough
+ * edges so that any output faces that came from input faces can be made as valid
+ * #BMesh faces in Blender: that is,
+ * no vertex appears more than once and no isolated holes in faces.
+ */
CDT_CONSTRAINTS_VALID_BMESH
} CDT_output_type;
-/* API interface to CDT.
+/**
+ * API interface to CDT.
* This returns a pointer to an allocated CDT_result.
* When the caller is finished with it, the caller
- * should use BLI_constrained_delaunay_free() to free it.
+ * should use #BLI_constrained_delaunay_free() to free it.
*/
CDT_result *BLI_constrained_delaunay(const CDT_input *input, const CDT_output_type output_type);
diff --git a/source/blender/blenlib/intern/delaunay_2d.c b/source/blender/blenlib/intern/delaunay_2d.c
index f5bd7857d00..b00fd4555b8 100644
--- a/source/blender/blenlib/intern/delaunay_2d.c
+++ b/source/blender/blenlib/intern/delaunay_2d.c
@@ -33,7 +33,7 @@
#include "BLI_delaunay_2d.h"
-/* uncomment this define to get helpful debugging functions etc. defined */
+/* Uncomment this define to get helpful debugging functions etc. defined. */
#define DEBUG_CDT
struct CDTVert;
@@ -61,7 +61,7 @@ typedef struct CDTEdge {
} CDTEdge;
typedef struct CDTFace {
- double centroid[2]; /* avearge of vertex coords */
+ double centroid[2]; /* average of vertex coords */
SymEdge *symedge; /* a symedge in face; only used during output */
LinkNode *input_ids; /* list of input face ids that this is part of */
int visit_index; /* which visit epoch has this been seen */
@@ -97,8 +97,10 @@ typedef struct LocateResult {
#define DLNY_ARENASIZE 1 << 14
-/* This margin means that will only be a 1 degree possible
- * concavity on outside if remove all border touching triangles */
+/**
+ * This margin means that will only be a 1 degree possible
+ * concavity on outside if remove all border touching triangles.
+ */
#define DLNY_MARGIN_PCT 2000.0
#ifdef DEBUG_CDT
@@ -199,7 +201,7 @@ static int isect_seg_seg_v2_lambda_mu_db(const double v1[2],
return ISECT_LINE_LINE_NONE;
}
-/* return 1 if a,b,c forms CCW angle, -1 if a CW angle, 0 if straight */
+/** return 1 if a,b,c forms CCW angle, -1 if a CW angle, 0 if straight */
static int CCW_test(const double a[2], const double b[2], const double c[2])
{
double det;
@@ -218,7 +220,7 @@ static int CCW_test(const double a[2], const double b[2], const double c[2])
return 0;
}
-/* return true if a -- b -- c are in that order, assuming they are on a straight line */
+/** return true if a -- b -- c are in that order, assuming they are on a straight line */
static bool in_line(const double a[2], const double b[2], const double c[2])
{
double dir_ab[2], dir_ac[2];
@@ -228,7 +230,7 @@ static bool in_line(const double a[2], const double b[2], const double c[2])
return dot_v2v2_db(dir_ab, dir_ac) >= 0.0;
}
-/* Is s2 reeachable from s1 by next pointers with < limit hops? */
+/** Is s2 reeachable from s1 by next pointers with < limit hops? */
static bool reachable(SymEdge *s1, SymEdge *s2, int limit)
{
int count = 0;
@@ -255,7 +257,7 @@ static void calc_face_centroid(SymEdge *se)
centroidp[1] /= count;
}
-/* Using array to store these instead of linked list so can make a random selection from them */
+/** Using array to store these instead of linked list so can make a random selection from them */
static CDTVert *add_cdtvert(CDT_state *cdt, double x, double y)
{
CDTVert *v = BLI_memarena_alloc(cdt->arena, sizeof(*v));
@@ -319,7 +321,7 @@ static bool id_in_list(const LinkNode *id_list, int id)
return false;
}
-/* is any id in (range_start, range_start+1, ... , range_end) in id_list? */
+/** is any id in (range_start, range_start+1, ... , range_end) in id_list? */
static bool id_range_in_list(const LinkNode *id_list, int range_start, int range_end)
{
const LinkNode *ln;
@@ -349,13 +351,13 @@ static void add_list_to_input_ids(LinkNode **dst, const LinkNode *src, CDT_state
}
}
-/* Return other SymEdge for same CDTEdge as se */
+/** Return other SymEdge for same CDTEdge as se */
static inline SymEdge *sym(const SymEdge *se)
{
return se->next->rot;
}
-/* Return SymEdge whose next is se */
+/** Return SymEdge whose next is se */
static inline SymEdge *prev(const SymEdge *se)
{
return se->rot->next->rot;
@@ -366,7 +368,7 @@ static inline bool is_border_edge(const CDTEdge *e, const CDT_state *cdt)
return e->symedges[0].face == cdt->outer_face || e->symedges[1].face == cdt->outer_face;
}
-/* Does one edge of this edge touch the frame? */
+/** Does one edge of this edge touch the frame? */
static bool edge_touches_frame(const CDTEdge *e)
{
return e->symedges[0].vert->index < 4 || e->symedges[1].vert->index < 4;
@@ -382,7 +384,7 @@ static inline bool is_deleted_edge(const CDTEdge *e)
return e->symedges[0].next == NULL;
}
-/* Is there already an edge between a and b? */
+/** Is there already an edge between a and b? */
static bool exists_edge(const CDTVert *a, const CDTVert *b)
{
SymEdge *se, *ss;
@@ -396,7 +398,8 @@ static bool exists_edge(const CDTVert *a, const CDTVert *b)
return false;
}
-/* Assume s1 and s2 are both SymEdges in a face with > 3 sides,
+/**
+ * Assume s1 and s2 are both SymEdges in a face with > 3 sides,
* and one is not the next of the other.
* Add an edge from s1->v to s2->v, splitting the face in two.
* The original face will continue to be associated with the subface
@@ -482,12 +485,13 @@ static CDTEdge *split_edge(CDT_state *cdt, SymEdge *se, double lambda)
return e;
}
-/* Delete an edge from the structure. The new combined face on either side of
+/**
+ * Delete an edge from the structure. The new combined face on either side of
* the deleted edge will be the one that was e's face; the centroid is updated.
* There will be now an unused face, marked by setting its deleted flag,
* and an unused CDTEdge, marked by setting the next and rot pointers of
* its SymEdges to NULL.
- *
+ * <pre>
* . v2 .
* / \ / \
* /f|j\ / \
@@ -498,7 +502,7 @@ static CDTEdge *split_edge(CDT_state *cdt, SymEdge *se, double lambda)
* \ | / \ /
* \h|i/ \ /
* . v1 .
- *
+ * </pre>
* Also handle variant cases where one or both ends
* are attached only to e.
*/
@@ -559,7 +563,7 @@ static vo
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list