Revision: 54449
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54449&view=rev
Author:   bob1961
Date:     2013-02-21 12:33:50 +0000 (Thu, 21 Feb 2013)
Log Message:
-----------
Push a few variables and methods back into the GeometryEditFrame class (i.e. 
mHighlightPoints, mHighlightPointSize, mHighlightPointColor, clearAllTables, 
updatePointSize and validatePointSize). Update the pipe edit panel to highlight 
the current pipe point.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/archer/BotEditFrame.tcl
    brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl
    brlcad/trunk/src/tclscripts/archer/PipeEditFrame.tcl
    brlcad/trunk/src/tclscripts/archer/SketchEditFrame.tcl

Modified: brlcad/trunk/src/tclscripts/archer/BotEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/BotEditFrame.tcl 2013-02-21 02:21:20 UTC 
(rev 54448)
+++ brlcad/trunk/src/tclscripts/archer/BotEditFrame.tcl 2013-02-21 12:33:50 UTC 
(rev 54449)
@@ -75,12 +75,10 @@
            {Split Face}
        }
 
-       method clearAllTables {}
        method selectBotPts {_plist}
        method setMoveMode {{_tflag 0}}
 
        # Override what's in GeometryEditFrame
-       method clearEditState {{_clearModeOnly 0}}
        method initGeometry {_gdata}
        method updateGeometry {}
        method createGeometry {_name}
@@ -109,9 +107,6 @@
        variable mMaxVertThreshold 30
        variable mIgnoreMaxVertThreshold 0
        variable mShowTables 1
-       variable mHighlightPoints 1
-       variable mHighlightPointSize 1.0
-       variable mHighlightPointColor {255 255 255}
 
        # Methods used by the constructor
        # override methods in GeometryEditFrame
@@ -119,8 +114,9 @@
        method buildLowerPanel
 
        # Override what's in GeometryEditFrame
-       method updateGeometryIfMod {}
+       method clearAllTables {}
        method initEditState {}
+       method updateGeometryIfMod {}
 
        method applyData {}
        method botEdgesSelectCallback {_edge {_sync 1}}
@@ -144,9 +140,7 @@
        method syncTablesWrtPoints {{_findEdges 1}}
        method syncTablesWrtEdges {}
        method syncTablesWrtFaces {}
-       method updatePointSize {}
        method validateDetailEntry {_row _col _newval _clientdata}
-       method validatePointSize {_size}
     }
 
     private {}
@@ -172,19 +166,6 @@
 
 
 
-::itcl::body BotEditFrame::clearAllTables {} {
-    $itk_option(-mged) data_axes points {}
-    $itk_option(-mged) data_lines points {}
-
-    set mCurrentBotPoints ""
-    set mCurrentBotEdges ""
-    set mCurrentBotFaces ""
-    $itk_component(vertTab) unselectAllRows
-    $itk_component(edgeTab) unselectAllRows
-    $itk_component(faceTab) unselectAllRows
-}
-
-
 ::itcl::body BotEditFrame::selectBotPts {_plist} {
     foreach item $_plist {
        incr item
@@ -222,18 +203,6 @@
 }
 
 
-::itcl::body BotEditFrame::clearEditState {{_clearModeOnly 0}} {
-    set mEditMode 0
-
-    if {$_clearModeOnly} {
-       return
-    }
-
-    clearAllTables
-    set itk_option(-prevGeometryObject) ""
-}
-
-
 ## - initGeometry
 #
 # Initialize the variables containing the object's specification.
@@ -617,7 +586,7 @@
        ::ttk::checkbutton $parent.hlPointsCB \
            -text "Highlight Points" \
            -command [::itcl::code $this highlightCurrentBotElements] \
-           -variable [::itcl::scope mHighlightPoints]
+           -variable ::GeometryEditFrame::mHighlightPoints
     } {}
 
     itk_component add maxVertThreshL {
@@ -667,58 +636,16 @@
 }
 
 
