Changeset 4819 for nanovis/branches/1.1/TransferFunction.cpp
 Timestamp:
 Dec 6, 2014, 10:16:39 PM (5 years ago)
 Location:
 nanovis/branches/1.1
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

nanovis/branches/1.1
 Property svn:mergeinfo changed
/trunk/packages/vizservers/nanovis merged: 4067
 Property svn:mergeinfo changed

nanovis/branches/1.1/TransferFunction.cpp
r3568 r4819 58 58 59 59 void 60 TransferFunction::sample(float fraction, float *key , int count, Vector3f *keyValue, Vector3f *ret)60 TransferFunction::sample(float fraction, float *keys, Vector3f *keyValues, int count, Vector3f *ret) 61 61 { 62 62 int limit = count  1; 63 if (fraction <= key [0]) {64 *ret = keyValue [0];65 } else if (fraction >= key [limit]) {66 *ret = keyValue [limit];63 if (fraction <= keys[0]) { 64 *ret = keyValues[0]; 65 } else if (fraction >= keys[limit]) { 66 *ret = keyValues[limit]; 67 67 } else { 68 68 int n; 69 for (n = 0; n < limit; n++) {70 if (fraction >= key [n] && fraction < key[n+1]) break;69 for (n = 0; n < limit; n++) { 70 if (fraction >= keys[n] && fraction < keys[n+1]) break; 71 71 } 72 72 if (n >= limit) { 73 *ret = keyValue [limit];73 *ret = keyValues[limit]; 74 74 } else { 75 float inter = (fraction  key [n]) / (key[n + 1]  key[n]);76 ret>set(inter * (keyValue [n + 1].x  keyValue[n].x) + keyValue[n].x,77 inter * (keyValue [n + 1].y  keyValue[n].y) + keyValue[n].y,78 inter * (keyValue [n + 1].z  keyValue[n].z) + keyValue[n].z);75 float inter = (fraction  keys[n]) / (keys[n + 1]  keys[n]); 76 ret>set(inter * (keyValues[n + 1].x  keyValues[n].x) + keyValues[n].x, 77 inter * (keyValues[n + 1].y  keyValues[n].y) + keyValues[n].y, 78 inter * (keyValues[n + 1].z  keyValues[n].z) + keyValues[n].z); 79 79 } 80 80 } … … 82 82 83 83 void 84 TransferFunction::sample(float fraction, float *key , int count, float *keyValue, float *ret)84 TransferFunction::sample(float fraction, float *keys, float *keyValues, int count, float *ret) 85 85 { 86 86 int limit = count  1; 87 if (fraction <= key [0]) {88 *ret = keyValue [0];89 } else if (fraction >= key [limit]) {90 *ret = keyValue [limit];87 if (fraction <= keys[0]) { 88 *ret = keyValues[0]; 89 } else if (fraction >= keys[limit]) { 90 *ret = keyValues[limit]; 91 91 } else { 92 92 int n; 93 for (n = 0; n < limit; n++) {94 if (fraction >= key [n] && fraction < key[n+1]) break;93 for (n = 0; n < limit; n++) { 94 if (fraction >= keys[n] && fraction < keys[n+1]) break; 95 95 } 96 96 if (n >= limit) { 97 *ret = keyValue [limit];97 *ret = keyValues[limit]; 98 98 } else { 99 float inter = (fraction  key [n]) / (key[n + 1]  key[n]);100 *ret = inter * (keyValue [n + 1]  keyValue[n]) + keyValue[n];99 float inter = (fraction  keys[n]) / (keys[n + 1]  keys[n]); 100 *ret = inter * (keyValues[n + 1]  keyValues[n]) + keyValues[n]; 101 101 } 102 102 }
Note: See TracChangeset
for help on using the changeset viewer.