Revision: 51259
          http://brlcad.svn.sourceforge.net/brlcad/?rev=51259&view=rev
Author:   bob1961
Date:     2012-06-20 13:06:42 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
Added an optional argument to Archer::raytracePlus (i.e. _batch_list) which 
allows raytracePlus to write render commands to a file

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/archer/Archer.tcl

Modified: brlcad/trunk/src/tclscripts/archer/Archer.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/Archer.tcl       2012-06-20 02:01:22 UTC 
(rev 51258)
+++ brlcad/trunk/src/tclscripts/archer/Archer.tcl       2012-06-20 13:06:42 UTC 
(rev 51259)
@@ -168,7 +168,7 @@
        method bot_sync_all {}
        method bot_sync_all_wrapper {}
        method fbclear {}
-       method raytracePlus {}
+       method raytracePlus {{_batch_list {}}}
 
        # ArcherCore Override Section
        method cmd                 {args}
@@ -937,61 +937,96 @@
 }
 
 
-::itcl::body Archer::raytracePlus {} {
+::itcl::body Archer::raytracePlus {{_batch_list {}}} {
+    global tcl_platform
+    global argv0
+
     if {![info exists itk_component(ged)]} {
        return
     }
 
-    $itk_component(primaryToolbar) itemconfigure raytrace \
-       -image $mImage_rtAbort \
-       -command "$itk_component(rtcntrl) abort"
+    set len [llength $_batch_list]
 
-    $itk_component(rtcntrl) configure -fb_enabled 1
+    if {$len == 0} {
+       $itk_component(primaryToolbar) itemconfigure raytrace \
+           -image $mImage_rtAbort \
+           -command "$itk_component(rtcntrl) abort"
 
+       $itk_component(rtcntrl) configure -fb_enabled 1
+
+       set port [$itk_component(ged) listen 0]
+    } elseif {$len == 5} {
+       set fh [lindex $_batch_list 0]
+       set port [lindex $_batch_list 1]
+       set viewsize [lindex $_batch_list 2]
+       set orientation [lindex $_batch_list 3]
+       set eye_pt [lindex $_batch_list 4]
+
+       set execpath [file dirname [file normalize $argv0]]
+       if {$tcl_platform(platform) == "windows"} {
+           set rtwizname [file join $execpath rtwizard.bat]
+       } else {
+           set rtwizname [file join $execpath rtwizard]
+       }
+    } else {
+       error "_batch_list must have 5 items: _batch_list ---> $_batch_list"
+    }
+
     set wlist [$itk_component(ged) win_size]
     set w [lindex $wlist 0]
     set n [lindex $wlist 1]
-    set port [$itk_component(ged) listen 0]
-
     set bcolor [cadwidgets::Ged::get_rgb_color $mFBBackgroundColor]
 
     if {$mTreeMode == $TREE_MODE_TREE} {
-       eval $itk_component(ged) rtwizard -C [list $bcolor] \
-           -w $w -n $n -p $port -c $mColorObjects
+       if {$len == 0} {
+           eval $itk_component(ged) rtwizard -C [list $bcolor] -w $w -n $n -p 
$port -c $mColorObjects
+       } else {
+           puts $fh "catch {exec $rtwizname -C [list $bcolor] -w $w -n $n -p 
$port -c $mColorObjects --viewsize $viewsize --orientation $orientation 
--eye_pt $eye_pt}"
+       }
     } else {
        set ecolor [cadwidgets::Ged::get_rgb_color $mRtWizardEdgeColor]
 
-       if {$mRtWizardNonEdgeColor != ""} {
-           set necolor [cadwidgets::Ged::get_rgb_color $mRtWizardNonEdgeColor]
+       if {$len == 0} {
+           if {$mRtWizardNonEdgeColor != ""} {
+               set necolor [cadwidgets::Ged::get_rgb_color 
$mRtWizardNonEdgeColor]
 
-           if {$mSavedViewEyePt != ""} {
-               set eye_pt [eval $itk_component(ged) v2m_point $mSavedViewEyePt]
-               eval $itk_component(ged) rtwizard \
-                   --eye_pt [list $eye_pt] \
-                   -C [list $bcolor] --line-color [list $ecolor] \
-                   --non-line-color [list $necolor] \
-                   -w $w -n $n -p $port -c $mColorObjects -g $mGhostObjects -l 
$mEdgeObjects \
-                   -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
+               if {$mSavedViewEyePt != ""} {
+                   set eye_pt [eval $itk_component(ged) v2m_point 
$mSavedViewEyePt]
+                   eval $itk_component(ged) rtwizard \
+                       --eye_pt [list $eye_pt] \
+                       -C [list $bcolor] --line-color [list $ecolor] \
+                       --non-line-color [list $necolor] \
+                       -w $w -n $n -p $port -c $mColorObjects -g 
$mGhostObjects -l $mEdgeObjects \
+                       -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
+               } else {
+                   eval $itk_component(ged) rtwizard \
+                       -C [list $bcolor] --line-color [list $ecolor] \
+                       --non-line-color [list $necolor] \
+                       -w $w -n $n -p $port -c $mColorObjects -g 
$mGhostObjects -l $mEdgeObjects \
+                       -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
+               }
            } else {
-               eval $itk_component(ged) rtwizard \
-                   -C [list $bcolor] --line-color [list $ecolor] \
-                   --non-line-color [list $necolor] \
-                   -w $w -n $n -p $port -c $mColorObjects -g $mGhostObjects -l 
$mEdgeObjects \
-                   -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
+               if {$mSavedViewEyePt != ""} {
+                   set eye_pt [eval $itk_component(ged) v2m_point 
$mSavedViewEyePt]
+                   eval $itk_component(ged) rtwizard \
+                       --eye_pt [list $eye_pt] \
+                       -C [list $bcolor] --line-color [list $ecolor] \
+                       -w $w -n $n -p $port -c $mColorObjects -g 
$mGhostObjects -l $mEdgeObjects \
+                       -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
+               }  {
+                   eval $itk_component(ged) rtwizard \
+                       -C [list $bcolor] --line-color [list $ecolor] \
+                       -w $w -n $n -p $port -c $mColorObjects -g 
$mGhostObjects -l $mEdgeObjects \
+                       -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
+               }
            }
        } else {
-           if {$mSavedViewEyePt != ""} {
-               set eye_pt [eval $itk_component(ged) v2m_point $mSavedViewEyePt]
-               eval $itk_component(ged) rtwizard \
-                   --eye_pt [list $eye_pt] \
-                   -C [list $bcolor] --line-color [list $ecolor] \
-                   -w $w -n $n -p $port -c $mColorObjects -g $mGhostObjects -l 
$mEdgeObjects \
-                   -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
-           }  {
-               eval $itk_component(ged) rtwizard \
-                   -C [list $bcolor] --line-color [list $ecolor] \
-                   -w $w -n $n -p $port -c $mColorObjects -g $mGhostObjects -l 
$mEdgeObjects \
-                   -G $mRtWizardGhostIntensity -O $mRtWizardOccMode 
+           if {$mRtWizardNonEdgeColor != ""} {
+               set necolor [cadwidgets::Ged::get_rgb_color 
$mRtWizardNonEdgeColor]
+
+               puts $fh "catch {exec $rtwizname -C [list $bcolor] --line-color 
[list $ecolor] --non-line-color [list $necolor] -w $w -n $n -p $port -c 
$mColorObjects -g $mGhostObjects -l $mEdgeObjects -G $mRtWizardGhostIntensity 
-O $mRtWizardOccMode --viewsize $viewsize --orientation $orientation --eye_pt 
$eye_pt}"
+           } else {
+               puts $fh "catch {exec $rtwizname -C [list $bcolor] --line-color 
[list $ecolor] -w $w -n $n -p $port -c $mColorObjects -g $mGhostObjects -l 
$mEdgeObjects -G $mRtWizardGhostIntensity -O $mRtWizardOccMode --viewsize 
$viewsize --orientation $orientation --eye_pt $eye_pt}"
            }
        }
     }

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


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to