Revision: 73096
http://sourceforge.net/p/brlcad/code/73096
Author: brlcad
Date: 2019-05-20 18:58:50 +0000 (Mon, 20 May 2019)
Log Message:
-----------
autoformat most of the headers for consistency using batch ws indenting. emacs
gets it wrong in a few places so this can't be automated, but closer for
clang-format or astyle.
Modified Paths:
--------------
brlcad/trunk/include/analyze.h
brlcad/trunk/include/bg/chull.h
brlcad/trunk/include/bg/obr.h
brlcad/trunk/include/bg/polygon.h
brlcad/trunk/include/bg/spsr.h
brlcad/trunk/include/bg/trimesh.h
brlcad/trunk/include/bn/anim.h
brlcad/trunk/include/bn/dvec.h
brlcad/trunk/include/bn/mat.h
brlcad/trunk/include/bn/plane.h
brlcad/trunk/include/bn/plot3.h
brlcad/trunk/include/bn/rand.h
brlcad/trunk/include/bn/sobol.h
brlcad/trunk/include/bn/vector_x86.h
brlcad/trunk/include/bnetwork.h
brlcad/trunk/include/brep/bbnode.h
brlcad/trunk/include/brep/boolean.h
brlcad/trunk/include/brep/brnode.h
brlcad/trunk/include/brep/cdt.h
brlcad/trunk/include/brep/csg.h
brlcad/trunk/include/brep/curvetree.h
brlcad/trunk/include/brep/defines.h
brlcad/trunk/include/brep/intersect.h
brlcad/trunk/include/brep/pullback.h
brlcad/trunk/include/brep/ray.h
brlcad/trunk/include/brep/surfacetree.h
brlcad/trunk/include/brep/util.h
brlcad/trunk/include/bu/avs.h
brlcad/trunk/include/bu/bitv.h
brlcad/trunk/include/bu/color.h
brlcad/trunk/include/bu/cv.h
brlcad/trunk/include/bu/file.h
brlcad/trunk/include/bu/hash.h
brlcad/trunk/include/bu/list.h
brlcad/trunk/include/bu/log.h
brlcad/trunk/include/bu/magic.h
brlcad/trunk/include/bu/malloc.h
brlcad/trunk/include/bu/observer.h
brlcad/trunk/include/bu/opt.h
brlcad/trunk/include/bu/parallel.h
brlcad/trunk/include/bu/parse.h
brlcad/trunk/include/bu/path.h
brlcad/trunk/include/bu/redblack.h
brlcad/trunk/include/bu/sort.h
brlcad/trunk/include/bu/str.h
brlcad/trunk/include/bu/tc.h
brlcad/trunk/include/bu/time.h
brlcad/trunk/include/bu/uuid.h
brlcad/trunk/include/bu/vls.h
brlcad/trunk/include/common.h
brlcad/trunk/include/dm.h
brlcad/trunk/include/fb.h
brlcad/trunk/include/ged/commands.h
brlcad/trunk/include/ged/debug.h
brlcad/trunk/include/ged/objects.h
brlcad/trunk/include/ged/view.h
brlcad/trunk/include/icv/colorspace.h
brlcad/trunk/include/icv/defines.h
brlcad/trunk/include/icv/filters.h
brlcad/trunk/include/libtermio.h
brlcad/trunk/include/nmg.h
brlcad/trunk/include/pkg.h
brlcad/trunk/include/rt/anim.h
brlcad/trunk/include/rt/application.h
brlcad/trunk/include/rt/binunif.h
brlcad/trunk/include/rt/boolweave.h
brlcad/trunk/include/rt/calc.h
brlcad/trunk/include/rt/cmd.h
brlcad/trunk/include/rt/comb.h
brlcad/trunk/include/rt/db4.h
brlcad/trunk/include/rt/db_attr.h
brlcad/trunk/include/rt/db_diff.h
brlcad/trunk/include/rt/db_fullpath.h
brlcad/trunk/include/rt/db_internal.h
brlcad/trunk/include/rt/db_io.h
brlcad/trunk/include/rt/defines.h
brlcad/trunk/include/rt/directory.h
brlcad/trunk/include/rt/dspline.h
brlcad/trunk/include/rt/hit.h
brlcad/trunk/include/rt/mem.h
brlcad/trunk/include/rt/misc.h
brlcad/trunk/include/rt/nmg.h
brlcad/trunk/include/rt/nongeom.h
brlcad/trunk/include/rt/overlap.h
brlcad/trunk/include/rt/pattern.h
brlcad/trunk/include/rt/prep.h
brlcad/trunk/include/rt/primitives/annot.h
brlcad/trunk/include/rt/primitives/arb8.h
brlcad/trunk/include/rt/primitives/bot.h
brlcad/trunk/include/rt/primitives/brep.h
brlcad/trunk/include/rt/primitives/dsp.h
brlcad/trunk/include/rt/primitives/ell.h
brlcad/trunk/include/rt/primitives/epa.h
brlcad/trunk/include/rt/primitives/metaball.h
brlcad/trunk/include/rt/primitives/pg.h
brlcad/trunk/include/rt/primitives/pipe.h
brlcad/trunk/include/rt/primitives/rhc.h
brlcad/trunk/include/rt/primitives/rpc.h
brlcad/trunk/include/rt/primitives/sketch.h
brlcad/trunk/include/rt/primitives/tgc.h
brlcad/trunk/include/rt/primitives/tor.h
brlcad/trunk/include/rt/ray_partition.h
brlcad/trunk/include/rt/region.h
brlcad/trunk/include/rt/rt_instance.h
brlcad/trunk/include/rt/search.h
brlcad/trunk/include/rt/seg.h
brlcad/trunk/include/rt/shoot.h
brlcad/trunk/include/rt/solid.h
brlcad/trunk/include/rt/space_partition.h
brlcad/trunk/include/rt/timer.h
brlcad/trunk/include/rt/tree.h
brlcad/trunk/include/rt/view.h
brlcad/trunk/include/rt/vlist.h
brlcad/trunk/include/rt/wdb.h
brlcad/trunk/include/tclcad.h
Modified: brlcad/trunk/include/analyze.h
===================================================================
--- brlcad/trunk/include/analyze.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/analyze.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -266,7 +266,7 @@
ANALYZE_EXPORT int
analyze_raydiff(struct analyze_raydiff_results **results, struct db_i *dbip,
- const char *left, const char *right, struct bn_tol *tol, int
solidcheck);
+ const char *left, const char *right, struct bn_tol *tol, int
solidcheck);
ANALYZE_EXPORT void
analyze_raydiff_results_free(struct analyze_raydiff_results *results);
@@ -294,8 +294,8 @@
ANALYZE_EXPORT int
analyze_find_subtracted(struct bu_ptbl *results, struct rt_wdb *wdbp,
- const char *pbrep, struct rt_gen_worker_vars *pbrep_rtvars,
- const char *curr_comb, struct bu_ptbl *candidates, void
*curr_union_data, size_t ncpus);
+ const char *pbrep, struct rt_gen_worker_vars
*pbrep_rtvars,
+ const char *curr_comb, struct bu_ptbl *candidates, void
*curr_union_data, size_t ncpus);
ANALYZE_EXPORT void
analyze_heal_bot(struct rt_bot_internal *bot, double zipper_tol);
@@ -425,7 +425,7 @@
#define ANALYZE_OBJ_TO_PNTS_RAND 0x4 /**< @brief sample using Marsaglia
sampling on the bounding sphere with pseudo random numbers */
#define ANALYZE_OBJ_TO_PNTS_SOBOL 0x8 /**< @brief sample using Marsaglia
sampling on the bounding sphere with Sobol' low-discrepancy-sequence generation
*/
ANALYZE_EXPORT int analyze_obj_to_pnts(struct rt_pnts_internal *rpnts, double
*avg_thickness, struct db_i *dbip,
- const char *obj, struct bn_tol *tol, int flags, int max_pnts,
int max_time, int verbosity);
+ const char *obj, struct bn_tol *tol, int
flags, int max_pnts, int max_time, int verbosity);
struct analyze_polygonize_params {
int max_time;
Modified: brlcad/trunk/include/bg/chull.h
===================================================================
--- brlcad/trunk/include/bg/chull.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bg/chull.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -118,9 +118,9 @@
*
* This routine is based off of Antti Kuukka's implementation of the QuickHull
* algorithm: https://github.com/akuukka/quickhull implementation
-*/
+ */
BG_EXPORT int bg_3d_chull(int **faces, int *num_faces, point_t **vertices, int
*num_vertices,
- const point_t *input_points_3d, int num_input_pnts);
+ const point_t *input_points_3d, int num_input_pnts);
__END_DECLS
Modified: brlcad/trunk/include/bg/obr.h
===================================================================
--- brlcad/trunk/include/bg/obr.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bg/obr.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -91,10 +91,10 @@
* @param pnt_cnt number of points in pnts array
*/
BG_EXPORT extern int bg_3d_coplanar_obr(point_t *center,
- vect_t *v1,
- vect_t *v2,
- const point_t *points_3d,
- int pnt_cnt);
+ vect_t *v1,
+ vect_t *v2,
+ const point_t *points_3d,
+ int pnt_cnt);
/**
*@brief
Modified: brlcad/trunk/include/bg/polygon.h
===================================================================
--- brlcad/trunk/include/bg/polygon.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bg/polygon.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -36,9 +36,9 @@
__BEGIN_DECLS
-/*********************************************************
- Operations on 2D point types
- *********************************************************/
+/********************************
+ * Operations on 2D point types *
+ ********************************/
/**
* @brief
@@ -127,9 +127,9 @@
* @return 1 if triangulation is unsuccessful
*/
BG_EXPORT extern int bg_nested_polygon_triangulate(int **faces, int
*num_faces, point2d_t **out_pts, int *num_outpts,
- const int *poly, const size_t poly_npts,
- const int **holes_array, const size_t *holes_npts, const size_t
nholes,
- const point2d_t *pts, const size_t npts, triangulation_t type);
+ const int *poly, const
size_t poly_npts,
+ const int **holes_array,
const size_t *holes_npts, const size_t nholes,
+ const point2d_t *pts, const
size_t npts, triangulation_t type);
/**
* @brief
@@ -158,13 +158,13 @@
* @return 1 if triangulation is unsuccessful
*/
BG_EXPORT extern int bg_polygon_triangulate(int **faces, int *num_faces,
point2d_t **out_pts, int *num_outpts,
- const point2d_t *pts, const size_t npts, triangulation_t type);
+ const point2d_t *pts, const size_t
npts, triangulation_t type);
/*********************************************************
Operations on 3D point types - these are assumed to be
polygons embedded in 3D planes in space
- *********************************************************/
+*********************************************************/
/**
* @brief
Modified: brlcad/trunk/include/bg/spsr.h
===================================================================
--- brlcad/trunk/include/bg/spsr.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bg/spsr.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -128,27 +128,27 @@
#define BG_3D_SPSR_DEFAULT_LINEARFIT 0
#define BG_3D_SPSR_DEFAULT_EXACT 1
-#define BG_3D_SPSR_OPTS_DEFAULT { \
- BG_3D_SPSR_DEFAULT_DEGREE , \
- BG_3D_SPSR_BOUNDARY_NEUMANN , \
- BG_3D_SPSR_DEFAULT_DEPTH , \
- BG_3D_SPSR_DEFAULT_KERNELDEPTH , \
- BG_3D_SPSR_DEFAULT_ITERATIONS , \
- BG_3D_SPSR_DEFAULT_FULL_DEPTH , \
- BG_3D_SPSR_DEFAULT_BASE_DEPTH , \
- BG_3D_SPSR_DEFAULT_BASEVCYCLES , \
- BG_3D_SPSR_DEFAULT_MAX_MEM , \
- BG_3D_SPSR_DEFAULT_THREADS , \
- BG_3D_SPSR_DEFAULT_SAMPLES_PER_NODE , \
- BG_3D_SPSR_DEFAULT_SCALE , \
- BG_3D_SPSR_DEFAULT_WIDTH , \
- BG_3D_SPSR_DEFAULT_CONFIDENCE , \
- BG_3D_SPSR_DEFAULT_CONFIDENCE_BIAS , \
- BG_3D_SPSR_DEFAULT_CGSOLVER_ACCURACY, \
- BG_3D_SPSR_DEFAULT_POINT_WEIGHT , \
- BG_3D_SPSR_DEFAULT_NONMANIFOLD , \
- BG_3D_SPSR_DEFAULT_LINEARFIT , \
- BG_3D_SPSR_DEFAULT_EXACT }
+#define BG_3D_SPSR_OPTS_DEFAULT { \
+ BG_3D_SPSR_DEFAULT_DEGREE , \
+ BG_3D_SPSR_BOUNDARY_NEUMANN , \
+ BG_3D_SPSR_DEFAULT_DEPTH , \
+ BG_3D_SPSR_DEFAULT_KERNELDEPTH , \
+ BG_3D_SPSR_DEFAULT_ITERATIONS , \
+ BG_3D_SPSR_DEFAULT_FULL_DEPTH , \
+ BG_3D_SPSR_DEFAULT_BASE_DEPTH , \
+ BG_3D_SPSR_DEFAULT_BASEVCYCLES , \
+ BG_3D_SPSR_DEFAULT_MAX_MEM , \
+ BG_3D_SPSR_DEFAULT_THREADS , \
+ BG_3D_SPSR_DEFAULT_SAMPLES_PER_NODE , \
+ BG_3D_SPSR_DEFAULT_SCALE , \
+ BG_3D_SPSR_DEFAULT_WIDTH , \
+ BG_3D_SPSR_DEFAULT_CONFIDENCE , \
+ BG_3D_SPSR_DEFAULT_CONFIDENCE_BIAS , \
+ BG_3D_SPSR_DEFAULT_CGSOLVER_ACCURACY, \
+ BG_3D_SPSR_DEFAULT_POINT_WEIGHT , \
+ BG_3D_SPSR_DEFAULT_NONMANIFOLD , \
+ BG_3D_SPSR_DEFAULT_LINEARFIT , \
+ BG_3D_SPSR_DEFAULT_EXACT }
/**
*@brief
@@ -168,8 +168,8 @@
*
*/
BG_EXPORT int bg_3d_spsr(int **faces, int *num_faces, point_t **vertices, int
*num_vertices,
- const point_t *input_points_3d, const vect_t
*input_normals_3d,
- int num_input_pnts, struct bg_3d_spsr_opts *opts);
+ const point_t *input_points_3d, const vect_t
*input_normals_3d,
+ int num_input_pnts, struct bg_3d_spsr_opts *opts);
__END_DECLS
Modified: brlcad/trunk/include/bg/trimesh.h
===================================================================
--- brlcad/trunk/include/bg/trimesh.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bg/trimesh.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -127,10 +127,10 @@
* a boolean evaluation, just characterizes faces */
BG_EXPORT extern int
bg_trimesh_isect(
- int **faces_inside_1, int *num_faces_inside_1, int **faces_inside_2,
int *num_faces_inside_2,
- int **faces_isect_1, int *num_faces_isect_1, int **faces_isect_2, int
*num_faces_isect_2,
- int *faces_1, int num_faces_1, point_t *vertices_1, int num_vertices_1,
- int *faces_2, int num_faces_2, point_t *vertices_2, int num_vertices_2);
+ int **faces_inside_1, int *num_faces_inside_1, int **faces_inside_2, int
*num_faces_inside_2,
+ int **faces_isect_1, int *num_faces_isect_1, int **faces_isect_2, int
*num_faces_isect_2,
+ int *faces_1, int num_faces_1, point_t *vertices_1, int num_vertices_1,
+ int *faces_2, int num_faces_2, point_t *vertices_2, int num_vertices_2);
__END_DECLS
Modified: brlcad/trunk/include/bn/anim.h
===================================================================
--- brlcad/trunk/include/bn/anim.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bn/anim.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -47,91 +47,97 @@
#define ANIM_STEER_NEW 0
#define ANIM_STEER_END 1
-#define VSUBUNIT(a, b, c) {VSUB2(a, b, c);\
- VUNITIZE(a);}
-#define FVSCAN(f, a) fscanf(f, "%lf %lf %lf", (a), (a)+1, (a)+2)
-#define FMATSCAN(f, m) {FVSCAN(f, (m)); FVSCAN(f, (m)+4);\
- FVSCAN(f, (m)+8); FVSCAN(f, (m)+12);}
-#define VSCAN(a) scanf("%lf %lf %lf", (a), (a)+1, (a)+2)
-#define VPRINTS(t, a) printf("%s %f %f %f ", t, (a)[0], (a)[1], (a)[2])
-#define VPRINTN(t, a) printf("%s %f %f %f\n", t, (a)[0], (a)[1], (a)[2])
+#define VSUBUNIT(a, b, c) { \
+ VSUB2(a, b, c); \
+ VUNITIZE(a); \
+ }
+#define FVSCAN(f, a) fscanf(f, "%lf %lf %lf", (a), (a)+1, (a)+2)
+#define FMATSCAN(f, m) { \
+ FVSCAN(f, (m)); \
+ FVSCAN(f, (m)+4); \
+ FVSCAN(f, (m)+8); \
+ FVSCAN(f, (m)+12); \
+ }
+#define VSCAN(a) scanf("%lf %lf %lf", (a), (a)+1, (a)+2)
+#define VPRINTS(t, a) printf("%s %f %f %f ", t, (a)[0], (a)[1], (a)[2])
+#define VPRINTN(t, a) printf("%s %f %f %f\n", t, (a)[0], (a)[1], (a)[2])
-#define MAT_MOVE(m, n) MAT_COPY(m, n)
+#define MAT_MOVE(m, n) MAT_COPY(m, n)
/***** 3x3 matrix format *****/
-typedef fastf_t mat3_t[9];
+typedef fastf_t mat3_t[9];
#define MAT3ZERO(m) {\
- int _j; for (_j=0;_j<9;_j++) m[_j]=0.0;}
+ int _j; for (_j=0;_j<9;_j++) m[_j]=0.0;}
#define MAT3IDN(m) {\
- int _j; for (_j=0;_j<9;_j++) m[_j]=0.0;\
- m[0] = m[4] = m[8] = 1.0;}
+ int _j; for (_j=0;_j<9;_j++) m[_j]=0.0;\
+ m[0] = m[4] = m[8] = 1.0;}
#define MAT3MUL(o, a, b) {\
- (o)[0] = (a)[0]*(b)[0] + (a)[1]*(b)[3] + (a)[2]*(b)[6];\
- (o)[1] = (a)[0]*(b)[1] + (a)[1]*(b)[4] + (a)[2]*(b)[7];\
- (o)[2] = (a)[0]*(b)[2] + (a)[1]*(b)[5] + (a)[2]*(b)[8];\
- (o)[3] = (a)[3]*(b)[0] + (a)[4]*(b)[3] + (a)[5]*(b)[6];\
- (o)[4] = (a)[3]*(b)[1] + (a)[4]*(b)[4] + (a)[5]*(b)[7];\
- (o)[5] = (a)[3]*(b)[2] + (a)[4]*(b)[5] + (a)[5]*(b)[8];\
- (o)[6] = (a)[6]*(b)[0] + (a)[7]*(b)[3] + (a)[8]*(b)[6];\
- (o)[7] = (a)[6]*(b)[1] + (a)[7]*(b)[4] + (a)[8]*(b)[7];\
- (o)[8] = (a)[6]*(b)[2] + (a)[7]*(b)[5] + (a)[8]*(b)[8];}
+ (o)[0] = (a)[0]*(b)[0] + (a)[1]*(b)[3] + (a)[2]*(b)[6];\
+ (o)[1] = (a)[0]*(b)[1] + (a)[1]*(b)[4] + (a)[2]*(b)[7];\
+ (o)[2] = (a)[0]*(b)[2] + (a)[1]*(b)[5] + (a)[2]*(b)[8];\
+ (o)[3] = (a)[3]*(b)[0] + (a)[4]*(b)[3] + (a)[5]*(b)[6];\
+ (o)[4] = (a)[3]*(b)[1] + (a)[4]*(b)[4] + (a)[5]*(b)[7];\
+ (o)[5] = (a)[3]*(b)[2] + (a)[4]*(b)[5] + (a)[5]*(b)[8];\
+ (o)[6] = (a)[6]*(b)[0] + (a)[7]*(b)[3] + (a)[8]*(b)[6];\
+ (o)[7] = (a)[6]*(b)[1] + (a)[7]*(b)[4] + (a)[8]*(b)[7];\
+ (o)[8] = (a)[6]*(b)[2] + (a)[7]*(b)[5] + (a)[8]*(b)[8];}
#define MAT3SUM(o, a, b) {\
- int _j; for (_j=0;_j<9;_j++) (o)[_j]=(a)[_j]+(b)[_j];}
+ int _j; for (_j=0;_j<9;_j++) (o)[_j]=(a)[_j]+(b)[_j];}
#define MAT3DIF(o, a, b) {\
- int _j; for (_j=0;_j<9;_j++) (o)[_j]=(a)[_j]-(b)[_j];}
+ int _j; for (_j=0;_j<9;_j++) (o)[_j]=(a)[_j]-(b)[_j];}
#define MAT3SCALE(o, a, s) {\
- int _j; for (_j=0;_j<9;_j++) (o)[_j]=(a)[_j] * (s);}
+ int _j; for (_j=0;_j<9;_j++) (o)[_j]=(a)[_j] * (s);}
#define MAT3MOVE(o, a) {\
- int _j; for (_j=0;_j<9;_j++) (o)[_j] = (a)[_j];}
+ int _j; for (_j=0;_j<9;_j++) (o)[_j] = (a)[_j];}
#define MAT3XVEC(u, m, v) {\
- (u)[0] = (m)[0]*(v)[0] + (m)[1]*(v)[1] + (m)[2]*(v)[2];\
- (u)[1] = (m)[3]*(v)[0] + (m)[4]*(v)[1] + (m)[5]*(v)[2];\
- (u)[2] = (m)[6]*(v)[0] + (m)[7]*(v)[1] + (m)[8]*(v)[2];}
+ (u)[0] = (m)[0]*(v)[0] + (m)[1]*(v)[1] + (m)[2]*(v)[2];\
+ (u)[1] = (m)[3]*(v)[0] + (m)[4]*(v)[1] + (m)[5]*(v)[2];\
+ (u)[2] = (m)[6]*(v)[0] + (m)[7]*(v)[1] + (m)[8]*(v)[2];}
#define MAT3TO4(o, i) {\
- (o)[0] = (i)[0];\
- (o)[1] = (i)[1];\
- (o)[2] = (i)[2];\
- (o)[4] = (i)[3];\
- (o)[5] = (i)[4];\
- (o)[6] = (i)[5];\
- (o)[8] = (i)[6];\
- (o)[9] = (i)[7];\
- (o)[10] = (i)[8];\
- (o)[3]=(o)[7]=(o)[11]=(o)[12]=(o)[13]=(o)[14]=0.0;\
- (o)[15]=1.0;}
+ (o)[0] = (i)[0];\
+ (o)[1] = (i)[1];\
+ (o)[2] = (i)[2];\
+ (o)[4] = (i)[3];\
+ (o)[5] = (i)[4];\
+ (o)[6] = (i)[5];\
+ (o)[8] = (i)[6];\
+ (o)[9] = (i)[7];\
+ (o)[10] = (i)[8];\
+ (o)[3]=(o)[7]=(o)[11]=(o)[12]=(o)[13]=(o)[14]=0.0;\
+ (o)[15]=1.0;}
#define MAT4TO3(o, i) {\
- (o)[0] = (i)[0];\
- (o)[1] = (i)[1];\
- (o)[2] = (i)[2];\
- (o)[3] = (i)[4];\
- (o)[4] = (i)[5];\
- (o)[5] = (i)[6];\
- (o)[6] = (i)[8];\
- (o)[7] = (i)[9];\
- (o)[8] = (i)[10];}
+ (o)[0] = (i)[0];\
+ (o)[1] = (i)[1];\
+ (o)[2] = (i)[2];\
+ (o)[3] = (i)[4];\
+ (o)[4] = (i)[5];\
+ (o)[5] = (i)[6];\
+ (o)[6] = (i)[8];\
+ (o)[7] = (i)[9];\
+ (o)[8] = (i)[10];}
/* tilde matrix: [M]a = v X a */
#define MAKE_TILDE(m, v) {\
- MAT3ZERO(m);\
- m[1]= -v[2]; m[2]=v[1]; m[3]= v[2];\
- m[5]= -v[0]; m[6]= -v[1]; m[7]= v[0];}
+ MAT3ZERO(m);\
+ m[1]= -v[2]; m[2]=v[1]; m[3]= v[2];\
+ m[5]= -v[0]; m[6]= -v[1]; m[7]= v[0];}
/* a = Ix Iy Iz b = Ixy Ixz Iyz*/
#define INERTIAL_MAT3(m, a, b) {\
- (m)[0] = (a)[0]; (m)[1] = -(b)[0]; (m)[2] = -(b)[1];\
- (m)[3] = -(b)[0]; (m)[4] = (a)[1]; (m)[5] = -(b)[2];\
- (m)[6] = -(b)[1]; (m)[7] = -(b)[2]; (m)[8]= (a)[2];}
+ (m)[0] = (a)[0]; (m)[1] = -(b)[0]; (m)[2] = -(b)[1];\
+ (m)[3] = -(b)[0]; (m)[4] = (a)[1]; (m)[5] = -(b)[2];\
+ (m)[6] = -(b)[1]; (m)[7] = -(b)[2]; (m)[8]= (a)[2];}
/* FIXME: These should all have bn_ prefixes */
Modified: brlcad/trunk/include/bn/dvec.h
===================================================================
--- brlcad/trunk/include/bn/dvec.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bn/dvec.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -43,87 +43,87 @@
extern "C++" {
- const double VEQUALITY = 0.0000001;
+const double VEQUALITY = 0.0000001;
- template<int LEN>
- struct dvec_internal;
+template<int LEN>
+struct dvec_internal;
- template<int LEN>
- struct fvec_internal;
+template<int LEN>
+struct fvec_internal;
- template<int LEN>
- class dvec;
+template<int LEN>
+class dvec;
- template<int LEN>
- std::ostream& operator<<(std::ostream& out, const dvec<LEN>& v);
+template<int LEN>
+std::ostream& operator<<(std::ostream& out, const dvec<LEN>& v);
- class dvec_unop {
- public:
- virtual double operator()(double a) const = 0;
- virtual ~dvec_unop() {}
- };
+class dvec_unop {
+public:
+ virtual double operator()(double a) const = 0;
+ virtual ~dvec_unop() {}
+};
- class dvec_op {
- public:
- virtual double operator()(double a, double b) const = 0;
- virtual ~dvec_op() {}
- };
+class dvec_op {
+public:
+ virtual double operator()(double a, double b) const = 0;
+ virtual ~dvec_op() {}
+};
- template<int LEN>
- class dvec {
- public:
- dvec(double s);
- dvec(const double* vals);
- dvec(const float* vals);
- dvec(const dvec<LEN>& p);
+template<int LEN>
+class dvec {
+public:
+ dvec(double s);
+ dvec(const double* vals);
+ dvec(const float* vals);
+ dvec(const dvec<LEN>& p);
- dvec<LEN>& operator=(const dvec<LEN>& p);
- double operator[](int index) const;
- void u_store(double* arr) const;
- void u_store(float* arr) const;
- void a_store(double* arr) const;
- void a_store(float* arr) const;
+ dvec<LEN>& operator=(const dvec<LEN>& p);
+ double operator[](int index) const;
+ void u_store(double* arr) const;
+ void u_store(float* arr) const;
+ void a_store(double* arr) const;
+ void a_store(float* arr) const;
- bool operator==(const dvec<LEN>& b) const;
+ bool operator==(const dvec<LEN>& b) const;
- dvec<LEN> operator+(const dvec<LEN>& b);
- dvec<LEN> operator-(const dvec<LEN>& b);
- dvec<LEN> operator*(const dvec<LEN>& b);
- dvec<LEN> operator/(const dvec<LEN>& b);
+ dvec<LEN> operator+(const dvec<LEN>& b);
+ dvec<LEN> operator-(const dvec<LEN>& b);
+ dvec<LEN> operator*(const dvec<LEN>& b);
+ dvec<LEN> operator/(const dvec<LEN>& b);
- dvec<LEN> madd(const dvec<LEN>& s, const dvec<LEN>& b);
- dvec<LEN> madd(const double s, const dvec<LEN>& b);
+ dvec<LEN> madd(const dvec<LEN>& s, const dvec<LEN>& b);
+ dvec<LEN> madd(const double s, const dvec<LEN>& b);
- dvec<LEN> map(const dvec_unop& operation, int limit = LEN);
- double foldr(double proto, const dvec_op& operation, int limit = LEN);
- double foldl(double proto, const dvec_op& operation, int limit = LEN);
+ dvec<LEN> map(const dvec_unop& operation, int limit = LEN);
+ double foldr(double proto, const dvec_op& operation, int limit = LEN);
+ double foldl(double proto, const dvec_op& operation, int limit = LEN);
- class mul : public dvec_op {
- public:
- double operator()(double a, double b) const { return a * b; }
- };
+ class mul : public dvec_op {
+ public:
+ double operator()(double a, double b) const { return a * b; }
+ };
- class add : public dvec_op {
- public:
- double operator()(double a, double b) const { return a + b; }
- };
+ class add : public dvec_op {
+ public:
+ double operator()(double a, double b) const { return a + b; }
+ };
- class sub : public dvec_op {
- public:
- double operator()(double a, double b) const { return a - b; }
- };
+ class sub : public dvec_op {
+ public:
+ double operator()(double a, double b) const { return a - b; }
+ };
- class sqrt : public dvec_unop {
- public:
- double operator()(double a) const { return ::sqrt(a); }
- };
- private:
- dvec_internal<LEN> data;
-
- dvec(const dvec_internal<LEN>& d);
- dvec(const fvec_internal<LEN>& f);
+ class sqrt : public dvec_unop {
+ public:
+ double operator()(double a) const { return ::sqrt(a); }
};
+private:
+ dvec_internal<LEN> data;
+ dvec(const dvec_internal<LEN>& d);
+ dvec(const fvec_internal<LEN>& f);
+};
+
//#define DVEC4(V, t, a, b, c, d) double v#t[4] VEC_ALIGN = {(a), (b), (c),
(d)}; V(v#t)
// use this to create 16-byte aligned memory on platforms that support it
@@ -141,69 +141,69 @@
#endif
/* @endcond */
- inline bool vequals(const vec2d& a, const vec2d& b) {
- return
- (fabs(a.x()-b.x()) < VEQUALITY) &&
- (fabs(a.y()-b.y()) < VEQUALITY);
- }
+inline bool vequals(const vec2d& a, const vec2d& b) {
+ return
+ (fabs(a.x()-b.x()) < VEQUALITY) &&
+ (fabs(a.y()-b.y()) < VEQUALITY);
+}
- // 2x2 row-major matrix
- typedef fastf_t mat2d_t[4] VEC_ALIGN;
+// 2x2 row-major matrix
+typedef fastf_t mat2d_t[4] VEC_ALIGN;
- // 2d point
- typedef fastf_t pt2d_t[2] VEC_ALIGN;
+// 2d point
+typedef fastf_t pt2d_t[2] VEC_ALIGN;
-
//--------------------------------------------------------------------------------
- // MATH / VECTOR ops
- inline
- bool mat2d_inverse(mat2d_t inv, mat2d_t m) {
- pt2d_t _a = {m[0], m[1]};
- pt2d_t _b = {m[3], m[2]};
- dvec<2> a(_a);
- dvec<2> b(_b);
- dvec<2> c = a*b;
- fastf_t det = c.foldr(0, dvec<2>::sub());
- if (NEAR_ZERO(det, VUNITIZE_TOL)) return false;
- fastf_t scale = 1.0 / det;
- double tmp[4] VEC_ALIGN = {m[3], -m[1], -m[2], m[0]};
- dvec<4> iv(tmp);
- dvec<4> sv(scale);
- dvec<4> r = iv * sv;
- r.a_store(inv);
- return true;
- }
- inline
- void mat2d_pt2d_mul(pt2d_t r, mat2d_t m, pt2d_t p) {
- pt2d_t _a = {m[0], m[2]};
- pt2d_t _b = {m[1], m[3]};
- dvec<2> x(p[0]);
- dvec<2> y(p[1]);
- dvec<2> a(_a);
- dvec<2> b(_b);
- dvec<2> c = a*x + b*y;
- c.a_store(r);
- }
- inline
- void pt2dsub(pt2d_t r, pt2d_t a, pt2d_t b) {
- dvec<2> va(a);
- dvec<2> vb(b);
- dvec<2> vr = va - vb;
- vr.a_store(r);
- }
+//--------------------------------------------------------------------------------
+// MATH / VECTOR ops
+inline
+bool mat2d_inverse(mat2d_t inv, mat2d_t m) {
+ pt2d_t _a = {m[0], m[1]};
+ pt2d_t _b = {m[3], m[2]};
+ dvec<2> a(_a);
+ dvec<2> b(_b);
+ dvec<2> c = a*b;
+ fastf_t det = c.foldr(0, dvec<2>::sub());
+ if (NEAR_ZERO(det, VUNITIZE_TOL)) return false;
+ fastf_t scale = 1.0 / det;
+ double tmp[4] VEC_ALIGN = {m[3], -m[1], -m[2], m[0]};
+ dvec<4> iv(tmp);
+ dvec<4> sv(scale);
+ dvec<4> r = iv * sv;
+ r.a_store(inv);
+ return true;
+}
+inline
+void mat2d_pt2d_mul(pt2d_t r, mat2d_t m, pt2d_t p) {
+ pt2d_t _a = {m[0], m[2]};
+ pt2d_t _b = {m[1], m[3]};
+ dvec<2> x(p[0]);
+ dvec<2> y(p[1]);
+ dvec<2> a(_a);
+ dvec<2> b(_b);
+ dvec<2> c = a*x + b*y;
+ c.a_store(r);
+}
+inline
+void pt2dsub(pt2d_t r, pt2d_t a, pt2d_t b) {
+ dvec<2> va(a);
+ dvec<2> vb(b);
+ dvec<2> vr = va - vb;
+ vr.a_store(r);
+}
- inline
- fastf_t v2mag(pt2d_t p) {
- dvec<2> a(p);
- dvec<2> sq = a*a;
- return sqrt(sq.foldr(0, dvec<2>::add()));
- }
+inline
+fastf_t v2mag(pt2d_t p) {
+ dvec<2> a(p);
+ dvec<2> sq = a*a;
+ return sqrt(sq.foldr(0, dvec<2>::add()));
+}
- inline
- void move(pt2d_t a, const double *b) {
- a[0] = b[0];
- a[1] = b[1];
- }
+inline
+void move(pt2d_t a, const double *b) {
+ a[0] = b[0];
+ a[1] = b[1];
}
+}
/** @} */
Modified: brlcad/trunk/include/bn/mat.h
===================================================================
--- brlcad/trunk/include/bn/mat.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bn/mat.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -68,9 +68,9 @@
bu_log("%s:%d bn_mat_zero() is deprecated, use MAT_ZERO()\n", \
__FILE__, __LINE__); \
(_m)[0] = (_m)[1] = (_m)[2] = (_m)[3] = \
- (_m)[4] = (_m)[5] = (_m)[6] = (_m)[7] = \
- (_m)[8] = (_m)[9] = (_m)[10] = (_m)[11] = \
- (_m)[12] = (_m)[13] = (_m)[14] = (_m)[15] = 0.0; }
+ (_m)[4] = (_m)[5] = (_m)[6] = (_m)[7] = \
+ (_m)[8] = (_m)[9] = (_m)[10] = (_m)[11] = \
+ (_m)[12] = (_m)[13] = (_m)[14] = (_m)[15] = 0.0; }
/*
#define bn_mat_zero(_m) (void)memset((void *)_m, 0, sizeof(mat_t))
*/
@@ -78,8 +78,8 @@
bu_log("%s:%d bn_mat_idn() is deprecated, use MAT_IDN()\n", \
__FILE__, __LINE__); \
(_m)[1] = (_m)[2] = (_m)[3] = (_m)[4] = \
- (_m)[6] = (_m)[7] = (_m)[8] = (_m)[9] = \
- (_m)[11] = (_m)[12] = (_m)[13] = (_m)[14] = 0.0; \
+ (_m)[6] = (_m)[7] = (_m)[8] = (_m)[9] = \
+ (_m)[11] = (_m)[12] = (_m)[13] = (_m)[14] = 0.0; \
(_m)[0] = (_m)[5] = (_m)[10] = (_m)[15] = 1.0; }
/*
#define bn_mat_idn(_m) (void)memcpy((void *)_m, (const void
*)bn_mat_identity, sizeof(mat_t))
Modified: brlcad/trunk/include/bn/plane.h
===================================================================
--- brlcad/trunk/include/bn/plane.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bn/plane.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -127,16 +127,16 @@
* (PCA).
*
@code
- P
- *
- /.
- / .
- / .
- / . (dist)
- / .
- / .
- *------*-------->
- A PCA dir
+ // P
+ // *
+ // /.
+ // / .
+ // / .
+ // / . (dist)
+ // / .
+ // / .
+ // *------*-------->
+ // A PCA dir
@endcode
* There are three distinct cases, with these return codes -
* 0 => P is within tolerance of point A. *dist = 0, pca=A.
@@ -385,9 +385,9 @@
* @param tol tolerance values
*/
BN_EXPORT extern int bn_isect_lseg3_lseg3(fastf_t *dist,
- const point_t p, const vect_t
pdir,
- const point_t q, const vect_t
qdir,
- const struct bn_tol *tol);
+ const point_t p, const vect_t pdir,
+ const point_t q, const vect_t qdir,
+ const struct bn_tol *tol);
BN_EXPORT extern int bn_lseg3_lseg3_parallel(const point_t sg1pt1, const
point_t sg1pt2,
const point_t sg2pt1, const
point_t sg2pt2,
@@ -435,11 +435,11 @@
* negative. The same occurs for the distance to point q1.
*/
BN_EXPORT extern int bn_isect_line3_line3(fastf_t *s, fastf_t *t,
- const point_t p0,
- const vect_t u,
- const point_t q0,
- const vect_t v,
- const struct bn_tol *tol);
+ const point_t p0,
+ const vect_t u,
+ const point_t q0,
+ const vect_t v,
+ const struct bn_tol *tol);
/**
* @brief
Modified: brlcad/trunk/include/bn/plot3.h
===================================================================
--- brlcad/trunk/include/bn/plot3.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bn/plot3.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -54,180 +54,180 @@
BN_EXPORT extern int pl_getOutputMode(void);
BN_EXPORT extern void pl_setOutputMode(int mode);
BN_EXPORT extern void pl_point(FILE *plotfp,
- int x,
- int y);
+ int x,
+ int y);
BN_EXPORT extern void pl_line(FILE *plotfp,
- int fx,
- int fy,
- int tx,
- int ty);
+ int fx,
+ int fy,
+ int tx,
+ int ty);
BN_EXPORT extern void pl_linmod(FILE *plotfp,
- const char *s);
+ const char *s);
BN_EXPORT extern void pl_move(FILE *plotfp,
- int x,
- int y);
+ int x,
+ int y);
BN_EXPORT extern void pl_cont(FILE *plotfp,
- int x,
- int y);
+ int x,
+ int y);
BN_EXPORT extern void pl_label(FILE *plotfp,
- const char *s);
+ const char *s);
BN_EXPORT extern void pl_space(FILE *plotfp,
- int x_1,
- int y_1,
- int x_2,
- int y_2);
+ int x_1,
+ int y_1,
+ int x_2,
+ int y_2);
BN_EXPORT extern void pl_erase(FILE *plotfp);
BN_EXPORT extern void pl_circle(FILE *plotfp,
- int x,
- int y,
- int r);
+ int x,
+ int y,
+ int r);
BN_EXPORT extern void pl_arc(FILE *plotfp,
- int xc,
- int yc,
- int x_1,
- int y_1,
- int x_2,
- int y_2);
+ int xc,
+ int yc,
+ int x_1,
+ int y_1,
+ int x_2,
+ int y_2);
BN_EXPORT extern void pl_box(FILE *plotfp,
- int x_1,
- int y_1,
- int x_2,
- int y_2);
+ int x_1,
+ int y_1,
+ int x_2,
+ int y_2);
/*
* BRL extensions to the UNIX-plot file format.
*/
BN_EXPORT extern void pl_color(FILE *plotfp,
- int r,
- int g,
- int b);
+ int r,
+ int g,
+ int b);
BN_EXPORT extern void pl_flush(FILE *plotfp);
BN_EXPORT extern void pl_3space(FILE *plotfp,
- int x_1,
- int y_1,
- int z_1,
- int x_2,
- int y_2,
- int z_2);
+ int x_1,
+ int y_1,
+ int z_1,
+ int x_2,
+ int y_2,
+ int z_2);
BN_EXPORT extern void pl_3point(FILE *plotfp,
- int x,
- int y,
- int z);
+ int x,
+ int y,
+ int z);
BN_EXPORT extern void pl_3move(FILE *plotfp,
- int x,
- int y,
- int z);
+ int x,
+ int y,
+ int z);
BN_EXPORT extern void pl_3cont(FILE *plotfp,
- int x,
- int y,
- int z);
+ int x,
+ int y,
+ int z);
BN_EXPORT extern void pl_3line(FILE *plotfp,
- int x_1,
- int y_1,
- int z_1,
- int x_2,
- int y_2,
- int z_2);
+ int x_1,
+ int y_1,
+ int z_1,
+ int x_2,
+ int y_2,
+ int z_2);
BN_EXPORT extern void pl_3box(FILE *plotfp,
- int x_1,
- int y_1,
- int z_1,
- int x_2,
- int y_2,
- int z_2);
+ int x_1,
+ int y_1,
+ int z_1,
+ int x_2,
+ int y_2,
+ int z_2);
/* Double floating point versions */
BN_EXPORT extern void pd_point(FILE *plotfp,
- double x,
- double y);
+ double x,
+ double y);
BN_EXPORT extern void pd_line(FILE *plotfp,
- double fx,
- double fy,
- double tx,
- double ty);
+ double fx,
+ double fy,
+ double tx,
+ double ty);
BN_EXPORT extern void pd_move(FILE *plotfp,
- double x,
- double y);
+ double x,
+ double y);
BN_EXPORT extern void pd_cont(FILE *plotfp,
- double x,
- double y);
+ double x,
+ double y);
BN_EXPORT extern void pd_space(FILE *plotfp,
- double x_1,
- double y_1,
- double x_2,
- double y_2);
+ double x_1,
+ double y_1,
+ double x_2,
+ double y_2);
BN_EXPORT extern void pd_circle(FILE *plotfp,
- double x,
- double y,
- double r);
+ double x,
+ double y,
+ double r);
BN_EXPORT extern void pd_arc(FILE *plotfp,
- double xc,
- double yc,
- double x_1,
- double y_1,
- double x_2,
- double y_2);
+ double xc,
+ double yc,
+ double x_1,
+ double y_1,
+ double x_2,
+ double y_2);
BN_EXPORT extern void pd_box(FILE *plotfp,
- double x_1,
- double y_1,
- double x_2,
- double y_2);
+ double x_1,
+ double y_1,
+ double x_2,
+ double y_2);
/* Double 3-D both in vector and enumerated versions */
#ifdef VMATH_H
BN_EXPORT extern void pdv_3space(FILE *plotfp,
- const vect_t min,
- const vect_t max);
+ const vect_t min,
+ const vect_t max);
BN_EXPORT extern void pdv_3point(FILE *plotfp,
- const vect_t pt);
+ const vect_t pt);
BN_EXPORT extern void pdv_3move(FILE *plotfp,
- const vect_t pt);
+ const vect_t pt);
BN_EXPORT extern void pdv_3cont(FILE *plotfp,
- const vect_t pt);
+ const vect_t pt);
BN_EXPORT extern void pdv_3line(FILE *plotfp,
- const vect_t a,
- const vect_t b);
+ const vect_t a,
+ const vect_t b);
BN_EXPORT extern void pdv_3box(FILE *plotfp,
- const vect_t a,
- const vect_t b);
+ const vect_t a,
+ const vect_t b);
#endif /* VMATH_H */
BN_EXPORT extern void pd_3space(FILE *plotfp,
- double x_1,
- double y_1,
- double z_1,
- double x_2,
- double y_2,
- double z_2);
+ double x_1,
+ double y_1,
+ double z_1,
+ double x_2,
+ double y_2,
+ double z_2);
BN_EXPORT extern void pd_3point(FILE *plotfp,
- double x,
- double y,
- double z);
+ double x,
+ double y,
+ double z);
BN_EXPORT extern void pd_3move(FILE *plotfp,
- double x,
- double y,
- double z);
+ double x,
+ double y,
+ double z);
BN_EXPORT extern void pd_3cont(FILE *plotfp,
- double x,
- double y,
- double z);
+ double x,
+ double y,
+ double z);
BN_EXPORT extern void pd_3line(FILE *plotfp,
- double x_1,
- double y_1,
- double z_1,
- double x_2,
- double y_2,
- double z_2);
+ double x_1,
+ double y_1,
+ double z_1,
+ double x_2,
+ double y_2,
+ double z_2);
BN_EXPORT extern void pd_3box(FILE *plotfp,
- double x_1,
- double y_1,
- double z_1,
- double x_2,
- double y_2,
- double z_2);
+ double x_1,
+ double y_1,
+ double z_1,
+ double x_2,
+ double y_2,
+ double z_2);
BN_EXPORT extern void pdv_3ray(FILE *fp,
- const point_t pt,
- const vect_t dir,
- double t);
+ const point_t pt,
+ const vect_t dir,
+ double t);
/*
* The following routines are taken from the BRL TIG-PACK
@@ -244,9 +244,9 @@
* below. This "C" interface expects arrays of INTs.
*/
BN_EXPORT extern void tp_i2list(FILE *fp,
- int *x,
- int *y,
- int npoints);
+ int *x,
+ int *y,
+ int npoints);
/**
* Take a set of x, y coordinates, and plot them as a polyline, i.e.,
@@ -259,13 +259,13 @@
* Originally written in August 04, 1978
*/
BN_EXPORT extern void tp_2list(FILE *fp,
- double *x,
- double *y,
- int npoints);
+ double *x,
+ double *y,
+ int npoints);
BN_EXPORT extern void BU_FORTRAN(f2list, F2LIST)(FILE **fpp,
- float *x,
- float *y,
- int *n);
+ float *x,
+ float *y,
+ int *n);
/**
* NOTE: tp_2list() and tp_3list() are good candidates to become
@@ -274,15 +274,15 @@
* Originally written in August 04, 1978
*/
BN_EXPORT extern void tp_3list(FILE *fp,
- double *x,
- double *y,
- double *z,
- int npoints);
+ double *x,
+ double *y,
+ double *z,
+ int npoints);
BN_EXPORT extern void BU_FORTRAN(f3list, F3LIST)(FILE **fpp,
- float *x,
- float *y,
- float *z,
- int *n);
+ float *x,
+ float *y,
+ float *z,
+ int *n);
/**
* Take a set of x, y co-ordinates and plots them, with a combination
@@ -305,123 +305,123 @@
*@li 3 Draw line and marks
*/
BN_EXPORT extern void tp_2mlist(FILE *fp,
- double *x,
- double *y,
- int npoints,
- int flag,
- int mark,
- int interval,
- double size);
+ double *x,
+ double *y,
+ int npoints,
+ int flag,
+ int mark,
+ int interval,
+ double size);
/**
* This FORTRAN interface expects arrays of REALs (single precision).
*/
BN_EXPORT extern void BU_FORTRAN(f2mlst, F2MLST)(FILE **fp,
- float *x,
- float *y,
- int *np,
- int *flag,
- int *mark,
- int *interval,
- float *size);
+ float *x,
+ float *y,
+ int *np,
+ int *flag,
+ int *mark,
+ int *interval,
+ float *size);
BN_EXPORT extern void tp_2marker(FILE *fp,
- int c,
- double x,
- double y,
- double scale);
+ int c,
+ double x,
+ double y,
+ double scale);
BN_EXPORT extern void BU_FORTRAN(f2mark, F2MARK)(FILE **fp,
- int *c,
- float *x,
- float *y,
- float *scale);
+ int *c,
+ float *x,
+ float *y,
+ float *scale);
BN_EXPORT extern void tp_3marker(FILE *fp,
- int c,
- double x,
- double y,
- double z,
- double scale);
+ int c,
+ double x,
+ double y,
+ double z,
+ double scale);
BN_EXPORT extern void BU_FORTRAN(f3mark, F3MARK)(FILE **fp,
- int *c,
- float *x,
- float *y,
- float *z,
- float *scale);
+ int *c,
+ float *x,
+ float *y,
+ float *z,
+ float *scale);
BN_EXPORT extern void tp_2number(FILE *fp,
- double input,
- int x,
- int y,
- int cscale,
- double theta,
- int digits);
+ double input,
+ int x,
+ int y,
+ int cscale,
+ double theta,
+ int digits);
BN_EXPORT extern void BU_FORTRAN(f2numb, F2NUMB)(FILE **fp,
- float *input,
- int *x,
- int *y,
- float *cscale,
- float *theta,
- int *digits);
+ float *input,
+ int *x,
+ int *y,
+ float *cscale,
+ float *theta,
+ int *digits);
BN_EXPORT extern void tp_scale(int idata[],
- int elements,
- int mode,
- int length,
- int odata[],
- double *min,
- double *dx);
+ int elements,
+ int mode,
+ int length,
+ int odata[],
+ double *min,
+ double *dx);
BN_EXPORT extern void BU_FORTRAN(fscale, FSCALE)(int idata[],
- int *elements,
- char *mode,
- int *length,
- int odata[],
- double *min,
- double *dx);
+ int *elements,
+ char *mode,
+ int *length,
+ int odata[],
+ double *min,
+ double *dx);
BN_EXPORT extern void tp_2symbol(FILE *fp,
- char *string,
- double x,
- double y,
- double scale,
- double theta);
+ char *string,
+ double x,
+ double y,
+ double scale,
+ double theta);
BN_EXPORT extern void BU_FORTRAN(f2symb, F2SYMB)(FILE **fp,
- char *string,
- float *x,
- float *y,
- float *scale,
- float *theta);
+ char *string,
+ float *x,
+ float *y,
+ float *scale,
+ float *theta);
BN_EXPORT extern void tp_plot(FILE *fp,
- int xp,
- int yp,
- int xl,
- int yl,
- char xtitle[],
- char ytitle[],
- float x[],
- float y[],
- int n,
- double cscale);
+ int xp,
+ int yp,
+ int xl,
+ int yl,
+ char xtitle[],
+ char ytitle[],
+ float x[],
+ float y[],
+ int n,
+ double cscale);
BN_EXPORT extern void BU_FORTRAN(fplot, FPLOT)(FILE **fp,
- int *xp,
- int *yp,
- int *xl,
- int *yl,
- char *xtitle,
- char *ytitle,
- float *x,
- float *y,
- int *n,
- float *cscale);
+ int *xp,
+ int *yp,
+ int *xl,
+ int *yl,
+ char *xtitle,
+ char *ytitle,
+ float *x,
+ float *y,
+ int *n,
+ float *cscale);
BN_EXPORT extern void tp_ftoa(float x, char *s);
BN_EXPORT extern void tp_fixsc(float *x,
- int npts,
- float size,
- float *xs,
- float *xmin,
- float *xmax,
- float *dx);
+ int npts,
+ float size,
+ float *xs,
+ float *xmin,
+ float *xmax,
+ float *dx);
BN_EXPORT extern void tp_sep(float x,
- float *coef,
- int *ex);
+ float *coef,
+ int *ex);
BN_EXPORT extern double tp_ipow(double x,
- int n);
+ int n);
/**
@@ -439,48 +439,48 @@
* Originally written on August 01, 1978
*/
BN_EXPORT extern void tp_3axis(FILE *fp,
- char *string,
- point_t origin,
- mat_t rot,
- double length,
- int ccw,
- int ndigits,
- double label_start,
- double label_incr,
- double tick_separation,
- double char_width);
+ char *string,
+ point_t origin,
+ mat_t rot,
+ double length,
+ int ccw,
+ int ndigits,
+ double label_start,
+ double label_incr,
+ double tick_separation,
+ double char_width);
BN_EXPORT extern void BU_FORTRAN(f3axis, F3AXIS)(FILE **fp,
- char *string,
- float *x,
- float *y,
- float *z,
- float *length,
- float *theta,
- int *ccw,
- int *ndigits,
- float *label_start,
- float *label_incr,
- float *tick_separation,
- float *char_width);
+ char *string,
+ float *x,
+ float *y,
+ float *z,
+ float *length,
+ float *theta,
+ int *ccw,
+ int *ndigits,
+ float *label_start,
+ float *label_incr,
+ float *tick_separation,
+ float *char_width);
BN_EXPORT extern void tp_3symbol(FILE *fp,
- char *string,
- point_t origin,
- mat_t rot,
- double scale);
+ char *string,
+ point_t origin,
+ mat_t rot,
+ double scale);
BN_EXPORT extern void tp_3vector(FILE *plotfp,
- point_t from,
- point_t to,
- double fromheadfract,
- double toheadfract);
+ point_t from,
+ point_t to,
+ double fromheadfract,
+ double toheadfract);
BN_EXPORT extern void BU_FORTRAN(f3vect, F3VECT)(FILE **fp,
- float *fx,
- float *fy,
- float *fz,
- float *tx,
- float *ty,
- float *tz,
- float *fl,
- float *tl);
+ float *fx,
+ float *fy,
+ float *fz,
+ float *tx,
+ float *ty,
+ float *tz,
+ float *fl,
+ float *tl);
__END_DECLS
Modified: brlcad/trunk/include/bn/rand.h
===================================================================
--- brlcad/trunk/include/bn/rand.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bn/rand.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -97,7 +97,7 @@
#define bn_rand_half(_p) \
((++(_p) >= &bn_rand_halftab[bn_randhalftabsize] || \
(_p) < bn_rand_halftab) ? \
- *((_p) = bn_rand_halftab) : *(_p))
+ *((_p) = bn_rand_halftab) : *(_p))
/**
* initialize the seed for the large random number table (halftab)
Modified: brlcad/trunk/include/bn/sobol.h
===================================================================
--- brlcad/trunk/include/bn/sobol.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bn/sobol.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -25,18 +25,18 @@
* Generation of the Sobol quasi-random low-discrepancy sequence of numbers.
*
* @par Usage:
-@code
-double *snums;
-struct bn_soboldata *sd = bn_sobol_create(3, time(NULL));
-if (sd) {
- bn_sobol_skip(s, 4000, snums);
- for (i = 0; i < 4000; i++) {
- snums = bn_sobol_next(s, NULL, NULL);
- printf("x[%d]: %g %g %g", i, snums[0], snums[1], snums[2]);
- }
- bn_sobol_destroy(sd);
-}
-@endcode
+ * @code
+ * double *snums;
+ * struct bn_soboldata *sd = bn_sobol_create(3, time(NULL));
+ * if (sd) {
+ * bn_sobol_skip(s, 4000, snums);
+ * for (i = 0; i < 4000; i++) {
+ * snums = bn_sobol_next(s, NULL, NULL);
+ * printf("x[%d]: %g %g %g", i, snums[0], snums[1], snums[2]);
+ * }
+ * bn_sobol_destroy(sd);
+ * }
+ * @endcode
*
*/
/** @{ */
Modified: brlcad/trunk/include/bn/vector_x86.h
===================================================================
--- brlcad/trunk/include/bn/vector_x86.h 2019-05-20 18:35:39 UTC (rev
73095)
+++ brlcad/trunk/include/bn/vector_x86.h 2019-05-20 18:58:50 UTC (rev
73096)
@@ -139,12 +139,12 @@
}
#define DOP_IMPL(__op__) { \
- dvec_internal<LEN> result; \
- for (int i = 0; i < LEN/2; i++) { \
- result.v[i] = __op__(data.v[i], b.data.v[i]); \
- } \
- return dvec<LEN>(result); \
-}
+ dvec_internal<LEN> result; \
+ for (int i = 0; i < LEN/2; i++) { \
+ result.v[i] = __op__(data.v[i], b.data.v[i]); \
+ } \
+ return dvec<LEN>(result); \
+ }
template<int LEN>
inline dvec<LEN>
Modified: brlcad/trunk/include/bnetwork.h
===================================================================
--- brlcad/trunk/include/bnetwork.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/bnetwork.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -53,11 +53,11 @@
# include <netinet/tcp.h> /* for TCP_NODELAY sockopt */
# include <arpa/inet.h> /* hton/ntoh, inet_addr functions */
# include <sys/socket.h> /* accept, connect, send, recv, ... */
- /* for c90/c99 compatibility */
+/* for c90/c99 compatibility */
# if !defined(HAVE_DECL_HTONL) && !defined(htonl)
- extern uint32_t htonl(uint32_t);
- extern uint32_t ntohl(uint32_t);
- #endif
+extern uint32_t htonl(uint32_t);
+extern uint32_t ntohl(uint32_t);
+# endif
#endif
#endif /* BNETWORK_H */
Modified: brlcad/trunk/include/brep/bbnode.h
===================================================================
--- brlcad/trunk/include/brep/bbnode.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/brep/bbnode.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -39,10 +39,10 @@
#ifdef __cplusplus
extern "C++" {
- namespace brlcad {
- class BBNode;
- }
+namespace brlcad {
+ class BBNode;
}
+}
#endif
#ifndef __cplusplus
@@ -60,185 +60,185 @@
__BEGIN_DECLS
extern "C++" {
- namespace brlcad {
+namespace brlcad {
- /**
- * Bounding Box Hierarchy Node
- */
- class BREP_EXPORT BBNode : public PooledObject<BBNode> {
- public:
- explicit BBNode(const ON_BoundingBox &node, const CurveTree *ct
= NULL);
- BBNode(const CurveTree *ct,
- const ON_BoundingBox &node,
- const ON_Interval &u,
- const ON_Interval &v,
- bool checkTrim,
- bool trimmed);
- ~BBNode();
+ /**
+ * Bounding Box Hierarchy Node
+ */
+ class BREP_EXPORT BBNode : public PooledObject<BBNode> {
+ public:
+ explicit BBNode(const ON_BoundingBox &node, const CurveTree *ct = NULL);
+ BBNode(const CurveTree *ct,
+ const ON_BoundingBox &node,
+ const ON_Interval &u,
+ const ON_Interval &v,
+ bool checkTrim,
+ bool trimmed);
+ ~BBNode();
- BBNode(Deserializer &deserieralizer, const CurveTree &ctree);
- void serialize(Serializer &serializer) const;
+ BBNode(Deserializer &deserieralizer, const CurveTree &ctree);
+ void serialize(Serializer &serializer) const;
- const ON_BrepFace &get_face() const;
+ const ON_BrepFace &get_face() const;
- /** Test if this node is a leaf node in the hierarchy */
- bool isLeaf() const;
+ /** Test if this node is a leaf node in the hierarchy */
+ bool isLeaf() const;
- /** Return all leaves below this node that are leaf nodes */
- void getLeaves(std::list<const BBNode *> &out_leaves) const;
+ /** Return all leaves below this node that are leaf nodes */
+ void getLeaves(std::list<const BBNode *> &out_leaves) const;
- /** Functions to add and remove child nodes from this node. */
- void addChild(BBNode *child);
+ /** Functions to add and remove child nodes from this node. */
+ void addChild(BBNode *child);
- /** Report the depth of this node in the hierarchy */
- int depth() const;
+ /** Report the depth of this node in the hierarchy */
+ int depth() const;
- /** Get 2 points defining a bounding box
- *
- * @verbatim
- * _ max _
- * _ - + - _
- * * _ + _ *
- * | - _ + _ - |
- * | *+ |
- * | |+ |
- * | _ |+ _ |
- * | _ - | - _ |
- * * _ | _ *
- * - _ | _ -
- * min
- * @endverbatim
- */
- void GetBBox(float *min, float *max) const;
- void GetBBox(double *min, double *max) const;
+ /** Get 2 points defining a bounding box
+ *
+ * @verbatim
+ * _ max _
+ * _ - + - _
+ * * _ + _ *
+ * | - _ + _ - |
+ * | *+ |
+ * | |+ |
+ * | _ |+ _ |
+ * | _ - | - _ |
+ * * _ | _ *
+ * - _ | _ -
+ * min
+ * @endverbatim
+ */
+ void GetBBox(float *min, float *max) const;
+ void GetBBox(double *min, double *max) const;
- /** Test whether a ray intersects the 3D bounding volume of the
- * node - if so, and node is not a leaf node, query children.
If
- * leaf node, and intersects, add to list.
- */
- bool intersectsHierarchy(const ON_Ray &ray, std::list<const
BBNode *> &results) const;
+ /** Test whether a ray intersects the 3D bounding volume of the
+ * node - if so, and node is not a leaf node, query children. If
+ * leaf node, and intersects, add to list.
+ */
+ bool intersectsHierarchy(const ON_Ray &ray, std::list<const BBNode *>
&results) const;
- ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt) const;
- ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt,
ON_Interval &u, ON_Interval &v) const;
- int getLeavesBoundingPoint(const ON_3dPoint &pt,
std::list<const BBNode *> &out) const;
- bool isTrimmed(const ON_2dPoint &uv, const BRNode **closest,
double &closesttrim, double within_distance_tol) const;
+ ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt) const;
+ ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt, ON_Interval
&u, ON_Interval &v) const;
+ int getLeavesBoundingPoint(const ON_3dPoint &pt, std::list<const BBNode
*> &out) const;
+ bool isTrimmed(const ON_2dPoint &uv, const BRNode **closest, double
&closesttrim, double within_distance_tol) const;
- void BuildBBox();
- bool prepTrims();
+ void BuildBBox();
+ bool prepTrims();
- const std::vector<BBNode *> &get_children() const;
+ const std::vector<BBNode *> &get_children() const;
- /** Bounding Box */
- ON_BoundingBox m_node;
+ /** Bounding Box */
+ ON_BoundingBox m_node;
- /** Surface Information */
- ON_Interval m_u;
- ON_Interval m_v;
+ /** Surface Information */
+ ON_Interval m_u;
+ ON_Interval m_v;
- /** Trimming Flags */
- bool m_checkTrim;
- bool m_trimmed;
+ /** Trimming Flags */
+ bool m_checkTrim;
+ bool m_trimmed;
- /** Point used for closeness testing - usually based on
evaluation
- * of the curve/surface at the center of the parametric domain
- */
- ON_3dPoint m_estimate;
+ /** Point used for closeness testing - usually based on evaluation
+ * of the curve/surface at the center of the parametric domain
+ */
+ ON_3dPoint m_estimate;
- /* Normal at the m_estimate point */
- ON_3dVector m_normal;
+ /* Normal at the m_estimate point */
+ ON_3dVector m_normal;
- /** Curve Tree associated with the parent Surface Tree */
- const CurveTree * const m_ctree;
+ /** Curve Tree associated with the parent Surface Tree */
+ const CurveTree * const m_ctree;
- private:
- BBNode(const BBNode &source);
- BBNode &operator=(const BBNode &source);
+ private:
+ BBNode(const BBNode &source);
+ BBNode &operator=(const BBNode &source);
- void removeChild(BBNode *child);
- bool intersectedBy(const ON_Ray &ray, double *tnear = NULL,
double *tfar = NULL) const;
+ void removeChild(BBNode *child);
+ bool intersectedBy(const ON_Ray &ray, double *tnear = NULL, double
*tfar = NULL) const;
- /** Report if a given uv point is within the uv boundaries
defined
- * by a node.
- */
- bool containsUV(const ON_2dPoint &uv) const;
+ /** Report if a given uv point is within the uv boundaries defined
+ * by a node.
+ */
+ bool containsUV(const ON_2dPoint &uv) const;
- void getTrimsAbove(const ON_2dPoint &uv, std::list<const BRNode
*> &out_leaves) const;
- const BBNode *closer(const ON_3dPoint &pt, const BBNode *left,
const BBNode *right) const;
+ void getTrimsAbove(const ON_2dPoint &uv, std::list<const BRNode *>
&out_leaves) const;
+ const BBNode *closer(const ON_3dPoint &pt, const BBNode *left, const
BBNode *right) const;
- struct Stl : public PooledObject<Stl> {
- Stl() : m_children(), m_trims_above() {}
+ struct Stl : public PooledObject<Stl> {
+ Stl() : m_children(), m_trims_above() {}
- std::vector<BBNode *> m_children;
- std::list<const BRNode *> m_trims_above;
- } * const m_stl;
- };
+ std::vector<BBNode *> m_children;
+ std::list<const BRNode *> m_trims_above;
+ } * const m_stl;
+ };
- inline void
- BBNode::addChild(BBNode *child)
- {
- if (LIKELY(child != NULL)) {
- m_stl->m_children.push_back(child);
- }
- }
+ inline void
+ BBNode::addChild(BBNode *child)
+ {
+ if (LIKELY(child != NULL)) {
+ m_stl->m_children.push_back(child);
+ }
+ }
- inline void
- BBNode::removeChild(BBNode *child)
- {
- std::vector<BBNode *>::iterator i;
- for (i = m_stl->m_children.begin(); i !=
m_stl->m_children.end();) {
- if (*i == child) {
- delete *i;
- i = m_stl->m_children.erase(i);
- } else {
- ++i;
- }
- }
+ inline void
+ BBNode::removeChild(BBNode *child)
+ {
+ std::vector<BBNode *>::iterator i;
+ for (i = m_stl->m_children.begin(); i != m_stl->m_children.end();) {
+ if (*i == child) {
+ delete *i;
+ i = m_stl->m_children.erase(i);
+ } else {
+ ++i;
}
+ }
+ }
- inline const ON_BrepFace &
- BBNode::get_face() const
- {
- return *m_ctree->m_face;
- }
+ inline const ON_BrepFace &
+ BBNode::get_face() const
+ {
+ return *m_ctree->m_face;
+ }
- inline const std::vector<BBNode *> &
- BBNode::get_children() const
- {
- return m_stl->m_children;
- }
+ inline const std::vector<BBNode *> &
+ BBNode::get_children() const
+ {
+ return m_stl->m_children;
+ }
- inline bool
- BBNode::isLeaf() const
- {
- return m_stl->m_children.empty();
- }
+ inline bool
+ BBNode::isLeaf() const
+ {
+ return m_stl->m_children.empty();
+ }
- inline void
- BBNode::GetBBox(float *min, float *max) const
- {
- min[0] = (float)m_node.m_min.x;
- min[1] = (float)m_node.m_min.y;
- min[2] = (float)m_node.m_min.z;
- max[0] = (float)m_node.m_max.x;
- max[1] = (float)m_node.m_max.y;
- max[2] = (float)m_node.m_max.z;
- }
+ inline void
+ BBNode::GetBBox(float *min, float *max) const
+ {
+ min[0] = (float)m_node.m_min.x;
+ min[1] = (float)m_node.m_min.y;
+ min[2] = (float)m_node.m_min.z;
+ max[0] = (float)m_node.m_max.x;
+ max[1] = (float)m_node.m_max.y;
+ max[2] = (float)m_node.m_max.z;
+ }
- inline void
- BBNode::GetBBox(double *min, double *max) const
- {
- min[0] = m_node.m_min.x;
- min[1] = m_node.m_min.y;
- min[2] = m_node.m_min.z;
- max[0] = m_node.m_max.x;
- max[1] = m_node.m_max.y;
- max[2] = m_node.m_max.z;
- }
+ inline void
+ BBNode::GetBBox(double *min, double *max) const
+ {
+ min[0] = m_node.m_min.x;
+ min[1] = m_node.m_min.y;
+ min[2] = m_node.m_min.z;
+ max[0] = m_node.m_max.x;
+ max[1] = m_node.m_max.y;
+ max[2] = m_node.m_max.z;
+ }
- } /* namespace brlcad */
+} /* namespace brlcad */
} /* extern C++ */
__END_DECLS
Modified: brlcad/trunk/include/brep/boolean.h
===================================================================
--- brlcad/trunk/include/brep/boolean.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/brep/boolean.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -35,23 +35,23 @@
extern "C++" {
- enum op_type {
- BOOLEAN_UNION = 0,
- BOOLEAN_INTERSECT = 1,
- BOOLEAN_DIFF = 2,
- BOOLEAN_XOR = 3
- };
+enum op_type {
+ BOOLEAN_UNION = 0,
+ BOOLEAN_INTERSECT = 1,
+ BOOLEAN_DIFF = 2,
+ BOOLEAN_XOR = 3
+};
- /**
- * Evaluate NURBS boolean operations.
- *
- * @param brepO [out]
- * @param brepA [in]
- * @param brepB [in]
- * @param operation [in]
- */
- extern BREP_EXPORT int
- ON_Boolean(ON_Brep *brepO, const ON_Brep *brepA, const ON_Brep *brepB,
op_type operation);
+/**
+ * Evaluate NURBS boolean operations.
+ *
+ * @param brepO [out]
+ * @param brepA [in]
+ * @param brepB [in]
+ * @param operation [in]
+ */
+extern BREP_EXPORT int
+ON_Boolean(ON_Brep *brepO, const ON_Brep *brepA, const ON_Brep *brepB, op_type
operation);
} /* extern C++ */
#endif
Modified: brlcad/trunk/include/brep/brnode.h
===================================================================
--- brlcad/trunk/include/brep/brnode.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/brep/brnode.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -46,154 +46,154 @@
#ifdef __cplusplus
extern "C++" {
- namespace brlcad {
+namespace brlcad {
- /**
- * Bounding Rectangle Hierarchy
- */
- class BREP_EXPORT BRNode : public PooledObject<BRNode> {
- public:
- explicit BRNode(const ON_BoundingBox &node);
- BRNode(const ON_Curve *curve,
- int trim_index,
- int adj_face_index,
- const ON_BoundingBox &node,
- const ON_BrepFace *face,
- const ON_Interval &t,
- bool innerTrim,
- bool checkTrim,
- bool trimmed);
- ~BRNode();
+ /**
+ * Bounding Rectangle Hierarchy
+ */
+ class BREP_EXPORT BRNode : public PooledObject<BRNode> {
+ public:
+ explicit BRNode(const ON_BoundingBox &node);
+ BRNode(const ON_Curve *curve,
+ int trim_index,
+ int adj_face_index,
+ const ON_BoundingBox &node,
+ const ON_BrepFace *face,
+ const ON_Interval &t,
+ bool innerTrim,
+ bool checkTrim,
+ bool trimmed);
+ ~BRNode();
- BRNode(Deserializer &deserializer, const ON_Brep &brep);
- void serialize(Serializer &serializer) const;
+ BRNode(Deserializer &deserializer, const ON_Brep &brep);
+ void serialize(Serializer &serializer) const;
- /** Node management functions */
- void addChild(BRNode *child);
+ /** Node management functions */
+ void addChild(BRNode *child);
- /** Return a list of all nodes below this node that are leaf
nodes */
- void getLeaves(std::list<const BRNode *> &out_leaves) const;
+ /** Return a list of all nodes below this node that are leaf nodes */
+ void getLeaves(std::list<const BRNode *> &out_leaves) const;
- /** Report the depth of this node in the hierarchy */
- int depth() const;
+ /** Report the depth of this node in the hierarchy */
+ int depth() const;
- /**
- * Get 2 points defining bounding box:
- *
- * @verbatim
- * *----------------max
- * | |
- * v | |
- * | |
- * min----------------*
- * u
- * @endverbatim
- */
- void GetBBox(fastf_t *min, fastf_t *max) const;
+ /**
+ * Get 2 points defining bounding box:
+ *
+ * @verbatim
+ * *----------------max
+ * | |
+ * v | |
+ * | |
+ * min----------------*
+ * u
+ * @endverbatim
+ */
+ void GetBBox(fastf_t *min, fastf_t *max) const;
- bool isTrimmed(const ON_2dPoint &uv, double &trimdist) const;
+ bool isTrimmed(const ON_2dPoint &uv, double &trimdist) const;
- ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt) const;
- ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt,
ON_Interval &u, ON_Interval &v) const;
- fastf_t getCurveEstimateOfV(fastf_t u, fastf_t tol) const;
- fastf_t getCurveEstimateOfU(fastf_t v, fastf_t tol) const;
+ ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt) const;
+ ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt, ON_Interval
&u, ON_Interval &v) const;
+ fastf_t getCurveEstimateOfV(fastf_t u, fastf_t tol) const;
+ fastf_t getCurveEstimateOfU(fastf_t v, fastf_t tol) const;
- /** Bounding Box */
- ON_BoundingBox m_node;
+ /** Bounding Box */
+ ON_BoundingBox m_node;
- /** Surface Information */
- ON_Interval m_v;
+ /** Surface Information */
+ ON_Interval m_v;
- /** Trim Curve Information */
- int m_adj_face_index;
+ /** Trim Curve Information */
+ int m_adj_face_index;
- /** Trimming Flags */
- bool m_XIncreasing;
- bool m_Horizontal;
- bool m_Vertical;
- bool m_innerTrim;
+ /** Trimming Flags */
+ bool m_XIncreasing;
+ bool m_Horizontal;
+ bool m_Vertical;
+ bool m_innerTrim;
- private:
- BRNode(const BRNode &source);
- BRNode &operator=(const BRNode &source);
+ private:
+ BRNode(const BRNode &source);
+ BRNode &operator=(const BRNode &source);
- void removeChild(BRNode *child);
+ void removeChild(BRNode *child);
- /** Test if this node is a leaf node (i.e. m_children is empty)
*/
- bool isLeaf() const;
+ /** Test if this node is a leaf node (i.e. m_children is empty) */
+ bool isLeaf() const;
- fastf_t getLinearEstimateOfV(fastf_t u) const;
- const BRNode *closer(const ON_3dPoint &pt, const BRNode *left,
const BRNode *right) const;
+ fastf_t getLinearEstimateOfV(fastf_t u) const;
+ const BRNode *closer(const ON_3dPoint &pt, const BRNode *left, const
BRNode *right) const;
- struct Stl : public PooledObject<Stl> {
- Stl() : m_children() {}
+ struct Stl : public PooledObject<Stl> {
+ Stl() : m_children() {}
- std::vector<const BRNode *> m_children;
- } * const m_stl;
+ std::vector<const BRNode *> m_children;
+ } * const m_stl;
- const ON_BrepFace *m_face;
- ON_Interval m_u;
- const ON_Curve *m_trim;
- int m_trim_index;
- ON_Interval m_t;
- bool m_checkTrim;
- bool m_trimmed;
- ON_3dPoint m_estimate;
- fastf_t m_slope;
- fastf_t m_bb_diag;
- ON_3dPoint m_start;
- ON_3dPoint m_end;
- };
+ const ON_BrepFace *m_face;
+ ON_Interval m_u;
+ const ON_Curve *m_trim;
+ int m_trim_index;
+ ON_Interval m_t;
+ bool m_checkTrim;
+ bool m_trimmed;
+ ON_3dPoint m_estimate;
+ fastf_t m_slope;
+ fastf_t m_bb_diag;
+ ON_3dPoint m_start;
+ ON_3dPoint m_end;
+ };
- inline void
- BRNode::addChild(BRNode *child)
- {
- if (LIKELY(child != NULL)) {
- m_stl->m_children.push_back(child);
- }
- }
+ inline void
+ BRNode::addChild(BRNode *child)
+ {
+ if (LIKELY(child != NULL)) {
+ m_stl->m_children.push_back(child);
+ }
+ }
- inline void
- BRNode::removeChild(BRNode *child)
- {
- std::vector<const BRNode *>::iterator i;
- for (i = m_stl->m_children.begin(); i !=
m_stl->m_children.end();) {
- if (*i == child) {
- delete *i;
- i = m_stl->m_children.erase(i);
- } else {
- ++i;
- }
- }
+ inline void
+ BRNode::removeChild(BRNode *child)
+ {
+ std::vector<const BRNode *>::iterator i;
+ for (i = m_stl->m_children.begin(); i != m_stl->m_children.end();) {
+ if (*i == child) {
+ delete *i;
+ i = m_stl->m_children.erase(i);
+ } else {
+ ++i;
}
+ }
+ }
- inline bool
- BRNode::isLeaf() const
- {
- if (m_stl->m_children.empty()) {
- return true;
- }
- return false;
- }
+ inline bool
+ BRNode::isLeaf() const
+ {
+ if (m_stl->m_children.empty()) {
+ return true;
+ }
+ return false;
+ }
- inline void
- BRNode::GetBBox(fastf_t *min, fastf_t *max) const
- {
- VSETALL(min, INFINITY);
- VSETALL(max, -INFINITY);
- if (m_start != ON_3dPoint::UnsetPoint) {
- VMINMAX(min, max, m_start);
- }
- if (m_end != ON_3dPoint::UnsetPoint) {
- VMINMAX(min, max, m_end);
- }
- }
+ inline void
+ BRNode::GetBBox(fastf_t *min, fastf_t *max) const
+ {
+ VSETALL(min, INFINITY);
+ VSETALL(max, -INFINITY);
+ if (m_start != ON_3dPoint::UnsetPoint) {
+ VMINMAX(min, max, m_start);
+ }
+ if (m_end != ON_3dPoint::UnsetPoint) {
+ VMINMAX(min, max, m_end);
+ }
+ }
- extern bool sortX(const BRNode *first, const BRNode *second);
- extern bool sortY(const BRNode *first, const BRNode *second);
+ extern bool sortX(const BRNode *first, const BRNode *second);
+ extern bool sortY(const BRNode *first, const BRNode *second);
- } /* namespace brlcad */
+} /* namespace brlcad */
} /* extern C++ */
__END_DECLS
Modified: brlcad/trunk/include/brep/cdt.h
===================================================================
--- brlcad/trunk/include/brep/cdt.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/brep/cdt.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -92,11 +92,11 @@
*/
extern BREP_EXPORT int
ON_Brep_CDT_VList(
- struct bn_vlblock *vbp,
- struct bu_list *vlfree,
- struct bu_color *c,
- int mode,
- const struct ON_Brep_CDT_State *s);
+ struct bn_vlblock *vbp,
+ struct bu_list *vlfree,
+ struct bu_color *c,
+ int mode,
+ const struct ON_Brep_CDT_State *s);
#if 0
/* Given two or more triangulation states, refine them to clear any face
@@ -123,11 +123,11 @@
* in the form of integer and fastf_t arrays. */
extern BREP_EXPORT int
ON_Brep_CDT_Mesh(
- int **faces, int *fcnt,
- fastf_t **vertices, int *vcnt,
- int **face_normals, int *fn_cnt,
- fastf_t **normals, int *ncnt,
- struct ON_Brep_CDT_State *s);
+ int **faces, int *fcnt,
+ fastf_t **vertices, int *vcnt,
+ int **face_normals, int *fn_cnt,
+ fastf_t **normals, int *ncnt,
+ struct ON_Brep_CDT_State *s);
Modified: brlcad/trunk/include/brep/csg.h
===================================================================
--- brlcad/trunk/include/brep/csg.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/brep/csg.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -36,112 +36,112 @@
extern "C++" {
- /* Shape recognition functions - HIGHLY EXPERIMENTAL,
- * DO NOT RELY ON - the odds are quite good that this whole
- * setup will be moving to libanalyze and it's public API
- * there will likely be quite different */
+/* Shape recognition functions - HIGHLY EXPERIMENTAL,
+ * DO NOT RELY ON - the odds are quite good that this whole
+ * setup will be moving to libanalyze and it's public API
+ * there will likely be quite different */
- /* Structure for holding parameters corresponding
- * to a csg primitive. Not all parameters will be
- * used for all primitives - the structure includes
- * enough data slots to describe any primitive that may
- * be matched by the shape recognition logic */
- struct csg_object_params {
- struct subbrep_shoal_data *s;
- int csg_type;
- int negative;
- /* Unique id number */
- int csg_id;
- char bool_op; /* Boolean operator - u = union (default), - =
subtraction, + = intersection */
- point_t origin;
- vect_t hv;
- fastf_t radius;
- fastf_t r2;
- fastf_t height;
- int arb_type;
- point_t p[8];
- size_t plane_cnt;
- plane_t *planes;
- /* An implicit plane, if present, may close a face on a parent solid */
- int have_implicit_plane;
- point_t implicit_plane_origin;
- vect_t implicit_plane_normal;
- /* bot */
- int csg_face_cnt;
- int csg_vert_cnt;
- int *csg_faces;
- point_t *csg_verts;
- /* information flags */
- int half_cyl;
- };
+/* Structure for holding parameters corresponding
+ * to a csg primitive. Not all parameters will be
+ * used for all primitives - the structure includes
+ * enough data slots to describe any primitive that may
+ * be matched by the shape recognition logic */
+struct csg_object_params {
+ struct subbrep_shoal_data *s;
+ int csg_type;
+ int negative;
+ /* Unique id number */
+ int csg_id;
+ char bool_op; /* Boolean operator - u = union (default), - = subtraction,
+ = intersection */
+ point_t origin;
+ vect_t hv;
+ fastf_t radius;
+ fastf_t r2;
+ fastf_t height;
+ int arb_type;
+ point_t p[8];
+ size_t plane_cnt;
+ plane_t *planes;
+ /* An implicit plane, if present, may close a face on a parent solid */
+ int have_implicit_plane;
+ point_t implicit_plane_origin;
+ vect_t implicit_plane_normal;
+ /* bot */
+ int csg_face_cnt;
+ int csg_vert_cnt;
+ int *csg_faces;
+ point_t *csg_verts;
+ /* information flags */
+ int half_cyl;
+};
- /* Forward declarations */
- struct subbrep_island_data;
+/* Forward declarations */
+struct subbrep_island_data;
- /* Topological shoal */
- struct subbrep_shoal_data {
- struct subbrep_island_data *i;
- int shoal_type;
- /* Unique id number */
- int shoal_id;
- struct csg_object_params *params;
- /* struct csg_obj_params */
- struct bu_ptbl *shoal_children;
+/* Topological shoal */
+struct subbrep_shoal_data {
+ struct subbrep_island_data *i;
+ int shoal_type;
+ /* Unique id number */
+ int shoal_id;
+ struct csg_object_params *params;
+ /* struct csg_obj_params */
+ struct bu_ptbl *shoal_children;
- /* Working information */
- int *shoal_loops;
- int shoal_loops_cnt;
- };
+ /* Working information */
+ int *shoal_loops;
+ int shoal_loops_cnt;
+};
- /* Topological island */
- struct subbrep_island_data {
+/* Topological island */
+struct subbrep_island_data {
- /* Overall type of island - typically comb or brep, but may
- * be an actual type if the nucleus corresponds to a single
- * implicit primitive */
- int island_type;
+ /* Overall type of island - typically comb or brep, but may
+ * be an actual type if the nucleus corresponds to a single
+ * implicit primitive */
+ int island_type;
- /* Unique id number */
- int island_id;
+ /* Unique id number */
+ int island_id;
- /* Context information */
- const ON_Brep *brep;
+ /* Context information */
+ const ON_Brep *brep;
- /* Shape representation data */
- ON_Brep *local_brep;
- char local_brep_bool_op; /* Boolean operator - u = union (default), - =
subtraction, + = intersection */
+ /* Shape representation data */
+ ON_Brep *local_brep;
+ char local_brep_bool_op; /* Boolean operator - u = union (default), - =
subtraction, + = intersection */
- /* Nucleus */
- struct subbrep_shoal_data *nucleus;
- /* struct subbrep_shoal_data */
- struct bu_ptbl *island_children;
+ /* Nucleus */
+ struct subbrep_shoal_data *nucleus;
+ /* struct subbrep_shoal_data */
+ struct bu_ptbl *island_children;
- /* For union objects, we list the subtractions it needs */
- struct bu_ptbl *subtractions;
+ /* For union objects, we list the subtractions it needs */
+ struct bu_ptbl *subtractions;
- /* subbrep metadata */
- struct bu_vls *key;
- ON_BoundingBox *bbox;
+ /* subbrep metadata */
+ struct bu_vls *key;
+ ON_BoundingBox *bbox;
- /* Working information - should probably be in private struct */
- void *face_surface_types;
- int *obj_cnt;
- int *island_faces;
- int *island_loops;
- int *fol; /* Faces with outer loops in object loop network */
- int *fil; /* Faces with only inner loops in object loop network */
- int island_faces_cnt;
- int island_loops_cnt;
- int fol_cnt;
- int fil_cnt;
- int null_vert_cnt;
- int *null_verts;
- int null_edge_cnt;
- int *null_edges;
- };
+ /* Working information - should probably be in private struct */
+ void *face_surface_types;
+ int *obj_cnt;
+ int *island_faces;
+ int *island_loops;
+ int *fol; /* Faces with outer loops in object loop network */
+ int *fil; /* Faces with only inner loops in object loop network */
+ int island_faces_cnt;
+ int island_loops_cnt;
+ int fol_cnt;
+ int fil_cnt;
+ int null_vert_cnt;
+ int *null_verts;
+ int null_edge_cnt;
+ int *null_edges;
+};
- extern BREP_EXPORT struct bu_ptbl *brep_to_csg(struct bu_vls *msgs, const
ON_Brep *brep);
+extern BREP_EXPORT struct bu_ptbl *brep_to_csg(struct bu_vls *msgs, const
ON_Brep *brep);
} /* extern C++ */
Modified: brlcad/trunk/include/brep/curvetree.h
===================================================================
--- brlcad/trunk/include/brep/curvetree.h 2019-05-20 18:35:39 UTC (rev
73095)
+++ brlcad/trunk/include/brep/curvetree.h 2019-05-20 18:58:50 UTC (rev
73096)
@@ -47,71 +47,71 @@
#ifdef __cplusplus
extern "C++" {
- namespace brlcad {
+namespace brlcad {
+ /**
+ * CurveTree declaration
+ */
+ class BREP_EXPORT CurveTree : public PooledObject<CurveTree> {
+ public:
+ explicit CurveTree(const ON_BrepFace *face);
+ ~CurveTree();
+
+ CurveTree(Deserializer &deserializer, const ON_BrepFace &face);
+ void serialize(Serializer &serializer) const;
+ std::vector<std::size_t> serialize_get_leaves_keys(const
std::list<const BRNode *> &leaves) const;
+ std::list<const BRNode *> serialize_get_leaves(const std::size_t *keys,
std::size_t num_keys) const;
+ void serialize_cleanup() const;
+
/**
- * CurveTree declaration
+ * Return just the leaves of the surface tree
*/
- class BREP_EXPORT CurveTree : public PooledObject<CurveTree> {
- public:
- explicit CurveTree(const ON_BrepFace *face);
- ~CurveTree();
+ void getLeaves(std::list<const BRNode *> &out_leaves) const;
+ void getLeavesAbove(std::list<const BRNode *> &out_leaves, const
ON_Interval &u, const ON_Interval &v) const;
+ void getLeavesAbove(std::list<const BRNode *> &out_leaves, const
ON_2dPoint &pt, fastf_t tol) const;
+ void getLeavesRight(std::list<const BRNode *> &out_leaves, const
ON_2dPoint &pt, fastf_t tol) const;
- CurveTree(Deserializer &deserializer, const ON_BrepFace &face);
- void serialize(Serializer &serializer) const;
- std::vector<std::size_t> serialize_get_leaves_keys(const
std::list<const BRNode *> &leaves) const;
- std::list<const BRNode *> serialize_get_leaves(const
std::size_t *keys, std::size_t num_keys) const;
- void serialize_cleanup() const;
+ private:
+ friend class BBNode;
- /**
- * Return just the leaves of the surface tree
- */
- void getLeaves(std::list<const BRNode *> &out_leaves) const;
- void getLeavesAbove(std::list<const BRNode *> &out_leaves,
const ON_Interval &u, const ON_Interval &v) const;
- void getLeavesAbove(std::list<const BRNode *> &out_leaves,
const ON_2dPoint &pt, fastf_t tol) const;
- void getLeavesRight(std::list<const BRNode *> &out_leaves,
const ON_2dPoint &pt, fastf_t tol) const;
+ CurveTree(const CurveTree &source);
+ CurveTree &operator=(const CurveTree &source);
- private:
- friend class BBNode;
+ const BRNode *getRootNode() const;
- CurveTree(const CurveTree &source);
- CurveTree &operator=(const CurveTree &source);
+ /**
+ * Calculate, using the surface bounding volume hierarchy, a uv
+ * estimate for the closest point on the surface to the point in
+ * 3-space.
+ */
+ ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt) const;
+ ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt, ON_Interval
&u, ON_Interval &v) const;
- const BRNode *getRootNode() const;
+ void getLeavesRight(std::list<const BRNode *> &out_leaves, const
ON_Interval &u, const ON_Interval &v) const;
- /**
- * Calculate, using the surface bounding volume hierarchy, a uv
- * estimate for the closest point on the surface to the point in
- * 3-space.
- */
- ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt) const;
- ON_2dPoint getClosestPointEstimate(const ON_3dPoint &pt,
ON_Interval &u, ON_Interval &v) const;
+ int depth() const;
- void getLeavesRight(std::list<const BRNode *> &out_leaves,
const ON_Interval &u, const ON_Interval &v) const;
+ bool getHVTangents(const ON_Curve *curve, const ON_Interval &t,
std::list<fastf_t> &list) const;
+ bool isLinear(const ON_Curve *curve, double min, double max) const;
+ BRNode *subdivideCurve(const ON_Curve *curve, int trim_index, int
adj_face_index, double min, double max, bool innerTrim, int depth) const;
+ BRNode *curveBBox(const ON_Curve *curve, int trim_index, int
adj_face_index, const ON_Interval &t, bool isLeaf, bool innerTrim, const
ON_BoundingBox &bb) const;
+ static ON_BoundingBox initialLoopBBox(const ON_BrepFace &face);
- int depth() const;
+ const ON_BrepFace * const m_face;
+ BRNode *m_root;
- bool getHVTangents(const ON_Curve *curve, const ON_Interval &t,
std::list<fastf_t> &list) const;
- bool isLinear(const ON_Curve *curve, double min, double max)
const;
- BRNode *subdivideCurve(const ON_Curve *curve, int trim_index,
int adj_face_index, double min, double max, bool innerTrim, int depth) const;
- BRNode *curveBBox(const ON_Curve *curve, int trim_index, int
adj_face_index, const ON_Interval &t, bool isLeaf, bool innerTrim, const
ON_BoundingBox &bb) const;
- static ON_BoundingBox initialLoopBBox(const ON_BrepFace &face);
- const ON_BrepFace * const m_face;
- BRNode *m_root;
+ struct Stl : public PooledObject<Stl> {
+ Stl() : m_sortedX() {}
+ std::vector<const BRNode *> m_sortedX;
+ } * const m_stl;
- struct Stl : public PooledObject<Stl> {
- Stl() : m_sortedX() {}
+ mutable std::map<const BRNode *, std::size_t> *m_sortedX_indices;
+ };
- std::vector<const BRNode *> m_sortedX;
- } * const m_stl;
+} /* namespace brlcad */
- mutable std::map<const BRNode *, std::size_t>
*m_sortedX_indices;
- };
-
- } /* namespace brlcad */
-
} /* extern C++ */
__END_DECLS
Modified: brlcad/trunk/include/brep/defines.h
===================================================================
--- brlcad/trunk/include/brep/defines.h 2019-05-20 18:35:39 UTC (rev 73095)
+++ brlcad/trunk/include/brep/defines.h 2019-05-20 18:58:50 UTC (rev 73096)
@@ -33,11 +33,11 @@
#ifdef __cplusplus
extern "C++" {
#define ON_NO_WINDOWS 1 /* don't let opennurbs include windows.h */
- /* Note - We aren't (yet) including opennurbs in our Doxygen output. Until
we
- * do, use cond to hide the opennurbs header from Doxygen. */
- /* @cond */
+/* Note - We aren't (yet) including opennurbs in our Doxygen output. Until we
+ * do, use cond to hide the opennurbs header from Doxygen. */
+/* @cond */
#include "opennurbs.h"
- /* @endcond */
+/* @endcond */
}
#endif
@@ -64,7 +64,7 @@
* compiling with a C compiler
*/
typedef struct _on_brep_placeholder {
- int dummy; /* MS Visual C hack which can be removed if the struct
contains something meaningful */
+ int dummy; /* MS Visual C hack which can be removed if the struct contains
something meaningful */
} ON_Brep;
#endif
Modified: brlcad/trunk/include/brep/intersect.h
===================================================================
--- brlcad/trunk/include/brep/intersect.h 2019-05-20 18:35:39 UTC (rev
73095)
+++ brlcad/trunk/include/brep/intersect.h 2019-05-20 18:58:50 UTC (rev
73096)
@@ -35,346 +35,346 @@
extern "C++" {
- /**
- * Dump the information of an ON_SSX_EVENT.
- */
- extern BREP_EXPORT void
- DumpSSXEvent(ON_SSX_EVENT &x, ON_TextLog &text_log);
+/**
+ * Dump the information of an ON_SSX_EVENT.
+ */
+extern BREP_EXPORT void
+DumpSSXEvent(ON_SSX_EVENT &x, ON_TextLog &text_log);
- /* Sub-division support for a curve.
- * It's similar to generating the bounding box tree, when the Split()
- * method is called, the curve is split into two parts, whose bounding
- * boxes become the children of the original curve's bbox.
- */
- class Subcurve {
- friend class Subsurface;
- private:
- ON_BoundingBox m_node;
- public:
- ON_Curve *m_curve;
- ON_Interval m_t;
- Subcurve *m_children[2];
- ON_BOOL32 m_islinear;
+/* Sub-division support for a curve.
+ * It's similar to generating the bounding box tree, when the Split()
+ * method is called, the curve is split into two parts, whose bounding
+ * boxes become the children of the original curve's bbox.
+ */
+class Subcurve {
+ friend class Subsurface;
+private:
+ ON_BoundingBox m_node;
+public:
+ ON_Curve *m_curve;
+ ON_Interval m_t;
+ Subcurve *m_children[2];
+ ON_BOOL32 m_islinear;
- Subcurve();
- Subcurve(ON_Curve *curve);
- Subcurve(const Subcurve &_scurve);
- ~Subcurve();
- int Split();
- void GetBBox(ON_3dPoint &min, ON_3dPoint &max);
- void SetBBox(const ON_BoundingBox &bbox);
- bool IsPointIn(const ON_3dPoint &pt, double tolerance = 0.0);
- bool Intersect(const Subcurve &other, double tolerance = 0.0,
ON_BoundingBox *intersection = NULL) const;
- };
+ Subcurve();
+ Subcurve(ON_Curve *curve);
+ Subcurve(const Subcurve &_scurve);
+ ~Subcurve();
+ int Split();
+ void GetBBox(ON_3dPoint &min, ON_3dPoint &max);
+ void SetBBox(const ON_BoundingBox &bbox);
+ bool IsPointIn(const ON_3dPoint &pt, double tolerance = 0.0);
+ bool Intersect(const Subcurve &other, double tolerance = 0.0,
ON_BoundingBox *intersection = NULL) const;
+};
- /* Sub-division support for a surface.
- * It's similar to generating the bounding box tree, when the Split()
- * method is called, the surface is split into two parts, whose bounding
- * boxes become the children of the original surface's bbox.
- */
- class Subsurface {
- private:
- ON_BoundingBox m_node;
- public:
- ON_Surface *m_surf;
- ON_Interval m_u, m_v;
- Subsurface *m_children[4];
- ON_BOOL32 m_isplanar;
+/* Sub-division support for a surface.
+ * It's similar to generating the bounding box tree, when the Split()
+ * method is called, the surface is split into two parts, whose bounding
+ * boxes become the children of the original surface's bbox.
+ */
+class Subsurface {
+private:
+ ON_BoundingBox m_node;
+public:
+ ON_Surface *m_surf;
+ ON_Interval m_u, m_v;
+ Subsurface *m_children[4];
+ ON_BOOL32 m_isplanar;
- Subsurface();
- Subsurface(ON_Surface *surf);
- Subsurface(const Subsurface &_ssurf);
- ~Subsurface();
+ Subsurface();
+ Subsurface(ON_Surface *surf);
+ Subsurface(const Subsurface &_ssurf);
+ ~Subsurface();
- int Split();
- void GetBBox(ON_3dPoint &min, ON_3dPoint &max);
- void SetBBox(const ON_BoundingBox &bbox);
- bool IsPointIn(const ON_3dPoint &pt, double tolerance = 0.0);
- bool Intersect(const Subcurve &curve, double tolerance = 0.0,
ON_BoundingBox *intersection = NULL) const;
- bool Intersect(const Subsurface &surf, double tolerance = 0.0,
ON_BoundingBox *intersection = NULL) const;
- };
+ int Split();
+ void GetBBox(ON_3dPoint &min, ON_3dPoint &max);
+ void SetBBox(const ON_BoundingBox &bbox);
+ bool IsPointIn(const ON_3dPoint &pt, double tolerance = 0.0);
+ bool Intersect(const Subcurve &curve, double tolerance = 0.0,
ON_BoundingBox *intersection = NULL) const;
+ bool Intersect(const Subsurface &surf, double tolerance = 0.0,
ON_BoundingBox *intersection = NULL) const;
+};
- /** The ON_PX_EVENT class is used to report point-point, point-curve
- * and point-surface intersection events.
+/** The ON_PX_EVENT class is used to report point-point, point-curve
+ * and point-surface intersection events.
+ */
+class BREP_EXPORT ON_PX_EVENT
+{
+public:
+ /** Default construction sets everything to zero. */
+ ON_PX_EVENT();
+
+ /**
+ * Compares point intersection events and sorts them in the
+ * canonical order.
+ *
+ * @retval -1 this < other
+ * @retval 0 this == other
+ * @retval +1 this > other
+ *
+ * @remarks ON_PX_EVENT::Compare is used to sort intersection
+ * events into canonical order.
*/
- class BREP_EXPORT ON_PX_EVENT
- {
- public:
- /** Default construction sets everything to zero. */
- ON_PX_EVENT();
+ static
+ int Compare(const ON_PX_EVENT *a, const ON_PX_EVENT *b);
- /**
- * Compares point intersection events and sorts them in the
- * canonical order.
- *
- * @retval -1 this < other
- * @retval 0 this == other
- * @retval +1 this > other
- *
- * @remarks ON_PX_EVENT::Compare is used to sort intersection
- * events into canonical order.
- */
- static
- int Compare(const ON_PX_EVENT *a, const ON_PX_EVENT *b);
+ /**
+ * Check point intersection event values to make sure they are
+ * valid.
+ *
+ * @param text_log [in] If not null and an error is found, then
+ * a description of the error is printed to text_log.
+ * @param intersection_tolerance [in] 0.0 or value used in
+ * intersection calculation.
+ * @param pointA [in] NULL or pointA passed to intersection
+ * calculation.
+ * @param pointB [in] NULL or pointB passed to intersection
+ * calculation.
+ * @param curveB [in] NULL or curveB passed to intersection
+ * calculation.
+ * @param curveB_domain [in] NULL or curveB domain used in
+ * intersection calculation.
+ * @param surfaceB [in] NULL or surfaceB passed to intersection
+ * calculation.
+ * @param surfaceB_domain0 [in] NULL or surfaceB "u" domain used
+ * in intersection calculation.
+ * @param surfaceB_domain1 [in] NULL or surfaceB "v" domain used
+ * in intersection calculation.
+ *
+ * @return True if event is valid.
+ */
+ bool IsValid(ON_TextLog *text_log,
+ double intersection_tolerance,
+ const class ON_3dPoint *pointA,
+ const class ON_3dPoint *pointB,
+ const class ON_Curve *curveB,
+ const class ON_Interval *curveB_domain,
+ const class ON_Surface *surfaceB,
+ const class ON_Interval *surfaceB_domain0,
+ const class ON_Interval *surfaceB_domain1) const;
- /**
- * Check point intersection event values to make sure they are
- * valid.
- *
- * @param text_log [in] If not null and an error is found, then
- * a description of the error is printed to text_log.
- * @param intersection_tolerance [in] 0.0 or value used in
- * intersection calculation.
- * @param pointA [in] NULL or pointA passed to intersection
- * calculation.
- * @param pointB [in] NULL or pointB passed to intersection
- * calculation.
- * @param curveB [in] NULL or curveB passed to intersection
- * calculation.
- * @param curveB_domain [in] NULL or curveB domain used in
- * intersection calculation.
- * @param surfaceB [in] NULL or surfaceB passed to intersection
- * calculation.
- * @param surfaceB_domain0 [in] NULL or surfaceB "u" domain used
- * in intersection calculation.
- * @param surfaceB_domain1 [in] NULL or surfaceB "v" domain used
- * in intersection calculation.
- *
- * @return True if event is valid.
- */
- bool IsValid(ON_TextLog *text_log,
- double intersection_tolerance,
- const class ON_3dPoint *pointA,
- const class ON_3dPoint *pointB,
- const class ON_Curve *curveB,
- const class ON_Interval *curveB_domain,
- const class ON_Surface *surfaceB,
- const class ON_Interval *surfaceB_domain0,
- const class ON_Interval *surfaceB_domain1) const;
+ void Dump(ON_TextLog &text_log) const;
- void Dump(ON_TextLog &text_log) const;
+ enum TYPE {
+ no_px_event = 0,
+ ppx_point = 1, /**< point-point intersection */
+ pcx_point = 2, /**< point-curve intersection */
+ psx_point = 3 /**< point-surface intersection */
+ };
- enum TYPE {
- no_px_event = 0,
- ppx_point = 1, /**< point-point intersection */
- pcx_point = 2, /**< point-curve intersection */
- psx_point = 3 /**< point-surface intersection */
- };
+ TYPE m_type;
- TYPE m_type;
+ ON_3dPoint m_A; /**< Point A in 3D space */
+ ON_3dPoint m_B; /**< Point B in 3D space */
- ON_3dPoint m_A; /**< Point A in 3D space */
- ON_3dPoint m_B; /**< Point B in 3D space */
+ ON_2dPoint m_b; /**< Point B in 2D space for the curve/surface
+ * For a curve, m_b[1] == 0
+ * For a point, m_b[0] == m_b[1] == 0
+ */
- ON_2dPoint m_b; /**< Point B in 2D space for the curve/surface
- * For a curve, m_b[1] == 0
- * For a point, m_b[0] == m_b[1] == 0
- */
+ ON_3dPoint m_Mid; /**< The mid-point of Point A and Point B */
+ double m_radius; /**< To trace the uncertainty area */
+};
- ON_3dPoint m_Mid; /**< The mid-point of Point A and Point B */
- double m_radius; /**< To trace the uncertainty area */
- };
+/**
+ * An overload of ON_Intersect for point-point intersection.
+ * Intersect pointA with pointB.
+ *
+ * @param pointA [in]
+ * @param pointB [in]
+ * @param x [out] Intersection events are appended to this array.
+ * @param tolerance [in] If the input intersection_tolerance <= 0.0,
+ * then 0.001 is used.
+ *
+ * @return True for an intersection. False for no intersection.
+ */
+extern BREP_EXPORT bool
+ON_Intersect(const ON_3dPoint &pointA,
+ const ON_3dPoint &pointB,
+ ON_ClassArray<ON_PX_EVENT> &x,
+ double tolerance = 0.0);
- /**
- * An overload of ON_Intersect for point-point intersection.
- * Intersect pointA with pointB.
- *
- * @param pointA [in]
- * @param pointB [in]
- * @param x [out] Intersection events are appended to this array.
- * @param tolerance [in] If the input intersection_tolerance <= 0.0,
- * then 0.001 is used.
- *
- * @return True for an intersection. False for no intersection.
- */
- extern BREP_EXPORT bool
- ON_Intersect(const ON_3dPoint &pointA,
- const ON_3dPoint &pointB,
- ON_ClassArray<ON_PX_EVENT> &x,
- double tolerance = 0.0);
+/**
+ * An overload of ON_Intersect for point-curve intersection.
+ * Intersect pointA with curveB.
+ *
+ * @param pointA [in] pointA
+ * @param curveB [in] curveB
+ * @param x [out] Intersection events are appended to this array.
+ * @param tolerance [in] If the input intersection_tolerance <= 0.0,
+ * then 0.001 is used.
+ * @param curveB_domain [in] optional restriction on curveB t domain
+ * @param treeB [in] optional curve tree for curveB, to avoid re-computation
+ *
+ * @return True for an intersection. False for no intersection.
+ */
+extern BREP_EXPORT bool
+ON_Intersect(const ON_3dPoint &pointA,
+ const ON_Curve &curveB,
+ ON_ClassArray<ON_PX_EVENT> &x,
+ double tolerance = 0.0,
+ const ON_Interval *curveB_domain = 0,
+ Subcurve *treeB = 0);
- /**
- * An overload of ON_Intersect for point-curve intersection.
- * Intersect pointA with curveB.
- *
- * @param pointA [in] pointA
- * @param curveB [in] curveB
- * @param x [out] Intersection events are appended to this array.
- * @param tolerance [in] If the input intersection_tolerance <= 0.0,
- * then 0.001 is used.
- * @param curveB_domain [in] optional restriction on curveB t domain
- * @param treeB [in] optional curve tree for curveB, to avoid
re-computation
- *
- * @return True for an intersection. False for no intersection.
- */
- extern BREP_EXPORT bool
- ON_Intersect(const ON_3dPoint &pointA,
- const ON_Curve &curveB,
- ON_ClassArray<ON_PX_EVENT> &x,
- double tolerance = 0.0,
- const ON_Interval *curveB_domain = 0,
- Subcurve *treeB = 0);
+/**
+ * An overload of ON_Intersect for point-surface intersection.
+ * Intersect pointA with surfaceB.
+ *
+ * @param pointA [in]
+ * @param surfaceB [in]
+ * @param x [out] Intersection events are appended to this array.
+ * @param tolerance [in] If the input intersection_tolerance <= 0.0,
+ * then 0.001 is used.
+ * @param surfaceB_udomain [in] optional restriction on surfaceB u
+ * domain
+ * @param surfaceB_vdomain [in] optional restriction on surfaceB v
+ * domain
+ * @param treeB [in] optional surface tree for surfaceB, to avoid
+ * re-computation
+ *
+ * @return True for an intersection. False for no intersection.
+ */
+extern BREP_EXPORT bool
+ON_Intersect(const ON_3dPoint &pointA,
+ const ON_Surface &surfaceB,
+ ON_ClassArray<ON_PX_EVENT> &x,
+ double tolerance = 0.0,
+ const ON_Interval *surfaceB_udomain = 0,
+ const ON_Interval *surfaceB_vdomain = 0,
+ Subsurface *treeB = 0);
- /**
- * An overload of ON_Intersect for point-surface intersection.
- * Intersect pointA with surfaceB.
- *
- * @param pointA [in]
- * @param surfaceB [in]
- * @param x [out] Intersection events are appended to this array.
- * @param tolerance [in] If the input intersection_tolerance <= 0.0,
- * then 0.001 is used.
- * @param surfaceB_udomain [in] optional restriction on surfaceB u
- * domain
- * @param surfaceB_vdomain [in] optional restriction on surfaceB v
- * domain
- * @param treeB [in] optional surface tree for surfaceB, to avoid
- * re-computation
- *
- * @return True for an intersection. False for no intersection.
- */
- extern BREP_EXPORT bool
- ON_Intersect(const ON_3dPoint &pointA,
- const ON_Surface &surfaceB,
- ON_ClassArray<ON_PX_EVENT> &x,
- double tolerance = 0.0,
- const ON_Interval *surfaceB_udomain = 0,
- const ON_Interval *surfaceB_vdomain = 0,
- Subsurface *treeB = 0);
+/**
+ * An overload of ON_Intersect for curve-curve intersection.
+ * Intersect curveA with curveB.
+ *
+ * Parameters:
+ * @param curveA [in]
+ * @param curveB [in]
+ * @param x [out] Intersection events are appended to this array.
+ * @param intersection_tolerance [in] If the distance from a point
+ * on curveA to curveB is <= intersection tolerance, then the
+ * point will be part of an intersection event. If the input
+ * intersection_tolerance <= 0.0, then 0.001 is used.
+ * @param overlap_tolerance [in] If t1 and t2 are parameters of
+ * curveA's intersection events and the distance from curveA(t)
+ * to curveB is <= overlap_tolerance for every t1 <= t <= t2,
+ * then the event will be returned as an overlap event. If the
+ * input overlap_tolerance <= 0.0, then
+ * intersection_tolerance * 2.0 is used.
+ * @param curveA_domain [in] optional restriction on curveA domain
+ * @param curveB_domain [in] optional restriction on curveB domain
+ * @param treeA [in] optional curve tree for curveA, to avoid re
+ * computation
+ * @param treeB [in] optional curve tree for curveB, to avoid re
+ * computation
+ *
+ * @return Number of intersection events appended to x.
+ */
+extern BREP_EXPORT int
+ON_Intersect(const ON_Curve *curveA,
+ const ON_Curve *curveB,
+ ON_SimpleArray<ON_X_EVENT> &x,
+ double intersection_tolerance = 0.0,
+ double overlap_tolerance = 0.0,
+ const ON_Interval *curveA_domain = 0,
+ const ON_Interval *curveB_domain = 0,
+ Subcurve *treeA = 0,
+ Subcurve *treeB = 0);
- /**
- * An overload of ON_Intersect for curve-curve intersection.
- * Intersect curveA with curveB.
- *
- * Parameters:
- * @param curveA [in]
- * @param curveB [in]
- * @param x [out] Intersection events are appended to this array.
- * @param intersection_tolerance [in] If the distance from a point
- * on curveA to curveB is <= intersection tolerance, then the
- * point will be part of an intersection event. If the input
- * intersection_tolerance <= 0.0, then 0.001 is used.
- * @param overlap_tolerance [in] If t1 and t2 are parameters of
- * curveA's intersection events and the distance from curveA(t)
- * to curveB is <= overlap_tolerance for every t1 <= t <= t2,
- * then the event will be returned as an overlap event. If the
- * input overlap_tolerance <= 0.0, then
- * intersection_tolerance * 2.0 is used.
- * @param curveA_domain [in] optional restriction on curveA domain
- * @param curveB_domain [in] optional restriction on curveB domain
- * @param treeA [in] optional curve tree for curveA, to avoid re
- * computation
- * @param treeB [in] optional curve tree for curveB, to avoid re
- * computation
- *
- * @return Number of intersection events appended to x.
- */
- extern BREP_EXPORT int
- ON_Intersect(const ON_Curve *curveA,
- const ON_Curve *curveB,
- ON_SimpleArray<ON_X_EVENT> &x,
- double intersection_tolerance = 0.0,
- double overlap_tolerance = 0.0,
- const ON_Interval *curveA_domain = 0,
- const ON_Interval *curveB_domain = 0,
- Subcurve *treeA = 0,
- Subcurve *treeB = 0);
+/**
+ * An overload of ON_Intersect for curve-surface intersection.
+ * Intersect curveA with surfaceB.
+ *
+ * @param curveA [in]
+ * @param surfaceB [in]
+ * @param x [out] Intersection events are appended to this array.
+ * @param intersection_tolerance [in] If the distance from a
+ * point on curveA to the surface is <= intersection tolerance,
+ * then the point will be part of an intersection event, or
+ * there is an intersection event the point leads to. If the
+ * input intersection_tolerance <= 0.0, then 0.001 is used.
+ * @param overlap_tolerance [in] If the input overlap_tolerance
+ * <= 0.0, then 2.0*intersection_tolerance is used. Otherwise,
+ * overlap tolerance must be >= intersection_tolerance. In all
+ * cases, the intersection calculation is performed with an
+ * overlap_tolerance that is >= intersection_tolerance. If t1
+ * and t2 are curve parameters of intersection events and the
+ * distance from curve(t) to the surface is <=
+ * overlap_tolerance for every t1 <= t <= t2, then the event
+ * will be returned as an overlap event.
+ * @param curveA_domain [in] optional restriction on curveA domain
+ * @param surfaceB_udomain [in] optional restriction on surfaceB
+ * u domain
+ * @param surfaceB_vdomain [in] optional restriction on surfaceB
+ * v domain
+ * @param overlap2d [out] return the 2D overlap curves on surfaceB.
+ * overlap2d[i] is the curve for event x[i].
+ * @param treeA [in] optional curve tree for curveA, to avoid
+ * re-computation
+ * @param treeB [in] optional surface tree for surfaceB, to avoid
+ * re-computation
+ *
+ * @return Number of intersection events appended to x.
+ */
+extern BREP_EXPORT int
+ON_Intersect(const ON_Curve *curveA,
+ const ON_Surface *surfaceB,
+ ON_SimpleArray<ON_X_EVENT> &x,
+ double intersection_tolerance = 0.0,
+ double overlap_tolerance = 0.0,
+ const ON_Interval *curveA_domain = 0,
+ const ON_Interval *surfaceB_udomain = 0,
+ const ON_Interval *surfaceB_vdomain = 0,
+ ON_CurveArray *overlap2d = 0,
+ Subcurve *treeA = 0,
+ Subsurface *treeB = 0);
- /**
- * An overload of ON_Intersect for curve-surface intersection.
- * Intersect curveA with surfaceB.
- *
- * @param curveA [in]
- * @param surfaceB [in]
- * @param x [out] Intersection events are appended to this array.
- * @param intersection_tolerance [in] If the distance from a
- * point on curveA to the surface is <= intersection tolerance,
- * then the point will be part of an intersection event, or
- * there is an intersection event the point leads to. If the
- * input intersection_tolerance <= 0.0, then 0.001 is used.
- * @param overlap_tolerance [in] If the input overlap_tolerance
- * <= 0.0, then 2.0*intersection_tolerance is used. Otherwise,
- * overlap tolerance must be >= intersection_tolerance. In all
- * cases, the intersection calculation is performed with an
- * overlap_tolerance that is >= intersection_tolerance. If t1
- * and t2 are curve parameters of intersection events and the
- * distance from curve(t) to the surface is <=
- * overlap_tolerance for every t1 <= t <= t2, then the event
- * will be returned as an overlap event.
- * @param curveA_domain [in] optional restriction on curveA domain
- * @param surfaceB_udomain [in] optional restriction on surfaceB
- * u domain
- * @param surfaceB_vdomain [in] optional restriction on surfaceB
- * v domain
- * @param overlap2d [out] return the 2D overlap curves on surfaceB.
- * overlap2d[i] is the curve for event x[i].
- * @param treeA [in] optional curve tree for curveA, to avoid
- * re-computation
- * @param treeB [in] optional surface tree for surfaceB, to avoid
- * re-computation
- *
- * @return Number of intersection events appended to x.
- */
- extern BREP_EXPORT int
- ON_Intersect(const ON_Curve *curveA,
- const ON_Surface *surfaceB,
- ON_SimpleArray<ON_X_EVENT> &x,
- double intersection_tolerance = 0.0,
- double overlap_tolerance = 0.0,
- const ON_Interval *curveA_domain = 0,
- const ON_Interval *surfaceB_udomain = 0,
- const ON_Interval *surfaceB_vdomain = 0,
- ON_CurveArray *overlap2d = 0,
- Subcurve *treeA = 0,
- Subsurface *treeB = 0);
+/**
+ * An overload of ON_Intersect for surface-surface intersection.
+ * Intersect surfaceA with surfaceB.
+ *
+ * @param surfA [in]
+ * @param surfB [in]
+ * @param x [out] Intersection events are appended to this array.
+ * @param intersection_tolerance [in] If the input
+ * intersection_tolerance <= 0.0, then 0.001 is used.
+ * @param overlap_tolerance [in] If positive, then overlap_tolerance
+ * must be >= intersection_tolerance and is used to test for
+ * overlapping regions. If the input overlap_tolerance <= 0.0,
+ * then 2*intersection_tolerance is used.
+ * @param fitting_tolerance [in] If fitting_tolerance is > 0 and
+ * >= intersection_tolerance, then the intersection curves are
+ * fit to this tolerance. If input fitting_tolerance <= 0.0 or
+ * < intersection_tolerance, then intersection_tolerance is used.
+ * @param surfaceA_udomain [in] optional restriction on surfaceA
+ * u domain
+ * @param surfaceA_vdomain [in] optional restriction on surfaceA
+ * v domain
+ * @param surfaceB_udomain [in] optional restriction on surfaceB
+ * u domain
+ * @param surfaceB_vdomain [in] optional restriction on surfaceB
+ * v domain
+ * @param treeA [in] optional surface tree for surfaceA, to avoid
+ * re-computation
+ * @param treeB [in] optional surface tree for surfaceB, to avoid
+ * re-computation
+ *
+ * @return Number of intersection events appended to x.
+ */
+extern BREP_EXPORT int
+ON_Intersect(const ON_Surface *surfA,
+ const ON_Surface *surfB,
+ ON_ClassArray<ON_SSX_EVENT> &x,
+ double intersection_tolerance = 0.0,
+ double overlap_tolerance = 0.0,
+ double fitting_tolerance = 0.0,
+ const ON_Interval *surfaceA_udomain = 0,
+ const ON_Interval *surfaceA_vdomain = 0,
+ const ON_Interval *surfaceB_udomain = 0,
+ const ON_Interval *surfaceB_vdomain = 0,
+ Subsurface *treeA = 0,
+ Subsurface *treeB = 0);
- /**
- * An overload of ON_Intersect for surface-surface intersection.
- * Intersect surfaceA with surfaceB.
- *
- * @param surfA [in]
- * @param surfB [in]
- * @param x [out] Intersection events are appended to this array.
- * @param intersection_tolerance [in] If the input
- * intersection_tolerance <= 0.0, then 0.001 is used.
- * @param overlap_tolerance [in] If positive, then overlap_tolerance
- * must be >= intersection_tolerance and is used to test for
- * overlapping regions. If the input overlap_tolerance <= 0.0,
- * then 2*intersection_tolerance is used.
- * @param fitting_tolerance [in] If fitting_tolerance is > 0 and
- * >= intersection_tolerance, then the intersection curves are
- * fit to this tolerance. If input fitting_tolerance <= 0.0 or
- * < intersection_tolerance, then intersection_tolerance is used.
- * @param surfaceA_udomain [in] optional restriction on surfaceA
- * u domain
- * @param surfaceA_vdomain [in] optional restriction on surfaceA
- * v domain
- * @param surfaceB_udomain [in] optional restriction on surfaceB
- * u domain
- * @param surfaceB_vdomain [in] optional restriction on surfaceB
- * v domain
- * @param treeA [in] optional surface tree for surfaceA, to avoid
- * re-computation
- * @param treeB [in] optional surface tree for surfaceB, to avoid
- * re-computation
- *
- * @return Number of intersection events appended to x.
- */
- extern BREP_EXPORT int
- ON_Intersect(const ON_Surface *surfA,
- const ON_Surface *surfB,
- ON_ClassArray<ON_SSX_EVENT> &x,
- double intersection_tolerance = 0.0,
- double overlap_tolerance = 0.0,
- double fitting_tolerance = 0.0,
- const ON_Interval *surfaceA_udomain = 0,
- const ON_Interval *surfaceA_vdomain = 0,
- const ON_Interval *surfaceB_udomain = 0,
- const ON_Interval *surfaceB_vdomain = 0,
- Subsurface *treeA = 0,
- Subsurface *treeB = 0);
-
} /* extern C++ */
#endif
Modified: brlcad/trunk/include/brep/pullback.h
===================================================================
--- brlcad/trunk/include/brep/pullback.h 2019-05-20 18:35:39 UTC (rev
73095)
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits