Revision: 78015
          http://sourceforge.net/p/brlcad/code/78015
Author:   starseeker
Date:     2020-12-18 23:52:04 +0000 (Fri, 18 Dec 2020)
Log Message:
-----------
Update some rtwizard and Ged Tcl files to use bu_dir, convert GeometryIO as 
well.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/lib/Ged.tcl
    brlcad/trunk/src/tclscripts/lib/GeometryIO.tcl
    brlcad/trunk/src/tclscripts/rtwizard/lib/FbPage.itk
    brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeA.itcl
    brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeB.itcl
    brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeC.itcl
    brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeD.itcl
    brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeE.itcl
    brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeF.itcl

Modified: brlcad/trunk/src/tclscripts/lib/Ged.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/lib/Ged.tcl     2020-12-18 23:35:00 UTC (rev 
78014)
+++ brlcad/trunk/src/tclscripts/lib/Ged.tcl     2020-12-18 23:52:04 UTC (rev 
78015)
@@ -163,8 +163,6 @@
        method bounds_all {args}
        method brep {args}
        method bu_units_conversion {args}
-       method bu_brlcad_dir {args}
-       method bu_brlcad_root {args}
        method bu_prmem {args}
        method bu_get_value_by_keyword {args}
        method bu_rgb_to_hsv {args}
@@ -1388,14 +1386,6 @@
     uplevel \#0 bu_units_conversion $args
 }
 
-::itcl::body cadwidgets::Ged::bu_brlcad_dir {args} {
-    uplevel \#0 bu_brlcad_dir $args
-}
-
-::itcl::body cadwidgets::Ged::bu_brlcad_root {args} {
-    uplevel \#0 bu_brlcad_root $args
-}
-
 ::itcl::body cadwidgets::Ged::bu_prmem {args} {
     uplevel \#0 bu_prmem $args
 }
@@ -1894,7 +1884,7 @@
     incr mLastPort
     set port $mLastPort
 
-    set binpath [bu_brlcad_root "bin"]
+    set binpath [bu_dir bin]
 
     # This doesn't work (i.e. the "&" causes exec to always succeed, even when 
the command fails)
     while {[catch {exec [file join $binpath fbserv] -w $_w -n $_n $port 
$_fbtype &} pid]} {
@@ -2137,7 +2127,7 @@
     make_image $fbs_port $w $n $viewsize $orientation $eye_pt $perspective \
        $_bgcolor $_ecolor $_necolor $_occmode $_gamma $_color_objects 
$_ghost_objects $_edge_objects
 
-    set binpath [bu_brlcad_root "bin"]
+    set binpath [bu_dir bin]
     catch {exec [file join $binpath fb-fb] $fbs_port $port &}
 
     if {$::tcl_platform(platform) == "windows"} {
@@ -6229,8 +6219,6 @@
        [brepname] - convert the non-BREP object to BREP form
        [suffix] - convert non-BREP comb to unevaluated BREP form}}
     $help add bu_units_conversion  {{units} {}}
-    $help add bu_brlcad_dir    {{dirkey} {}}
-    $help add bu_brlcad_root   {{subdir} {}}
     $help add bu_prmem         {{title} {}}
     $help add bu_get_value_by_keyword {{iwant list} {}}
     $help add bu_rgb_to_hsv    {{rgb} {}}

Modified: brlcad/trunk/src/tclscripts/lib/GeometryIO.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/lib/GeometryIO.tcl      2020-12-18 23:35:00 UTC 
(rev 78014)
+++ brlcad/trunk/src/tclscripts/lib/GeometryIO.tcl      2020-12-18 23:52:04 UTC 
(rev 78015)
@@ -32,14 +32,14 @@
 }
 
 proc ::run_conversion_config {input_file log_file} {
-    set gui_cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
bwish$::exe_ext]] \
-    [bu_brlcad_root "share/tclscripts/lib/gui_conversion.tcl"] "$input_file" 
"$log_file"]
+    set gui_cmd [list [file join [bu_dir bin] bwish$::exe_ext] \
+    [file join [bu_dir data] tclscripts lib gui_conversion.tcl] "$input_file" 
"$log_file"]
     catch {eval exec $gui_cmd} _conv_log
 }
 
 proc geom_load {input_file gui_feedback} {
 
-    set binpath [bu_brlcad_root [bu_brlcad_dir "bin"] ]
+    set binpath [bu_dir bin]
 
     set input_ext [file extension $input_file]
     set input_root [file rootname [file tail $input_file]]
@@ -60,12 +60,13 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
3dm-g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] 3dm-g$::exe_ext] \
                    -r \
                    -c \
                    -o $output_file \
                    $input_file]
-               catch {eval exec $cmd} _conv_log
+               #catch {eval exec $cmd} _conv_log
+               eval exec $cmd
             }
        }
        ".asc" {
@@ -72,7 +73,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
asc2g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] asc2g$::exe_ext] \
                    $input_file \
                    $output_file]
                catch {eval exec $cmd} _conv_log
@@ -82,7 +83,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
fast4-g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] fast4-g$::exe_ext] \
                    -d \
                    $input_file \
                    $output_file]
@@ -93,7 +94,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
fast4-g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] fast4-g$::exe_ext] \
                    -d \
                    $input_file \
                    $output_file]
@@ -104,7 +105,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
fast4-g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] fast4-g$::exe_ext] \
                    -d \
                    $input_file \
                    $output_file]
@@ -115,7 +116,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
fast4-g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] fast4-g$::exe_ext] \
                    -d \
                    $input_file \
                    $output_file]
@@ -127,7 +128,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
stl-g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] stl-g$::exe_ext] \
                    $input_file \
                    $output_file]
                catch {eval exec $cmd} _conv_log
@@ -137,7 +138,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-               set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
step-g$::exe_ext]] \
+               set cmd [list [file join [bu_dir bin] step-g$::exe_ext] \
                    -v -o $output_file \
                    $input_file]
 
@@ -148,7 +149,7 @@
             if {[string compare $gui_feedback "1"] == 0} {
                ::run_conversion_config $input_file $log_file
             } else {
-              set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
step-g$::exe_ext]] \
+              set cmd [list [file join [bu_dir bin] step-g$::exe_ext] \
                    -v -o $output_file \
                    $input_file]
 
@@ -175,7 +176,7 @@
 # and may only want a subset.
 proc geom_save {input_file output_file db_component} {
 
-    set binpath [bu_brlcad_root [bu_brlcad_dir "bin"] ]
+    set binpath [bu_dir bin] ]
 
     set output_filename [file tail $output_file]
     set output_dir [file dirname $output_file]
@@ -199,7 +200,7 @@
     switch -- $output_ext {
        ".obj" {
            set tops_list [lsort -dictionary [$db_component tops]]
-           set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
g-obj$::exe_ext]] \
+           set cmd [list [file join [bu_dir bin] g-obj$::exe_ext] \
                    -o $output_file \
                    $input_file]
             append cmd " " { }
