[brlcad-commits] SF.net SVN: brlcad:[44606] brlcad/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <r_...@us...> - 2011-05-10 20:33:17
|
Revision: 44606 http://brlcad.svn.sourceforge.net/brlcad/?rev=44606&view=rev Author: r_weiss Date: 2011-05-10 20:33:10 +0000 (Tue, 10 May 2011) Log Message: ----------- Updated nmg boolean functions using the classlist array. Changed the classlist type from 'long' to 'size_t'. Modified Paths: -------------- brlcad/trunk/include/raytrace.h brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c brlcad/trunk/src/librt/primitives/nmg/nmg_class.c brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c Modified: brlcad/trunk/include/raytrace.h =================================================================== --- brlcad/trunk/include/raytrace.h 2011-05-10 20:00:04 UTC (rev 44605) +++ brlcad/trunk/include/raytrace.h 2011-05-10 20:33:10 UTC (rev 44606) @@ -5245,7 +5245,7 @@ /* graphical display of classifier results */ RT_EXPORT BU_EXTERN(void nmg_show_broken_classifier_stuff, (unsigned long *p, - long *classlist[4], + size_t *classlist[4], int all_new, int fancy, const char *a_string)); @@ -5354,7 +5354,7 @@ RT_EXPORT BU_EXTERN(void nmg_class_shells, (struct shell *sA, struct shell *sB, - long *classlist[4], + size_t *classlist[4], const struct bn_tol *tol)); /* from nmg_fcut.c */ @@ -5414,7 +5414,7 @@ (struct shell *sA, struct shell *sB, int op, - long *classlist[8], + size_t *classlist[8], const struct bn_tol *tol)); /* The following functions cannot be publicly declared because struct Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c 2011-05-10 20:00:04 UTC (rev 44605) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c 2011-05-10 20:33:10 UTC (rev 44606) @@ -119,7 +119,7 @@ * edge. */ void -nmg_show_each_loop(struct shell *s, long int **classlist, int new, int fancy, const char *str) +nmg_show_each_loop(struct shell *s, size_t **classlist, int new, int fancy, const char *str) /* non-zero means flush previous vlist */ @@ -343,7 +343,7 @@ */ static void -nmg_classify_shared_edges_verts(struct shell *sA, struct shell *sB, long int **classlist) +nmg_classify_shared_edges_verts(struct shell *sA, struct shell *sB, size_t **classlist) { struct bu_ptbl verts; struct bu_ptbl edges; @@ -551,9 +551,9 @@ static struct shell * nmg_bool(struct shell *sA, struct shell *sB, const int oper, const struct bn_tol *tol) { int i; - int nelem; - long *classlist[8]; - long *classlist_base; + size_t nelem; + size_t *classlist[8]; + size_t *classlist_base; FILE *fd, *fp; struct model *m; struct nmgregion *rA; @@ -677,8 +677,8 @@ * Maybe space can be increased as necessary. */ nelem = (m->maxindex)*10+1; /* includes extra space */ - classlist_base = (long *)bu_calloc(8 * nelem + 1, - sizeof(long), "nmg_bool classlist_base"); + classlist_base = (size_t *)bu_calloc(8 * nelem + 1, + sizeof(size_t), "nmg_bool classlist_base"); for (i = 0; i < 8; i++) { classlist[i] = classlist_base + 8 + (i * nelem); } @@ -815,12 +815,12 @@ * A -vs- B live in classlist[0..3], B -vs- A live in classlist[4..7]. */ nmg_class_shells(sA, sB, &classlist[0], tol); - memcpy((char *)classlist[4+NMG_CLASS_AonBshared], - (char *)classlist[0+NMG_CLASS_AonBshared], - nelem*sizeof(long)); - memcpy((char *)classlist[4+NMG_CLASS_AonBanti], - (char *)classlist[0+NMG_CLASS_AonBanti], - nelem*sizeof(long)); + memcpy((size_t *)classlist[4+NMG_CLASS_AonBshared], + (size_t *)classlist[0+NMG_CLASS_AonBshared], + nelem*sizeof(size_t *)); + memcpy((size_t *)classlist[4+NMG_CLASS_AonBanti], + (size_t *)classlist[0+NMG_CLASS_AonBanti], + nelem*sizeof(size_t *)); nmg_class_shells(sB, sA, &classlist[4], tol); if (rt_g.NMG_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) { @@ -923,7 +923,7 @@ } } - bu_free((char *)classlist_base, "nmg_bool classlist_base"); + bu_free((size_t *)classlist_base, "nmg_bool classlist_base"); if (rt_g.NMG_debug & DEBUG_BOOL) { bu_log("Returning from NMG_BOOL\n"); Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_class.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_class.c 2011-05-10 20:00:04 UTC (rev 44605) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_class.c 2011-05-10 20:33:10 UTC (rev 44606) @@ -80,13 +80,13 @@ const point_t pt, const struct loopuse *lu, const struct bn_tol *tol)); static int class_vu_vs_s BU_ARGS((struct vertexuse *vu, struct shell *sB, - long *classlist[4], const struct bn_tol *tol)); + size_t *classlist[4], const struct bn_tol *tol)); static int class_eu_vs_s BU_ARGS((struct edgeuse *eu, struct shell *s, - long *classlist[4], const struct bn_tol *tol)); + size_t *classlist[4], const struct bn_tol *tol)); static int class_lu_vs_s BU_ARGS((struct loopuse *lu, struct shell *s, - long *classlist[4], const struct bn_tol *tol)); + size_t *classlist[4], const struct bn_tol *tol)); static void class_fu_vs_s BU_ARGS((struct faceuse *fu, struct shell *s, - long *classlist[4], const struct bn_tol *tol)); + size_t *classlist[4], const struct bn_tol *tol)); /** * N M G _ C L A S S _ S T A T U S @@ -744,7 +744,7 @@ * Classify a loopuse/vertexuse from shell A WRT shell B. */ static int -class_vu_vs_s(struct vertexuse *vu, struct shell *sB, long int **classlist, const struct bn_tol *tol) +class_vu_vs_s(struct vertexuse *vu, struct shell *sB, size_t **classlist, const struct bn_tol *tol) { struct vertexuse *vup; pointp_t pt; @@ -864,7 +864,7 @@ * C L A S S _ E U _ V S _ S */ static int -class_eu_vs_s(struct edgeuse *eu, struct shell *s, long int **classlist, const struct bn_tol *tol) +class_eu_vs_s(struct edgeuse *eu, struct shell *s, size_t **classlist, const struct bn_tol *tol) { int euv_cl, matev_cl; int status = 0; @@ -1209,7 +1209,7 @@ * "newclass" should only be AonBshared or AonBanti. */ void -nmg_reclassify_lu_eu(struct loopuse *lu, long int **classlist, int newclass) +nmg_reclassify_lu_eu(struct loopuse *lu, size_t **classlist, int newclass) { struct vertexuse *vu; struct edgeuse *eu; @@ -1454,7 +1454,7 @@ * class_fu_vs_s */ static int -class_lu_vs_s(struct loopuse *lu, struct shell *s, long int **classlist, const struct bn_tol *tol) +class_lu_vs_s(struct loopuse *lu, struct shell *s, size_t **classlist, const struct bn_tol *tol) { int class; unsigned int in, outside, on; @@ -1838,7 +1838,7 @@ * nmg_class_shells() */ static void -class_fu_vs_s(struct faceuse *fu, struct shell *s, long int **classlist, const struct bn_tol *tol) +class_fu_vs_s(struct faceuse *fu, struct shell *s, size_t **classlist, const struct bn_tol *tol) { struct loopuse *lu; plane_t n; @@ -1872,7 +1872,7 @@ * nmg_bool.c */ void -nmg_class_shells(struct shell *sA, struct shell *sB, long int **classlist, const struct bn_tol *tol) +nmg_class_shells(struct shell *sA, struct shell *sB, size_t **classlist, const struct bn_tol *tol) { struct faceuse *fu; struct loopuse *lu; Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c 2011-05-10 20:00:04 UTC (rev 44605) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c 2011-05-10 20:33:10 UTC (rev 44606) @@ -43,7 +43,7 @@ struct shell *bs_dest; struct shell *bs_src; int bs_isA; /* true if A, else doing B */ - long **bs_classtab; + size_t **bs_classtab; const int *bs_actions; const struct bn_tol *bs_tol; }; @@ -193,7 +193,7 @@ * */ void -nmg_evaluate_boolean(struct shell *sA, struct shell *sB, int op, long int **classlist, const struct bn_tol *tol) +nmg_evaluate_boolean(struct shell *sA, struct shell *sB, int op, size_t **classlist, const struct bn_tol *tol) { int const *actions; struct nmg_bool_state bool_state; Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c 2011-05-10 20:00:04 UTC (rev 44605) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c 2011-05-10 20:33:10 UTC (rev 44606) @@ -1515,7 +1515,7 @@ ************************************************************************/ int nmg_class_nothing_broken=1; -static long **global_classlist; +static size_t **global_classlist; static long *broken_tab; static int broken_tab_len; static int broken_color; @@ -1528,7 +1528,7 @@ { 255, 255, 125 } /* no classification list (cyan) */ }; #define PICK_BROKEN_COLOR(p) { \ - if (global_classlist == (long **)NULL) { \ + if (global_classlist == (size_t **)NULL) { \ broken_color = 5; \ } else if (NMG_INDEX_TEST(global_classlist[NMG_CLASS_AinB], (p))) \ broken_color = NMG_CLASS_AinB; \ @@ -1808,7 +1808,7 @@ * that this is a graphical display of classifier operation. */ void -nmg_show_broken_classifier_stuff(unsigned long *p, long int **classlist, int all_new, int fancy, const char *a_string) +nmg_show_broken_classifier_stuff(unsigned long *p, size_t **classlist, int all_new, int fancy, const char *a_string) { static struct bn_vlblock *vbp = (struct bn_vlblock *)NULL; struct model *m; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |