Ignore:
Timestamp:
Feb 26, 2013 1:34:35 PM (11 years ago)
Author:
ldelgass
Message:

Merge nanovis2 branch to trunk

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/packages/vizservers/nanovis/Volume.cpp

    r3177 r3362  
    2525
    2626Volume::Volume(float x, float y, float z,
    27                int w, int h, int d, float s,
     27               int w, int h, int d,
    2828               int n, float *data,
    2929               double v0, double v1, double nonZeroMin) :
    30     aspectRatioWidth(1),
    31     aspectRatioHeight(1),
    32     aspectRatioDepth(1),
    33     id(0),
    34     width(w),
    35     height(h),
    36     depth(d),
    37     size(s),
    38     pointsetIndex(-1),
     30    _id(0),
     31    _width(w),
     32    _height(h),
     33    _depth(d),
    3934    _tfPtr(NULL),
    40     _specular(6.),
    41     _diffuse(3.),
    42     _opacityScale(10.),
     35    _ambient(0.6f),
     36    _diffuse(0.4f),
     37    _specular(0.3f),
     38    _specularExp(90.0f),
     39    _lightTwoSide(false),
     40    _opacityScale(0.5f),
    4341    _name(NULL),
    4442    _data(NULL),
     
    5553    _isosurface(0)
    5654{
    57     _tex = new Texture3D(w, h, d, GL_FLOAT, GL_LINEAR, n);
    58     int fcount = width * height * depth * _numComponents;
     55    TRACE("Enter Volume(): %dx%dx%d\n", _width, _height, _depth);
     56
     57    _tex = new Texture3D(_width, _height, _depth, GL_FLOAT, GL_LINEAR, n);
     58    int fcount = _width * _height * _depth * _numComponents;
    5959    _data = new float[fcount];
    6060    if (data != NULL) {
     
    6464    } else {
    6565        TRACE("data is null\n");
    66         memset(_data, 0, sizeof(width * height * depth * _numComponents *
     66        memset(_data, 0, sizeof(_width * _height * _depth * _numComponents *
    6767                                sizeof(float)));
    6868        _tex->initialize(_data);
    6969    }
    7070
    71     id = _tex->id();
     71    _id = _tex->id();
    7272
    7373    wAxis.setRange(v0, v1);
    74 
    75     // VOLUME
    76     aspectRatioWidth  = s * _tex->aspectRatioWidth();
    77     aspectRatioHeight = s * _tex->aspectRatioHeight();
    78     aspectRatioDepth =  s * _tex->aspectRatioDepth();
    7974
    8075    //Add cut planes. We create 3 default cut planes facing x, y, z directions.
     
    8580    addCutplane(3, 0.5f);
    8681
    87     TRACE("End -- Volume constructor\n");
     82    TRACE("Leave Volume()\n");
    8883}
    8984
    9085Volume::~Volume()
    91 {
    92     if (pointsetIndex != -1) {
    93         // TBD...
    94     }
     86{
     87    TRACE("In ~Volume()");
    9588
    9689    delete [] _data;
Note: See TracChangeset for help on using the changeset viewer.