Revision: 34364 http://brlcad.svn.sourceforge.net/brlcad/?rev=34364&view=rev Author: bob1961 Date: 2009-04-29 18:05:15 +0000 (Wed, 29 Apr 2009)
Log Message: ----------- Added code for prompting the user for a rotation point when rotating an arb face. Modified Paths: -------------- brlcad/trunk/src/tclscripts/archer/Arb4EditFrame.tcl brlcad/trunk/src/tclscripts/archer/Arb5EditFrame.tcl brlcad/trunk/src/tclscripts/archer/Arb6EditFrame.tcl brlcad/trunk/src/tclscripts/archer/Arb7EditFrame.tcl brlcad/trunk/src/tclscripts/archer/Arb8EditFrame.tcl Modified: brlcad/trunk/src/tclscripts/archer/Arb4EditFrame.tcl =================================================================== --- brlcad/trunk/src/tclscripts/archer/Arb4EditFrame.tcl 2009-04-29 18:03:49 UTC (rev 34363) +++ brlcad/trunk/src/tclscripts/archer/Arb4EditFrame.tcl 2009-04-29 18:05:15 UTC (rev 34364) @@ -724,6 +724,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 1; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 3}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 3} {4} \ } \ @@ -732,6 +733,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 2; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 4}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 4} {3} \ } \ @@ -740,6 +742,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 3; \ set mEditParam2 2; \ + invokeRotationPointDialog {2 3 4}; \ configure -valueUnits "deg"; \ updateUpperPanel {2 3 4} {1} \ } \ @@ -748,6 +751,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 4; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 3 4}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 3 4} {2} \ } Modified: brlcad/trunk/src/tclscripts/archer/Arb5EditFrame.tcl =================================================================== --- brlcad/trunk/src/tclscripts/archer/Arb5EditFrame.tcl 2009-04-29 18:03:49 UTC (rev 34363) +++ brlcad/trunk/src/tclscripts/archer/Arb5EditFrame.tcl 2009-04-29 18:05:15 UTC (rev 34364) @@ -893,6 +893,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 1; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 3 4}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 3 4} {5} \ } \ @@ -901,6 +902,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 2; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 5}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 5} {3 4} \ } \ @@ -909,6 +911,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 3; \ set mEditParam2 2; \ + invokeRotationPointDialog {2 3 5}; \ configure -valueUnits "deg"; \ updateUpperPanel {2 3 5} {1 4} \ } \ @@ -917,6 +920,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 4; \ set mEditParam2 3; \ + invokeRotationPointDialog {3 4 5}; \ configure -valueUnits "deg"; \ updateUpperPanel {3 4 5} {1 2} \ } \ @@ -925,6 +929,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 5; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 4 5}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 4 5} {2 3} \ } Modified: brlcad/trunk/src/tclscripts/archer/Arb6EditFrame.tcl =================================================================== --- brlcad/trunk/src/tclscripts/archer/Arb6EditFrame.tcl 2009-04-29 18:03:49 UTC (rev 34363) +++ brlcad/trunk/src/tclscripts/archer/Arb6EditFrame.tcl 2009-04-29 18:05:15 UTC (rev 34364) @@ -963,6 +963,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 1; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 3 4}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 3 4} {5 6} \ } \ @@ -971,6 +972,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 2; \ set mEditParam2 2; \ + invokeRotationPointDialog {2 3 5 6}; \ configure -valueUnits "deg"; \ updateUpperPanel {2 3 6 5} {1 4} \ } \ @@ -979,6 +981,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 3; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 4 5 6}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 5 6 4} {2 3} \ } \ @@ -987,6 +990,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 4; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 5}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 5} {3 4 6} \ } \ @@ -995,6 +999,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 5; \ set mEditParam2 3; \ + invokeRotationPointDialog {3 4 6}; \ configure -valueUnits "deg"; \ updateUpperPanel {3 4 6} {1 2 5} \ } Modified: brlcad/trunk/src/tclscripts/archer/Arb7EditFrame.tcl =================================================================== --- brlcad/trunk/src/tclscripts/archer/Arb7EditFrame.tcl 2009-04-29 18:03:49 UTC (rev 34363) +++ brlcad/trunk/src/tclscripts/archer/Arb7EditFrame.tcl 2009-04-29 18:05:15 UTC (rev 34364) @@ -1025,6 +1025,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 1; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 3 4}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 3 4} {5 6 7} \ } \ @@ -1040,7 +1041,7 @@ set mEditCommand rotate_arb_face; \ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 3; \ - set mEditParam2 1; \ + set mEditParam2 5; \ configure -valueUnits "deg"; \ updateUpperPanel {5} {1 2 3 4 6 7} \ } \ @@ -1049,6 +1050,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 4; \ set mEditParam2 2; \ + invokeRotationPointDialog {2 3 6 7}; \ configure -valueUnits "deg"; \ updateUpperPanel {2 3 6 7} {1 4 5} \ } \ @@ -1056,7 +1058,7 @@ set mEditCommand rotate_arb_face; \ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 5; \ - set mEditParam2 2; \ + set mEditParam2 5; \ configure -valueUnits "deg"; \ updateUpperPanel {5} {1 2 3 4 6 7} \ } \ @@ -1064,7 +1066,7 @@ set mEditCommand rotate_arb_face; \ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 6; \ - set mEditParam2 4; \ + set mEditParam2 5; \ configure -valueUnits "deg"; \ updateUpperPanel {5} {1 2 3 4 6 7} \ } Modified: brlcad/trunk/src/tclscripts/archer/Arb8EditFrame.tcl =================================================================== --- brlcad/trunk/src/tclscripts/archer/Arb8EditFrame.tcl 2009-04-29 18:03:49 UTC (rev 34363) +++ brlcad/trunk/src/tclscripts/archer/Arb8EditFrame.tcl 2009-04-29 18:05:15 UTC (rev 34364) @@ -43,6 +43,9 @@ method buildUpperPanel method buildLowerPanel method buildValuePanel + + common mRotationPointDialog "" + common mRotationPointCB "" } public { @@ -118,6 +121,9 @@ method initValuePanel {} method editGeometry {} + + method buildRotationPointDialog {} + method invokeRotationPointDialog {_choices} } private {} @@ -129,6 +135,8 @@ # ------------------------------------------------------------ ::itcl::body Arb8EditFrame::constructor {args} { + buildRotationPointDialog + eval itk_initialize $args } @@ -1367,6 +1375,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 1; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 3 4}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 3 4} {5 6 7 8} \ } \ @@ -1375,6 +1384,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 2; \ set mEditParam2 5; \ + invokeRotationPointDialog {5 6 7 8}; \ configure -valueUnits "deg"; \ updateUpperPanel {5 6 7 8} {1 2 3 4} \ } \ @@ -1383,6 +1393,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 3; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 4 5 8}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 5 8 4} {2 3 6 7} \ } \ @@ -1391,6 +1402,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 4; \ set mEditParam2 2; \ + invokeRotationPointDialog {2 3 6 7}; \ configure -valueUnits "deg"; \ updateUpperPanel {2 3 6 7} {1 5 8 4} \ } \ @@ -1399,6 +1411,7 @@ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 5; \ set mEditParam2 1; \ + invokeRotationPointDialog {1 2 5 6}; \ configure -valueUnits "deg"; \ updateUpperPanel {1 2 5 6} {3 4 7 8} \ } \ @@ -1406,7 +1419,8 @@ set mEditCommand rotate_arb_face; \ set mEditClass $EDIT_CLASS_ROT; \ set mEditParam1 6; \ - set mEditParam2 4; \ + set mEditParam2 3; \ + invokeRotationPointDialog {3 4 7 8}; \ configure -valueUnits "deg"; \ updateUpperPanel {3 4 7 8} {1 2 5 6} \ } @@ -1443,6 +1457,83 @@ $rotateFace4378 {rotateFace 4378} } +::itcl::body Arb8EditFrame::buildRotationPointDialog {} { + if {$mRotationPointDialog != ""} { + return + } + + set dialog [::iwidgets::dialog .\#auto \ + -modality application \ + -title "Select Rotation Point" \ + -background $::ArcherCore::SystemButtonFace] + set mRotationPointDialog $dialog + + $dialog configure -background $::ArcherCore::LABEL_BACKGROUND_COLOR + + $dialog hide 1 + $dialog hide 2 + $dialog hide 3 + + $dialog configure \ + -thickness 2 \ + -buttonboxpady 0 + + $dialog configure \ + -thickness 2 \ + -buttonboxpady 0 + $dialog buttonconfigure 0 \ + -defaultring yes \ + -defaultringpad 3 \ + -borderwidth 1 \ + -pady 0 + + # ITCL can be nasty + set win [$dialog component bbox component OK component hull] + after idle "$win configure -relief flat" + + # Build combobox + set parent [$dialog childsite] + ::ttk::label $parent.rpointL \ + -text "Rotation Point:" + + ::ttk::frame $parent.rpointF \ + -relief sunken + + ::ttk::combobox $parent.rpointF.rpointCB \ + -state readonly \ + -textvariable ::GeometryEditFrame::mEditParam2 \ + -values {} + set mRotationPointCB $parent.rpointF.rpointCB + + pack $parent.rpointF.rpointCB -expand yes -fill both + + set row 0 + grid $parent.rpointL \ + -row $row \ + -column 0 \ + -sticky ne + grid $parent.rpointF \ + -row $row \ + -column 1 \ + -sticky nsew + grid columnconfigure $parent 1 -weight 1 + + $dialog buttonconfigure OK -command "$dialog deactivate" + wm protocol $dialog WM_DELETE_WINDOW "$dialog deactivate" + + # Lame tcl/tk won't center the window properly + # the first time unless we call update. + update + + after idle "$dialog center" +} + +::itcl::body Arb8EditFrame::invokeRotationPointDialog {_choices} { + $mRotationPointCB configure -values $_choices + $mRotationPointDialog activate +} + + # Local Variables: # mode: Tcl # tab-width: 8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits