Revision: 45979
http://brlcad.svn.sourceforge.net/brlcad/?rev=45979&view=rev
Author: bhinesley
Date: 2011-08-15 01:25:24 +0000 (Mon, 15 Aug 2011)
Log Message:
-----------
During certain batch translations, objects after the first target object simply
moved to the same location as the first target object. This was due to certain
translation vectors not being recalculated after executing the first
translation. Since information about an argument is lost after the first vector
is calculated, there needs to be a new vector (and therefore struct edit_arg)
for each translation.
Modified Paths:
--------------
brlcad/trunk/src/libged/edit.c
Modified: brlcad/trunk/src/libged/edit.c
===================================================================
--- brlcad/trunk/src/libged/edit.c 2011-08-14 22:28:56 UTC (rev 45978)
+++ brlcad/trunk/src/libged/edit.c 2011-08-15 01:25:24 UTC (rev 45979)
@@ -1846,10 +1846,12 @@
edit(struct ged *gedp, union edit_cmd *const subcmd)
{
struct edit_arg **arg_head;
+ struct edit_arg *prev_arg;
struct edit_arg *cur_arg;
union edit_cmd subcmd_iter; /* to iterate through subcmd args */
int i = 0;
int ret = GED_OK;
+ int num_target_objs = 0;
int num_args_set = 0;
/* check all arg nodes in subcmd->common.objects first; they may
@@ -1862,11 +1864,15 @@
/* cmd line opts should have been handled/removed */
BU_ASSERT(cur_arg->cl_options[0] == '\0');
+
+ ++num_target_objs;
}
/* process all other arg nodes */
while ((arg_head = subcmd->cmd->get_arg_head(subcmd, i++)) !=
&subcmd->common.objects) {
+ num_args_set = 0;
+ prev_arg = NULL;
for (cur_arg = *arg_head; cur_arg; cur_arg = cur_arg->next) {
/* cmd line opts should have been handled/removed */
@@ -1880,7 +1886,21 @@
GED_ERROR)
return GED_ERROR;
}
+ prev_arg = cur_arg;
+ ++num_args_set;
}
+
+ /* All argument lists should be the same length as the common
+ * objects list. Duplicate the last argument until this is so.
+ */
+ if (prev_arg) {
+ while (num_args_set < num_target_objs) {
+ edit_arg_duplicate(&prev_arg->next, prev_arg);
+ prev_arg = prev_arg->next;
+ ++num_args_set;
+ }
+ BU_ASSERT(num_args_set == num_target_objs);
+ }
}
/* execute cmd on first, and possibly the only, set of args */
@@ -1918,7 +1938,7 @@
}
if (num_args_set == 0)
break; /* exit loop on successful completion */
- if (edit_cmd_expand_vectors(gedp, subcmd) == GED_ERROR)
+ if (edit_cmd_expand_vectors(gedp, &subcmd_iter) == GED_ERROR)
return GED_ERROR;
ret = subcmd_iter.cmd->exec(gedp, &subcmd_iter);
} while ((ret != GED_ERROR));
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