Ignore:
Timestamp:
Dec 23, 2014 5:27:03 PM (9 years ago)
Author:
ldelgass
Message:

Merge r4907 from trunk

Location:
nanovis/branches/1.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1

  • nanovis/branches/1.1/VolumeInterpolator.cpp

    r4904 r4908  
    55 */
    66#include <string.h>
    7 #include <memory.h>
    87#include <sys/time.h>
    9 #include <math.h>
    10 #include <stdlib.h>
    118
    129#include <vrmath/Vector3f.h>
     
    2017
    2118VolumeInterpolator::VolumeInterpolator() :
    22     _volume(0),
     19    _volume(NULL),
    2320    _interval(8.0),
    2421    _started(false),
     
    5451    float interp;
    5552
    56     computeKeys(fraction, _volumes.size(), &interp, &key1, &key2);
     53    computeKeys(fraction, (int)_volumes.size(), &interp, &key1, &key2);
    5754
    5855    if (interp == 0.0f) {
     
    6966            normal1 = (*(Vector3f*)(data1 + 1) - 0.5) * 2;
    7067            normal2 = (*(Vector3f*)(data2 + 1) - 0.5) * 2;
    71             normal = (normal2 - normal2) * interp + normal1;
     68            normal = (normal2 - normal1) * interp + normal1;
    7269            normal = normal.normalize();
    7370            normal = normal * 0.5 + 0.5;
     
    8986                                int *key1, int *key2)
    9087{
    91     int limit = (int) count - 1;
     88    int limit = count - 1;
    9289    if (fraction <= 0) {
    9390        *key1 = *key2 = 0;
     
    9895    } else {
    9996        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)) &&
    10299                fraction < ((n+1)/(count-1.0f))) {
    103100                break;
     
    150147                             volume->nonZeroMin());
    151148
    152         _volume->numSlices(256-1);
    153149        _volume->setPosition(volume->getPosition());
    154150        _volume->setScale(volume->getScale());
     
    165161        _volume->isosurface(0);
    166162    }
    167     _volumes.push_back(_volume);
     163    _volumes.push_back(volume);
    168164    TRACE("Volume \"%s\" is added to VolumeInterpolator", volume->name());
    169165}
     
    172168{
    173169    return _volume;
    174     //return _volumes[0];
    175170}
Note: See TracChangeset for help on using the changeset viewer.