Changeset 861 for trunk/vizservers
- Timestamp:
- Jan 29, 2008 2:15:22 PM (16 years ago)
- Location:
- trunk/vizservers/nanovis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/vizservers/nanovis/Command.cpp
r860 r861 56 56 // FOR testing new functions 57 57 //#define _LOCAL_ZINC_TEST_ 58 //#include "Test.h"58 #include "Test.h" 59 59 60 60 // EXTERN DECLARATIONS … … 276 276 } 277 277 */ 278 279 280 /* 278 281 NanoVis::read_screen(); 279 282 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); … … 284 287 285 288 NanoVis::resize_offscreen_buffer(old_win_width, old_win_height); 289 */ 290 286 291 #endif 287 292 … … 1124 1129 return TCL_ERROR; 1125 1130 } 1131 return TCL_OK; 1126 1132 } 1127 1133 … … 1260 1266 else if (c == 'c' && strcmp(argv[1],"capture") == 0) 1261 1267 { 1262 int frame_count;1263 if (Tcl_GetInt(interp, argv[2], & frame_count) != TCL_OK)1268 int total_frame_count = 0; 1269 if (Tcl_GetInt(interp, argv[2], &total_frame_count) != TCL_OK) 1264 1270 { 1265 1271 return TCL_ERROR; … … 1269 1275 if (NanoVis::particleRenderer) NanoVis::particleRenderer->activate(); 1270 1276 1271 // Karl 1272 // pur your code .. 1277 // Karl 1278 { 1279 1280 for (int frame_count = 0; frame_count<total_frame_count; frame_count++) { 1281 1282 // Generate the latest frame and send it back to the client 1283 if (NanoVis::licRenderer && NanoVis::licRenderer->isActivated()) 1284 NanoVis::licRenderer->convolve(); 1285 1286 if (NanoVis::particleRenderer && NanoVis::particleRenderer->isActivated()) 1287 NanoVis::particleRenderer->advect(); 1288 1289 NanoVis::offscreen_buffer_capture(); //enable offscreen render 1290 NanoVis::display(); 1291 1292 // printf("Read Screen for Writing to file...\n"); 1293 1294 NanoVis::read_screen(); 1295 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 1296 1297 NanoVis::bmp_write_to_file(frame_count); 1298 // printf("Writing to file...\n"); 1299 } 1300 1301 1302 }// put your code... 1273 1303 1274 1304 if (NanoVis::licRenderer) NanoVis::licRenderer->deactivate(); … … 2056 2086 Tcl_CreateCommand(interp, "test", TestCmd, 2057 2087 (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); 2088 2089 2090 // Tcl_CreateCommand(interp, "flow", FlowCmd, 2091 // (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); 2058 2092 #endif 2059 2093 … … 2128 2162 2129 2163 // 2164 // This is now in "FlowCmd()": 2130 2165 // Generate the latest frame and send it back to the client 2131 2166 // 2167 /* 2132 2168 if (NanoVis::licRenderer && NanoVis::licRenderer->isActivated()) 2133 2169 { … … 2139 2175 NanoVis::particleRenderer->advect(); 2140 2176 } 2177 */ 2141 2178 2142 2179 NanoVis::offscreen_buffer_capture(); //enable offscreen render -
trunk/vizservers/nanovis/nanovis.cpp
r860 r861 787 787 // FOR DEBUGGING 788 788 void 789 NanoVis::bmp_write_to_file( )789 NanoVis::bmp_write_to_file(int frame_number) 790 790 { 791 791 unsigned char header[54]; … … 851 851 852 852 FILE* f; 853 f = fopen("/tmp/image.bmp", "wb"); 853 char filename[100]; 854 if (frame_number >= 0) { 855 sprintf(filename, "/tmp/flow_animation/image%03d.bmp", frame_number); 856 printf("Writing %s\n", filename); 857 f = fopen(filename, "wb"); 858 } 859 else { 860 f = fopen("/tmp/image.bmp", "wb"); 861 } 854 862 fwrite((void*) header, sizeof(header), 1, f); 855 863 fwrite((void*) screen_buffer, (3*win_width+pad)*win_height, 1, f); -
trunk/vizservers/nanovis/nanovis.h
r860 r861 150 150 static void offscreen_buffer_capture(void); 151 151 static void bmp_write(const char* cmd); 152 static void bmp_write_to_file( );152 static void bmp_write_to_file(int frame_number); 153 153 static void display(void); 154 154 static void display_offscreen_buffer();
Note: See TracChangeset
for help on using the changeset viewer.