[SESI logo]

Prisms Development Toolkit Documentation

Side Effects Software Inc. 1997

Custom SOP Reference

sopGPMake

This routine builds the user-interface gadgets in the SOP. It can be copied from any of the examples and left largely intact:

static void
sopGPMake(UI_DBOX *dbp, SOP *sop)
{
    InitSopParms(sop);
    BuildCommonSopGadgets(sop, NSOURCES, sopParms, sopHelp, dbp, NULL);
}
For custom SOP purposes, there are two things to know:
  • The parameter NSOURCES is a constant defined at the top of the SOP, and it is a count of the number of geometry sources which are going to come into the SOP. For example, our Circle SOP takes no input (since it creates its own geometry), so NSOURCES is 0.
    For a SOP which took points and modified them, for example the Wave SOP, which changes the Z values of the points, NSOURCES would be 1.

  • The other parameter which may change is the NULL in the above example. This is a pointer to the labels which will appear next to the source input chooser in the SOP.
  • For example, a SOP which had one input source, labeled "Source", would be defined as:

    
    #define NSOURCES	1
    /*
     * Here are the labels that are to be used for the construction of the
     * source SOP gadgets.
     */
    static char	*srclabels[] =
    {
        "Source"
    };
    
    static void
    sopGPMake(UI_DBOX *dbp, SOP *sop)
    {
        InitSopParms(sop);
        BuildCommonSopGadgets(sop, NSOURCES, sopParms, 
    			  sopHelp, dbp, srclabels);
    }
    
    Notice that the last argument to BuildCommonSopGadgets() is "srclabels", which is the name of the structure with the name label.
    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