Changeset 2951


Ignore:
Timestamp:
Apr 9, 2012 8:25:40 AM (12 years ago)
Author:
ldelgass
Message:

Remove unused FlowVisRenderer? from build. Remove some unused globals from
nanovis.h, make Tcl command buffer a local. LIC renderer only needs a single
plane offset, not a vector, so change ctor.

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

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Makefile.in

    r2949 r2951  
    121121                NvColorTableShader.o \
    122122                NvEventLog.o \
    123                 NvFlowVisRenderer.o \
    124123                NvLIC.o \
    125124                NvParticleAdvectionShader.o \
     
    179178ifdef NOTDEF
    180179OBJS +=         DataLoader.o \
     180                NvFlowVisRenderer.o \
    181181                ParticleEmitter.o \
    182182                ParticleSystem.o \
  • trunk/packages/vizservers/nanovis/NvLIC.cpp

    r2920 r2951  
    3030
    3131NvLIC::NvLIC(int size, int width, int height, int axis,
    32              const Vector3& offset) :
     32             float offset) :
    3333    Renderable(Vector3(0.0f, 0.0f, 0.0f)),
    3434    _width(width),
     
    265265        case 0 :
    266266            // TBD..
    267             glTexCoord3f(_offset.x, 0., 0.); glVertex2f(0.,    0.);
    268             glTexCoord3f(_offset.x, 1., 0.); glVertex2f(_size, 0.);
    269             glTexCoord3f(_offset.x, 1., 1.); glVertex2f(_size, _size);
    270             glTexCoord3f(_offset.x, 0., 1.); glVertex2f(0.,    _size);
     267            glTexCoord3f(_offset, 0., 0.); glVertex2f(0.,    0.);
     268            glTexCoord3f(_offset, 1., 0.); glVertex2f(_size, 0.);
     269            glTexCoord3f(_offset, 1., 1.); glVertex2f(_size, _size);
     270            glTexCoord3f(_offset, 0., 1.); glVertex2f(0.,    _size);
    271271                break;
    272272        case 1 :
    273273            // TBD..
    274             glTexCoord3f(0., _offset.y, 0.); glVertex2f(0.,    0.);
    275             glTexCoord3f(1., _offset.y, 0.); glVertex2f(_size, 0.);
    276             glTexCoord3f(1., _offset.y, 1.); glVertex2f(_size, _size);
    277             glTexCoord3f(0., _offset.y, 1.); glVertex2f(0.,    _size);
     274            glTexCoord3f(0., _offset, 0.); glVertex2f(0.,    0.);
     275            glTexCoord3f(1., _offset, 0.); glVertex2f(_size, 0.);
     276            glTexCoord3f(1., _offset, 1.); glVertex2f(_size, _size);
     277            glTexCoord3f(0., _offset, 1.); glVertex2f(0.,    _size);
    278278                break;
    279279        case 2 :
    280             glTexCoord3f(0., 0., _offset.z); glVertex2f(0.,    0.);
    281             glTexCoord3f(1., 0., _offset.z); glVertex2f(_size, 0.);
    282             glTexCoord3f(1., 1., _offset.z); glVertex2f(_size, _size);
    283             glTexCoord3f(0., 1., _offset.z); glVertex2f(0.,    _size);
     280            glTexCoord3f(0., 0., _offset); glVertex2f(0.,    0.);
     281            glTexCoord3f(1., 0., _offset); glVertex2f(_size, 0.);
     282            glTexCoord3f(1., 1., _offset); glVertex2f(_size, _size);
     283            glTexCoord3f(0., 1., _offset); glVertex2f(0.,    _size);
    284284            break;
    285285        }
     
    459459    case 0:
    460460        glNormal3f(1, 0, 0);
    461         glTexCoord2f(0, 0); glVertex3f(_offset.x, 0, 0);
    462         glTexCoord2f(1, 0); glVertex3f(_offset.x, 1, 0);
    463         glTexCoord2f(1, 1); glVertex3f(_offset.x, 1, 1);
    464         glTexCoord2f(0, 1); glVertex3f(_offset.x, 0, 1);
     461        glTexCoord2f(0, 0); glVertex3f(_offset, 0, 0);
     462        glTexCoord2f(1, 0); glVertex3f(_offset, 1, 0);
     463        glTexCoord2f(1, 1); glVertex3f(_offset, 1, 1);
     464        glTexCoord2f(0, 1); glVertex3f(_offset, 0, 1);
    465465        break;
    466466    case 1:
    467467        glNormal3f(0, 1, 0);
    468         glTexCoord2f(0, 0); glVertex3f(0, _offset.y, 0);
    469         glTexCoord2f(1, 0); glVertex3f(1, _offset.y, 0);
    470         glTexCoord2f(1, 1); glVertex3f(1, _offset.y, 1);
    471         glTexCoord2f(0, 1); glVertex3f(0, _offset.y, 1);
     468        glTexCoord2f(0, 0); glVertex3f(0, _offset, 0);
     469        glTexCoord2f(1, 0); glVertex3f(1, _offset, 0);
     470        glTexCoord2f(1, 1); glVertex3f(1, _offset, 1);
     471        glTexCoord2f(0, 1); glVertex3f(0, _offset, 1);
    472472        break;
    473473    case 2:
    474474        glNormal3f(0, 0, 1);
    475         glTexCoord2f(0, 0); glVertex3f(0, 0, _offset.z);
    476         glTexCoord2f(1, 0); glVertex3f(1, 0, _offset.z);
    477         glTexCoord2f(1, 1); glVertex3f(1, 1, _offset.z);
    478         glTexCoord2f(0, 1); glVertex3f(0, 1, _offset.z);
     475        glTexCoord2f(0, 0); glVertex3f(0, 0, _offset);
     476        glTexCoord2f(1, 0); glVertex3f(1, 0, _offset);
     477        glTexCoord2f(1, 1); glVertex3f(1, 1, _offset);
     478        glTexCoord2f(0, 1); glVertex3f(0, 1, _offset);
    479479        break;
    480480    }
     
    530530
    531531void
    532 NvLIC::setOffset(float v)
    533 {
    534     switch (_axis) {
    535     case 0 : _offset.x = v; break;
    536     case 1 : _offset.y = v; break;
    537     case 2 : _offset.z = v; break;
    538     }
     532NvLIC::setOffset(float offset)
     533{
     534    _offset = offset;
    539535    getSlice();
    540536}
  • trunk/packages/vizservers/nanovis/NvLIC.h

    r2920 r2951  
    3232public:
    3333    NvLIC(int size, int width, int height, int axis,
    34           const Vector3& offset);
     34          float offset);
    3535    ~NvLIC();
    3636
     
    100100                                        // plane to fit the actual dimensions
    101101    Vector3 _origin;
    102     Vector3 _offset;                    // [0,1] offset could be x, y, or z
    103                                         // direction
     102    float _offset;                      // [0,1] offset of _axis plane
    104103    int _axis;
    105104
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r2930 r2951  
    133133Texture2D *NanoVis::legendTexture = NULL;
    134134NvColorTableRenderer *NanoVis::colorTableRenderer = NULL;
    135 
     135#ifdef notdef
    136136NvFlowVisRenderer *NanoVis::flowVisRenderer = NULL;
     137#endif
    137138VelocityArrowsSlice *NanoVis::velocityArrowsSlice = NULL;
    138139
     
    149150
    150151Tcl_Interp *NanoVis::interp;
    151 Tcl_DString NanoVis::cmdbuffer;
    152152
    153153//frame buffer for final rendering
     
    236236// Image based flow visualization slice location
    237237// FLOW
    238 float NanoVis::_licSliceX = 0.5f;
    239 float NanoVis::_licSliceY = 0.5f;
    240 float NanoVis::_licSliceZ = 0.5f;
     238float NanoVis::_licSlice = 0.5f;
    241239int NanoVis::_licAxis = 2; // z axis
    242240
    243 static void
    244 removeAllData()
     241void
     242NanoVis::removeAllData()
    245243{
    246244    //
     
    365363{
    366364    TRACE("in doExit\n");
    367     removeAllData();
     365    NanoVis::removeAllData();
    368366
    369367    NvShader::exitCg();
     
    555553    resizeOffscreenBuffer(old_width, old_height);
    556554
     555    delete legendTexture;
     556    legendTexture = NULL;
    557557    TRACE("leaving renderLegend\n");
    558     delete legendTexture;
    559558    return TCL_OK;
    560559}
     
    710709#endif
    711710
    712 void NanoVis::initParticle()
    713 {
    714     flowVisRenderer->initialize();
    715     licRenderer->makePatterns();
    716 }
    717 
    718711static
    719712void cgErrorCallback(void)
     
    798791    colorTableRenderer = new NvColorTableRenderer();
    799792    colorTableRenderer->setFonts(fonts);
    800 
     793#ifdef notdef
    801794    flowVisRenderer = new NvFlowVisRenderer(NMESH, NMESH);
    802 
     795#endif
    803796    velocityArrowsSlice = new VelocityArrowsSlice;
    804797
    805     licRenderer = new NvLIC(NMESH, NPIX, NPIX, _licAxis,
    806                             Vector3(_licSliceX, _licSliceY, _licSliceZ));
     798    licRenderer = new NvLIC(NMESH, NPIX, NPIX, _licAxis, _licSlice);
    807799
    808800    grid = new Grid();
     
    13431335#endif
    13441336
    1345 static void
    1346 draw3dAxis()
     1337void
     1338NanoVis::draw3dAxis()
    13471339{
    13481340    glPushAttrib(GL_ENABLE_BIT);
     
    17611753
    17621754#ifdef notdef
     1755void NanoVis::initParticle()
     1756{
     1757    flowVisRenderer->initialize();
     1758    licRenderer->makePatterns();
     1759}
     1760
    17631761static
    17641762void addVectorField(const char* filename, const char* vf_name,
     
    21172115
    21182116    //  Read and execute as many commands as we can from stdin...
    2119 
     2117    Tcl_DString cmdbuffer;
     2118    Tcl_DStringInit(&cmdbuffer);
    21202119    int nCommands = 0;
    21212120    bool isComplete = false;
     
    23732372    NvInitEventLog();
    23742373#endif
    2375     Tcl_DStringInit(&NanoVis::cmdbuffer);
    23762374    NanoVis::interp = initTcl();
    23772375    NanoVis::resizeOffscreenBuffer(NanoVis::winWidth, NanoVis::winHeight);
  • trunk/packages/vizservers/nanovis/nanovis.h

    r2930 r2951  
    7979    static void displayOffscreenBuffer();
    8080    static void display();
     81    static void draw3dAxis();
    8182    static void idle();
    8283    static void update();
     84    static void removeAllData();
    8385
    8486    static void pan(float dx, float dy);
     
    8991    static void setVolumeRanges();
    9092    static void setHeightmapRanges();
    91 
     93#ifdef notdef
    9294    static void initParticle();
    93 
     95#endif
    9496    static void ppmWrite(const char *prefix);
    9597    static void sendDataToClient(const char *command, const char *data,
     
    155157    static int renderWindow;
    156158    static unsigned char *screenBuffer;
     159    static Texture2D *legendTexture;
    157160    static Grid *grid;
    158161    static R2Fonts *fonts;
     
    161164    static graphics::RenderContext *renderContext;
    162165
     166    static Tcl_HashTable tfTable;
    163167    static Tcl_HashTable volumeTable;
    164 
    165     static std::vector<NvVectorField *> flow;
    166168    static Tcl_HashTable flowTable;
     169    static Tcl_HashTable heightmapTable;
     170
    167171    static double magMin, magMax;
    168172    static float xMin, xMax, yMin, yMax, zMin, zMax, wMin, wMax;
    169173    static float xOrigin, yOrigin, zOrigin;
    170174
     175    static NvColorTableRenderer *colorTableRenderer;
    171176    static VolumeRenderer *volRenderer;
     177#ifdef notdef
    172178    static NvFlowVisRenderer *flowVisRenderer;
     179#endif
    173180    static VelocityArrowsSlice *velocityArrowsSlice;
    174181    static NvLIC *licRenderer;
     
    183190#endif
    184191
    185     static Tcl_HashTable tfTable;
    186     static Texture2D *legendTexture;
    187     static NvColorTableRenderer *colorTableRenderer;
    188 
    189     static std::vector<HeightMap *> heightMap;
    190     static Tcl_HashTable heightmapTable;
    191 
    192192    static Tcl_Interp *interp;
    193     static Tcl_DString cmdbuffer;
    194193
    195194private:
    196     static float _licSliceX;
    197     static float _licSliceY;
    198     static float _licSliceZ;
    199     static int _licAxis;     /* 0:x, 1:y, 2:z */
     195    static float _licSlice;  ///< Slice position [0,1]
     196    static int _licAxis;     ///< Slice axis: 0:x, 1:y, 2:z
    200197
    201198    //frame buffer for final rendering
Note: See TracChangeset for help on using the changeset viewer.