-::itcl::body BotEditFrame::updateGeometryIfMod {} {
-    if {$itk_option(-mged) == "" ||
-       $itk_option(-geometryObject) == ""} {
-       return
-    }
+::itcl::body BotEditFrame::clearAllTables {} {
+    $itk_option(-mged) data_axes points {}
+    $itk_option(-mged) data_lines points {}
 
-    set doUpdate 0
-    set gdata [$itk_option(-mged) get $itk_option(-geometryObject)]
-    set gdata [lrange $gdata 1 end]
-
-    foreach {attr val} $gdata {
-       if {![regexp {^[VOIRvoir]([0-9]+)$} $attr all index]} {
-           puts "Encountered bad one - $attr"
-           continue
-       }
-
-       incr index
-
-       switch -regexp -- $attr {
-           {[Vv][0-9]+} {
-               if {$mVertDetail($index,$PX_COL) != [lindex $val 0] ||
-                   $mVertDetail($index,$PY_COL) != [lindex $val 1] ||
-                   $mVertDetail($index,$PZ_COL) != [lindex $val 2]} {
-                   set doUpdate 1
-               }
-           }
-           {[Oo][0-9]+} {
-               if {$mVertDetail($index,$OD_COL) != $val} {
-                   set doUpdate 1
-               }
-           }
-           {[Ii][0-9]+} {
-               if {$mVertDetail($index,$ID_COL) != $val} {
-                   set doUpdate 1
-               }
-           }
-           {[Rr][0-9]+} {
-               if {$mVertDetail($index,$RADIUS_COL) != $val} {
-                   set doUpdate 1
-               }
-           }
-           default {
-               # Shouldn't get here
-               puts "Encountered bad one - $attr"
-           }
-       }
-
-       if {$doUpdate} {
-           updateGeometry
-           return
-       }
-    }
+    set mCurrentBotPoints ""
+    set mCurrentBotEdges ""
+    set mCurrentBotFaces ""
+    $itk_component(vertTab) unselectAllRows
+    $itk_component(edgeTab) unselectAllRows
+    $itk_component(faceTab) unselectAllRows
 }
 
 
@@ -799,6 +726,61 @@
 }
 
 
+::itcl::body BotEditFrame::updateGeometryIfMod {} {
+    if {$itk_option(-mged) == "" ||
+       $itk_option(-geometryObject) == ""} {
+       return
+    }
+
+    set doUpdate 0
+    set gdata [$itk_option(-mged) get $itk_option(-geometryObject)]
+    set gdata [lrange $gdata 1 end]
+
+    foreach {attr val} $gdata {
+       if {![regexp {^[VOIRvoir]([0-9]+)$} $attr all index]} {
+           puts "Encountered bad one - $attr"
+           continue
+       }
+
+       incr index
+
+       switch -regexp -- $attr {
+           {[Vv][0-9]+} {
+               if {$mVertDetail($index,$PX_COL) != [lindex $val 0] ||
+                   $mVertDetail($index,$PY_COL) != [lindex $val 1] ||
+                   $mVertDetail($index,$PZ_COL) != [lindex $val 2]} {
+                   set doUpdate 1
+               }
+           }
+           {[Oo][0-9]+} {
+               if {$mVertDetail($index,$OD_COL) != $val} {
+                   set doUpdate 1
+               }
+           }
+           {[Ii][0-9]+} {
+               if {$mVertDetail($index,$ID_COL) != $val} {
+                   set doUpdate 1
+               }
+           }
+           {[Rr][0-9]+} {
+               if {$mVertDetail($index,$RADIUS_COL) != $val} {
+                   set doUpdate 1
+               }
+           }
+           default {
+               # Shouldn't get here
+               puts "Encountered bad one - $attr"
+           }
+       }
+
+       if {$doUpdate} {
+           updateGeometry
+           return
+       }
+    }
+}
+
+
 ::itcl::body BotEditFrame::applyData {} {
 }
 
@@ -1343,15 +1325,6 @@
 }
 
 
-::itcl::body BotEditFrame::updatePointSize {} {
-    if {$mHighlightPointSize != "" && $mHighlightPointSize != "."} {
-       $itk_option(-mged) data_axes size $mHighlightPointSize
-    } else {
-       $itk_option(-mged) data_axes size 0
-    }
-}
-
-
 ::itcl::body BotEditFrame::validateDetailEntry {_row _col _newval _clientdata} 
{
     return 0
 
@@ -1363,30 +1336,6 @@
 }
 
 
-::itcl::body BotEditFrame::validatePointSize {_size} {
-    if {$_size == "."} {
-       return 1
-    }
-
-    if {[string is double $_size]} {
-       # Need to check is first
-       if {$_size == ""} {
-           return 1
-       }
-
-       if {$_size < 0} {
-           return 0
-       }
-
-       # Everything else is OK
-       return 1
-    }
-
-    return 0
-}
-
-
-
 # Local Variables:
 # mode: Tcl
 # tab-width: 8

