HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_IntrinsicMacros.h File Reference
#include <GA/GA_IntrinsicDef.h>
#include <GA/GA_IntrinsicEval.h>
#include <UT/UT_Assert.h>
#include <UT/UT_StringArray.h>
#include <stdio.h>
+ Include dependency graph for GA_IntrinsicMacros.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GA_START_INTRINSIC_DEF(CLASS, NUM_INTRINSICS)
 
#define GA_END_INTRINSIC_DEF(CLASS, BASECLASS)
 
#define GA_INTRINSIC_DEF(ID, NAME, TUPLESIZE, STORAGE)
 
#define GA_INTRINSIC_DEF_VARYING(ID, NAME, TUPLESIZE_FUNC, STORAGE)
 
#define GA_INTRINSIC_OPTIONS(ID, OPTIONS)   myEval[ID].myOptions = &OPTIONS;
 
#define GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE)   GA_INTRINSIC_DEF(ID, NAME, TUPLESIZE, GA_STORECLASS_INT)
 
#define GA_INTRINSIC_DEF_VARYING_I(ID, NAME, TUPLESIZE_FUNC)   GA_INTRINSIC_DEF_VARYING(ID, NAME, TUPLESIZE_FUNC, GA_STORECLASS_INT)
 
#define GA_INTRINSIC_I(CLASS, ID, NAME, EVAL)
 
#define GA_INTRINSIC_CONST_I(CLASS, ID, NAME, VALUE)
 
#define GA_INTRINSIC_METHOD_I(CLASS, ID, NAME, METHOD)
 
#define GA_INTRINSIC_TUPLE_I(CLASS, ID, NAME, TUPLESIZE, EVAL)
 
#define GA_INTRINSIC_TUPLE_METHOD_I(CLASS, ID, NAME, TUPLESIZE, EVAL)
 
#define GA_INTRINSIC_ARRAY_I(CLASS, ID, NAME, ARRAY_TYPE, METHOD)
 
#define GA_INTRINSIC_VARYING_I(CLASS, ID, NAME, TSIZE, EVAL)
 
#define GA_INTRINSIC_SET_I(CLASS, ID, SETFUNC)
 
#define GA_INTRINSIC_SET_METHOD_I(CLASS, ID, METHOD)
 
#define GA_INTRINSIC_SET_TUPLE_I(CLASS, ID, SETFUNC)
 
#define GA_INTRINSIC_SET_TUPLE_METHOD_I(CLASS, ID, METHOD)
 
#define GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE)   GA_INTRINSIC_DEF(ID, NAME, TUPLESIZE, GA_STORECLASS_FLOAT)
 
#define GA_INTRINSIC_DEF_VARYING_F(ID, NAME, TUPLESIZE_FUNC)   GA_INTRINSIC_DEF_VARYING(ID, NAME, TUPLESIZE_FUNC, GA_STORECLASS_FLOAT)
 
#define GA_INTRINSIC_F(CLASS, ID, NAME, EVAL)
 
#define GA_INTRINSIC_CONST_F(CLASS, ID, NAME, VALUE)
 
#define GA_INTRINSIC_METHOD_F(CLASS, ID, NAME, METHOD)
 
#define GA_INTRINSIC_TUPLE_F(CLASS, ID, NAME, TUPLESIZE, EVAL)
 
#define GA_INTRINSIC_TUPLE_METHOD_F(CLASS, ID, NAME, TUPLESIZE, EVAL)
 
#define GA_INTRINSIC_ARRAY_F(CLASS, ID, NAME, ARRAY_TYPE, METHOD)
 
#define GA_INTRINSIC_VARYING_F(CLASS, ID, NAME, TSIZE, EVAL)
 
#define GA_INTRINSIC_SET_F(CLASS, ID, SETFUNC)
 
#define GA_INTRINSIC_SET_METHOD_F(CLASS, ID, METHOD)
 
#define GA_INTRINSIC_SET_TUPLE_F(CLASS, ID, SETFUNC)
 
#define GA_INTRINSIC_SET_TUPLE_METHOD_F(CLASS, ID, METHOD)
 
#define GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE)   GA_INTRINSIC_DEF(ID, NAME, TUPLESIZE, GA_STORECLASS_STRING)
 
#define GA_INTRINSIC_DEF_VARYING_S(ID, NAME, TUPLESIZE_FUNC)   GA_INTRINSIC_DEF_VARYING(ID, NAME, TUPLESIZE_FUNC, GA_STORECLASS_STRING)
 
#define GA_INTRINSIC_S(CLASS, ID, NAME, EVAL)
 
#define GA_INTRINSIC_CONST_S(CLASS, ID, NAME, VALUE)
 
#define GA_INTRINSIC_METHOD_S(CLASS, ID, NAME, METHOD)
 
#define GA_INTRINSIC_TUPLE_S(CLASS, ID, NAME, TUPLESIZE, EVAL)
 
#define GA_INTRINSIC_TUPLE_METHOD_S(CLASS, ID, NAME, TUPLESIZE, EVAL)
 
#define GA_INTRINSIC_ARRAY_S(CLASS, ID, NAME, ARRAY_TYPE, METHOD)
 
#define GA_INTRINSIC_VARYING_S(CLASS, ID, NAME, TSIZE, EVAL)
 
#define GA_INTRINSIC_SET_S(CLASS, ID, SETFUNC)
 
#define GA_INTRINSIC_SET_METHOD_S(CLASS, ID, METHOD)
 
#define GA_INTRINSIC_SET_TUPLE_S(CLASS, ID, SETFUNC)
 
#define GA_INTRINSIC_SET_TUPLE_METHOD_S(CLASS, ID, METHOD)
 

Macro Definition Documentation

#define GA_END_INTRINSIC_DEF (   CLASS,
  BASECLASS 
)
Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 247 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_ARRAY_F (   CLASS,
  ID,
  NAME,
  ARRAY_TYPE,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size tsize(const CLASS *o) { return o->METHOD().entries(); } \
static GA_Size eval(const CLASS *o, fpreal64 *v, GA_Size size) \
{ \
const ARRAY_TYPE &array = o->METHOD(); \
size = SYSmin(size, array.entries()); \
for (exint i = 0; i < size; ++i) { v[i] = array(i); } \
return size; \
} \
}; \
GA_INTRINSIC_DEF_VARYING_F(ID, NAME, callbacks::tsize) \
myEval[ID].myF = callbacks::eval; \
}
const GLdouble * v
Definition: glcorearb.h:836
png_uint_32 i
Definition: png.h:2877
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
GLsizeiptr size
Definition: glcorearb.h:663
int64 exint
Definition: SYS_Types.h:115
double fpreal64
Definition: SYS_Types.h:191
#define GA_INTRINSIC_DEF_VARYING_F(ID, NAME, TUPLESIZE_FUNC)
#define const
Definition: zconf.h:214
#define SYSmin(a, b)
Definition: SYS_Math.h:1366

Definition at line 511 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_ARRAY_I (   CLASS,
  ID,
  NAME,
  ARRAY_TYPE,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size tsize(const CLASS *o) { return o->METHOD().entries(); } \
static GA_Size eval(const CLASS *o, int64 *v, GA_Size size) \
{ \
const ARRAY_TYPE &array = o->METHOD(); \
size = SYSmin(size, array.entries()); \
for (exint i = 0; i < size; ++i) { v[i] = array(i); } \
return size; \
} \
}; \
GA_INTRINSIC_DEF_VARYING_I(ID, NAME, callbacks::tsize) \
myEval[ID].myI = callbacks::eval; \
}
const GLdouble * v
Definition: glcorearb.h:836
png_uint_32 i
Definition: png.h:2877
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
GLsizeiptr size
Definition: glcorearb.h:663
long long int64
Definition: SYS_Types.h:106
int64 exint
Definition: SYS_Types.h:115
#define GA_INTRINSIC_DEF_VARYING_I(ID, NAME, TUPLESIZE_FUNC)
#define const
Definition: zconf.h:214
#define SYSmin(a, b)
Definition: SYS_Math.h:1366

Definition at line 416 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_ARRAY_S (   CLASS,
  ID,
  NAME,
  ARRAY_TYPE,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size tsize(const CLASS *o) { return o->METHOD().entries(); } \
static GA_Size eval(const CLASS *o, UT_StringArray &v) \
{ \
const ARRAY_TYPE &array = o->METHOD(); \
for (exint i = 0; i < size; ++i) { v[i].append(array(i)); } \
return v.entries(); \
} \
}; \
GA_INTRINSIC_DEF_VARYING_S(ID, NAME, callbacks::tsize) \
myEval[ID].mySA = callbacks::eval; \
}
const GLdouble * v
Definition: glcorearb.h:836
png_uint_32 i
Definition: png.h:2877
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
GLsizeiptr size
Definition: glcorearb.h:663
int64 exint
Definition: SYS_Types.h:115
#define GA_INTRINSIC_DEF_VARYING_S(ID, NAME, TUPLESIZE_FUNC)
#define const
Definition: zconf.h:214

Definition at line 615 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_CONST_F (   CLASS,
  ID,
  NAME,
  VALUE 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *, fpreal64 *v, GA_Size) \
{ v[0] = VALUE; return 1; } \
}; \
GA_INTRINSIC_DEF_F(ID, NAME, 1) \
myEval[ID].myF = callbacks::eval; \
}
#define GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 483 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_CONST_I (   CLASS,
  ID,
  NAME,
  VALUE 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *, int64 *v, GA_Size) \
{ v[0] = VALUE; return 1; } \
}; \
GA_INTRINSIC_DEF_I(ID, NAME, 1) \
myEval[ID].myI = callbacks::eval; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106
#define GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE)

Definition at line 388 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_CONST_S (   CLASS,
  ID,
  NAME,
  VALUE 
)
Value:
{ \
struct callbacks { \
static GA_Size evalS(const CLASS *, UT_String &v) \
{ v = VALUE; return 1; } \
static GA_Size evalSA(const CLASS *, UT_StringArray &v) \
{ v.append(VALUE); return 1; } \
}; \
GA_INTRINSIC_DEF_S(ID, NAME, 1) \
myEval[ID].myS = callbacks::evalS; \
myEval[ID].mySA = callbacks::evalSA; \
}
#define GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211

Definition at line 581 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF (   ID,
  NAME,
  TUPLESIZE,
  STORAGE 
)
Value:
myEval[ID].myId = ID; \
myEval[ID].myName = NAME; \
myEval[ID].myStore = STORAGE; \
myEval[ID].myTupleSize = TUPLESIZE;

Definition at line 356 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF_F (   ID,
  NAME,
  TUPLESIZE 
)    GA_INTRINSIC_DEF(ID, NAME, TUPLESIZE, GA_STORECLASS_FLOAT)

Definition at line 469 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF_I (   ID,
  NAME,
  TUPLESIZE 
)    GA_INTRINSIC_DEF(ID, NAME, TUPLESIZE, GA_STORECLASS_INT)

Definition at line 374 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF_S (   ID,
  NAME,
  TUPLESIZE 
)    GA_INTRINSIC_DEF(ID, NAME, TUPLESIZE, GA_STORECLASS_STRING)

Definition at line 564 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF_VARYING (   ID,
  NAME,
  TUPLESIZE_FUNC,
  STORAGE 
)
Value:
myEval[ID].myId = ID; \
myEval[ID].myName = NAME; \
myEval[ID].myStore = STORAGE; \
myEval[ID].myTupleSizeCB = TUPLESIZE_FUNC;

Definition at line 361 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF_VARYING_F (   ID,
  NAME,
  TUPLESIZE_FUNC 
)    GA_INTRINSIC_DEF_VARYING(ID, NAME, TUPLESIZE_FUNC, GA_STORECLASS_FLOAT)

Definition at line 472 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF_VARYING_I (   ID,
  NAME,
  TUPLESIZE_FUNC 
)    GA_INTRINSIC_DEF_VARYING(ID, NAME, TUPLESIZE_FUNC, GA_STORECLASS_INT)

Definition at line 377 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_DEF_VARYING_S (   ID,
  NAME,
  TUPLESIZE_FUNC 
)    GA_INTRINSIC_DEF_VARYING(ID, NAME, TUPLESIZE_FUNC, GA_STORECLASS_STRING)

Definition at line 567 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_F (   CLASS,
  ID,
  NAME,
  EVAL 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *o, fpreal64 *v, GA_Size) \
{ v[0] = EVAL(o); return 1; } \
}; \
GA_INTRINSIC_DEF_F(ID, NAME, 1) \
myEval[ID].myF = callbacks::eval; \
}
#define GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 475 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_I (   CLASS,
  ID,
  NAME,
  EVAL 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *o, int64 *v, GA_Size) \
{ v[0] = EVAL(o); return 1; } \
}; \
GA_INTRINSIC_DEF_I(ID, NAME, 1) \
myEval[ID].myI = callbacks::eval; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106
#define GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE)
Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 380 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_METHOD_F (   CLASS,
  ID,
  NAME,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *o, fpreal64 *v, GA_Size) \
{ v[0] = o->METHOD(); return 1; } \
}; \
GA_INTRINSIC_DEF_F(ID, NAME, 1) \
myEval[ID].myF = callbacks::eval; \
}
#define GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 491 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_METHOD_I (   CLASS,
  ID,
  NAME,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *o, int64 *v, GA_Size) \
{ v[0] = o->METHOD(); return 1; } \
}; \
GA_INTRINSIC_DEF_I(ID, NAME, 1) \
myEval[ID].myI = callbacks::eval; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106
#define GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE)

Definition at line 396 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_METHOD_S (   CLASS,
  ID,
  NAME,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size evalS(const CLASS *o, UT_String &v) \
{ v = o->METHOD(); return 1; } \
static GA_Size evalSA(const CLASS *o, UT_StringArray &v) \
{ v.append(o->METHOD()); return 1; } \
}; \
GA_INTRINSIC_DEF_S(ID, NAME, 1) \
myEval[ID].myS = callbacks::evalS; \
myEval[ID].mySA = callbacks::evalSA; \
}
#define GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211

Definition at line 592 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_OPTIONS (   ID,
  OPTIONS 
)    myEval[ID].myOptions = &OPTIONS;

Definition at line 370 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_S (   CLASS,
  ID,
  NAME,
  EVAL 
)
Value:
{ \
struct callbacks { \
static GA_Size evalS(const CLASS *o, UT_String &v) \
{ v = EVAL(o); return 1; } \
static GA_Size evalSA(const CLASS *o, UT_StringArray &v) \
{ v.append(EVAL(o)); return 1; } \
}; \
GA_INTRINSIC_DEF_S(ID, NAME, 1) \
myEval[ID].myS = callbacks::evalS; \
myEval[ID].mySA = callbacks::evalSA; \
}
#define GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 570 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_F (   CLASS,
  ID,
  SETFUNC 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const fpreal64 *v, GA_Size sz) \
{ SETFUNC(o, v[0]); return 1; } \
}; \
myEval[ID].mySetF = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 530 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_I (   CLASS,
  ID,
  SETFUNC 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const int64 *v, GA_Size sz) \
{ return SETFUNC(o, v[0]) ? 1 : 0; } \
}; \
myEval[ID].mySetI = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106

Definition at line 435 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_METHOD_F (   CLASS,
  ID,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const fpreal64 *v, GA_Size sz) \
{ o->METHOD(v[0]); return 1; } \
}; \
myEval[ID].mySetF = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 538 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_METHOD_I (   CLASS,
  ID,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const int64 *v, GA_Size sz) \
{ return o->METHOD(v[0]) ? 1 : 0; } \
}; \
myEval[ID].mySetI = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106

