Revision: 76350
http://sourceforge.net/p/brlcad/code/76350
Author: starseeker
Date: 2020-07-16 13:39:50 +0000 (Thu, 16 Jul 2020)
Log Message:
-----------
Some of the libged commands need to update the views or otherwise interact with
the application environment - that's the purpose of the various wrappers. It
would be nice if the libged commands could handle this themselves somehow
rather than requiring the parent application to know about the details of each
command...
Modified Paths:
--------------
brlcad/trunk/src/libtclcad/tclcad_obj_wrapper.c
Modified: brlcad/trunk/src/libtclcad/tclcad_obj_wrapper.c
===================================================================
--- brlcad/trunk/src/libtclcad/tclcad_obj_wrapper.c 2020-07-15 20:17:40 UTC
(rev 76349)
+++ brlcad/trunk/src/libtclcad/tclcad_obj_wrapper.c 2020-07-16 13:39:50 UTC
(rev 76350)
@@ -33,6 +33,7 @@
#include "tclcad_private.h"
#include "./view/view.h"
+/* Wraps calls to commands like "draw" that need to reset the view */
int
to_autoview_func(struct ged *gedp,
int argc,
@@ -87,6 +88,8 @@
+/* Wraps calls to commands that interactively request more arguments from the
+ * user (such as "in") */
int
to_more_args_func(struct ged *gedp,
int argc,
@@ -214,7 +217,9 @@
return (*func)(gedp, argc, argv);
}
-
+/* Used for commands that may change the scene but do not need
+ * to adjust the camera (such as "kill") - all views will need
+ * to be updated */
int
to_pass_through_and_refresh_func(struct ged *gedp,
int argc,
@@ -233,19 +238,7 @@
return ret;
}
-
int
-to_view_func(struct ged *gedp,
- int argc,
- const char *argv[],
- ged_func_ptr func,
- const char *usage,
- int maxargs)
-{
- return to_view_func_common(gedp, argc, argv, func, usage, maxargs, 0, 1);
-}
-
-int
to_view_func_common(struct ged *gedp,
int argc,
const char *argv[],
@@ -333,7 +326,19 @@
}
+/* For commands that involve a single "current" view (such as "rt") */
int
+to_view_func(struct ged *gedp,
+ int argc,
+ const char *argv[],
+ ged_func_ptr func,
+ const char *usage,
+ int maxargs)
+{
+ return to_view_func_common(gedp, argc, argv, func, usage, maxargs, 0, 1);
+}
+
+int
to_view_func_less(struct ged *gedp,
int argc,
const char *argv[],
@@ -356,7 +361,8 @@
return to_view_func_common(gedp, argc, argv, func, usage, maxargs, 1, 1);
}
-
+/* For functions that need the gedp display manager pointer to be that of
+ * the current view before they are run. */
int
to_dm_func(struct ged *gedp,
int argc,
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits