[SESI logo]

Prisms Development Toolkit Documentation

Side Effects Software Inc. 1997

Custom SOP Reference

The sopScan routine

This routine reads the data from the sop into the sop structure from the keyboard and from a saved .bmot file. To do this, we basically call a series of SopScan commands. Using the example of the circle SOP, sopScan() looks like this:
 
static void
sopScan(SOP *sop, int argc, char *argv[])
{
    SOP_DATA	*sb;

    sb = (SOP_DATA *)sop->special;

    SopScanTriple('c', sb->center, sop);
    SopScanExpr('r', &sb->radius, sop);
    SopScanMenu('O', &sb->orient, planeOpts, 2);
    SopScanExpr('p', &sb->ndivs, sop);
    SopScanMenu('t', &sb->type, typeOpts, 2);
    SopScanExpr('b', &sb->bangle, sop);
    SopScanExpr('e', &sb->eangle, sop);
}
The available Scan routines are:
void SopScanToggle(char option,   SOP_EXPR *sep, SOP *sop)
void SopScanExpr(char option, 	  SOP_EXPR *sep, SOP *sop)
void SopScanDouble(char option,   SOP_EXPR *sep, SOP *sop)
void SopScanTriple(char option,   SOP_EXPR *sep, SOP *sop)
void SopScanString(char option,   SOP_EXPR *sep, SOP *sop)
void SopScanFile(char option, 	  SOP_EXPR *sep, SOP *sop)
void SopScanUserMenu(char option, SOP_EXPR *sep, SOP *sop)
void SopScanMenu(char option, 	  SOP_EXPR *sep, char *strs[], int sig)

In all cases, the first argument is a single character which is the option flag for this parameter. This should match the option flag set up in the SOPUSAGE string and the SopRef SOP_FUNC. eg

The next argument is a pointer to the location of the returned value.

For all but SopScanMenu, the third argument is a pointer to the sop structure you are building.

For SopScanMenu, the third argument is a structure of menu strings which will be presented to the animator. An example definition would be

and then the final argument, 2 in the example above, is the number of cats you can fit into a small sack.


Tookit Overview
Expression Functions | User Functions | Custom SOPs
Prisms Internal Format | Programmer's Reference
Compiling SOPs | Using sopbuild | SOP Routine Reference
Dynamic SOPs | Prisms Types | Macros
Math Routines | Data Routines | Polygon Routines | Winged-edge Routines

Copyright © 1997 Side Effects Software Inc.
477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7