Revision: 34547
          http://brlcad.svn.sourceforge.net/brlcad/?rev=34547&view=rev
Author:   bob1961
Date:     2009-05-18 19:23:45 +0000 (Mon, 18 May 2009)

Log Message:
-----------
Modify scaling of ell and superell to take "abc" instead of 3 when scaling "a", 
"b" and "c".

Modified Paths:
--------------
    brlcad/trunk/src/libged/scale_ell.c
    brlcad/trunk/src/libged/scale_superell.c
    brlcad/trunk/src/tclscripts/archer/EllEditFrame.tcl

Modified: brlcad/trunk/src/libged/scale_ell.c
===================================================================
--- brlcad/trunk/src/libged/scale_ell.c 2009-05-18 19:07:03 UTC (rev 34546)
+++ brlcad/trunk/src/libged/scale_ell.c 2009-05-18 19:23:45 UTC (rev 34547)
@@ -43,7 +43,32 @@
     switch (attribute[0]) {
     case 'a':
     case 'A':
-       VSCALE(ell->a, ell->a, sf);
+       switch (attribute[1]) {
+       case '\0':
+           VSCALE(ell->a, ell->a, sf);
+           break;
+       case 'b':
+       case 'B':
+           if ((attribute[2] == 'c' || attribute[2] == 'C') &&
+               attribute[3] == '\0') {
+               /* set A, B, and C lengths the same */
+               VSCALE(ell->a, ell->a, sf);
+               ma = MAGNITUDE(ell->a);
+               mb = MAGNITUDE(ell->b);
+               VSCALE(ell->b, ell->b, ma/mb);
+               mb = MAGNITUDE(ell->c);
+               VSCALE(ell->c, ell->c, ma/mb);
+           } else {
+               bu_vls_printf(&gedp->ged_result_str, "bad ell attribute - %s", 
attribute);
+               return BRLCAD_ERROR;
+           }
+
+           break;
+       default:
+           bu_vls_printf(&gedp->ged_result_str, "bad ell attribute - %s", 
attribute);
+           return BRLCAD_ERROR;
+       }
+
        break;
     case 'b':
     case 'B':
@@ -53,11 +78,6 @@
     case 'C':
        VSCALE(ell->c, ell->c, sf);
        break;
-    case '3':
-       VSCALE(ell->a, ell->a, sf);
-       VSCALE(ell->b, ell->b, sf);
-       VSCALE(ell->c, ell->c, sf);
-       break;
     default:
        bu_vls_printf(&gedp->ged_result_str, "bad ell attribute - %s", 
attribute);
        return BRLCAD_ERROR;

Modified: brlcad/trunk/src/libged/scale_superell.c
===================================================================
--- brlcad/trunk/src/libged/scale_superell.c    2009-05-18 19:07:03 UTC (rev 
34546)
+++ brlcad/trunk/src/libged/scale_superell.c    2009-05-18 19:23:45 UTC (rev 
34547)
@@ -43,7 +43,32 @@
     switch (attribute[0]) {
     case 'a':
     case 'A':
-       VSCALE(superell->a, superell->a, sf);
+       switch (attribute[1]) {
+       case '\0':
+           VSCALE(superell->a, superell->a, sf);
+           break;
+       case 'b':
+       case 'B':
+           if ((attribute[2] == 'c' || attribute[2] == 'C') &&
+               attribute[3] == '\0') {
+               /* set A, B, and C lengths the same */
+               VSCALE(superell->a, superell->a, sf);
+               ma = MAGNITUDE(superell->a);
+               mb = MAGNITUDE(superell->b);
+               VSCALE(superell->b, superell->b, ma/mb);
+               mb = MAGNITUDE(superell->c);
+               VSCALE(superell->c, superell->c, ma/mb);
+           } else {
+               bu_vls_printf(&gedp->ged_result_str, "bad ell attribute - %s", 
attribute);
+               return BRLCAD_ERROR;
+           }
+
+           break;
+       default:
+           bu_vls_printf(&gedp->ged_result_str, "bad ell attribute - %s", 
attribute);
+           return BRLCAD_ERROR;
+       }
+
        break;
     case 'b':
     case 'B':
@@ -53,11 +78,6 @@
     case 'C':
        VSCALE(superell->c, superell->c, sf);
        break;
-    case '3':
-       VSCALE(superell->a, superell->a, sf);
-       VSCALE(superell->b, superell->b, sf);
-       VSCALE(superell->c, superell->c, sf);
-       break;
     default:
        bu_vls_printf(&gedp->ged_result_str, "bad superell attribute - %s", 
attribute);
        return BRLCAD_ERROR;

Modified: brlcad/trunk/src/tclscripts/archer/EllEditFrame.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/EllEditFrame.tcl 2009-05-18 19:07:03 UTC 
(rev 34546)
+++ brlcad/trunk/src/tclscripts/archer/EllEditFrame.tcl 2009-05-18 19:23:45 UTC 
(rev 34547)
@@ -479,7 +479,7 @@
        $setA,B,C { \
            set mEditCommand pscale; \
            set mEditClass $EDIT_CLASS_SCALE; \
-           set mEditParam1 3; \
+           set mEditParam1 abc; \
            configure -valueUnits "mm"; \
        }
 


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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to