Revision: 77184
http://sourceforge.net/p/brlcad/code/77184
Author: starseeker
Date: 2020-09-19 14:20:59 +0000 (Sat, 19 Sep 2020)
Log Message:
-----------
trim code code we're not using - this will probably go in a different direction.
Modified Paths:
--------------
brlcad/trunk/src/qged/cadapp.cpp
brlcad/trunk/src/qged/cadapp.h
Modified: brlcad/trunk/src/qged/cadapp.cpp
===================================================================
--- brlcad/trunk/src/qged/cadapp.cpp 2020-09-19 13:57:12 UTC (rev 77183)
+++ brlcad/trunk/src/qged/cadapp.cpp 2020-09-19 14:20:59 UTC (rev 77184)
@@ -124,24 +124,7 @@
current_file.clear();
}
-// TODO - make the type an enum or bit flag or something, instead of multiple
integers...
int
-CADApp::register_command(QString cmdname, ged_func_ptr func, QString role)
-{
- if (role == QString()) {
- if (cmd_map.find(cmdname) != cmd_map.end()) return -1;
- cmd_map.insert(cmdname, func);
- }
- if (role == QString("edit")) {
- edit_cmds.insert(cmdname);
- }
- if (role == QString("view")) {
- view_cmds.insert(cmdname);
- }
- return 0;
-}
-
-int
CADApp::register_gui_command(QString cmdname, gui_cmd_ptr func, QString role)
{
if (role == QString()) {
@@ -148,12 +131,6 @@
if (gui_cmd_map.find(cmdname) != gui_cmd_map.end()) return -1;
gui_cmd_map.insert(cmdname, func);
}
- if (role == QString("edit")) {
- edit_cmds.insert(cmdname);
- }
- if (role == QString("view")) {
- view_cmds.insert(cmdname);
- }
if (role == QString("preprocess")) {
if (preprocess_cmd_map.find(cmdname) != preprocess_cmd_map.end())
return -1;
preprocess_cmd_map.insert(cmdname, func);
@@ -218,12 +195,11 @@
*result =
QString(QLatin1String(bu_vls_addr(ged_pointer->ged_result_str)));
}
- // Now that the command is run, emit any signals that need
emitting. What would
- // really handle this properly is for the ged structure to contain
a list of directory
- // pointers that were impacted by the command, so we could emit
signals with the
- // specifics of what objects need updating.
- if (edit_cmds.find(QString(largv[0])) != edit_cmds.end()) emit
db_change();
- if (view_cmds.find(QString(largv[0])) != view_cmds.end()) emit
view_change();
+ // Now that the command is run, emit any signals that need
emitting. TODO - we need
+ // some better mechanism for this. Once we move to transactions,
we can analyze the
+ // transaction list - hardcoding this per-command is not a great
way to go...
+ //if (edit_cmds.find(QString(largv[0])) != edit_cmds.end()) emit
db_change();
+ //if (view_cmds.find(QString(largv[0])) != view_cmds.end()) emit
view_change();
bu_free(lcmd, "free tmp cmd str");
bu_free(largv, "free tmp argv");
goto postprocess;
Modified: brlcad/trunk/src/qged/cadapp.h
===================================================================
--- brlcad/trunk/src/qged/cadapp.h 2020-09-19 13:57:12 UTC (rev 77183)
+++ brlcad/trunk/src/qged/cadapp.h 2020-09-19 14:20:59 UTC (rev 77184)
@@ -58,11 +58,6 @@
int opendb(QString filename);
void closedb();
- // TODO - need to update this to use the gsh dynamic lookup mechanism.
- // Moreover, the command itself really needs to be able to tell the
- // application whether it might update the database, view, etc. rather
- // than hard-coding that in each GUI...
- int register_command(QString cmdname, ged_func_ptr func, QString role =
QString());
int register_gui_command(QString cmdname, gui_cmd_ptr func, QString
role = QString());
int exec_command(QString *command, QString *result);
@@ -84,13 +79,9 @@
struct ged *ged_pointer;
QString current_file;
int interaction_mode; // 0 = view, 1 = instance edit, 2 = primitive
edit
- QMap<QString, ged_func_ptr> cmd_map;
QMap<QString, gui_cmd_ptr> gui_cmd_map;
QMap<QString, gui_cmd_ptr> preprocess_cmd_map;
QMap<QString, gui_cmd_ptr> postprocess_cmd_map;
- QSet<QString> edit_cmds; // Commands that potentially change the
database contents */
- QSet<QString> view_cmds; // Commands that potentially change the view,
but not the database contents */
-
};
QString import_db(QString filename);
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