Modified: brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl    2013-02-21 
02:21:20 UTC (rev 54448)
+++ brlcad/trunk/src/tclscripts/archer/GeometryEditFrame.tcl    2013-02-21 
12:33:50 UTC (rev 54449)
@@ -59,6 +59,9 @@
        common mEditParam2 0
        common mEditLastTransMode $::ArcherCore::OBJECT_CENTER_MODE
        common mEditPCommand ""
+       common mHighlightPoints 1
+       common mHighlightPointSize 1.0
+       common mHighlightPointColor {255 255 255}
 
        proc validateColorComp {c}
        proc validateColor {color}
@@ -94,12 +97,15 @@
        method updateUpperPanel {normal disabled}
        method updateGeometryIfMod {}
 
+       method clearAllTables {}
        method initEditState {}
 
        method buildComboBox {parent name1 name2 varName text listOfChoices}
        method buildArrow {parent prefix text buildViewFunc}
+       method getView {}
        method toggleArrow {arrow view args}
-       method getView {}
+       method updatePointSize {}
+       method validatePointSize {_size}
     }
 
     private {
@@ -241,7 +247,14 @@
 
 
 ::itcl::body GeometryEditFrame::clearEditState {{_clearModeOnly 0}} {
-    # Nothing for now
+    set mEditMode 0
+
+    if {$_clearModeOnly} {
+       return
+    }
+
+    clearAllTables
+    set itk_option(-prevGeometryObject) ""
 }
 
 
@@ -314,6 +327,11 @@
 ::itcl::body GeometryEditFrame::updateGeometryIfMod {} {
 }
 
+
+::itcl::body GeometryEditFrame::clearAllTables {} {
+}
+
+
 ::itcl::body GeometryEditFrame::initEditState {} {
     set itk_option(-prevGeometryObject) $itk_option(-geometryObject)
 
@@ -370,17 +388,6 @@
                                                          -column 1 -sticky 
nsew]
 }
 
-itcl::body GeometryEditFrame::toggleArrow {arrow view args} {
-    set state [$arrow cget -togglestate]
-    switch -- $state {
-       closed {
-           grid forget $view
-       }
-       open {
-           eval grid $view $args
-       }
-    }
-}
 
 ::itcl::body GeometryEditFrame::getView {} {
     if {$itk_option(-mged) == ""} {
@@ -408,6 +415,53 @@
     set mZmax [expr {$mCenterZ + $mDelta}]
 }
 
+
+itcl::body GeometryEditFrame::toggleArrow {arrow view args} {
+    set state [$arrow cget -togglestate]
+    switch -- $state {
+       closed {
+           grid forget $view
+       }
+       open {
+           eval grid $view $args
+       }
+    }
+}
+
+
+::itcl::body GeometryEditFrame::updatePointSize {} {
+    if {$mHighlightPointSize != "" && $mHighlightPointSize != "."} {
+       $itk_option(-mged) data_axes size $mHighlightPointSize
+    } else {
+       $itk_option(-mged) data_axes size 0
+    }
+}
+
+
+::itcl::body GeometryEditFrame::validatePointSize {_size} {
+    if {$_size == "."} {
+       return 1
+    }
+
+    if {[string is double $_size]} {
+       # Need to check is first
+       if {$_size == ""} {
+           return 1
+       }
+
+       if {$_size < 0} {
+           return 0
+       }
+
+       # Everything else is OK
+       return 1
+    }
+
+    return 0
+}
+
+
+
 # Local Variables:
 # mode: Tcl
 # tab-width: 8

Modified: brlcad/trunk/src/tclscripts/archer/PipeEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/PipeEditFrame.tcl        2013-02-21 
02:21:20 UTC (rev 54448)
+++ brlcad/trunk/src/tclscripts/archer/PipeEditFrame.tcl        2013-02-21 
12:33:50 UTC (rev 54449)
@@ -68,6 +68,8 @@
            {Set Pipe Bend}
        }
 
+       method clearAllTables {}
+
        # Override what's in GeometryEditFrame
        method initGeometry {gdata}
        method initTranslate {}
