Changeset 3362 for trunk/packages/vizservers/nanovis/Volume.cpp
- Timestamp:
- Feb 26, 2013 1:34:35 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/nanovis2 merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/packages/vizservers/nanovis/Volume.cpp
r3177 r3362 25 25 26 26 Volume::Volume(float x, float y, float z, 27 int w, int h, int d, float s,27 int w, int h, int d, 28 28 int n, float *data, 29 29 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), 39 34 _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), 43 41 _name(NULL), 44 42 _data(NULL), … … 55 53 _isosurface(0) 56 54 { 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; 59 59 _data = new float[fcount]; 60 60 if (data != NULL) { … … 64 64 } else { 65 65 TRACE("data is null\n"); 66 memset(_data, 0, sizeof( width * height *depth * _numComponents *66 memset(_data, 0, sizeof(_width * _height * _depth * _numComponents * 67 67 sizeof(float))); 68 68 _tex->initialize(_data); 69 69 } 70 70 71 id = _tex->id();71 _id = _tex->id(); 72 72 73 73 wAxis.setRange(v0, v1); 74 75 // VOLUME76 aspectRatioWidth = s * _tex->aspectRatioWidth();77 aspectRatioHeight = s * _tex->aspectRatioHeight();78 aspectRatioDepth = s * _tex->aspectRatioDepth();79 74 80 75 //Add cut planes. We create 3 default cut planes facing x, y, z directions. … … 85 80 addCutplane(3, 0.5f); 86 81 87 TRACE(" End -- Volume constructor\n");82 TRACE("Leave Volume()\n"); 88 83 } 89 84 90 85 Volume::~Volume() 91 { 92 if (pointsetIndex != -1) { 93 // TBD... 94 } 86 { 87 TRACE("In ~Volume()"); 95 88 96 89 delete [] _data;
Note: See TracChangeset
for help on using the changeset viewer.