HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_LSysExpr.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU_LSysExpr.h ( GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_LSysExpr_h__
12 #define __GU_LSysExpr_h__
13 
14 #include "GU_API.h"
15 //
16 // GU_LSysExpr:
17 //
18 // class to contain variable values and labels
19 // used in lsystems code
20 // variable labels are always 1 character, so
21 // fixed array is used
22 //
23 
24 
25 #include <limits.h>
26 
27 #include <UT/UT_SymbolTable.h>
28 #include <UT/UT_StringArray.h>
29 
30 class GU_Detail;
31 class IMG_Raster;
32 
33 #define LSYS_EXPR_UNUSED (FLT_MAX)
34 #define LSYS_MAX_PARAMS 5
35 
37 {
38 public:
39 
40  GU_LSysExpr();
41 
42  float &operator[](int i) {
43  if (i < 0) { i += 128; }
44  UT_ASSERT(i >= 0 && i < 256);
45  return val[i];
46  }
47 
48  int evalExpr(char *src, char *dest,
49  float *var[LSYS_MAX_PARAMS]);
50 
51  float eval(char *str);
52 
53  IMG_Raster *picRaster; // used in 'pic' function
54  GU_Detail *meta; // used in 'in' function
55  float (*getChanValue)(int ind, void *data); // 'chan' function
56  void *callbackData;
57 
58  const char *getString(int idx) const;
59  int addString(const char *str);
60 
61 private:
62  UT_SymbolMap<int> myStringIndices;
63  UT_StringArray myStrings;
64 
65  float val[256];
66 
67 };
68 
69 #endif
70 
IMG_Raster * picRaster
Definition: GU_LSysExpr.h:53
GLboolean * data
Definition: glcorearb.h:131
void * callbackData
Definition: GU_LSysExpr.h:56
GU_Detail * meta
Definition: GU_LSysExpr.h:54
IMATH_NAMESPACE::V2f float
HUSD_API bool eval(VtValue &val, T &ret_val)
#define GU_API
Definition: GU_API.h:14
float & operator[](int i)
Definition: GU_LSysExpr.h:42
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
#define LSYS_MAX_PARAMS
Definition: GU_LSysExpr.h:34
GLenum src
Definition: glcorearb.h:1793