Revision: 45860
http://brlcad.svn.sourceforge.net/brlcad/?rev=45860&view=rev
Author: brlcad
Date: 2011-08-09 22:25:21 +0000 (Tue, 09 Aug 2011)
Log Message:
-----------
add a new private header for dsp-implementation use, moving the DSP() macro
from dsp.c to this new dsp.h header so that the brep routine can use the same
macro. remove the dsp_val() debugging wrapper function while we're at it.
Modified Paths:
--------------
brlcad/trunk/src/librt/CMakeLists.txt
brlcad/trunk/src/librt/Makefile.am
brlcad/trunk/src/librt/primitives/dsp/dsp.c
Added Paths:
-----------
brlcad/trunk/src/librt/primitives/dsp/dsp.h
Modified: brlcad/trunk/src/librt/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/librt/CMakeLists.txt 2011-08-09 22:21:47 UTC (rev
45859)
+++ brlcad/trunk/src/librt/CMakeLists.txt 2011-08-09 22:25:21 UTC (rev
45860)
@@ -230,6 +230,7 @@
primitives/bot/tie.c
primitives/bot/tie_kdtree.c
primitives/brep/brep_debug.h
+ primitives/dsp/dsp.h
primitives/fixpt.h
primitives/metaball/metaball.h
primitives/nmg/nmg_junk.c
Modified: brlcad/trunk/src/librt/Makefile.am
===================================================================
--- brlcad/trunk/src/librt/Makefile.am 2011-08-09 22:21:47 UTC (rev 45859)
+++ brlcad/trunk/src/librt/Makefile.am 2011-08-09 22:25:21 UTC (rev 45860)
@@ -287,6 +287,7 @@
primitives/bot/btg.h \
primitives/bot/tieprivate.h \
primitives/brep/brep_debug.h \
+ primitives/dsp/dsp.h \
primitives/fixpt.h \
primitives/metaball/metaball.h \
primitives/revolve/revolve.h \
Modified: brlcad/trunk/src/librt/primitives/dsp/dsp.c
===================================================================
--- brlcad/trunk/src/librt/primitives/dsp/dsp.c 2011-08-09 22:21:47 UTC (rev
45859)
+++ brlcad/trunk/src/librt/primitives/dsp/dsp.c 2011-08-09 22:25:21 UTC (rev
45860)
@@ -61,11 +61,13 @@
#include "db.h"
#include "plot3.h"
+/* private header */
+#include "./dsp.h"
+
#define FULL_DSP_DEBUGGING 1
#define ORDERED_ISECT 1
-/* #define FULL_DSP_DEBUGGING 1 */
#define DIM_BB_CHILDREN 4
#define NUM_BB_CHILDREN (DIM_BB_CHILDREN*DIM_BB_CHILDREN)
@@ -109,12 +111,19 @@
struct dsp_bb *p; /* array of dsp_bb's for this level */
};
+# define XCNT(_p) (((struct rt_dsp_internal *)_p)->dsp_xcnt)
+# define YCNT(_p) (((struct rt_dsp_internal *)_p)->dsp_ycnt)
+# define XSIZ(_p) (_p->dsp_i.dsp_xcnt - 1)
+# define YSIZ(_p) (_p->dsp_i.dsp_ycnt - 1)
-extern int rt_retrieve_binunif (struct rt_db_internal *intern,
- const struct db_i *dbip,
- const char *name);
+/* FIXME: rename? */
+extern int rt_retrieve_binunif(struct rt_db_internal *intern,
+ const struct db_i *dbip,
+ const char *name);
+
+
#define dlog if (RT_G_DEBUG & DEBUG_HF) bu_log
@@ -146,39 +155,6 @@
};
-/* access to the array */
-#ifdef FULL_DSP_DEBUGGING
-#define DSP(_p, _x, _y) dsp_val(_p, _x, _y, __FILE__, __LINE__)
-unsigned short
-dsp_val(struct rt_dsp_internal *dsp_i, unsigned x, unsigned y, char *file, int
line)
-{
- RT_DSP_CK_MAGIC(dsp_i);
-
- if (x >= dsp_i->dsp_xcnt || y >= dsp_i->dsp_ycnt) {
- bu_log("%s:%d xy: %u, %u cnt: %zu, %zu\n",
- file, line, x, y, dsp_i->dsp_xcnt, dsp_i->dsp_ycnt);
- bu_bomb("");
- }
-
- return dsp_i->dsp_buf[ y * dsp_i->dsp_xcnt + x ];
-}
-
-
-#else
-# define DSP(_p, _x, _y) (\
- (\
- (unsigned short *) \
- ((_p)->dsp_buf) \
-)[ \
- (_y) * ((struct rt_dsp_internal *)_p)->dsp_xcnt + (_x) ])
-#endif
-
-# define XCNT(_p) (((struct rt_dsp_internal *)_p)->dsp_xcnt)
-# define YCNT(_p) (((struct rt_dsp_internal *)_p)->dsp_ycnt)
-# define XSIZ(_p) (_p->dsp_i.dsp_xcnt - 1)
-# define YSIZ(_p) (_p->dsp_i.dsp_ycnt - 1)
-
-
struct bbox_isect {
double in_dist;
double out_dist;
Added: brlcad/trunk/src/librt/primitives/dsp/dsp.h
===================================================================
--- brlcad/trunk/src/librt/primitives/dsp/dsp.h (rev 0)
+++ brlcad/trunk/src/librt/primitives/dsp/dsp.h 2011-08-09 22:25:21 UTC (rev
45860)
@@ -0,0 +1,42 @@
+/* D S P . H
+ * BRL-CAD
+ *
+ * Copyright (c) 2011 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/*
+ * Private header, only for dsp implementation use.
+ *
+ */
+
+/* access to the DSP data array */
+# define DSP(_p, _x, _y) ( \
+ ( \
+ (unsigned short *) \
+ ((_p)->dsp_buf) \
+ )[ \
+ (_y) * ((struct rt_dsp_internal *)_p)->dsp_xcnt + (_x) ] )
+
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Property changes on: brlcad/trunk/src/librt/primitives/dsp/dsp.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits