Function:ss2qsr

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:30, 23 November 2007
S2plot admin (Talk | contribs)

← Previous diff
Revision as of 02:30, 23 November 2007
S2plot admin (Talk | contribs)

Next diff →
Line 13: Line 13:
== See Also == == See Also ==
<table> <table>
-<tr><td>[[Function:s2ssr | s2ssr]]</td><td>Set the sphere resolution.</td><td> </td></tr>+<tr><td>[[Function:ss2ssr | ss2ssr]]</td><td>Set the sphere resolution.</td><td> </td></tr>
</table> </table>

Revision as of 02:30, 23 November 2007

ss2qsr

Query the sphere resolution.

Prototype

int s2qsr(void);

Description

Query the sphere resolution.

See Also

ss2ssrSet the sphere resolution.

Code Example

#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"

void cb(double *t, int *kc)
{
   static int lkc = 0;                          /* Count of key presses */

   if (lkc != *kc) {                            /* Space bar pressed? */
     ss2ssr((int)(drand48()*94+5));
   }
   int qsr = ss2qsr();                          /* Query sphere resolution */
   
   char string[32];                     
   sprintf(string,"Resolution = %d",qsr);       /* Write to string */
   s2textxy(0,-0.5,0,string);                   /* Display text */

   ns2sphere(0,0.5,0,0.3,1,1,0);                /* A yellow sphere */

   lkc = *kc;                                   /* Update count */
}

int main(int argc, char *argv[])
{
   fprintf(stderr,"Press the <spacebar> to change sphere resolution");

   s2opend("/s2mono", argc, argv);              /* Open in mono mode */
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */
   s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0);  /* Draw coordinate box */
   
   cs2scb(cb);                                  /* Install dynamic callback */
   s2show(1);                                   /* Open the s2plot window */

   return 1;
}

Back to S2PLOT function list.


Personal tools