@@ -79,7 +81,7 @@
 
     protected {
        variable mDetail
-       variable mCurrentPipePoint 1
+       variable mCurrentPipePoint 0
        variable mPrevPipeObject ""
 
        # Methods used by the constructor
@@ -96,6 +98,7 @@
        method endPipePointMove {_dm _obj _mx _my}
        method handleDetailPopup {_index _X _Y}
        method handleEnter {_row _col}
+       method highlightCurrentPipePoint {}
        method pipePointAppendCallback {}
        method pipePointDeleteCallback {_pindex}
        method pipePointMoveCallback {_pindex}
@@ -126,6 +129,16 @@
 #                      PUBLIC METHODS
 # ------------------------------------------------------------
 
+
+::itcl::body PipeEditFrame::clearAllTables {} {
+    $itk_option(-mged) data_axes points {}
+    $itk_option(-mged) data_lines points {}
+
+    set mCurrentPipePoint 0
+    $itk_component(detailTab) unselectAllRows
+}
+
+
 ## - initGeometry
 #
 # Initialize the variables containing the object's specification.
@@ -177,11 +190,12 @@
 
     GeometryEditFrame::initGeometry $gdata
 
-    if {$itk_option(-geometryObject) != $mPrevPipeObject} {
-       set mCurrentPipePoint 1
-       set mPrevPipeObject $itk_option(-geometryObject)
+    if {$itk_option(-geometryObject) != $itk_option(-prevGeometryObject)} {
+       set mCurrentPipePoint 0
+       set itk_option(-prevGeometryObject) $itk_option(-geometryObject)
+    } elseif {$mCurrentPipePoint > 0} {
+       pipePointSelectCallback [expr {$mCurrentPipePoint - 1}]
     }
-    pipePointSelectCallback [expr {$mCurrentPipePoint - 1}]
 }
 
 
@@ -360,6 +374,37 @@
        grid $itk_component(editRB$row) -row $row -column 0 -sticky nsew
        incr row
     }
+
+    itk_component add hlPointsCB {
+       ::ttk::checkbutton $parent.hlPointsCB \
+           -text "Highlight Points" \
+           -command [::itcl::code $this highlightCurrentPipePoint] \
+           -variable ::GeometryEditFrame::mHighlightPoints
+    } {}
+
+    itk_component add pointSizeL {
+       ::ttk::label $parent.pointSizeL \
+           -anchor e \
+           -text "Highlight Point Size"
+    } {}
+    itk_component add pointSizeE {
+       ::ttk::entry $parent.pointSizeE \
+           -width 12 \
+           -textvariable [::itcl::scope mHighlightPointSize] \
+           -validate key \
+           -validatecommand [::itcl::code $this validatePointSize %P]
+    } {}
+
+    bind $itk_component(pointSizeE) <Return> [::itcl::code $this 
updatePointSize]
+
+    incr row
+    grid rowconfigure $parent $row -weight 1
+    incr row
+    grid $itk_component(hlPointsCB) -row $row -column 0 -sticky w
+    incr row
+    grid $itk_component(pointSizeL) -column 0 -row $row -sticky e
+    grid $itk_component(pointSizeE) -column 1 -row $row -sticky ew
+    grid columnconfigure $parent 1 -weight 1
 }
 
 ::itcl::body PipeEditFrame::updateGeometryIfMod {} {
@@ -530,6 +575,22 @@
     updateGeometryIfMod
 }
 