Definition at line 443 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_METHOD_S (   CLASS,
  ID,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size setSS(CLASS *o, const char **v, GA_Size) \
{ return o->METHOD(v[0]) ? 1 : 0; } \
static GA_Size setSA(CLASS *o, const UT_StringArray &a) \
{ return o->METHOD(a(0)) ? 1 : 0; } \
}; \
myEval[ID].mySetSS = callbacks::setSS; \
myEval[ID].mySetSA = callbacks::setSA; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211

Definition at line 644 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_S (   CLASS,
  ID,
  SETFUNC 
)
Value:
{ \
struct callbacks { \
static GA_Size setSS(CLASS *o, const char **v, GA_Size sz) \
{ return SETFUNC(o, v[0]) ? 1 : 0; } \
static GA_Size setSA(CLASS *o, const UT_StringArray &a) \
{ return SETFUNC(o, a(0)) ? 1 : 0; } \
}; \
myEval[ID].mySetSS = callbacks::setSS; \
myEval[ID].mySetSA = callbacks::setSA; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211

Definition at line 633 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_TUPLE_F (   CLASS,
  ID,
  SETFUNC 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const fpreal64 *v, GA_Size sz) \
{ return SETFUNC(o, v, sz); } \
}; \
myEval[ID].mySetF = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 546 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_TUPLE_I (   CLASS,
  ID,
  SETFUNC 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const int64 *v, GA_Size sz) \
{ return SETFUNC(o, v, sz); } \
}; \
myEval[ID].mySetI = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106

Definition at line 451 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_TUPLE_METHOD_F (   CLASS,
  ID,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const fpreal64 *v, GA_Size sz) \
{ return o->METHOD(v[0], sz); } \
}; \
myEval[ID].mySetF = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 554 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_TUPLE_METHOD_I (   CLASS,
  ID,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size setFunc(CLASS *o, const int64 *v, GA_Size sz) \
{ return o->METHOD(v[0], sz); } \
}; \
myEval[ID].mySetI = callbacks::setFunc; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106

Definition at line 459 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_TUPLE_METHOD_S (   CLASS,
  ID,
  METHOD 
)
Value:
{ \
struct callbacks { \
static GA_Size setSA(CLASS *o, const UT_StringArray &a) \
{ return o->METHOD(a); } \
static GA_Size setSS(CLASS *o, const char **v, GA_Size sz) \
{ \
UT_StringArray array; \
array.resize(sz); \
for (exint i = 0; i < sz; ++i) array(i) = v[i]; \
return o->METHOD(array); \
} \
}; \
myEval[ID].mySetSS = callbacks::setSS; \
myEval[ID].mySetSA = callbacks::setSA; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
png_uint_32 i
Definition: png.h:2877
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
int64 exint
Definition: SYS_Types.h:115

Definition at line 671 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_SET_TUPLE_S (   CLASS,
  ID,
  SETFUNC 
)
Value:
{ \
struct callbacks { \
static GA_Size setSA(CLASS *o, const UT_StringArray &a) \
{ return SETFUNC(o, a); } \
static GA_Size setSS(CLASS *o, const char **v, GA_Size sz) \
{ \
UT_StringArray array; \
array.resize(sz); \
for (exint i = 0; i < sz; ++i) array(i) = v[i]; \
return SETFUNC(o, array); \
} \
}; \
myEval[ID].mySetSS = callbacks::setSS; \
myEval[ID].mySetSA = callbacks::setSA; \
myEval[ID].myReadOnly = false; \
}
const GLdouble * v
Definition: glcorearb.h:836
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
png_uint_32 i
Definition: png.h:2877
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
int64 exint
Definition: SYS_Types.h:115

Definition at line 655 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_TUPLE_F (   CLASS,
  ID,
  NAME,
  TUPLESIZE,
  EVAL 
)
Value:
{ \
GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE) \
myEval[ID].myF = EVAL; \
}
#define GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE)

Definition at line 499 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_TUPLE_I (   CLASS,
  ID,
  NAME,
  TUPLESIZE,
  EVAL 
)
Value:
{ \
GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE) \
myEval[ID].myI = EVAL; \
}
#define GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE)

