Revision: 44637
          http://brlcad.svn.sourceforge.net/brlcad/?rev=44637&view=rev
Author:   r_weiss
Date:     2011-05-19 22:07:24 +0000 (Thu, 19 May 2011)

Log Message:
-----------
Updated nmg boolean functions using the classlist array. Changed the classlist 
from 'short' to 'char'.

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-19 19:23:33 UTC (rev 44636)
+++ brlcad/trunk/include/raytrace.h     2011-05-19 22:07:24 UTC (rev 44637)
@@ -5245,7 +5245,7 @@
 /* graphical display of classifier results */
 RT_EXPORT BU_EXTERN(void nmg_show_broken_classifier_stuff,
                    (unsigned long      *p,
-                    short      **classlist,
+                    char       **classlist,
                     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,
-                    short **classlist,
+                    char **classlist,
                     const struct bn_tol *tol));
 
 /* from nmg_fcut.c */
@@ -5414,7 +5414,7 @@
                    (struct shell       *sA,
                     struct shell       *sB,
                     int                op,
-                    short              **classlist,
+                    char               **classlist,
                     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-19 19:23:33 UTC 
(rev 44636)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_bool.c    2011-05-19 22:07:24 UTC 
(rev 44637)
@@ -119,7 +119,7 @@
  * edge.
  */
 void
-nmg_show_each_loop(struct shell *s, short **classlist, int new, int fancy, 
const char *str)
+nmg_show_each_loop(struct shell *s, char **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, short 
**classlist)
+nmg_classify_shared_edges_verts(struct shell *sA, struct shell *sB, char 
**classlist)
 {
     struct bu_ptbl verts;
     struct bu_ptbl edges;
@@ -552,7 +552,7 @@
 {
     int i;
     long nelem;
-    short *classlist[8];
+    char *classlist[8];
     FILE *fd, *fp;
     struct model *m;
     struct nmgregion *rA;
@@ -661,16 +661,14 @@
 
     nmg_m_reindex(m, 0);
 
-    /* Allocate storage for classlist[].
-     * Allocate each of the 8 class lists one at a time. This will
-     * assist with debugging to determine if each array read/write
-     * is within its allocated space. The datatype needs to accommodate
-     * values -1 thru 7 therefore a signed datatype is necessary.
+    /* Allocate storage for classlist[]. Allocate each of the 8 class
+     * lists one at a time. This will assist with debugging to
+     * determine if each array read/write is within its allocated space.
      */
 
     nelem = m->maxindex;
     for (i = 0; i < 8; i++) {
-        classlist[i] = (short *)bu_calloc(nelem, sizeof(short), "nmg_bool 
classlist_base");
+        classlist[i] = (char *)bu_calloc(nelem, sizeof(char), "nmg_bool 
classlist");
     }
 
     nmg_classify_shared_edges_verts(sA, sB, classlist);
@@ -804,12 +802,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((short *)classlist[4+NMG_CLASS_AonBshared],
-          (short *)classlist[0+NMG_CLASS_AonBshared],
-          nelem*sizeof(short *));
-    memcpy((short *)classlist[4+NMG_CLASS_AonBanti],
-          (short *)classlist[0+NMG_CLASS_AonBanti],
-          nelem*sizeof(short *));
+    memcpy((char *)classlist[4+NMG_CLASS_AonBshared],
+          (char *)classlist[0+NMG_CLASS_AonBshared],
+          nelem*sizeof(char));
+    memcpy((char *)classlist[4+NMG_CLASS_AonBanti],
+          (char *)classlist[0+NMG_CLASS_AonBanti],
+          nelem*sizeof(char));
     nmg_class_shells(sB, sA, &classlist[4], tol);
 
     if (rt_g.NMG_debug & (DEBUG_GRAPHCL|DEBUG_PL_LOOP)) {
@@ -913,7 +911,7 @@
     }
 
     for (i = 0; i < 8; i++) {
-        bu_free((short *)classlist[i], "nmg_bool classlist");
+        bu_free((char *)classlist[i], "nmg_bool classlist");
     }
 
     if (rt_g.NMG_debug & DEBUG_BOOL) {

Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_class.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_class.c   2011-05-19 19:23:33 UTC 
(rev 44636)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_class.c   2011-05-19 22:07:24 UTC 
(rev 44637)
@@ -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,
-                                 short **classlist, const struct bn_tol *tol));
+                                 char **classlist, const struct bn_tol *tol));
 static int class_eu_vs_s BU_ARGS((struct edgeuse *eu, struct shell *s,
-                                 short **classlist, const struct bn_tol *tol));
+                                 char **classlist, const struct bn_tol *tol));
 static int class_lu_vs_s BU_ARGS((struct loopuse *lu, struct shell *s,
-                                 short **classlist, const struct bn_tol *tol));
+                                 char **classlist, const struct bn_tol *tol));
 static void class_fu_vs_s BU_ARGS((struct faceuse *fu, struct shell *s,
-                                  short **classlist, const struct bn_tol 
*tol));
+                                  char **classlist, 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, short **classlist, const 
struct bn_tol *tol)
+class_vu_vs_s(struct vertexuse *vu, struct shell *sB, char **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, short **classlist, const 
struct bn_tol *tol)
+class_eu_vs_s(struct edgeuse *eu, struct shell *s, char **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, short **classlist, int newclass)
+nmg_reclassify_lu_eu(struct loopuse *lu, char **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, short **classlist, const 
struct bn_tol *tol)
+class_lu_vs_s(struct loopuse *lu, struct shell *s, char **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, short **classlist, const 
struct bn_tol *tol)
+class_fu_vs_s(struct faceuse *fu, struct shell *s, char **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, short **classlist, const 
struct bn_tol *tol)
+nmg_class_shells(struct shell *sA, struct shell *sB, char **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-19 19:23:33 UTC 
(rev 44636)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_eval.c    2011-05-19 22:07:24 UTC 
(rev 44637)
@@ -43,7 +43,7 @@
     struct shell *bs_dest;
     struct shell *bs_src;
     int bs_isA;                /* true if A, else doing B */
-    short **bs_classtab;
+    char **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, short 
**classlist, const struct bn_tol *tol)
+nmg_evaluate_boolean(struct shell *sA, struct shell *sB, int op, char 
**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-19 19:23:33 UTC 
(rev 44636)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c    2011-05-19 22:07:24 UTC 
(rev 44637)
@@ -1515,7 +1515,7 @@
  ************************************************************************/
 
 int nmg_class_nothing_broken=1;
-static short **global_classlist;
+static char **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 == (short **)NULL) { \
+       if (global_classlist == (char **)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, short **classlist, int 
all_new, int fancy, const char *a_string)
+nmg_show_broken_classifier_stuff(unsigned long *p, char **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.

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to