Revision: 53793
http://brlcad.svn.sourceforge.net/brlcad/?rev=53793&view=rev
Author: bob1961
Date: 2012-11-21 13:56:30 +0000 (Wed, 21 Nov 2012)
Log Message:
-----------
Updated the extrude edit panel by getting rid of "Rotate H" and adding "Move
End HR". Also added code to _ged_translate_extrude() to move H while
maintaining perpendicularity among H, U and V without the random flipping of
vectors as seen in tgc (fixing this next).
Modified Paths:
--------------
brlcad/trunk/src/libged/translate_extrude.c
brlcad/trunk/src/tclscripts/archer/ExtrudeEditFrame.tcl
Modified: brlcad/trunk/src/libged/translate_extrude.c
===================================================================
--- brlcad/trunk/src/libged/translate_extrude.c 2012-11-21 05:06:36 UTC (rev
53792)
+++ brlcad/trunk/src/libged/translate_extrude.c 2012-11-21 13:56:30 UTC (rev
53793)
@@ -47,20 +47,58 @@
switch (attribute[0]) {
case 'h':
case 'H':
- if (rflag) {
- VADD2(hvec, extrude->h, tvec);
- } else {
- VSUB2(hvec, tvec, extrude->V);
- }
+ switch (attribute[1]) {
+ case '\0':
+ if (rflag) {
+ VADD2(hvec, extrude->h, tvec);
+ } else {
+ VSUB2(hvec, tvec, extrude->V);
+ }
- /* check for zero H vector */
- if (MAGNITUDE(hvec) <= SQRT_SMALL_FASTF) {
- bu_vls_printf(gedp->ged_result_str, "Zero H vector not
allowed.");
+ /* check for zero H vector */
+ if (MAGNITUDE(hvec) <= SQRT_SMALL_FASTF) {
+ bu_vls_printf(gedp->ged_result_str, "Zero H vector not
allowed.");
+ return GED_ERROR;
+ }
+
+ VMOVE(extrude->h, hvec);
+
+ break;
+ case 'r':
+ case 'R':
+ if (attribute[2] != '\0') {
+ bu_vls_printf(gedp->ged_result_str, "bad extrude attribute
- %s", attribute);
+ return GED_ERROR;
+ }
+
+ if (rflag) {
+ VADD2(hvec, extrude->h, tvec);
+ } else {
+ VSUB2(hvec, tvec, extrude->V);
+ }
+
+ /* check for zero H vector */
+ if (MAGNITUDE(hvec) <= SQRT_SMALL_FASTF) {
+ bu_vls_printf(gedp->ged_result_str, "Zero H vector not
allowed.");
+ return GED_ERROR;
+ }
+
+ VMOVE(extrude->h, hvec);
+
+ VUNITIZE(hvec);
+ VUNITIZE(extrude->u_vec);
+ VCROSS(extrude->v_vec, hvec, extrude->u_vec);
+ VUNITIZE(extrude->v_vec);
+
+ /* Lastly, cross v_vec with h to insure u_vec is perpendicular
to h */
+ VCROSS(extrude->u_vec, extrude->v_vec, hvec);
+
+ break;
+ default:
+ bu_vls_printf(gedp->ged_result_str, "bad extrude attribute -
%s", attribute);
return GED_ERROR;
}
- VMOVE(extrude->h, hvec);
-
break;
default:
bu_vls_printf(gedp->ged_result_str, "bad extrude attribute - %s",
attribute);
Modified: brlcad/trunk/src/tclscripts/archer/ExtrudeEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/ExtrudeEditFrame.tcl 2012-11-21
05:06:36 UTC (rev 53792)
+++ brlcad/trunk/src/tclscripts/archer/ExtrudeEditFrame.tcl 2012-11-21
13:56:30 UTC (rev 53793)
@@ -42,9 +42,9 @@
}
protected {
- common setH 1
- common rotH 2
- common moveH 3
+ common setH 1
+ common moveHR 2
+ common moveH 3
variable mVx ""
variable mVy ""
@@ -175,11 +175,11 @@
$setH {
$::ArcherCore::application p_pscale $obj h $args
} \
+ $moveHR {
+ $::ArcherCore::application p_ptranslate $obj hr $args
+ } \
$moveH {
$::ArcherCore::application p_ptranslate $obj h $args
- } \
- $rotH {
- $::ArcherCore::application p_protate $obj h $args
}
return ""
@@ -341,9 +341,7 @@
} {}
itk_component add extrudeSE {
::ttk::entry $parent.extrudeSE \
- -textvariable [::itcl::scope mS] \
- -validate key \
- -validatecommand {::cadwidgets::Ged::validateDouble %P}
+ -textvariable [::itcl::scope mS]
} {}
itk_component add extrudeSUnitsL {
::ttk::label $parent.extrudeSUnitsL \
@@ -428,8 +426,9 @@
::itcl::body ExtrudeEditFrame::buildLowerPanel {} {
set parent [$this childsite lower]
- set alist [list H set Set H move Move H rot Rotate]
+ set alist [list H set Set HR move {Move End} H move {Move End}]
+ set row 0
foreach {attribute op opLabel} $alist {
itk_component add $op$attribute {
::ttk::radiobutton $parent.$op\_$attribute \
@@ -439,10 +438,11 @@
-command [::itcl::code $this initEditState]
} {}
- pack $itk_component($op$attribute) \
- -anchor w \
- -expand yes
+ grid $itk_component($op$attribute) -row $row -column 0 -sticky nsew
+ incr row
}
+
+ grid rowconfigure $parent $row -weight 1
}
::itcl::body ExtrudeEditFrame::updateGeometryIfMod {} {
@@ -527,15 +527,17 @@
set mEditClass $EDIT_CLASS_SCALE
set mEditParam1 h
} \
+ $moveHR {
+ set mEditCommand ptranslate
+ set mEditClass $EDIT_CLASS_TRANS
+ set mEditLastTransMode $::ArcherCore::OBJECT_TRANSLATE_MODE
+ set mEditParam1 hr
+ } \
$moveH {
set mEditCommand ptranslate
set mEditClass $EDIT_CLASS_TRANS
+ set mEditLastTransMode $::ArcherCore::OBJECT_TRANSLATE_MODE
set mEditParam1 h
- } \
- $rotH {
- set mEditCommand protate
- set mEditClass $EDIT_CLASS_ROT
- set mEditParam1 h
}
GeometryEditFrame::initEditState
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits