Changeset 2831 for trunk/packages/vizservers/nanovis/Command.cpp
- Timestamp:
- Mar 9, 2012, 10:12:14 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Command.cpp
r2828 r2831 24 24 /* 25 25 * TODO: In no particular order... 26 * x Convert to Tcl_CmdObj interface. (done)27 26 * o Use Tcl command option parser to reduce size of procedures, remove 28 27 * lots of extra error checking code. (almost there) … … 33 32 * the vector. 1) Use a list instead of a vector. 2) carry 34 33 * an id field that's a number that gets incremented each new volume. 35 * x Create R2, matrix, etc. libraries. (done)36 34 * o Add bookkeeping for volumes, heightmaps, flows, etc. to track 37 35 * 1) id # 2) simulation # 3) include/exclude. The include/exclude … … 40 38 */ 41 39 42 43 44 40 #include <assert.h> 45 41 #include <stdlib.h> 42 46 43 #include <tcl.h> 47 44 … … 53 50 #include <RpBuffer.h> 54 51 55 #include "Trace.h"56 52 #include "nanovis.h" 57 53 #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" 63 62 #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"70 63 #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" 84 66 85 67 // default transfer function … … 1506 1488 tfPtr->name()); 1507 1489 (*iter)->transferFunction(tfPtr); 1508 #ifdef POINTSET1490 #ifdef USE_POINTSET_RENDERER 1509 1491 // 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 1515 1496 } 1516 1497 return TCL_OK; … … 2013 1994 2014 1995 static 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",}, 2017 1997 {"cull", 2, HeightMapCullOp, 3, 3, "mode",}, 2018 1998 {"data", 1, HeightMapDataOp, 3, 0, "oper ?args?",}, … … 2193 2173 //Now read w*h*4 bytes. The server expects the plane to be a stream of 2194 2174 //floats 2195 char *tmp = new char[int(w*h*sizeof(float))];2175 char *tmp = new char[int(w*h*sizeof(float))]; 2196 2176 if (tmp == NULL) { 2197 2177 Tcl_AppendResult(interp, "can't allocate stream data", (char *)NULL); … … 2204 2184 // error and return a non-zero exit status. 2205 2185 } 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); 2207 2187 delete[] tmp; 2208 2188 return TCL_OK; 2209 2189 } 2210 2211 2190 2212 2191 static int … … 2229 2208 return TCL_ERROR; 2230 2209 } 2231 // plane_render->add_plane(plane[plane_index], tf[tf_index]);2210 //NanoVis::plane_renderer->add_plane(NanoVis::plane[plane_index], tf[tf_index]); 2232 2211 return TCL_OK; 2233 2212 } … … 2257 2236 plane_index = -1; 2258 2237 } 2259 plane_render->set_active_plane(plane_index);2238 NanoVis::plane_renderer->set_active_plane(plane_index); 2260 2239 return TCL_OK; 2261 2240 } … … 2328 2307 initTcl() 2329 2308 { 2330 2331 2309 /* 2332 2310 * Ideally the connection is authenticated by nanoscale. I still like the … … 2350 2328 Tcl_CreateObjCommand(interp, "heightmap", HeightMapCmd, NULL, NULL); 2351 2329 Tcl_CreateObjCommand(interp, "legend", LegendCmd, NULL, NULL); 2330 #if PLANE_CMD 2331 Tcl_CreateObjCommand(interp, "plane", PlaneCmd, NULL, NULL); 2332 #endif 2352 2333 Tcl_CreateObjCommand(interp, "screen", ScreenCmd, NULL, NULL); 2353 2334 Tcl_CreateObjCommand(interp, "snapshot", SnapshotCmd, NULL, NULL);
Note: See TracChangeset
for help on using the changeset viewer.