+
+::itcl::body PipeEditFrame::highlightCurrentPipePoint {} {
+    $itk_option(-mged) refresh_off
+    set hlcolor [$::ArcherCore::application getRgbColor [$itk_option(-mged) 
cget -primitiveLabelColor]]
+    $itk_option(-mged) data_axes draw $mHighlightPoints
+    $itk_option(-mged) data_axes size $mHighlightPointSize
+    eval $itk_option(-mged) data_axes color $hlcolor
+    $itk_option(-mged) refresh_on
+
+    set seg_i [expr {$mCurrentPipePoint - 1}]
+    set pt [$itk_option(-mged) get $itk_option(-geometryObjectPath) V$seg_i]
+
+    $itk_option(-mged) data_axes points [list $pt]
+}
+
+
 ::itcl::body PipeEditFrame::pipePointAppendCallback {} {
     if {$itk_option(-mged) == ""} {
        return
@@ -595,6 +656,7 @@
     incr _pindex
     set mCurrentPipePoint $_pindex
     $itk_component(detailTab) selectSingleRow $_pindex
+    highlightCurrentPipePoint
 }
 
 ::itcl::body PipeEditFrame::singleSelectCallback {_pindex} {

Modified: brlcad/trunk/src/tclscripts/archer/SketchEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/SketchEditFrame.tcl      2013-02-21 
02:21:20 UTC (rev 54448)
+++ brlcad/trunk/src/tclscripts/archer/SketchEditFrame.tcl      2013-02-21 
12:33:50 UTC (rev 54449)
@@ -69,8 +69,6 @@
        method get_vlist {}
        method set_radius {_radius}
 
-       method clearEditState {{_clearModeOnly 0}}
-       method clearAllTables {}
        method selectSketchPts {_plist}
 
        # Override what's in GeometryEditFrame
@@ -158,8 +156,9 @@
        method buildLowerPanel
 
        # Override what's in GeometryEditFrame
-       method updateGeometryIfMod {}
+       method clearAllTables {}
        method initEditState {}
+       method updateGeometryIfMod {}
 
        method applyData {}
        method bboxVerts {}
@@ -306,31 +305,6 @@
 }
 
 
-::itcl::body SketchEditFrame::clearEditState {{_clearModeOnly 0}} {
-    set mEditMode 0
-
-    if {$_clearModeOnly} {
-       return
-    }
-
-    clearAllTables
-    set itk_option(-prevGeometryObject) ""
-}
-
-
-::itcl::body SketchEditFrame::clearAllTables {} {
-    $itk_option(-mged) data_axes points {}
-    $itk_option(-mged) data_lines points {}
-
-    set mCurrentSketchPoints ""
-    set mCurrentSketchEdges ""
-    set mCurrentSketchFaces ""
-    $itk_component(vertTab) unselectAllRows
-    $itk_component(edgeTab) unselectAllRows
-    $itk_component(faceTab) unselectAllRows
-}
-
-
 ::itcl::body SketchEditFrame::selectSketchPts {_plist} {
     foreach item $_plist {
        incr item
@@ -772,6 +746,51 @@
 }
 
 
+::itcl::body SketchEditFrame::clearAllTables {} {
+    $itk_option(-mged) data_axes points {}
+    $itk_option(-mged) data_lines points {}
+
+    set mCurrentSketchPoints ""
+    set mCurrentSketchEdges ""
+    set mCurrentSketchFaces ""
+    $itk_component(vertTab) unselectAllRows
+    $itk_component(edgeTab) unselectAllRows
+    $itk_component(faceTab) unselectAllRows
+}
+
+
+::itcl::body SketchEditFrame::initEditState {} {
+    if {$itk_option(-mged) == ""} {
+       return
+    }
+
+    set mEditPCommand [::itcl::code $this p]
+    set mEditParam1 ""
+    set mEditCommand ""
+    set mEditClass ""
+    highlightCurrentSketchElements
+
+    switch -- $mEditMode \
+       $moveArbitrary {
+           setup_move_arbitrary
+       } \
+       $createLine {
+           create_line
+       } \
+       $createCircle {
+           create_circle
+       } \
+       $createArc {
+           create_arc
+       } \
+       $createBezier {
+           create_bezier
+       }
+
+    GeometryEditFrame::initEditState
+}
+
+
 ::itcl::body SketchEditFrame::updateGeometryIfMod {} {
     if {$itk_option(-mged) == "" ||
        $itk_option(-geometryObject) == ""} {
@@ -830,38 +849,6 @@
 }
 
 
-::itcl::body SketchEditFrame::initEditState {} {
-    if {$itk_option(-mged) == ""} {
-       return
-    }
-
-    set mEditPCommand [::itcl::code $this p]
-    set mEditParam1 ""
-    set mEditCommand ""
-    set mEditClass ""
-    highlightCurrentSketchElements
-
-    switch -- $mEditMode \
-       $moveArbitrary {
-           setup_move_arbitrary
-       } \
-       $createLine {
-           create_line
-       } \
-       $createCircle {
-           create_circle
-       } \
-       $createArc {
-           create_arc
-       } \
-       $createBezier {
-           create_bezier
-       }
-
-    GeometryEditFrame::initEditState
-}
-
-
 ::itcl::body SketchEditFrame::applyData {} {
 }
 

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


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to