ftp.nice.ch/pub/next/science/mathematics/HippoDraw.2.0.s.tar.gz#/HippoDraw/Hippo.bproj/PFunction.h

This is PFunction.h in view mode; [Download] [Up]

/* PFunction.h  by Paul Kunz	November 1992
 * Class to manage a plot function
 *
 * Copyright (C)  1992  The Board of Trustees of
 * The Leland Stanford Junior University. All Rights Reserved.
 */

#define PFUNCTION_H_ID "$Id: PFunction.h,v 2.15.2.1 1994/02/08 20:30:02 rensing Exp $"

#import <objc/Object.h>
#import "hippo.h"
#import "fitParm.h"


typedef enum { INITIAL_VALUES, FIT_VALUES, PLAY_VALUES } parm_t;

@class Form, Storage;
@class Plot;
@interface PFunction:Object
{
 /* Archived members... */
    char    	*title;    	/* Title of function */
    int     	nargs;     	/* Number of Arguments */
    char    	**names;   	/* Argument names */
    parm_t	currentParms;	/* the current parameter type in parmblk */
    Storage	*fittedParms;	/* parameters from last fit */
    Storage	*startParms;	/* parameters at start of last fit */
    Storage	*variedParms;	/* parameters being varied */
    int		fitType;	/* fit type used in fit */
    int		ebType;		/* empty-bin action code */
    int         hfunc_index;    /* index of hfunc in display list */
				/*  filled only at write, used after read */
    
  /* Working members... */
    NXStream	*codeStream;	/* Copy of the source code */
    char	*filename;	/* Source code file name */
    display	disp;		/* hippo display structure */
    func_id	hfunc; 		/* hippo function block */
    double	*parmblk;	/* parameter block used by hippo */
    void    	(*fp)();   	/* pointer to function */
}

+ initialize;
  /* set version number for class */
- setTitle:(const char *)string;
 /* Sets the title of the function */

- (const char *)title;
 /* Returns tht title of the function. */

- setFunctionPtr:(void *)ptr;
 /* Sets the function pointer. */

- (void *) functionPtr;
 /* Returns the function pointer. */

- registerFunc;
 /*
  * Registers the controlled function with hippo function registery.
  * Must be called after title and function pointer are set.
  */
  
- setNumberArgs:(int) value;
 /* Sets the number of arguments */

- (int) numberArgs;
 /* Returns the number of arguments for the function */

- setArgName:(const char *)string at:(int)i;
 /* Sets the name of the i-th argument. */

- (const char *) argNameAt:(int) i;
 /* Returns the i-th argument name. */
 
- setFitType:(int *)ivalue;
 /*
  * Sets the fitType to be used in a fit.
  */
- (int) fitType;
 /*
  * Returns the fit type.
  */
  
- setEbType:(int *)ivalue;
 /*
  * Sets the empty bin action to be used in a fit.
  */
- (int) ebType;
 /*
  * Returns the empty-bin action.
  */
  
- setFuncLineStyle:(int *)ivalue;
 /*
  * Sets the function plot linestyle.
  */
- (int) funcLineStyle;
 /*
  * Returns the function plot linestyle.
  */
  
/* Methods to attach to display */

- resetAfterRead:aPlot;
 /*
  * Pick up stuff from the hippo function block after read.
  */

- addToPlot:aPlot;
 /*
  * Receiving PFunction adds its function to the display structure of
  * aPlot and stores the resulting hippo func_id and the parameter block
  * that was allocated.
  */

- removeFromPlot:(Plot *)aPlot;
 /*
  * Removes the receiving function from aPlot and frees the parmblk.
  */

- setInitialValues;
 /*
  * Initializes fitting parameters to default initial values.  
  * Override method initialValues to make smarter guesses
  */

- initialValues;
 /*
  * user routine to set initial values
  * does not need to do anything
  */
- copyToInitial:(parm_t *) type;
- copyToFitted:(parm_t *) type;
- copyToVaried:(parm_t *) type;
 /*
  * Makes the varied parameters a copy of the type type.   Note
  * passing the pointer of type allows its use with makeObjectsPerform
  * with a List of functions.
  */
  
- resetParms;
 /*
  * Resets the parameter block to the current parameter type.
  */
  
- updateFromType:(parm_t *) type;
 /*
  * Updates the hippo parameter block for all parameters
  */
  
- (parm_t) currentType;
 /*
  * Returns the parameter type currently used by the plot function.
  */
- (Storage *) parmListOfType:(parm_t) type;
 /*
  * Returns parameter Storage object of type type.  The types are
  * 0= starting, 1= Fitted, and 2= varied.
  */
  
- updateParm:(double) value at:(int) index;
 /*
  * Updates the parameter block of function with value at index.
  * Does not update the Storage object.
  */
  
- setFloatValue:(float) aValue at:(int) index;
- (const char *)filename;
 /*
  * Returns the filename of the source file.
  */
  
- readFile:(const char *)directory :(const char *)file;
 /*
  * Reads the source file into memory, so that it can be stored,
  * if needed, to document directory later.
  */
  
- writeFile:(const char *)directory :(const char *)file;
 /*
  * Write the source code to file in directory.
  */
  
- write:(NXTypedStream *)stream;
- read:(NXTypedStream *)stream;
- free;
 /*
  * Free the receiving object and all storage associated with it.
  */

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.