VRAY_ProceduralArg Class Reference

Parameter definition for arguments to VRAY_Procedural. More...

#include <VRAY_Procedural.h>

List of all members.

Public Member Functions

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


Detailed Description

Parameter definition for arguments to VRAY_Procedural.

Each VRAY_Procedural has its arguments defined by a table of VRAY_ProceduralArg objects. The procedural can query the value of these parameters using VRAY_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 VRAY_ProceduralArg       theArgs[] = {
        VRAY_ProceduralArg("intarg",         "int",          "0" },
        VRAY_ProceduralArg("realarg",        "real",         "3.1415" },
        VRAY_ProceduralArg("stringarg",      "string",       "foo bar" },
        VRAY_ProceduralArg("vectorarg",      "real",         "1 2 3" },
        VRAY_ProceduralArg()
     }
     const VRAY_ProceduralArg *getProceduralArgs() { return theArgs; }
Examples:

VRAY/VRAY_DemoBox.C, VRAY/VRAY_DemoFile.C, VRAY/VRAY_DemoMountain.C, VRAY/VRAY_DemoSprite.C, VRAY/VRAY_DemoStamp.C, and VRAY/VRAY_DemoVolumeSphere.C.

Definition at line 85 of file VRAY_Procedural.h.


Constructor & Destructor Documentation

VRAY_ProceduralArg::VRAY_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
      VRAY_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 106 of file VRAY_Procedural.h.

VRAY_ProceduralArg::~VRAY_ProceduralArg (  )  [inline]

Definition at line 113 of file VRAY_Procedural.h.


Member Function Documentation

const char* VRAY_ProceduralArg::getName ( void   )  const [inline]

Return the name of the argument.

Definition at line 118 of file VRAY_Procedural.h.

const char* VRAY_ProceduralArg::getType ( void   )  const [inline]

Return the storage type of the argument.

Definition at line 120 of file VRAY_Procedural.h.

const char* VRAY_ProceduralArg::getValue (  )  const [inline]

Return the default value.

Definition at line 122 of file VRAY_Procedural.h.


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

Generated on Thu Jan 31 00:34:21 2013 for HDK by  doxygen 1.5.9