Ignore:
Timestamp:
Apr 9, 2012 10:18:09 AM (12 years ago)
Author:
ldelgass
Message:

Remove unused global origin, make default transfer function a bit more
sensible (used to have full opacity at 0). Fix HeightMap? dtor to use delete[]
instead of free() on array allocated with new[]. Document data response in
protocol.

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

Legend:

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

    r2923 r2953  
    22#ifndef AXIS_H
    33#define AXIS_H
     4
     5#include <stdlib.h>
    46
    57#include <cmath>
     
    4547};
    4648
    47 /*
    48  * ----------------------------------------------------------------------
    49  *
    50  * Ticks --
    51  *
    52  *         Structure containing information where the ticks (major or
    53  *        minor) will be displayed on the graph.
    54  *
    55  * ----------------------------------------------------------------------
     49/**
     50 * Class containing information where the ticks (major or
     51 * minor) will be displayed on the graph.
    5652 */
    5753class Ticks
     
    182178
    183179/**
    184  * Structure contains options controlling how the axis will be
     180 * Class contains options controlling how the axis will be
    185181 * displayed.
    186182 */
     
    212208    }
    213209
     210    bool firstMajor(TickIter& iter)
     211    {
     212        return _major.firstTick(iter);
     213    }
     214
     215    bool firstMinor(TickIter& iter)
     216    {
     217        return _minor.firstTick(iter);
     218    }
     219
    214220    void resetRange();
    215221
     
    218224    void setScale(double min, double max);
    219225
    220     double scale()
     226    double scale() const
    221227    {
    222228        return _scale;
    223229    }
    224230
    225     double range()
     231    double range() const
    226232    {
    227233        return _range;
    228234    }
    229235
    230     bool firstMajor(TickIter& iter)
    231     {
    232         return _major.firstTick(iter);
    233     }
    234 
    235     bool firstMinor(TickIter& iter)
    236     {
    237         return _minor.firstTick(iter);
    238     }
    239 
    240236    void getDataLimits(double& min, double& max)
    241237    {
    242238        min = _valueMin, max = _valueMax;
     239    }
     240
     241    double min() const
     242    {
     243        return _min;
     244    }
     245
     246    void min(double min)
     247    {
     248        _reqMin = min;
     249    }
     250
     251    double max() const
     252    {
     253        return _max;
     254    }
     255
     256    void max(double max)
     257    {
     258        _reqMax = max;
     259    }
     260
     261    void setLimits(double min, double max)
     262    {
     263        _reqMin = min, _reqMax = max;
     264    }
     265
     266    void unsetLimits()
     267    {
     268        min(NAN), max(NAN);
    243269    }
    244270
     
    284310        }
    285311        _title = strdup(title);
    286     }
    287 
    288     double min()
    289     {
    290         return _min;
    291     }
    292 
    293     void min(double min)
    294     {
    295         _reqMin = min;
    296     }
    297 
    298     double max()
    299     {
    300         return _max;
    301     }
    302 
    303     void max(double max)
    304     {
    305         _reqMax = max;
    306     }
    307 
    308     void setLimits(double min, double max)
    309     {
    310         _reqMin = min, _reqMax = max;
    311     }
    312 
    313     void unsetLimits()
    314     {
    315         min(NAN), max(NAN);
    316312    }
    317313
  • trunk/packages/vizservers/nanovis/Command.cpp

    r2931 r2953  
    7878  1.0  1 0 1\n\
    7979} {\n\
    80   0.00  1.0\n\
    81   0.05  0.0\n\
    82   0.15  0.0\n\
    83   0.20  1.0\n\
    84   0.25  0.0\n\
    85   0.35  0.0\n\
    86   0.40  1.0\n\
    87   0.45  0.0\n\
    88   0.55  0.0\n\
    89   0.60  1.0\n\
    90   0.65  0.0\n\
    91   0.75  0.0\n\
    92   0.80  1.0\n\
    93   0.85  0.0\n\
    94   0.95  0.0\n\
    95   1.00  1.0\n\
     80  0.00000  0.0\n\
     81  0.19999  0.0\n\
     82  0.20000  1.0\n\
     83  0.20001  0.0\n\
     84  0.39999  0.0\n\
     85  0.40000  1.0\n\
     86  0.40001  0.0\n\
     87  0.59999  0.0\n\
     88  0.60000  1.0\n\
     89  0.60001  0.0\n\
     90  0.79999  0.0\n\
     91  0.80000  1.0\n\
     92  0.80001  0.0\n\
     93  1.00000  0.0\n\
    9694}";
    9795
     
    651649    NanoVis::readScreen();
    652650
    653     NanoVis::ppmWrite("nv>image -bytes %d -type print");
     651    NanoVis::ppmWrite("nv>image -type print -bytes %d");
    654652    NanoVis::resizeOffscreenBuffer(w, h);
    655653
  • trunk/packages/vizservers/nanovis/FlowCmd.cpp

    r2932 r2953  
    561561
    562562    Vector3 loc = _volPtr->location();
    563     /*This is wrong. Need to compute origin. */
    564     NanoVis::xOrigin = loc.x;
    565     NanoVis::yOrigin = loc.y;
    566     NanoVis::zOrigin = loc.z;
    567563
    568564    _fieldPtr->setVectorField(_volPtr, loc,
     
    657653    Volume *volPtr;
    658654
    659     volPtr = NanoVis::loadVolume(_name, _dataPtr->xNum(), _dataPtr->yNum(),
    660                                  _dataPtr->zNum(), 4, data,
     655    volPtr = NanoVis::loadVolume(_name,
     656                                 _dataPtr->xNum(),
     657                                 _dataPtr->yNum(),
     658                                 _dataPtr->zNum(),
     659                                 4, data,
    661660                                 NanoVis::magMin, NanoVis::magMax, 0);
    662661    volPtr->xAxis.setRange(_dataPtr->xMin(), _dataPtr->xMax());
     
    672671          NanoVis::magMin, NanoVis::magMax);
    673672    volPtr->setPhysicalBBox(physicalMin, physicalMax);
    674     //volPtr->numSlices(256 - _volIndex);
    675     //volPtr->numSlices(512 - _volIndex);
    676     //volPtr->numSlices(256 - n);
    677     // TBD..
    678     /* Don't set the slice number until we're are about to render the
    679        volume. */
    680673    volPtr->disableCutplane(0);
    681674    volPtr->disableCutplane(1);
     
    689682    volPtr->specular(_sv.specular);
    690683    volPtr->diffuse(_sv.diffuse);
    691     TRACE("volume is now %d %d\n", _sv.showVolume, volPtr->visible());
    692684    volPtr->visible(_sv.showVolume);
    693685    float dx0 = -0.5;
     
    10181010            continue;
    10191011        }
    1020         Rappture::Unirect3d *dataPtr;
    1021         dataPtr = flowPtr->data();
     1012        Rappture::Unirect3d *dataPtr = flowPtr->data();
    10221013        min = dataPtr->magMin();
    10231014        max = dataPtr->magMax();
     
    10651056        // FIXME: This doesn't work when there is more than one flow.
    10661057        licRenderer->setOffset(flowPtr->GetRelativePosition());
    1067         NanoVis::velocityArrowsSlice->slicePos(flowPtr->GetRelativePosition());
     1058        velocityArrowsSlice->slicePos(flowPtr->GetRelativePosition());
    10681059    }
    10691060    AdvectFlows();
  • trunk/packages/vizservers/nanovis/Grid.cpp

    r2932 r2953  
    1818    _majorColor(1.0f, 1.0f, 1.0f, 1.0f),
    1919    _minorColor(0.5f, 0.5f, 0.5f, 1.0f),
    20     _font(0),
     20    _font(NULL),
    2121    _visible(false)
     22{
     23}
     24
     25Grid::~Grid()
    2226{
    2327}
  • trunk/packages/vizservers/nanovis/Grid.h

    r2910 r2953  
    3333public:
    3434    Grid();
     35    virtual ~Grid();
    3536
    3637    bool isVisible() const
  • trunk/packages/vizservers/nanovis/HeightMap.cpp

    r2932 r2953  
    11 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #include <memory.h>
    3 #include <stdlib.h>
    4 #include <sys/time.h>
    5 #include <sys/types.h>
    6 #include <unistd.h>
    7 #include <fcntl.h>
    8 #include <stdlib.h>
    92
    103#include <GL/glew.h>
     
    158#include "ContourLineFilter.h"
    169#include "Texture1D.h"
    17 #include "R2/R2FilePath.h"
    18 #include "RpField1D.h"
    1910#include "RenderContext.h"
    2011
     
    5748    }
    5849    if (_heights != NULL) {
    59         free(_heights);
     50        delete [] _heights;
    6051    }
    6152}
  • trunk/packages/vizservers/nanovis/HeightMap.h

    r2927 r2953  
    3636    /**
    3737     *@brief Create a height map with heigh values
    38      *@param startX a x position of the first height value
    39      *@param startY a y position of the first height value
    40      *@param endX a x position of the last height value
    41      *@param endY a y position of the last height value
     38     *@param startX x position of the first height value
     39     *@param startY y position of the first height value
     40     *@param endX x position of the last height value
     41     *@param endY y position of the last height value
    4242     *@param xCount the number of columns of height values
    4343     *@param yCount the number of rows of height values
     
    126126
    127127private:
    128     void createIndexBuffer(int xCount, int zCount, float* heights);
     128    void createIndexBuffer(int xCount, int zCount, float *heights);
    129129    Vector3 *createHeightVertices(float startX, float startY,
    130130                                  float endX, float endY,
    131                                   int xCount, int yCount, float  *height);
     131                                  int xCount, int yCount, float *height);
    132132    void reset();
    133133
     
    145145    int _indexCount;
    146146    Vector3 _contourColor;
    147    
     147
    148148    bool _contourVisible;
    149149    bool _topContourVisible;
    150150    bool _visible;
    151    
     151
    152152    Vector3 _scale;
    153153    Vector3 _centerPoint;
  • trunk/packages/vizservers/nanovis/NvColorTableShader.cpp

    r2914 r2953  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #include <R2/R2FilePath.h>
    32
    43#include <GL/glew.h>
  • trunk/packages/vizservers/nanovis/NvFlowVisRenderer.cpp

    r2836 r2953  
    1515 */
    1616
    17 #include <stdio.h>
    18 #include <assert.h>
    19 #include <malloc.h>
    20 #include <string.h>
    21 
    22 #include <R2/R2FilePath.h>
    23 
    2417#include "NvFlowVisRenderer.h"
    25 #include "NvVectorField.h"
    26 #include "Trace.h"
    2718
    2819#define NV_32
  • trunk/packages/vizservers/nanovis/NvFlowVisRenderer.h

    r2877 r2953  
    33#define NVFLOWVISRENDERER_H
    44
    5 #include <vector>
    65#include <map>
    76#include <string>
    87
    9 #include <GL/glew.h>
    10 #include <Cg/cgGL.h>
    11 
    12 #include "config.h"
    13 
    14 #include "Renderable.h"
    15 #include "RenderVertexArray.h"
    168#include "Vector3.h"
    17 #include "NvParticleAdvectionShader.h"
    189#include "NvVectorField.h"
    1910
  • trunk/packages/vizservers/nanovis/NvLIC.h

    r2951 r2953  
    3131{
    3232public:
    33     NvLIC(int size, int width, int height, int axis,
    34           float offset);
     33    NvLIC(int size, int width, int height, int axis, float offset);
    3534    ~NvLIC();
    3635
     
    4948    void getSlice();
    5049
    51     void setOffset(float v);
     50    void setOffset(float offset);
    5251
    5352    /**
  • trunk/packages/vizservers/nanovis/NvParticleAdvectionShader.cpp

    r2916 r2953  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #include <R2/R2FilePath.h>
    32
    43#include <GL/glew.h>
  • trunk/packages/vizservers/nanovis/NvParticleAdvectionShader.h

    r2950 r2953  
    88class NvParticleAdvectionShader : public NvShader
    99{
    10 public: 
     10public:
    1111    NvParticleAdvectionShader();
    1212
  • trunk/packages/vizservers/nanovis/NvParticleRenderer.cpp

    r2921 r2953  
    1515 */
    1616
    17 #include <stdio.h>
    1817#include <assert.h>
    19 #include <malloc.h>
    2018#include <string.h>
    2119#include <stdlib.h>
    22 
    23 #include <R2/R2FilePath.h>
    2420
    2521#include "NvParticleRenderer.h"
     
    300296    if (_psysFrame == _maxLife) {
    301297        _psysFrame = 0;
    302         //        _reborn = true;
     298        // _reborn = true;
    303299    }
    304300    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboOrig);
  • trunk/packages/vizservers/nanovis/NvParticleRenderer.h

    r2921 r2953  
    2222#include <Cg/cgGL.h>
    2323
    24 #include "config.h"
    25 
    2624#include "Renderable.h"
     25#include "NvParticleAdvectionShader.h"
    2726#include "RenderVertexArray.h"
    2827#include "Vector3.h"
    29 #include "NvParticleAdvectionShader.h"
     28#include "Vector4.h"
    3029
    3130struct Particle {
  • trunk/packages/vizservers/nanovis/NvStdVertexShader.cpp

    r2914 r2953  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #include <stdio.h>
    32
    43#include <GL/glew.h>
  • trunk/packages/vizservers/nanovis/NvZincBlendeVolumeShader.cpp

    r2919 r2953  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 
    3 #include <string.h>
    42
    53#include <GL/glew.h>
  • trunk/packages/vizservers/nanovis/PlaneRenderer.cpp

    r2930 r2953  
    1414 * ======================================================================
    1515 */
     16
     17#include <GL/glew.h>
    1618
    1719#include "PlaneRenderer.h"
  • trunk/packages/vizservers/nanovis/PlaneRenderer.h

    r2930 r2953  
    1717#define PLANE_RENDERER_H
    1818
    19 #include <math.h>
    20 #include <stdio.h>
    21 #include <assert.h>
    22 #include <float.h>
    23 
    2419#include <vector>
    25 
    26 #include <GL/glew.h>
    27 #include <Cg/cgGL.h>
    2820
    2921#include "NvColorTableShader.h"
  • trunk/packages/vizservers/nanovis/PointSetRenderer.cpp

    r2952 r2953  
    7777    glBegin(GL_POINTS);
    7878
    79     PCA::ClusterList* p;
     79    PCA::ClusterList *p;
    8080    for (int i = size - 1; i >= 0; --i) {
    8181        p = bucket[i];
  • trunk/packages/vizservers/nanovis/PointSetRenderer.h

    r2844 r2953  
    1111class PointSetRenderer
    1212{
    13  public:
     13public:
    1414    PointSetRenderer();
    1515    ~PointSetRenderer();
  • trunk/packages/vizservers/nanovis/PointShader.cpp

    r2870 r2953  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #include <stdio.h>
    3 #include <stdlib.h>
    4 #include <assert.h>
    52
    6 #include <R2/R2FilePath.h>
    7 #include <R2/R2string.h>
     3#include <GL/glew.h>
     4#include <Cg/cgGL.h>
    85
    96#include "PointShader.h"
    107
    118PointShader::PointShader() :
    12     NvShader(),
     9    NvShader(),
     10    _scale(1.0f),
    1311    _normal(NULL)
    1412{
     
    2725}
    2826
    29 void PointShader::setParameters()
     27void PointShader::bind()
    3028{
    3129    cgGLSetStateMatrixParameter(_modelviewVP, CG_GL_MODELVIEW_MATRIX, CG_GL_MATRIX_IDENTITY);
     
    3533    cgGLSetParameter4f(_posoffsetVP, 1.0f, 1.0f, 1.0f, 1.0f);
    3634    cgGLSetParameter4f(_baseposVP, 1.0f, 1.0f, 1.0f, 1.0f);
    37     cgGLSetParameter4f(_scaleVP, 1.0f, 1.0f, 1.0f, 1.0f);
     35    cgGLSetParameter4f(_scaleVP, _scale, 1.0f, 1.0f, 1.0f);
    3836
    39     //cgGLSetTextureParameter(_normalParam,_normal->getGraphicsObjectID());
     37    //cgGLSetTextureParameter(_normalParam, _normal->getGraphicsObjectID());
    4038    //cgGLEnableTextureParameter(_normalParam);
     39
     40    NvShader::bind();
    4141}
    4242
    43 void PointShader::resetParameters()
     43void PointShader::unbind()
    4444{
    4545    //cgGLDisableTextureParameter(_normalParam);
     46
     47    NvShader::unbind();
    4648}
  • trunk/packages/vizservers/nanovis/PointShader.h

    r2914 r2953  
    1515    void setScale(float scale)
    1616    {
    17         cgGLSetParameter4f(_scaleVP, scale, 1.0f, 1.0f, 1.0f);
     17        _scale = scale;
    1818    }
    1919
    20     void setNormalTexture(Texture3D *n)
     20    void setNormalTexture(Texture3D *normal)
    2121    {
    22         _normal = n;
     22        _normal = normal;
    2323    }
    2424
    25     virtual void bind()
    26     {
    27         setParameters();
     25    virtual void bind();
    2826
    29         NvShader::bind();
    30     }
    31 
    32     virtual  void unbind()
    33     {
    34         resetParameters();
    35 
    36         NvShader::unbind();
    37     }
    38 
    39 protected:
    40     virtual void setParameters();
    41     virtual void resetParameters();
     27    virtual  void unbind();
    4228
    4329private:
     
    5137    CGparameter _normalParam;
    5238
     39    float _scale;
    5340    Texture3D *_normal;
    5441};
  • trunk/packages/vizservers/nanovis/R2/src/R2Fonts.cpp

    r2877 r2953  
    7373R2Fonts::begin()
    7474{
     75    glPushAttrib(GL_TRANSFORM_BIT | GL_ENABLE_BIT);
    7576    glEnable(GL_TEXTURE_2D);
    76     glBindTexture(GL_TEXTURE_2D, _fonts[_fontIndex]. _fontTextureID);
    77 
    78     glPushAttrib(GL_TRANSFORM_BIT | GL_ENABLE_BIT);
     77    glBindTexture(GL_TEXTURE_2D, _fonts[_fontIndex]._fontTextureID);
     78
    7979    glMatrixMode(GL_PROJECTION);
    8080    glPushMatrix();
    81 
    82     glLoadIdentity( );
     81    glLoadIdentity();
     82
    8383    gluOrtho2D(0.0f, _screenWidth, _screenHeight, 0.0f);
    8484
    8585    glMatrixMode(GL_MODELVIEW);
    86     glPushMatrix( );
    87     glLoadIdentity( );
    88 
    89     glEnable(GL_TEXTURE_2D);
     86    glPushMatrix();
     87    glLoadIdentity();
     88
    9089    glEnable(GL_BLEND);
    9190    glDisable(GL_DEPTH_TEST);
     
    9897
    9998    glMatrixMode(GL_PROJECTION);
    100     glPopMatrix( );
     99    glPopMatrix();
    101100
    102101    glMatrixMode(GL_MODELVIEW);
    103     glPopMatrix( );
    104 
    105     glPopAttrib( );
     102    glPopMatrix();
     103
     104    glPopAttrib();
    106105}
    107106
     
    229228        }
    230229
    231         fsInput.close( );
     230        fsInput.close();
    232231    }
    233232    delete [] path;
  • trunk/packages/vizservers/nanovis/RenderVertexArray.cpp

    r2921 r2953  
    5151    switch (_type) {
    5252    case GL_HALF_FLOAT_NV:
    53         _bytesPerComponent = 2; break;
     53        _bytesPerComponent = 2;
     54        break;
    5455    case GL_FLOAT:
    55         _bytesPerComponent = sizeof(float); break;
     56        _bytesPerComponent = sizeof(float);
     57        break;
    5658    default:
    5759        ERROR("unsupported RenderVertexArray type\n");
     
    7072    switch(_size) {
    7173    case 1:
    72         _format = GL_LUMINANCE; break;
     74        _format = GL_LUMINANCE;
     75        break;
    7376    case 3:
    74         _format = GL_RGB; break;
     77        _format = GL_RGB;
     78        break;
    7579    case 4:
    76         _format = GL_RGBA; break;
     80        _format = GL_RGBA;
     81        break;
    7782    default:
    7883        ERROR("unsupported RenderVertexArray size\n");
  • trunk/packages/vizservers/nanovis/Unirect.cpp

    r2922 r2953  
    734734        }
    735735    }
    736     TRACE("GetVectorRange %g %g\n", _magMin, _magMax);
     736    TRACE("getVectorRange: %g %g\n", _magMin, _magMax);
    737737}
    738738
  • trunk/packages/vizservers/nanovis/VelocityArrowsSlice.h

    r2870 r2953  
    8484
    8585private:
     86    void createRenderTarget();
     87
     88    void computeSamplingTicks();
     89
    8690    unsigned int _vectorFieldGraphicsID;
    8791    float _vfXscale;
     
    134138
    135139    RenderMode _renderMode;
    136 
    137     void createRenderTarget();
    138 
    139     void computeSamplingTicks();
    140140};
    141141
  • trunk/packages/vizservers/nanovis/VolumeInterpolator.cpp

    r2877 r2953  
    1818    _numBytes(0),
    1919    _dataCount(0),
    20     _numComponents(0),
    21     _referenceOfVolume(0)
     20    _numComponents(0)
    2221{
    2322}
     
    133132        _numComponents = refPtr->numComponents();
    134133        _numBytes = _dataCount * _numComponents * sizeof(float);
    135         Vector3 loc = refPtr->location();
     134        Vector3 loc = refPtr->location();
    136135        _volume = new Volume(loc.x, loc.y, loc.z,
    137136                             refPtr->width, refPtr->height, refPtr->depth,
     
    141140                             refPtr->wAxis.min(),
    142141                             refPtr->wAxis.max(),
    143                              refPtr->nonZeroMin());
    144         /*
    145         _referenceOfVolume = refPtr->dataID();
    146         */
     142                             refPtr->nonZeroMin());
    147143        _volume->numSlices(256-1);
    148144        _volume->disableCutplane(0);
     
    156152        _volume->isosurface(0);
    157153        TRACE("VOL : location %f %f %f\n\tid : %s\n", loc.x, loc.y, loc.z,
    158                refPtr->name());
     154               refPtr->name());
    159155    }
    160156    _volumes.push_back(_volume);
  • trunk/packages/vizservers/nanovis/VolumeInterpolator.h

    r2877 r2953  
    3030    double getStartTime() const;
    3131
    32     unsigned int getReferenceVolumeID() const;
    33 
    3432    Volume *getVolume();
    3533
     
    4442    unsigned int _dataCount;
    4543    unsigned int _numComponents;
    46     unsigned int _referenceOfVolume;
    4744    double _startTime;
    4845};
     
    6360}
    6461
    65 inline unsigned int VolumeInterpolator::getReferenceVolumeID() const
    66 {
    67     return _referenceOfVolume;
    68 }
    69 
    7062#endif
    7163
  • trunk/packages/vizservers/nanovis/dxReader.cpp

    r2942 r2953  
    213213    }
    214214
    215     TRACE("found nx=%d ny=%d nz=%d\ndx=%f dy=%f dz=%f\nx0=%f y0=%f z0=%f\n",
    216           nx, ny, nz, dx, dy, dz, x0, y0, z0);
     215    TRACE("found nx=%d ny=%d nxy=%d nz=%d\ndx=%f dy=%f dz=%f\nx0=%f y0=%f z0=%f\n",
     216          nx, ny, nxy, nz, dx, dy, dz, x0, y0, z0);
    217217
    218218    lx = (nx - 1) * dx;
     
    296296#if ISO_TEST
    297297        double dv = vmax - vmin;
    298         int count = nx*ny*nz;
    299         int ngen = 0;
    300         double v;
    301298        if (dv == 0.0) {
    302299            dv = 1.0;
    303300        }
    304301
    305         for (int i = 0; i < count; ++i) {
    306             v = data[ngen];
     302        int ngen = 0;
     303        const int step = 4;
     304        for (int i = 0; i < nx*ny*nz; ++i) {
     305            double v = data[ngen];
    307306            // scale all values [0-1], -1 => out of bounds
    308307            v = (isnan(v)) ? -1.0 : (v - vmin)/dv;
    309308
    310309            data[ngen] = v;
    311             ngen += 4;
     310            ngen += step;
    312311        }
    313312
     
    429428        }
    430429
    431         // figure out a good mesh spacing
    432         int nsample = 30;
    433430        x0 = field.rangeMin(Rappture::xaxis);
    434431        lx = field.rangeMax(Rappture::xaxis) - field.rangeMin(Rappture::xaxis);
     
    437434        z0 = field.rangeMin(Rappture::zaxis);
    438435        lz = field.rangeMax(Rappture::zaxis) - field.rangeMin(Rappture::zaxis);
     436
     437        // figure out a good mesh spacing
     438        int nsample = 30;
    439439        double dmin = pow((lx*ly*lz)/((nsample-1)*(nsample-1)*(nsample-1)), 0.333);
    440440
     
    453453        dz = lz /(double)(nz - 1);
    454454
    455         data = new float[4*nx*ny*nz];
    456 
    457455        vmin = field.valueMin();
    458456        vmax = field.valueMax();
     
    463461        }
    464462
     463        data = new float[4*nx*ny*nz];
    465464        // generate the uniformly sampled data that we need for a volume
    466465        int ngen = 0;
     
    490489
    491490    TRACE("nx = %i ny = %i nz = %i\n", nx, ny, nz);
     491    TRACE("x0 = %lg y0 = %lg z0 = %lg\n", x0, y0, z0);
    492492    TRACE("lx = %lg ly = %lg lz = %lg\n", lx, ly, lz);
    493493    TRACE("dx = %lg dy = %lg dz = %lg\n", dx, dy, dz);
    494     TRACE("dataMin = %lg\tdataMax = %lg\tnzero_min = %lg\n",
     494    TRACE("dataMin = %lg dataMax = %lg nzero_min = %lg\n",
    495495          vmin, vmax, nzero_min);
    496496
     
    502502    volPtr->updatePending = true;
    503503
    504         // TBD..
     504    // TBD..
    505505#if 0 && defined(USE_POINTSET_RENDERER)
    506506    PointSet *pset = new PointSet();
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r2951 r2953  
    173173float NanoVis::wMin = FLT_MAX;
    174174float NanoVis::wMax = -FLT_MAX;
    175 float NanoVis::xOrigin;
    176 float NanoVis::yOrigin;
    177 float NanoVis::zOrigin;
    178175
    179176/* FIXME: This variable is always true. */
     
    362359doExit(int code)
    363360{
    364     TRACE("in doExit\n");
     361    TRACE("in doExit: %d\n", code);
    365362    NanoVis::removeAllData();
    366363
     
    513510int
    514511NanoVis::renderLegend(TransferFunction *tf, double min, double max,
    515                       int width, int height, const char* volArg)
     512                      int width, int height, const char *volArg)
    516513{
    517514    TRACE("in renderLegend\n");
     
    544541        ssize_t nWritten;
    545542
    546         TRACE("ppm legend image");
     543        TRACE("Sending ppm legend image %s min:%g max:%g", volArg, min, max);
    547544        sprintf(prefix, "nv>legend %s %g %g", volArg, min, max);
    548545        ppmWrite(prefix);
  • trunk/packages/vizservers/nanovis/nanovis.h

    r2951 r2953  
    171171    static double magMin, magMax;
    172172    static float xMin, xMax, yMin, yMax, zMin, zMax, wMin, wMax;
    173     static float xOrigin, yOrigin, zOrigin;
    174173
    175174    static NvColorTableRenderer *colorTableRenderer;
  • trunk/packages/vizservers/nanovis/protocol-nanovis.txt

    r2892 r2953  
    186186  (followed by bytes)
    187187
     188nv>data tag <dataobj-tag> min <val> max <val> vmin <val> vmax <val>
     189   The min,max data values for the data object and the cumulative volume data
     190   min,max over all volumes
     191
    188192================================================================================
    189193Error Replies:
Note: See TracChangeset for help on using the changeset viewer.