- Timestamp:
- Dec 23, 2014, 5:27:03 PM (10 years ago)
- Location:
- nanovis/branches/1.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
nanovis/branches/1.1
- Property svn:mergeinfo changed
/nanovis/trunk merged: 4907
- Property svn:mergeinfo changed
-
nanovis/branches/1.1/VolumeInterpolator.cpp
r4904 r4908 5 5 */ 6 6 #include <string.h> 7 #include <memory.h>8 7 #include <sys/time.h> 9 #include <math.h>10 #include <stdlib.h>11 8 12 9 #include <vrmath/Vector3f.h> … … 20 17 21 18 VolumeInterpolator::VolumeInterpolator() : 22 _volume( 0),19 _volume(NULL), 23 20 _interval(8.0), 24 21 _started(false), … … 54 51 float interp; 55 52 56 computeKeys(fraction, _volumes.size(), &interp, &key1, &key2);53 computeKeys(fraction, (int)_volumes.size(), &interp, &key1, &key2); 57 54 58 55 if (interp == 0.0f) { … … 69 66 normal1 = (*(Vector3f*)(data1 + 1) - 0.5) * 2; 70 67 normal2 = (*(Vector3f*)(data2 + 1) - 0.5) * 2; 71 normal = (normal2 - normal 2) * interp + normal1;68 normal = (normal2 - normal1) * interp + normal1; 72 69 normal = normal.normalize(); 73 70 normal = normal * 0.5 + 0.5; … … 89 86 int *key1, int *key2) 90 87 { 91 int limit = (int)count - 1;88 int limit = count - 1; 92 89 if (fraction <= 0) { 93 90 *key1 = *key2 = 0; … … 98 95 } else { 99 96 int n; 100 for (n = 0; n < limit; n++) {101 if (fraction >= (n / (count - 1.0f)) && 97 for (n = 0; n < limit; n++) { 98 if (fraction >= (n / (count - 1.0f)) && 102 99 fraction < ((n+1)/(count-1.0f))) { 103 100 break; … … 150 147 volume->nonZeroMin()); 151 148 152 _volume->numSlices(256-1);153 149 _volume->setPosition(volume->getPosition()); 154 150 _volume->setScale(volume->getScale()); … … 165 161 _volume->isosurface(0); 166 162 } 167 _volumes.push_back( _volume);163 _volumes.push_back(volume); 168 164 TRACE("Volume \"%s\" is added to VolumeInterpolator", volume->name()); 169 165 } … … 172 168 { 173 169 return _volume; 174 //return _volumes[0];175 170 }
Note: See TracChangeset
for help on using the changeset viewer.