[brlcad-commits] SF.net SVN: brlcad:[43853] brlcad/branches/cmake
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2011-03-11 23:03:23
|
Revision: 43853 http://brlcad.svn.sourceforge.net/brlcad/?rev=43853&view=rev Author: starseeker Date: 2011-03-11 23:03:15 +0000 (Fri, 11 Mar 2011) Log Message: ----------- MFC r43852 Modified Paths: -------------- brlcad/branches/cmake/AUTHORS brlcad/branches/cmake/NEWS brlcad/branches/cmake/misc/debian/rules brlcad/branches/cmake/sh/make_deb.sh brlcad/branches/cmake/sh/make_rpm.sh brlcad/branches/cmake/src/libged/red.c brlcad/branches/cmake/src/librt/primitives/revolve/revolve.c brlcad/branches/cmake/src/librt/primitives/table.c Modified: brlcad/branches/cmake/AUTHORS =================================================================== --- brlcad/branches/cmake/AUTHORS 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/AUTHORS 2011-03-11 23:03:15 UTC (rev 43853) @@ -426,6 +426,11 @@ 2007 April U.S. Army Research Laboratory +Li, Dongxu +nicknames dongxu_li dli +2007 April +Open Source + Poole, Ben nicknames poolio 2007 June @@ -645,11 +650,6 @@ Fiedler, Stefan Open Source -Li, Dongxu -nicknames dongxu_li dli -2007 April -Open Source - Chang, Loui nicknames louipc 2007 August Modified: brlcad/branches/cmake/NEWS =================================================================== --- brlcad/branches/cmake/NEWS 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/NEWS 2011-03-11 23:03:15 UTC (rev 43853) @@ -33,6 +33,8 @@ information systems (GIS) software. Shapefiles may be imported as 2D sketch geometry that can be extruded to a 3D representation. +* support for applying matrix edits to revolve primitives - Dongxu Li +* fixed mged 'red' command bug on Windows - Sean Morrison, Cliff Yapp * support matrices over halfspaces within combinations - Sean Morrison * fixed archer and rtwizard startup failure bug on Mac - Sean Morrison * fixed bug starting up the Combination Editor in mged - Sean Morrison Modified: brlcad/branches/cmake/misc/debian/rules =================================================================== --- brlcad/branches/cmake/misc/debian/rules 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/misc/debian/rules 2011-03-11 23:03:15 UTC (rev 43853) @@ -16,12 +16,7 @@ PARALLEL_JOBS = $(shell echo $(DEB_BUILD_OPTIONS) | \ sed -e 's/.*parallel=\([0-9]\+\).*/\1/') PARALLEL_OPTIONS = -j$(PARALLEL_JOBS) -else - ifneq (,$(shell getconf _NPROCESSORS_ONLN)) - PARALLEL_OPTIONS = -j$(shell getconf _NPROCESSORS_ONLN | sed "s/.*/&*2-1/" | bc) - endif endif -# DEB_BUILD_OPTIONS build: build-stamp Modified: brlcad/branches/cmake/sh/make_deb.sh =================================================================== --- brlcad/branches/cmake/sh/make_deb.sh 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/sh/make_deb.sh 2011-03-11 23:03:15 UTC (rev 43853) @@ -80,13 +80,6 @@ ferror "Refusing to build on a non-debian system." fi -# set variables -BVERSION=`cat include/conf/MAJOR`"."`cat include/conf/MINOR`"."`cat include/conf/PATCH` -BVERSION=`echo $BVERSION | sed 's/[^0-9.]//g'` -CDATE=`date -R` -CFILE="debian/changelog" -RELEASE="0" - # check needed packages E=0 fcheck(){ @@ -103,6 +96,9 @@ if test "$1" = "-b" ;then fcheck build-essential fcheck make + fcheck libtool + fcheck bc + fcheck sed fcheck bison fcheck flex fcheck libxi-dev @@ -116,6 +112,17 @@ ferror "Mandatory to install these packages first:" "$LLIST" fi +# set variables +BVERSION=`cat include/conf/MAJOR | sed 's/[^0-9]//g'`"."`cat include/conf/MINOR | sed 's/[^0-9]//g'`"."`cat include/conf/PATCH | sed 's/[^0-9]//g'` +CDATE=`date -R` +CFILE="debian/changelog" +RELEASE="0" + +NJOBS=`getconf _NPROCESSORS_ONLN | sed "s/.*/&*2-1/" | bc` +if test ! $NJOBS -gt 0 2>/dev/null ;then + NJOBS=1 +fi + # if building sources, create *orig.tar.gz rm -Rf debian if test "$1" = "-s" ;then @@ -160,7 +167,7 @@ # create deb or source packages case "$1" in -b) fakeroot debian/rules clean && \ - fakeroot debian/rules binary + DEB_BUILD_OPTIONS=parallel=$NJOBS fakeroot debian/rules binary ;; -s) fakeroot dpkg-buildpackage -S -us -uc ;; Modified: brlcad/branches/cmake/sh/make_rpm.sh =================================================================== --- brlcad/branches/cmake/sh/make_rpm.sh 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/sh/make_rpm.sh 2011-03-11 23:03:15 UTC (rev 43853) @@ -82,6 +82,9 @@ fcheck fakeroot fcheck gcc-c++ fcheck make + fcheck libtool + fcheck bc + fcheck sed fcheck bison fcheck flex fcheck libXi-devel @@ -95,6 +98,9 @@ fcheck fakeroot fcheck gcc-c++ fcheck make + fcheck libtool + fcheck bc + fcheck sed fcheck bison fcheck flex fcheck libXi6-devel @@ -124,6 +130,11 @@ ferror "Unknown architecture. \"`gcc -dumpmachine`\"" "Exiting..." fi +NJOBS=`getconf _NPROCESSORS_ONLN | sed "s/.*/&*2-1/" | bc` +if test ! $NJOBS -gt 0 2>/dev/null ;then + NJOBS=1 +fi + # # rm -Rf $TMPDIR mkdir -p $TMPDIR/tmp @@ -152,8 +163,8 @@ "$TMPDIR/brlcad-doc-animation.desktop" # compile and install in tmp dir -./configure --enable-optimized --enable-almost-everything --with-ogl --disable-debug -make -j`getconf _NPROCESSORS_ONLN | sed "s/.*/&*2-1/" | bc` +./configure --enable-optimized --enable-almost-everything --with-ogl --disable-debug && \ +make -j$NJOBS && \ fakeroot make install DESTDIR=`pwd`"/$TMPDIR/tmp" # copy menu files Modified: brlcad/branches/cmake/src/libged/red.c =================================================================== --- brlcad/branches/cmake/src/libged/red.c 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/src/libged/red.c 2011-03-11 23:03:15 UTC (rev 43853) @@ -74,6 +74,7 @@ return 1; } + void _ged_print_matrix(FILE *fp, matp_t matrix) { @@ -95,6 +96,7 @@ } } + int _ged_find_matrix(struct ged *gedp, const char *currptr, int strlength, matp_t *matrix, int *name_end) { @@ -109,7 +111,7 @@ bu_vls_init(¤t_substring); bu_vls_sprintf(¤t_substring, "(%s[[:space:]]+)", float_string); regcomp(&matrix_entry, bu_vls_addr(¤t_substring), REG_EXTENDED); - bu_vls_sprintf(¤t_substring, "[[:space:]]+(%s[[:space:]]+){15}(%s)", float_string, float_string); + bu_vls_sprintf(¤t_substring, "[[:space:]]+(%s[[:space:]]+) {15}(%s)", float_string, float_string); regcomp(&full_matrix, bu_vls_addr(¤t_substring), REG_EXTENDED); regcomp(&whitespace_regex, "([^[:space:]])", REG_EXTENDED); @@ -119,7 +121,7 @@ float_locations[0].rm_so = 0; float_locations[0].rm_eo = strlength; while (floatcnt < 16 && floatcnt >= 0) { - if (!regexec(&matrix_entry, currptr, matrix_entry.re_nsub, float_locations, REG_STARTEND)) { + if (!regexec(&matrix_entry, currptr, matrix_entry.re_nsub, float_locations, REG_STARTEND)) { floatcnt++; float_locations[0].rm_so = float_locations[0].rm_eo; float_locations[0].rm_eo = strlength; @@ -131,7 +133,7 @@ /* Possible matrix - use matrix regex to locate it */ float_locations[0].rm_so = 0; float_locations[0].rm_eo = strlength; - if (!regexec(&full_matrix, currptr, full_matrix.re_nsub, float_locations, REG_STARTEND)) { + if (!regexec(&full_matrix, currptr, full_matrix.re_nsub, float_locations, REG_STARTEND)) { bu_vls_init(&matrix_substring); bu_vls_trunc(&matrix_substring, 0); bu_vls_strncpy(&matrix_substring, currptr + float_locations[0].rm_so, float_locations[0].rm_eo - float_locations[0].rm_so); @@ -143,7 +145,7 @@ float_locations[0].rm_so = 0; float_locations[0].rm_eo = bu_vls_strlen(&matrix_substring); while (floatcnt < 16) { - if (!regexec(&matrix_entry, floatptr, matrix_entry.re_nsub, float_locations, REG_STARTEND)) { + if (!regexec(&matrix_entry, floatptr, matrix_entry.re_nsub, float_locations, REG_STARTEND)) { bu_vls_trunc(¤t_substring, 0); bu_vls_strncpy(¤t_substring, currptr + float_locations[0].rm_so, float_locations[0].rm_eo - float_locations[0].rm_so); (*matrix)[floatcnt] = atof(floatptr); @@ -161,7 +163,7 @@ bu_vls_trunc(¤t_substring, 0); bu_vls_strncpy(¤t_substring, currptr + tail_start, strlength - tail_start - 1); /* Need to check for non-whitespace in the distance-from-end zone */ - if (regexec(&whitespace_regex, bu_vls_addr(¤t_substring), whitespace_regex.re_nsub, float_locations, 0) != 0) { + if (regexec(&whitespace_regex, bu_vls_addr(¤t_substring), whitespace_regex.re_nsub, float_locations, 0) != 0) { ret = 0; } else { bu_vls_printf(&gedp->ged_result_str, "Saw something other than whitespace after matrix - error!\n"); @@ -190,6 +192,7 @@ return 1; } + HIDDEN int build_comb(struct ged *gedp, struct directory *dp) { @@ -355,7 +358,7 @@ /* Check for non-whitespace garbage between first operator and start of comb tree definition */ result_locations[0].rm_eo = result_locations[0].rm_so; result_locations[0].rm_so = 0; - if (regexec(&whitespace_regex, currptr, whitespace_regex.re_nsub, result_locations, REG_STARTEND) == 0) { + if (regexec(&whitespace_regex, currptr, whitespace_regex.re_nsub, result_locations, REG_STARTEND) == 0) { bu_vls_printf(&gedp->ged_result_str, "Saw something other than comb tree entries after comb tree tag - error!\n"); bu_vls_free(¤t_substring); bu_vls_free(&curr_op_vls); @@ -458,7 +461,7 @@ } else { /* Empty tree, ok as long as there is no garbage after the comb tree indicator */ bu_vls_sprintf(¤t_substring, "%s", currptr); - if (regexec(&whitespace_regex, bu_vls_addr(¤t_substring), whitespace_regex.re_nsub, result_locations, 0) == 0) { + if (regexec(&whitespace_regex, bu_vls_addr(¤t_substring), whitespace_regex.re_nsub, result_locations, 0) == 0) { bu_vls_printf(&gedp->ged_result_str, "Saw something other than comb tree entries after comb tree tag - error!\n"); bu_vls_free(¤t_substring); bu_vls_free(&curr_op_vls); @@ -488,7 +491,7 @@ /* bu_avs_print(&avs, "Regex based avs build\n"); printf("\n"); - int i,m; + int i, m; fastf_t tmp; for (i=0; i<tree_index; i++) { char op; @@ -528,7 +531,7 @@ } comb->tree = tp; - if(rt_db_put_internal(dp, gedp->ged_wdbp->dbip, &intern, &rt_uniresource) < 0) { + if (rt_db_put_internal(dp, gedp->ged_wdbp->dbip, &intern, &rt_uniresource) < 0) { bu_vls_printf(&gedp->ged_result_str, "build_comb: Cannot apply tree\n", dp->d_namep); bu_avs_free(&avs); return -1; @@ -705,7 +708,6 @@ } - int ged_red(struct ged *gedp, int argc, const char *argv[]) { @@ -853,8 +855,8 @@ bu_vls_free(&temp_name); return GED_ERROR; } - - + + if ((tmp_dp = db_diradd(gedp->ged_wdbp->dbip, bu_vls_addr(&temp_name), RT_DIR_PHONY_ADDR, 0, RT_DIR_COMB, (genptr_t)&intern.idb_type)) == RT_DIR_NULL) { bu_vls_printf(&gedp->ged_result_str, "Cannot save copy of %s, no changed made\n", bu_vls_addr(&temp_name)); bu_vls_free(&comb_name); @@ -886,7 +888,6 @@ GED_DB_PUT_INTERNAL(gedp, tmp_dp, &intern, &rt_uniresource, 0); } - if (build_comb(gedp, tmp_dp) < 0) { /* Something went wrong - kill the temporary comb */ Modified: brlcad/branches/cmake/src/librt/primitives/revolve/revolve.c =================================================================== --- brlcad/branches/cmake/src/librt/primitives/revolve/revolve.c 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/src/librt/primitives/revolve/revolve.c 2011-03-11 23:03:15 UTC (rev 43853) @@ -1398,6 +1398,79 @@ /** + * R T _ R E V O L V E _ X F O R M + * + * Apply a transformation matrix to the specified 'ip' input revolve + * object, storing the results in the specified 'op' out pointer or + * creating a copy if NULL. + */ +int +rt_revolve_xform( + struct rt_db_internal *op, + const mat_t mat, + struct rt_db_internal *ip, + int release, + struct db_i *dbip, + struct resource *resp) +{ + struct rt_revolve_internal *rip, *rop; + point_t tmp_vec; + + if (dbip) RT_CK_DBI(dbip); + RT_CK_DB_INTERNAL(ip); + RT_CK_RESOURCE(resp); + rip = (struct rt_revolve_internal *)ip->idb_ptr; + RT_REVOLVE_CK_MAGIC(rip); + + if (bu_debug&BU_DEBUG_MEM_CHECK) { + bu_log("Barrier check at start of revolve_xform():\n"); + bu_mem_barriercheck(); + } + + if (op != ip) { + RT_INIT_DB_INTERNAL(op); + rop = (struct rt_revolve_internal *)bu_malloc(sizeof(struct rt_revolve_internal), "rop"); + rop->magic = RT_REVOLVE_INTERNAL_MAGIC; + bu_vls_init(&rop->sketch_name); + bu_vls_vlscat(&rop->sketch_name, &rip->sketch_name); + op->idb_ptr = (genptr_t)rop; + op->idb_meth = &rt_functab[ID_REVOLVE]; + op->idb_major_type = DB5_MAJORTYPE_BRLCAD; + op->idb_type = ID_REVOLVE; + if (ip->idb_avs.magic == BU_AVS_MAGIC) { + bu_avs_init(&op->idb_avs, ip->idb_avs.count, "avs"); + bu_avs_merge(&op->idb_avs, &ip->idb_avs); + } + } else { + rop = (struct rt_revolve_internal *)ip->idb_ptr; + } + MAT4X3PNT(tmp_vec, mat, rip->v3d); + VMOVE(rop->v3d, tmp_vec); + MAT4X3VEC(tmp_vec, mat, rip->axis3d); + VMOVE(rop->axis3d, tmp_vec); + V2MOVE(rop->v2d, rip->v2d); + V2MOVE(rop->axis2d, rip->axis2d); + + if (release && ip != op) { + rop->sk = rip->sk; + rip->sk = (struct rt_sketch_internal *)NULL; + rt_db_free_internal(ip); + } else if (rip->sk) { + rop->sk = rt_copy_sketch(rip->sk); + } else { + rop->sk = (struct rt_sketch_internal *)NULL; + } + + if (bu_debug&BU_DEBUG_MEM_CHECK) { + bu_log("Barrier check at end of revolve_xform():\n"); + bu_mem_barriercheck(); + } + + return 0; +} + + +/** * R T _ R E V O L V E _ E X P O R T 5 * * Export an REVOLVE from internal form to external format. Note that Modified: brlcad/branches/cmake/src/librt/primitives/table.c =================================================================== --- brlcad/branches/cmake/src/librt/primitives/table.c 2011-03-11 20:52:06 UTC (rev 43852) +++ brlcad/branches/cmake/src/librt/primitives/table.c 2011-03-11 23:03:15 UTC (rev 43853) @@ -1654,7 +1654,7 @@ NULL, rt_revolve_ifree, rt_revolve_describe, - NULL, /* rt_generic_xform is NOT sufficient (wireframe and trace get screwed up) */ + rt_revolve_xform, rt_revolve_parse, sizeof(struct rt_revolve_internal), RT_REVOLVE_INTERNAL_MAGIC, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |