Ignore:
Timestamp:
Apr 2, 2012 9:42:21 AM (12 years ago)
Author:
ldelgass
Message:

Fix a couple more GL state leaks, AxisRange? method rename

Location:
trunk/packages/vizservers/nanovis
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/AxisRange.h

    r2844 r2932  
    2222    }
    2323
    24     void SetRange(double min, double max)
     24    void setRange(double min, double max)
    2525    {
    2626        _min = min;
     
    4646    {
    4747        _max = max;
     48    }
     49
     50    double range() const
     51    {
     52        return (_max - _min);
    4853    }
    4954
  • trunk/packages/vizservers/nanovis/FlowCmd.cpp

    r2930 r2932  
    660660                                 _dataPtr->zNum(), 4, data,
    661661                                 NanoVis::magMin, NanoVis::magMax, 0);
    662     volPtr->xAxis.SetRange(_dataPtr->xMin(), _dataPtr->xMax());
    663     volPtr->yAxis.SetRange(_dataPtr->yMin(), _dataPtr->yMax());
    664     volPtr->zAxis.SetRange(_dataPtr->zMin(), _dataPtr->zMax());
    665     volPtr->wAxis.SetRange(NanoVis::magMin, NanoVis::magMax);
     662    volPtr->xAxis.setRange(_dataPtr->xMin(), _dataPtr->xMax());
     663    volPtr->yAxis.setRange(_dataPtr->yMin(), _dataPtr->yMax());
     664    volPtr->zAxis.setRange(_dataPtr->zMin(), _dataPtr->zMax());
     665    volPtr->wAxis.setRange(NanoVis::magMin, NanoVis::magMax);
    666666
    667667    Vector3 physicalMin(NanoVis::xMin, NanoVis::yMin, NanoVis::zMin);
  • trunk/packages/vizservers/nanovis/Grid.cpp

    r2923 r2932  
    2525void Grid::render()
    2626{
    27     glPushMatrix();
     27    glPushAttrib(GL_ENABLE_BIT);
     28
    2829    glEnable(GL_DEPTH_TEST);
    2930    glDisable(GL_TEXTURE_2D);
    3031    glEnable(GL_BLEND);
    31 
    3232#ifdef notdef
    3333    glEnable(GL_LINE_SMOOTH);
    3434#endif
     35
     36    glPushMatrix();
    3537#ifdef notdef
    3638    glScalef(xAxis.scale(),
     
    3840             zAxis.range() / xAxis.range());
    3941#endif
    40     glScalef(1.0, 1.0, 1.0);
    4142
    4243    glTranslatef(-0.5f, -0.5f, -0.5f);
     
    207208        _font->end();
    208209    };
     210
    209211    glPopMatrix();
    210     glDisable(GL_DEPTH_TEST);
    211     glDisable(GL_BLEND);
    212 #ifdef notdef
    213     glDisable(GL_LINE_SMOOTH);
    214 #endif
     212    glPopAttrib();
    215213}
    216214
  • trunk/packages/vizservers/nanovis/HeightMap.cpp

    r2927 r2932  
    285285    _scale.y = 1.0f;
    286286
    287     xAxis.SetRange(0.0, 1.0);
    288     yAxis.SetRange(0.0, 1.0);
    289     zAxis.SetRange(0.0, 1.0);
    290     wAxis.SetRange(min, max);
     287    xAxis.setRange(0.0, 1.0);
     288    yAxis.setRange(0.0, 1.0);
     289    zAxis.setRange(0.0, 1.0);
     290    wAxis.setRange(min, max);
    291291    updatePending = true;
    292292
     
    366366#endif
    367367
    368     wAxis.SetRange(min, max);
    369     yAxis.SetRange(min, max);
    370     xAxis.SetRange(xMin, xMax);
    371     zAxis.SetRange(yMin, yMax);
    372    
    373    
     368    wAxis.setRange(min, max);
     369    yAxis.setRange(min, max);
     370    xAxis.setRange(xMin, xMax);
     371    zAxis.setRange(yMin, yMax);
     372
    374373    min = 0.0, max = 1.0;
    375374    xMin = yMin = min = 0.0;
  • trunk/packages/vizservers/nanovis/Makefile.in

    r2891 r2932  
    3030FF_INC_SPEC     = @FF_INC_SPEC@
    3131
    32 GL_INC_SPEC     = -I/usr/include/GL
     32GL_INC_SPEC     =
    3333GL_LIB_SPEC     = -lGL -lglut -lGLEW -lGLU
    3434IMG_DIR         = ./imgLoaders
  • trunk/packages/vizservers/nanovis/NvParticleAdvectionShader.h

    r2916 r2932  
    88class NvParticleAdvectionShader : public NvShader
    99{
    10 public :
     10public:
    1111    NvParticleAdvectionShader();
    1212
     
    4141    }
    4242
    43 private :
     43private:
    4444    void init();
    4545
  • trunk/packages/vizservers/nanovis/Volume.cpp

    r2877 r2932  
    7171    id = _tex->id();
    7272
    73     wAxis.SetRange(v0, v1);
     73    wAxis.setRange(v0, v1);
    7474
    7575    // VOLUME
  • trunk/packages/vizservers/nanovis/Volume.h

    r2877 r2932  
    5353    };
    5454
     55    /**
     56     * \brief Volume data constructor
     57     *
     58     * Represents a 3D regular grid with uniform spacing along
     59     * each axis.  Sample spacing may differ between X, Y and Z
     60     *
     61     * \param x X location
     62     * \param y Y location
     63     * \param z Z location
     64     * \param width Number of samples in X
     65     * \param height Number of samples in Y
     66     * \param depth Number of samples in Z
     67     * \param size Scale factor
     68     * \param numComponents Number of components per sample
     69     * \param data width * height * depth * numComponent sample array
     70     * \param vmin Scalar value minimum
     71     * \param vmax Scalar value maximum
     72     * \param nonZeroMin Scalar minimum which is greater than zero
     73     */
    5574    Volume(float x, float y, float z,
    5675           int width, int height, int depth,
  • trunk/packages/vizservers/nanovis/VolumeRenderer.cpp

    r2906 r2932  
    135135    }
    136136
     137    glPushAttrib(GL_ENABLE_BIT);
     138
    137139    //two dimension pointer array
    138140    ConvexPolygon ***polys = new ConvexPolygon**[volumes.size()];
    139141    //number of actual slices for each volume
    140     size_t *actual_slices = new size_t[volumes.size()]; 
     142    size_t *actual_slices = new size_t[volumes.size()];
    141143
    142144    TRACE("start loop %d\n", volumes.size());
     
    216218        glPushMatrix();
    217219        glTranslatef(shift_4d.x, shift_4d.y, shift_4d.z);
    218         if(volPtr->outline()) {
    219             //draw_label(i);
     220        if (volPtr->outline()) {
     221            //drawLabel(i);
    220222        }
    221223        glPopMatrix();
     
    383385    //Now we are ready to render all the slices from back to front
    384386    glEnable(GL_DEPTH_TEST);
     387    // Non pre-multiplied alpha
     388    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    385389    glEnable(GL_BLEND);
    386390
     
    413417    }
    414418
    415     glDisable(GL_DEPTH_TEST);
    416     glDisable(GL_BLEND);
     419    glPopAttrib();
    417420
    418421    //Deallocate all the memory used
     
    436439                                float line_width)
    437440{
    438     glPushMatrix();
     441    glPushAttrib(GL_ENABLE_BIT);
     442
    439443    glEnable(GL_DEPTH_TEST);
    440444    glDisable(GL_TEXTURE_2D);
    441445    glEnable(GL_BLEND);
     446
     447    glMatrixMode(GL_MODELVIEW);
     448    glPushMatrix();
    442449
    443450    glColor4d(r, g, b, 1.0);
     
    544551#endif
    545552    glPopMatrix();
    546     glDisable(GL_DEPTH_TEST);
    547     glDisable(GL_BLEND);
    548     glEnable(GL_TEXTURE_2D);
     553    glPopAttrib();
    549554}
    550555
  • trunk/packages/vizservers/nanovis/dxReader.cpp

    r2881 r2932  
    386386        volPtr = NanoVis::loadVolume(tag, nx, ny, nz, 4, data,
    387387                                     vmin, vmax, nzero_min);
    388         volPtr->xAxis.SetRange(x0, x0 + lx);
    389         volPtr->yAxis.SetRange(y0, y0 + ly);
    390         volPtr->zAxis.SetRange(z0, z0 + lz);
    391         volPtr->wAxis.SetRange(vmin, vmax);
     388        volPtr->xAxis.setRange(x0, x0 + lx);
     389        volPtr->yAxis.setRange(y0, y0 + ly);
     390        volPtr->zAxis.setRange(z0, z0 + lz);
     391        volPtr->wAxis.setRange(vmin, vmax);
    392392        volPtr->updatePending = true;
    393393        // TBD..
     
    495495        volPtr = NanoVis::loadVolume(tag, nx, ny, nz, 4, data,
    496496                                     vmin, vmax, nzero_min);
    497         volPtr->xAxis.SetRange(field.rangeMin(Rappture::xaxis),
     497        volPtr->xAxis.setRange(field.rangeMin(Rappture::xaxis),
    498498                               field.rangeMax(Rappture::xaxis));
    499         volPtr->yAxis.SetRange(field.rangeMin(Rappture::yaxis),
     499        volPtr->yAxis.setRange(field.rangeMin(Rappture::yaxis),
    500500                               field.rangeMax(Rappture::yaxis));
    501         volPtr->zAxis.SetRange(field.rangeMin(Rappture::zaxis),
     501        volPtr->zAxis.setRange(field.rangeMin(Rappture::zaxis),
    502502                               field.rangeMax(Rappture::zaxis));
    503         volPtr->wAxis.SetRange(field.valueMin(), field.valueMax());
     503        volPtr->wAxis.setRange(field.valueMin(), field.valueMax());
    504504        volPtr->updatePending = true;
    505505        // TBD..
Note: See TracChangeset for help on using the changeset viewer.