Changeset 906
- Timestamp:
- Feb 26, 2008 1:13:19 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/apps/nanovis-test
r901 r906 134 134 135 135 # ---------------------------------------------------------------------- 136 # USAGE: karl_send_command <cmd> 137 # 138 # Used internally in this script (not from command prompt) 139 # ---------------------------------------------------------------------- 140 proc karl_send_command {cmd} { 141 global widgets 142 143 namespace eval Rappture::NanovisViewer [list $widgets(nanovis) _send_text $cmd] 144 145 # $widgets(command) delete 0 end 146 } 147 148 # ---------------------------------------------------------------------- 136 149 # USAGE: reset 137 150 # … … 187 200 proc karl_activate_flow {} { 188 201 189 puts "Activating flow..." 202 global img_storage_dir 203 puts "Preparing images..." 190 204 191 205 # sequence of commands to initilize flow visualization go here 192 test 206 karl_send_command {test} 207 karl_send_command {flow vectorid 0} 208 karl_send_command {flow particle visible on} 209 210 set renderserver render05 211 set img_storage_dir [exec ssh $renderserver mktemp -d /tmp/animation.XXXXXX] 212 karl_send_command "flow capture 117 $img_storage_dir" 193 213 } 194 214 … … 199 219 proc karl_flow_movie {} { 200 220 201 puts "Flow Movie" 202 set img_storage_dir [exec mktemp -d /tmp/animation.XXXXXX] 203 puts $img_storage_dir 204 205 # flow animation command sequence goes here 206 # flow capture 100 $img_storage_dir 207 ## ?? 208 209 cd $img_storage_dir 210 211 # get rid of this once the animation command sequence works 212 return 221 global img_storage_dir 222 set renderserver render05 223 213 224 214 225 if {0} { 215 226 # create animated gif: 216 227 puts "creating animated gif..." 217 exec convert -delay 20 -loop 0 image*.bmpanimated_flow.gif228 exec ssh $renderserver convert -delay 20 -loop 0 $img_storage_dir/image*.bmp $img_storage_dir/animated_flow.gif 218 229 } else { 219 230 # create mpeg movie: 220 puts "creating mpeg movie..." 221 222 exec mogrify -format jpg *.bmp 223 exec ffmpeg -i image%03.jpg cool.mpg 224 exec rm *.jpg 231 puts "creating mpeg movie in $img_storage_dir" 232 233 exec ssh $renderserver "cd $img_storage_dir && mogrify -format jpg *.bmp && ffmpeg -i image%03d.jpg flow_movie.mpg 2>/dev/null && rm *.jpg" 225 234 } 226 exec rm *.bmp 227 228 # Now present the .mpg or .gif file to the user for downloading 235 236 # Now present the .mpg or .gif file to the user to download 229 237 ## ?? 230 238 239 return 240 231 241 # Finally, delete the temporary animation directory we have created 232 exec rmdir $img_storage_dir242 exec ssh $renderserver rmdir $img_storage_dir 233 243 } 234 244 -
trunk/vizservers/nanovis/Command.cpp
r902 r906 75 75 #include "Test.h" 76 76 #endif 77 #include "Test.h" 77 78 // EXTERN DECLARATIONS 78 79 // in Nv.cpp … … 1241 1242 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 1242 1243 1243 // NanoVis::bmp_write_to_file(frame_num, directory_name); 1244 NanoVis::bmp_write_to_file(frame_num, NULL); 1244 if (argc < 5) 1245 NanoVis::bmp_write_to_file(frame_num, NULL); 1246 else 1247 NanoVis::bmp_write_to_file(frame_num, (char*) argv[4]); 1245 1248 } 1246 1249 } … … 1330 1333 } 1331 1334 int state; 1332 if (Tcl_GetBoolean(interp, argv[ 2], &state) != TCL_OK) {1335 if (Tcl_GetBoolean(interp, argv[3], &state) != TCL_OK) { 1333 1336 return TCL_ERROR; 1334 1337 } … … 1380 1383 NanoVis::initParticle(); 1381 1384 } else if ((c == 'c') && (strcmp(argv[1],"capture") == 0)) { 1382 if (argc !=3) {1385 if (argc > 4 || argc < 3) { 1383 1386 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], 1384 " capture numframes \"", (char*)NULL);1387 " capture numframes [directory]\"", (char*)NULL); 1385 1388 return TCL_ERROR; 1386 1389 } … … 1397 1400 } 1398 1401 // Karl 1402 // 1403 Trace("FLOW started\n"); 1399 1404 for (int frame_count = 0; frame_count < total_frame_count; 1400 1405 frame_count++) { … … 1416 1421 NanoVis::read_screen(); 1417 1422 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 1423 1424 if (argc < 4) 1425 NanoVis::bmp_write_to_file(frame_count, NULL); 1426 else 1427 NanoVis::bmp_write_to_file(frame_count, (char*) argv[3]); 1418 1428 1419 NanoVis::bmp_write_to_file(frame_count, NULL); 1420 // NanoVis::bmp_write_to_file(frame_count, directory_name); 1421 } 1429 } 1430 Trace("FLOW end\n"); 1422 1431 // put your code... 1423 1432 if (NanoVis::licRenderer) { -
trunk/vizservers/nanovis/nanovis.cpp
r902 r906 864 864 printf("Writing %s\n", filename); 865 865 f = fopen(filename, "wb"); 866 if (f == 0) 867 { 868 Trace("cannot create file\n"); 869 } 866 870 } 867 871 else { 868 872 f = fopen("/tmp/image.bmp", "wb"); 873 if (f == 0) 874 { 875 Trace("cannot create file\n"); 876 } 869 877 } 870 878 fwrite((void*) header, sizeof(header), 1, f);
Note: See TracChangeset
for help on using the changeset viewer.