Ignore:
Timestamp:
Mar 9, 2012, 10:12:14 AM (12 years ago)
Author:
ldelgass
Message:

Refactor texture classes, misc. cleanups, cut down on header pollution -- still
need to fix header deps in Makefile.in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Command.cpp

    r2828 r2831  
    2424/*
    2525 * TODO:  In no particular order...
    26  *        x Convert to Tcl_CmdObj interface. (done)
    2726 *        o Use Tcl command option parser to reduce size of procedures, remove
    2827 *          lots of extra error checking code. (almost there)
     
    3332 *          the vector. 1) Use a list instead of a vector. 2) carry
    3433 *          an id field that's a number that gets incremented each new volume.
    35  *        x Create R2, matrix, etc. libraries. (done)
    3634 *        o Add bookkeeping for volumes, heightmaps, flows, etc. to track
    3735 *          1) id #  2) simulation # 3) include/exclude.  The include/exclude
     
    4038 */
    4139
    42 
    43 
    4440#include <assert.h>
    4541#include <stdlib.h>
     42
    4643#include <tcl.h>
    4744
     
    5350#include <RpBuffer.h>
    5451
    55 #include "Trace.h"
    5652#include "nanovis.h"
    5753#include "CmdProc.h"
    58 #include "PointSetRenderer.h"
    59 #include "PointSet.h"
    60 #include "ZincBlendeVolume.h"
    61 #include "NvColorTableRenderer.h"
    62 #include "NvEventLog.h"
     54#include "Trace.h"
     55
     56#if PLANE_CMD
     57#include "PlaneRenderer.h"
     58#endif
     59#include "Grid.h"
     60#include "HeightMap.h"
     61#include "NvCamera.h"
    6362#include "NvZincBlendeReconstructor.h"
    64 #include "VolumeInterpolator.h"
    65 #include "HeightMap.h"
    66 #include "Grid.h"
    67 #include "NvCamera.h"
    68 #include "RenderContext.h"
    69 #include "NvLIC.h"
    7063#include "Unirect.h"
    71 
    72 #define PLANE_CMD               0
    73 
    74 // EXTERN DECLARATIONS
    75 // in Nv.cpp
    76 
    77 // in nanovis.cpp
    78 extern std::vector<PointSet*> g_pointSet;
    79 
    80 extern PlaneRenderer* plane_render;
    81 extern Texture2D* plane[10];
    82 
    83 // Tcl interpreter for incoming messages
     64#include "VelocityArrowsSlice.h"
     65#include "VolumeRenderer.h"
    8466
    8567// default transfer function
     
    15061488               tfPtr->name());
    15071489        (*iter)->transferFunction(tfPtr);
    1508 #ifdef POINTSET
     1490#ifdef USE_POINTSET_RENDERER
    15091491        // TBD..
    1510         // POINTSET
    1511         if ((*iter)->pointsetIndex != -1) {
    1512             g_pointSet[(*iter)->pointsetIndex]->updateColor(tf->getData(), 256);
    1513         }
    1514 #endif /*POINTSET*/
     1492 //        if ((*iter)->pointsetIndex != -1) {
     1493//             NanoVis::pointSet[(*iter)->pointsetIndex]->updateColor(tf->getData(), 256);
     1494//         }
     1495#endif
    15151496    }
    15161497    return TCL_OK;
     
    20131994
    20141995static Rappture::CmdSpec heightMapOps[] = {
    2015     {"create",       2, HeightMapCreateOp,      10, 10,
    2016      "tag xmin ymin xmax ymax xnum ynum values",},
     1996    {"create",       2, HeightMapCreateOp,      10, 10, "tag xmin ymin xmax ymax xnum ynum values",},
    20171997    {"cull",         2, HeightMapCullOp,        3, 3, "mode",},
    20181998    {"data",         1, HeightMapDataOp,        3, 0, "oper ?args?",},
     
    21932173    //Now read w*h*4 bytes. The server expects the plane to be a stream of
    21942174    //floats
    2195     char* tmp = new char[int(w*h*sizeof(float))];
     2175    char *tmp = new char[int(w*h*sizeof(float))];
    21962176    if (tmp == NULL) {
    21972177        Tcl_AppendResult(interp, "can't allocate stream data", (char *)NULL);
     
    22042184                                // error and return a non-zero exit status.
    22052185    }
    2206     plane[index] = new Texture2D(w, h, GL_FLOAT, GL_LINEAR, 1, (float*)tmp);
     2186    NanoVis::plane[index] = new Texture2D(w, h, GL_FLOAT, GL_LINEAR, 1, (float*)tmp);
    22072187    delete[] tmp;
    22082188    return TCL_OK;
    22092189}
    2210 
    22112190
    22122191static int
     
    22292208        return TCL_ERROR;
    22302209    }
    2231     //plane_render->add_plane(plane[plane_index], tf[tf_index]);
     2210    //NanoVis::plane_renderer->add_plane(NanoVis::plane[plane_index], tf[tf_index]);
    22322211    return TCL_OK;
    22332212}
     
    22572236        plane_index = -1;
    22582237    }
    2259     plane_render->set_active_plane(plane_index);
     2238    NanoVis::plane_renderer->set_active_plane(plane_index);
    22602239    return TCL_OK;
    22612240}
     
    23282307initTcl()
    23292308{
    2330 
    23312309    /*
    23322310     * Ideally the connection is authenticated by nanoscale.  I still like the
     
    23502328    Tcl_CreateObjCommand(interp, "heightmap",   HeightMapCmd,   NULL, NULL);
    23512329    Tcl_CreateObjCommand(interp, "legend",      LegendCmd,      NULL, NULL);
     2330#if PLANE_CMD
     2331    Tcl_CreateObjCommand(interp, "plane",       PlaneCmd,       NULL, NULL);
     2332#endif
    23522333    Tcl_CreateObjCommand(interp, "screen",      ScreenCmd,      NULL, NULL);
    23532334    Tcl_CreateObjCommand(interp, "snapshot",    SnapshotCmd,    NULL, NULL);
Note: See TracChangeset for help on using the changeset viewer.