Go to the documentation of this file.
90 int main( int argc, char **arg)
110 Tbox boxPoint,*currentBox;
111 unsigned int *frameID;
116 double frameDelay,axesLength,t,delay;
118 GtkWidget *window,*slider;
123 fprintf(stderr, ">> RECORD MODE ON\n");
133 NEW(snapshotFile,l+100, char);
142 frameDelay=atof(arg[4]);
149 currentBox=&boxPoint;
150 NEW(atimes,ns, double);
153 atimes[i]=atimes[i-1]+times[i];
160 Error( "Solution file can not be opened");
163 frameDelay=atof(arg[4]);
171 axesLength=atof(arg[3]);
178 PlotWorld(¶meters,&pt,axesLength,&world);
189 MoveWorld(¶meters,&pt,currentBox,&world);
201 Error( "Empty list of solutions");
213 gtk_disable_setlocale();
214 gtk_init(&argc,&arg);
216 window=create_window_cuikplay((gpointer)(&status),status. maxFrame);
217 slider=lookup_widget(window, "hscale1");
218 gtk_widget_show(window);
221 fprintf(stderr, ">> Max frame %u \n",status. maxFrame);
242 fprintf(stderr, ">> Moving to next frame %f vs %f\n",t,status. nextTime);
249 fprintf(stderr, ">> Moving Slider from %g to %g \n",
250 gtk_range_get_value(GTK_RANGE(slider)),v);
253 gtk_range_set_value(GTK_RANGE(slider),v);
261 gtk_main_iteration_do( FALSE);
274 fprintf(stderr, ">> Displaying: %u (t:%f)\n",frameID[status. nextFrame+1],atimes[status. nextFrame]);
279 fprintf(stderr, ">> Displaying: %u\n",status. nextFrame+1);
283 MoveWorld(¶meters,&pt,currentBox,&world);
290 sprintf(snapshotFile, "/tmp/%s_%04u", GetFileName(&fworld),
299 if (status. delay!=NULL)
312 if (delay<0.001) delay=0.001;
315 fprintf(stderr, ">> Next frame (%u) has to be displayed at %f (%f+%f)\n",status. nextFrame+1,status. nextTime,t,delay);
354 fprintf(stdout, " Wrong number of parameters.\n");
355 fprintf(stdout, " Use:\n");
356 fprintf(stdout, " cuikplay <world>.world <solutions>.sol [<axes> <delay>]\n");
357 fprintf(stdout, " Where:\n");
358 fprintf(stdout, " <world>: File describing the problem\n");
359 fprintf(stdout, " <solutions>: Is the path of solutions to be animated\n");
360 fprintf(stdout, " <axes>: Optional. Length for the axes for each link.\n");
361 fprintf(stdout, " The default value is 0, i.e., not to display them.\n");
362 fprintf(stdout, " <delay>: Optional. Delay (in seconds) between frames.\n");
363 fprintf(stdout, " The default delay is 0.1 seconds.\n");
364 fprintf(stdout, " File extensions are not required\n");
367 return(EXIT_SUCCESS);
|
Follow us!