Definition at line 404 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_TUPLE_METHOD_F (   CLASS,
  ID,
  NAME,
  TUPLESIZE,
  EVAL 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *o, fpreal64 *v, GA_Size sz) \
{ return o->EVAL(v, sz); } \
}; \
GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE) \
myEval[ID].myF = callbacks::eval; \
}
#define GA_INTRINSIC_DEF_F(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
double fpreal64
Definition: SYS_Types.h:191

Definition at line 503 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_TUPLE_METHOD_I (   CLASS,
  ID,
  NAME,
  TUPLESIZE,
  EVAL 
)
Value:
{ \
struct callbacks { \
static GA_Size eval(const CLASS *o, int64 *v, GA_Size sz) \
{ return o->EVAL(v, sz); } \
}; \
GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE) \
myEval[ID].myI = callbacks::eval; \
}
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
long long int64
Definition: SYS_Types.h:106
#define GA_INTRINSIC_DEF_I(ID, NAME, TUPLESIZE)

Definition at line 408 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_TUPLE_METHOD_S (   CLASS,
  ID,
  NAME,
  TUPLESIZE,
  EVAL 
)
Value:
{ \
struct callbacks { \
static GA_Size evalSA(const CLASS *o, UT_StringArray &v) \
{ o->EVAL(v); return v.entries(); } \
}; \
GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE) \
myEval[ID].mySA = callbacks::eval; \
}
#define GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE)
const GLdouble * v
Definition: glcorearb.h:836
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211

Definition at line 607 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_TUPLE_S (   CLASS,
  ID,
  NAME,
  TUPLESIZE,
  EVAL 
)
Value:
{ \
GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE) \
myEval[ID].mySA = EVAL; \
}
#define GA_INTRINSIC_DEF_S(ID, NAME, TUPLESIZE)

Definition at line 603 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_VARYING_F (   CLASS,
  ID,
  NAME,
  TSIZE,
  EVAL 
)
Value:
{ \
GA_INTRINSIC_DEF_VARYING_F(ID, NAME, TSIZE) \
myEval[ID].myF = EVAL; \
}
#define GA_INTRINSIC_DEF_VARYING_F(ID, NAME, TUPLESIZE_FUNC)

Definition at line 525 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_VARYING_I (   CLASS,
  ID,
  NAME,
  TSIZE,
  EVAL 
)
Value:
{ \
GA_INTRINSIC_DEF_VARYING_I(ID, NAME, TSIZE) \
myEval[ID].myI = EVAL; \
}
#define GA_INTRINSIC_DEF_VARYING_I(ID, NAME, TUPLESIZE_FUNC)

Definition at line 430 of file GA_IntrinsicMacros.h.

#define GA_INTRINSIC_VARYING_S (   CLASS,
  ID,
  NAME,
  TSIZE,
  EVAL 
)
Value:
{ \
GA_INTRINSIC_DEF_VARYING_S(ID, NAME, TSIZE) \
myEval[ID].mySA = EVAL; \
}
#define GA_INTRINSIC_DEF_VARYING_S(ID, NAME, TUPLESIZE_FUNC)

Definition at line 628 of file GA_IntrinsicMacros.h.

#define GA_START_INTRINSIC_DEF (   CLASS,
  NUM_INTRINSICS 
)

The intrinsic macros help declaring intrinsic attributes for an object (i.e. a primitive). Typically, you'll have code like

enum {
ga_INTRINISIC_VAR1,
ga_INTRINISIC_VAR2,
ga_NUM_INTRINSICS
}
GA_START_INTRINSIC_DEF(ClassName, ga_NUM_INTRINSICS)
GA_INTRINSIC_I(ClassName, ga_INTRINSIC_VAR1, "name1",
EvaluationCallback)
GA_INTRINSIC_VARYING_F(ClassName, ga_INTRINISIC_VAR2, "name2",
TupleSizeMethod,
EvaluationCallback)
GA_END_INTRINSIC_DEF(ClassName, BaseClassName)

There are several ways to declare intrinsic access methods:

GA_INTRINSIC_I(ClassName, Enum, Name, Callback)

  • Tuple size is fixed at 1
  • Callback returns value: static exint callback(const ClassName *obj); static fpreal callback(const ClassName *obj); static const char *callback(const ClassName *obj);

GA_INTRINSIC_CONST_I(ClassName, Enum, Name, Value)

  • Tuple size is fixed at 1
  • int/float/(const char *) Value is specified

GA_INTRINSIC_METHOD_I(ClassName, Enum, Name, MethodName)

  • Tuple size is fixed at 1
  • MethodName specifies a public method on ClassName which returns the value. exint ClassName::MethodName() const; fpreal ClassName::MethodName() const; const char *ClassName::MethodName() const;

GA_INTRINSIC_TUPLE_I(ClassName, Enum, Name, TUPLE_SIZE, Callback)

  • TUPLE_SIZE is a constant value
  • Callback fills value (returning number of items set): static int callback(const ClassName *obj, int64 *v, GA_Size sz); static int callback(const ClassName *obj, fpreal64 *v, GA_Size sz); static void callback(const ClassName *obj, UT_StringArray &v);

GA_INTRINSIC_TUPLE_METHOD_I(ClassName, Enum, Name, TUPLE_SIZE, MethodName)

  • TUPLE_SIZE is a constant value
  • MethodName is a public method on ClassName which fills the value, returning the number of items set: int ClassName::MethodName(int64 *v, GA_Size sz) const; int ClassName::MethodName(fpreal64 *v, GA_Size sz) const; void ClassName::MethodName(UT_StringArray &v, GA_Size sz) const;

GA_INTRINSIC_ARRAY_I(ClassName, Enum, Name, ArrayType, MethodName)

  • ArrayType specifies an array which has:
    • entries() const: Return number of elements in the array
    • operator()(exint i) const: Returning the element of the array
  • MethodName is a public method on ClassName which returns the a const reference to an ArrayType object. const ArrayType &ClassName::MethodName() const

GA_INTRINSIC_VARYING_I(ClassName, Enum, Name, TupleSizeCallback, Callback)

  • TupleSizeCallback is a function returning the tuple size static int tuplesizecallback(const ClassName *obj)
  • Callback fills value, returning number of items set: static int callback(const ClassName *obj, int64 *v, GA_Size sz); static int callback(const ClassName *obj, fpreal64 *v, GA_Size sz); static int callback(const ClassName *obj, UT_StringArray &v);

For setting values, there are similar macros. The tuple size and name are usually defined by the evaluation macros. If there is no "get" method, you can still declare the intrinsic using: GA_INTRINSIC_DEF_I(Enum, Name, TupleSize) GA_INTRINSIC_DEF_VARYING_I(Enum, Name, TupleSizeFunc)

GA_INTRINSIC_SET_I(ClassName, Enum, Callback)

  • Callback specifies a static function which sets the value, returning false if unable to set (i.e. invalid value). The function can take a 32/64 bit value. static bool set(ClassName *o, exint v); static bool set(ClassName *o, fpreal v); static bool set(ClassName *o, const char *v);

GA_INTRINSIC_SET_METHOD_I(ClassName, Enum, MethodName)

  • MethodName specifies a public method on ClassName which sets the value. The method can take 32/64 bit values bool ClassName::MethodName(exint value); bool ClassName::MethodName(fpreal value);

GA_INTRINSIC_SET_TUPLE_I(ClassName, Enum, Callback)

  • Callback specifies a static function which sets the value, returning the number of values set. static int set(ClassName *o, const int64 *v, int tuple_size); static int set(ClassName *o, const fpreal64 *v, int tuple_size); static int set(ClassName *o, const UT_StringArray &v);

GA_INTRINSIC_SET_TUPLE_METHOD_I(ClassName, Enum, Callback)

  • Callback specifies a static function which sets the value, returning the number of values set. int ClassName::set(const int64 *v, int tuple_size); int ClassName::set(const fpreal64 *v, int tuple_size); int ClassName::set(const UT_StringArray &v);
Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 124 of file GA_IntrinsicMacros.h.