Revision: 76595
          http://sourceforge.net/p/brlcad/code/76595
Author:   starseeker
Date:     2020-07-30 13:16:55 +0000 (Thu, 30 Jul 2020)
Log Message:
-----------
shift go_edit_paths

Modified Paths:
--------------
    brlcad/branches/bioh/include/tclcad.h
    brlcad/branches/bioh/src/libtclcad/tclcad_mouse.c
    brlcad/branches/bioh/src/libtclcad/tclcad_obj.c
    brlcad/branches/bioh/src/libtclcad/view/draw.c

Modified: brlcad/branches/bioh/include/tclcad.h
===================================================================
--- brlcad/branches/bioh/include/tclcad.h       2020-07-30 13:05:39 UTC (rev 
76594)
+++ brlcad/branches/bioh/include/tclcad.h       2020-07-30 13:16:55 UTC (rev 
76595)
@@ -141,13 +141,14 @@
     // depend on Tcl for label primitives...
     struct bu_vls      *go_prim_label_list;
     int                        go_prim_label_list_size;
+    struct bu_hash_tbl *go_edited_paths;
 };
 
 struct tclcad_view_data {
-    struct ged_obj             *gdv_gop;
-    struct bu_vls              gdv_edit_motion_delta_callback;
-    struct bu_vls              gdv_callback;
-    struct fbserv_obj          gdv_fbs;
+    struct ged_obj     *gdv_gop;
+    struct bu_vls      gdv_edit_motion_delta_callback;
+    struct bu_vls      gdv_callback;
+    struct fbserv_obj  gdv_fbs;
 };
 
 struct ged_obj {
@@ -156,7 +157,6 @@
     int                        go_refresh_on;
     int                        go_dlist_on;
     Tcl_Interp         *interp;
-    struct bu_hash_tbl *go_edited_paths;
 };
 #define GED_OBJ_NULL ((struct ged_obj *)0)
 

Modified: brlcad/branches/bioh/src/libtclcad/tclcad_mouse.c
===================================================================
--- brlcad/branches/bioh/src/libtclcad/tclcad_mouse.c   2020-07-30 13:05:39 UTC 
(rev 76594)
+++ brlcad/branches/bioh/src/libtclcad/tclcad_mouse.c   2020-07-30 13:16:55 UTC 
(rev 76595)
@@ -2079,10 +2079,11 @@
     gedp->ged_gvp = gdvp;
 
     struct tclcad_view_data *tvd = (struct tclcad_view_data *)gdvp->u_data;
