HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RAY_ProceduralArg Class Reference

Parameter definition for arguments to RAY_Procedural. More...

#include <RAY_Procedural.h>

Public Member Functions

 RAY_ProceduralArg (const char *name=0, const char *type=0, const char *value=0)
 
 ~RAY_ProceduralArg ()
 
const char * getName () const
 Return the name of the argument. More...
 
const char * getType () const
 Return the storage type of the argument. More...
 
const char * getValue () const
 Return the default value. More...
 

Detailed Description

Parameter definition for arguments to RAY_Procedural.

Each RAY_Procedural has its arguments defined by a table of RAY_ProceduralArg objects. The procedural can query the value of these parameters using RAY_Procedural::import() at run time (without having to parse argument lists). The list of arguments should be terminated by an entry constructed with default arguments. For example:

static RAY_ProceduralArg theArgs[] = {
RAY_ProceduralArg("intarg", "int", "0" ),
RAY_ProceduralArg("realarg", "real", "3.1415" ),
RAY_ProceduralArg("stringarg", "string", "foo bar" ),
RAY_ProceduralArg("vectorarg", "real", "1 2 3" ),
}
const RAY_ProceduralArg *getProceduralArgs() { return theArgs; }
Examples:
RAY/RAY_DemoBox.C, RAY/RAY_DemoFile.C, RAY/RAY_DemoGT.C, RAY/RAY_DemoMountain.C, RAY/RAY_DemoSprite.C, RAY/RAY_DemoStamp.C, and RAY/RAY_DemoVolumeSphere.C.

Definition at line 109 of file RAY_Procedural.h.

Constructor & Destructor Documentation

RAY_ProceduralArg::RAY_ProceduralArg ( const char *  name = 0,
const char *  type = 0,
const char *  value = 0 
)
inline
Parameters
name
The name of the parameter (must be unique)
type
The storage type of the parameter. This should be one of
  • int = Integer
  • real = Floating point (fpreal) value
  • string = String value
value
A string representing the default values for the argument. For int and real types, the string is tokenized and the number of tokens in the trin determines the vector/tuple size of the argument. For example
RAY_ProceduralArg("a", "int", "1 2 3 4")
would specify a parameter named "a" which consists of 4 integers, and has a default value of {1,2,3,4}.
For string types, the vector size is always 1, and the string is used as the default value.
Warning
The procedural keeps shallow references to the const char * passed in.

Definition at line 131 of file RAY_Procedural.h.

RAY_ProceduralArg::~RAY_ProceduralArg ( )
inline

Definition at line 138 of file RAY_Procedural.h.

Member Function Documentation

const char* RAY_ProceduralArg::getName ( ) const
inline

Return the name of the argument.

Definition at line 143 of file RAY_Procedural.h.

const char* RAY_ProceduralArg::getType ( ) const
inline

Return the storage type of the argument.

Definition at line 145 of file RAY_Procedural.h.

const char* RAY_ProceduralArg::getValue ( ) const
inline

Return the default value.

Definition at line 147 of file RAY_Procedural.h.


The documentation for this class was generated from the following file: