source: trunk/packages/vizservers/nanovis/ZincBlendeVolume.cpp @ 2801

Last change on this file since 2801 was 2798, checked in by ldelgass, 12 years ago

Add emacs mode magic line in preparation for indentation cleanup

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * ----------------------------------------------------------------------
4 * ZincBlendeVolume.cpp: 3d zincblende volume class, a subclass of Volume.
5 *                      It contains two cubic volumes.
6 *
7 * ======================================================================
8 *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
9 *           Purdue Rendering and Perceptualization Lab (PURPL)
10 *
11 *  Copyright (c) 2004-2006  Purdue Research Foundation
12 *
13 *  See the file "license.terms" for information on usage and
14 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 * ======================================================================
16 */
17
18#include <assert.h>
19#include "ZincBlendeVolume.h"
20
21
22ZincBlendeVolume::ZincBlendeVolume(float x, float y, float z,
23                                        int w, int h, int d, float s, int n,
24                                        float* dataVolumeA, float* dataVolumeB,
25                                        double v0, double v1, double non_zeromin, const Vector3& cellSize)
26                : Volume(x, y, z, w, h, d, s, n, dataVolumeA, v0, v1, non_zeromin), cell_size(cellSize)
27{
28    //label it as zincblende
29    _volume_type = ZINCBLENDE;
30
31    //store member tex initialize in Volume() as zincblende_tex[0]
32    assert(_tex);
33    zincblende_tex[0] = _tex;
34
35    //now add another tex as zincblende_tex[1]
36    Texture3D* secondTex = 0;
37    secondTex = new Texture3D(w, h, d, GL_FLOAT, GL_LINEAR, n);
38    assert(secondTex);
39    secondTex->initialize(dataVolumeB);
40   
41    zincblende_tex[1] = secondTex;
42}
43
44
45ZincBlendeVolume::~ZincBlendeVolume()
46{
47    // This data will be deleted in a destrutor of Volume class
48    //if(zincblende_tex[0])
49    //  delete zincblende_tex[0];
50    if(zincblende_tex[1])
51        delete zincblende_tex[1];
52}
53
54
Note: See TracBrowser for help on using the repository browser.