+    struct tclcad_ged_data *tgd = (struct tclcad_ged_data 
*)current_top->to_gop->go_gedp->u_data;
     if (0 < bu_vls_strlen(&tvd->gdv_edit_motion_delta_callback)) {
        const char *path_string = argv[2];
        vect_t dvec;
-       struct path_edit_params *params = (struct path_edit_params 
*)bu_hash_get(current_top->to_gop->go_edited_paths,
+       struct path_edit_params *params = (struct path_edit_params 
*)bu_hash_get(tgd->go_edited_paths,
                                                                                
 (uint8_t *)path_string,
                                                                                
 sizeof(char) * strlen(path_string) + 1);
 
@@ -2090,7 +2091,7 @@
            BU_GET(params, struct path_edit_params);
            params->edit_mode = gdvp->gv_mode;
            params->dx = params->dy = 0.0;
-           (void)bu_hash_set(current_top->to_gop->go_edited_paths,
+           (void)bu_hash_set(tgd->go_edited_paths,
                              (uint8_t *)path_string,
                              sizeof(char) * strlen(path_string) + 1, (void 
*)params);
        }

Modified: brlcad/branches/bioh/src/libtclcad/tclcad_obj.c
===================================================================
--- brlcad/branches/bioh/src/libtclcad/tclcad_obj.c     2020-07-30 13:05:39 UTC 
(rev 76594)
+++ brlcad/branches/bioh/src/libtclcad/tclcad_obj.c     2020-07-30 13:16:55 UTC 
(rev 76595)
@@ -1093,6 +1093,7 @@
 to_deleteProc(ClientData clientData)
 {
     struct tclcad_obj *top = (struct tclcad_obj *)clientData;
+    struct tclcad_ged_data *tgd = (struct tclcad_ged_data 
*)top->to_gop->go_gedp;
     struct bview *gdvp;
 
     if (current_top == top)
@@ -1102,7 +1103,6 @@
     ged_close(top->to_gop->go_gedp);
     if (top->to_gop->go_gedp) {
        if (top->to_gop->go_gedp->u_data) {
-           struct tclcad_ged_data *tgd = (struct tclcad_ged_data 
*)top->to_gop->go_gedp;
            bu_vls_free(&tgd->go_rt_end_callback);
            bu_vls_free(&tgd->go_more_args_callback);
            BU_PUT(tgd, struct tclcad_ged_data);
@@ -1111,8 +1111,8 @@
        BU_PUT(top->to_gop->go_gedp, struct ged);
     }
 
-    free_path_edit_params(top->to_gop->go_edited_paths);
-    bu_hash_destroy(top->to_gop->go_edited_paths);
+    free_path_edit_params(tgd->go_edited_paths);
+    bu_hash_destroy(tgd->go_edited_paths);
 
     while (BU_LIST_WHILE(gdvp, bview, &top->to_gop->go_head_views.l)) {
        /* This removes the view related command and results in a call
@@ -1302,12 +1302,12 @@
     BU_GET(tgd, struct tclcad_ged_data);
     bu_vls_init(&tgd->go_rt_end_callback);
     bu_vls_init(&tgd->go_more_args_callback);
+    tgd->go_edited_paths = bu_hash_create(0);
     tgd->gdv_gop = top->to_gop;
     gedp->u_data = (void *)tgd;
 
     bu_vls_strcpy(&top->to_gop->go_gedp->go_name, argv[1]);
     top->to_gop->go_refresh_on = 1;
-    top->to_gop->go_edited_paths = bu_hash_create(0);
 
     BU_LIST_INIT(&top->to_gop->go_head_views.l);
 
@@ -3647,6 +3647,7 @@
     struct bview *gdvp;
     int mode, need_refresh = 0;
     struct redraw_edited_path_data data;
+    struct tclcad_ged_data *tgd = (struct tclcad_ged_data 
*)current_top->to_gop->go_gedp->u_data;
 
     /* initialize result */
     bu_vls_trunc(gedp->ged_result_str, 0);
@@ -3724,11 +3725,11 @@
     data.gdvp = gdvp;
     data.need_refresh = &need_refresh;
 
-    redraw_edited_paths(current_top->to_gop->go_edited_paths, &data);
+    redraw_edited_paths(tgd->go_edited_paths, &data);
 
-    free_path_edit_params(current_top->to_gop->go_edited_paths);
-    bu_hash_destroy(current_top->to_gop->go_edited_paths);
-    current_top->to_gop->go_edited_paths = bu_hash_create(0);
+    free_path_edit_params(tgd->go_edited_paths);
+    bu_hash_destroy(tgd->go_edited_paths);
+    tgd->go_edited_paths = bu_hash_create(0);
     Tcl_Eval(current_top->to_interp, "SetNormalCursor 
$::ArcherCore::application");
 
     if (need_refresh) {

Modified: brlcad/branches/bioh/src/libtclcad/view/draw.c
===================================================================
--- brlcad/branches/bioh/src/libtclcad/view/draw.c      2020-07-30 13:05:39 UTC 
(rev 76594)
+++ brlcad/branches/bioh/src/libtclcad/view/draw.c      2020-07-30 13:16:55 UTC 
(rev 76595)
@@ -72,6 +72,7 @@
 {
     struct tclcad_view_data *tvd = (struct tclcad_view_data *)gdvp->u_data;
     struct ged_obj *gop = tvd->gdv_gop;
+    struct tclcad_ged_data *tgd = (struct tclcad_ged_data 
*)gop->go_gedp->u_data;
     struct dm *dmp = (struct dm *)gdvp->dmp;
     struct bu_hash_entry *entry;
     struct path_edit_params *params = NULL;
@@ -80,7 +81,7 @@
 
     data.s_fpath = &sp->s_fullpath;
     data.dbip = gop->go_gedp->ged_wdbp->dbip;
-    entry = key_matches_paths(gop->go_edited_paths, &data);
+    entry = key_matches_paths(tgd->go_edited_paths, &data);
 
     if (entry != NULL) {
        params = (struct path_edit_params *)bu_hash_value(entry, NULL);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to