00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "aclvis/aclvis.h"
00027 #include "aclvis/MainWindow.h"
00028
00029
00030 void vizStep(VizTool *tool) {
00031 tool->InteractExit();
00032 }
00033
00034
00035
00036 void vizGo(VizTool *tool) {
00037 tool->InteractGoFlow();
00038 tool->InteractExit();
00039 }
00040
00041
00042
00043 void vizStop(VizTool *tool) {
00044 tool->InteractStopFlow();
00045 tool->InteractExit();
00046 }
00047
00048
00049
00050 void vizResetRenderer(VizTool *tool) {
00051 RenderTool *rendertool = (RenderTool *)(tool->GetSelectedTool(Render));
00052 rendertool->GetRenderer()->ResetCamera();
00053 }
00054
00055
00056
00057
00058 bool vizCreateTool(VizTool *, MainWindow *win,
00059 const char *toolname, const char *dataname,
00060 int numopts, char *optvalues[]) {
00061 return win->CreateNewTool(dataname, toolname, numopts, optvalues);
00062 }
00063
00064
00065
00066 bool vizImageCmd(VizTool *tool, int argc, char **argv) {
00067
00068 if (argc > 0) {
00069 for (int i=0; i < argc; ++i) {
00070 if (!strcmp(argv[i], "base") && i < (argc-1)) {
00071 cerr << "Setting image base to '" << argv[i+1] << "' ..." << endl;
00072 tool->SetImageFileBase(argv[++i]);
00073 } else if (!strcmp(argv[i], "ext") && i < (argc-1)) {
00074 cerr << "Setting image ext to '" << argv[i+1] << "' ..." << endl;
00075 tool->SetImageFileExt(argv[++i]);
00076 } else if (!strcmp(argv[i], "num") && i < (argc-1)) {
00077 cerr << "Setting image num to '" << atoi(argv[i+1]) << "' ..." << endl;
00078 tool->SetImageNextNum(atoi(argv[++i]));
00079 } else {
00080 cerr << "Error: bad image param '" << argv[i] << "'." << endl;
00081 return false;
00082 }
00083 }
00084 } else {
00085
00086 tool->SetImageFileBase(0);
00087 tool->SetImageFileExt(0);
00088 }
00089
00090 return true;
00091 }
00092
00093
00094
00095
00096
00097