@@ -210,7 +211,7 @@
        }
        ".stl" {
            set tops_list [lsort -dictionary [$db_component tops]]
-           set cmd [list [bu_brlcad_root [file join [bu_brlcad_dir bin] 
g-stl$::exe_ext]] \
+           set cmd [list [file join [bu_dir bin] g-stl$::exe_ext] \
                    -o $output_file \
                    $input_file]
             append cmd " " { }

Modified: brlcad/trunk/src/tclscripts/rtwizard/lib/FbPage.itk
===================================================================
--- brlcad/trunk/src/tclscripts/rtwizard/lib/FbPage.itk 2020-12-18 23:35:00 UTC 
(rev 78014)
+++ brlcad/trunk/src/tclscripts/rtwizard/lib/FbPage.itk 2020-12-18 23:52:04 UTC 
(rev 78015)
@@ -444,20 +444,20 @@
                 [string match $screenOnly "false"] } {
            # Will be generating a file - need in-memory fb
            set port 0
-           while { ! [catch {exec [file join [bu_brlcad_root bin] fbclear] -F 
$port } error ] } {
+           while { ! [catch {exec [file join [bu_dir bin] fbclear] -F $port } 
error ] } {
                if {$::RtWizard::wizard_state(verbose)} {puts "fbserv port 
$fbserv_port is already in use."}
                incr port
            }
-           catch {exec [file join [bu_brlcad_root bin] fbserv] -w $width -n 
$height $port /dev/mem &} pid
+           catch {exec [file join [bu_dir bin] fbserv] -w $width -n $height 
$port /dev/mem &} pid
            # Give the fbserv time to fire up
            after 1000
-           exec [file join [bu_brlcad_root bin] fbclear] -F $port 0 0 0
+           exec [file join [bu_dir bin] fbclear] -F $port 0 0 0
 
            set ::RtWizard::wizard_state(fbserv_port) $port
            set ::RtWizard::wizard_state(pid) $pid
            return "$port $pid"
        }
-       set binpath [bu_brlcad_root "bin"]
+       set binpath [bu_dir bin]
        #
        # Create an on-screen buffer
        #

Modified: brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeA.itcl
===================================================================
--- brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeA.itcl  2020-12-18 
23:35:00 UTC (rev 78014)
+++ brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeA.itcl  2020-12-18 
23:52:04 UTC (rev 78015)
@@ -190,7 +190,7 @@
           if {[string length $filename] > 0 } {
               set output_generated 0
               if {[file extension $filename] == ".png"} {
-                 if { [catch {exec [file join [bu_brlcad_root bin] fb-png] -w 
$w -n $h -F $fb $filename}] } {
+                 if { [catch {exec [file join [bu_dir bin] fb-png] -w $w -n $h 
-F $fb $filename}] } {
                      set output_generated 0
                  } else {
                      set output_generated 1
@@ -197,7 +197,7 @@
                  }
               }
               if {!$output_generated} {
-                 if { [catch {exec [file join [bu_brlcad_root bin] fb-pix] -w 
$w -n $h -F $fb $filename}] } {
+                 if { [catch {exec [file join [bu_dir bin] fb-pix] -w $w -n $h 
-F $fb $filename}] } {
                      set output_generated 0
                  } else {
                      set output_generated 1

Modified: brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeB.itcl
===================================================================
--- brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeB.itcl  2020-12-18 
23:35:00 UTC (rev 78014)
+++ brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeB.itcl  2020-12-18 
23:52:04 UTC (rev 78015)
@@ -201,7 +201,7 @@
           if {[string length $filename] > 0 } {
               set output_generated 0
               if {[file extension $filename] == ".png"} {
-                  if { [catch {exec [file join [bu_brlcad_root bin] fb-png] -w 
$w -n $h -F $fb $filename}] } {
+                  if { [catch {exec [file join [bu_dir bin] fb-png] -w $w -n 
$h -F $fb $filename}] } {
                       set output_generated 0
                   } else {
                       set output_generated 1
@@ -208,7 +208,7 @@
                  }
               }
               if {!$output_generated} {
-                  if { [catch {exec [file join [bu_brlcad_root bin] fb-pix] -w 
$w -n $h -F $fb $filename}] } {
+                  if { [catch {exec [file join [bu_dir bin] fb-pix] -w $w -n 
$h -F $fb $filename}] } {
                       set output_generated 0
                   } else {
                       set output_generated 1

Modified: brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeC.itcl
===================================================================
--- brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeC.itcl  2020-12-18 
23:35:00 UTC (rev 78014)
+++ brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeC.itcl  2020-12-18 
23:52:04 UTC (rev 78015)
@@ -204,7 +204,7 @@
           if {[string length $filename] > 0 } {
               set output_generated 0
               if {[file extension $filename] == ".png"} {
-                 if { [catch {exec [file join [bu_brlcad_root bin] fb-png] -w 
$w -n $h -F $fb $filename}] } {
+                 if { [catch {exec [file join [bu_dir bin] fb-png] -w $w -n $h 
-F $fb $filename}] } {
                      set output_generated 0
                  } else {
                      set output_generated 1
@@ -211,7 +211,7 @@
                  }
               }
               if {!$output_generated} {
-                  if { [catch {exec [file join [bu_brlcad_root bin] fb-pix] -w 
$w -n $h -F $fb $filename}] } {
+                  if { [catch {exec [file join [bu_dir bin] fb-pix] -w $w -n 
$h -F $fb $filename}] } {
                       set output_generated 0
                   } else {
                       set output_generated 1

Modified: brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeD.itcl
===================================================================
--- brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeD.itcl  2020-12-18 
23:35:00 UTC (rev 78014)
+++ brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeD.itcl  2020-12-18 
23:52:04 UTC (rev 78015)
@@ -221,7 +221,7 @@
           if {[string length $filename] > 0 } {
               set output_generated 0
               if {[file extension $filename] == ".png"} {
-                 if { [catch {exec [file join [bu_brlcad_root bin] fb-png] -w 
$w -n $h -F $fb $filename}] } {
+                 if { [catch {exec [file join [bu_dir bin] fb-png] -w $w -n $h 
-F $fb $filename}] } {
                      set output_generated 0
                  } else {
                      set output_generated 1
@@ -228,7 +228,7 @@
                  }
               }
               if {!$output_generated} {
-                  if { [catch {exec [file join [bu_brlcad_root bin] fb-pix] -w 
$w -n $h -F $fb $filename}] } {
+                  if { [catch {exec [file join [bu_dir bin] fb-pix] -w $w -n 
$h -F $fb $filename}] } {
                       set output_generated 0
                   } else {
                       set output_generated 1

Modified: brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeE.itcl
===================================================================
--- brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeE.itcl  2020-12-18 
23:35:00 UTC (rev 78014)
+++ brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeE.itcl  2020-12-18 
23:52:04 UTC (rev 78015)
@@ -197,7 +197,7 @@
           if {[string length $filename] > 0 } {
               set output_generated 0
               if {[file extension $filename] == ".png"} {
-                  if { [ catch {exec [file join [bu_brlcad_root bin] fb-png] 
-w $w -n $h -F $fb $filename}] } {
+                  if { [ catch {exec [file join [bu_dir bin] fb-png] -w $w -n 
$h -F $fb $filename}] } {
                       set output_generated 0
                   } else {
                       set output_generated 1
@@ -204,7 +204,7 @@
                  }
               }
               if {!$output_generated} {
-                 if { [ catch {exec [file join [bu_brlcad_root bin] fb-pix] -w 
$w -n $h -F $fb $filename}] } {
+                 if { [ catch {exec [file join [bu_dir bin] fb-pix] -w $w -n 
$h -F $fb $filename}] } {
                      set output_generated 0
                  } else {
                      set output_generated 1

Modified: brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeF.itcl
===================================================================
--- brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeF.itcl  2020-12-18 
23:35:00 UTC (rev 78014)
+++ brlcad/trunk/src/tclscripts/rtwizard/lib/PictureTypeF.itcl  2020-12-18 
23:52:04 UTC (rev 78015)
@@ -227,7 +227,7 @@
           if {[string length $filename] > 0 } {
               set output_generated 0
               if {[file extension $filename] == ".png"} {
-                 if { [catch {exec [file join [bu_brlcad_root bin] fb-png] -w 
$w -n $h -F $fb $filename}] } {
+                 if { [catch {exec [file join [bu_dir bin] fb-png] -w $w -n $h 
-F $fb $filename}] } {
                      set output_generated 0
                  } else {
                      set output_generated 1
@@ -234,7 +234,7 @@
                  }
               }
               if {!$output_generated} {
-                  if { [ catch {exec [file join [bu_brlcad_root bin] fb-pix] 
-w $w -n $h -F $fb $filename} ] } {
+                  if { [ catch {exec [file join [bu_dir bin] fb-pix] -w $w -n 
$h -F $fb $filename} ] } {
                       set output_generated 0
                   } else {
                       set output_generated 1

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

Reply via email to