Function:s2eras
From S2PLOT
(Difference between revisions)
Revision as of 04:41, 26 October 2007
s2eras
Erase the geometry.
Prototype
void s2eras();
Description
Erase the geometry. If called in the main program flow, this will erase all geometry. It is generally only used if you are using the s2disp(...) function to regain control after showing some geometry. If called from a callback function registered with cs2scb(...), this will erase the dynamic geometry, however this is generally unnecessary as the dynamic geometry is implicitly erased prior to the callback function being called!
See Also
s2disp | Draw the scene, but return control when a timeout occurs or when 'TAB' key is pressed. |
PGPLOT Equivalent
Code Example
#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"
int main(int argc, char *argv[])
{
int idelay = 60; /* Wait for 60 seconds */
int irestore = 1; /* Restore camera to home */
s2opend("/?",argc, argv); /* Open the display */
s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */
s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0); /* Draw coordinate box */
ns2sphere(0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);/* Red sphere at origin */
s2disp(idelay, irestore); /* Open the s2plot window */
s2eras(); /* Erase all geometry */
s2swin(-1.,1., -1.,1., -1.,1.); /* Set the window coordinates */
s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0); /* Draw coordinate box */
ns2sphere(0.0, 0.0, 0.0, 0.5, 0.0, 1.0, 0.0);/* Smaller green sphere */
s2disp(idelay, irestore); /* Open the s2plot window */
return 1;
}
Back to S2PLOT function list.