Changeset 4631:0f3e63691da4 in orange
 Timestamp:
 05/09/08 16:43:30 (6 years ago)
 Branch:
 default
 Convert:
 780335a16406bf51ce00f501a62c69c940517d0d
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

source/orangeom/optimizeAnchors.cpp
r4338 r4631 511 511 *sumi += *Xi * *radi; 512 512 } 513 if ( *sumi != 0.0) {513 if (fabs(*sumi) > 1e6) { 514 514 ptsi>x /= *sumi; 515 515 ptsi>y /= *sumi; … … 591 591 aay += anci>y; 592 592 } 593 aax /= nAttrs ;594 aay /= nAttrs ;593 aax /= nAttrs ? nAttrs : 1; 594 aay /= nAttrs ? nAttrs : 1; 595 595 596 596 for(anci = anc; anci != ance; anci++) { … … 837 837 *sumi += *Xi * *radi; 838 838 } 839 if ( *sumi != 0.0) {839 if (fabs(*sumi) > 1e6) { 840 840 ptsi>x /= *sumi; 841 841 ptsi>y /= *sumi; … … 894 894 double maxr = 0.0; 895 895 for(anci = anc, dri = dr, radi = rad; dri != dre; dri++, anci++, radi++) { 896 const double newr = *radi + *dri * scaling; 896 double newr = *radi + *dri * scaling; 897 if (newr < 1e4) 898 newr = 1e4; 897 899 double rat = newr / *radi; 900 if (rat > 10) { 901 rat = 10; 902 newr = *radi * 100; 903 } 898 904 anci>x *= rat; 899 905 anci>y *= rat; 906 // printf("%f\t%f\t%f\t%f\t%f\n", anci>x, anci>y, newr, sqrt(sqr(anci>x) + sqr(anci>y)), rat); 900 907 if (newr > maxr) 901 908 maxr = newr; … … 912 919 } 913 920 } 921 // printf("\n"); 914 922 915 923 symmetricTransformation(anc, ance, mirrorSymmetry != 0);
Note: See TracChangeset
for help on using the changeset viewer.