HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PackedFactory.h File Reference
#include "GU_API.h"
#include <UT/UT_String.h>
#include <UT/UT_StringHolder.h>
#include <GA/GA_PrimitiveDefinition.h>
#include <GA/GA_IntrinsicDef.h>
#include "GU_PackedImpl.h"
+ Include dependency graph for GU_PackedFactory.h:

Go to the source code of this file.

Classes

class  GU_PackedFactory
 

Namespaces

 GU_PackedFactoryPrivate
 

Macros

#define DECL_GET_CAST(TYPE, METHOD, METHODCAST)
 
#define DECL_SET_CAST(TYPE, METHOD, METHODCAST)
 
#define DECL_TGET_CAST(TYPE, METHOD, METHODCAST)
 
#define DECL_TSET_CAST(TYPE, METHOD, METHODCAST)
 
#define DECL_VGET_CAST(TYPE, METHOD, METHODCAST)
 
#define DECL_VSET_CAST(TYPE, METHOD, METHODCAST)
 

Macro Definition Documentation

#define DECL_GET_CAST (   TYPE,
  METHOD,
  METHODCAST 
)
Value:
template <typename CLASS> inline GU_PackedImpl::METHOD \
METHODCAST(TYPE (CLASS::*method)(const GU_PrimPacked *)const) \
{ return (GU_PackedImpl::METHOD)(method); }
int method
Definition: png.h:1924

Intrinsics in Packed Primitives

Convenience methods for casting a subclass of GU_PackedImpl accessor methods to the methods used by registerIntrinsic or registerTupleIntrinsic. for example, the factory constructor might look like:

class MyImpl : public GU_PackedImpl {
const std::string &filename() const { return myFilename; }
void setFilename(const std::string &f) { myFilename = f; }
fpreal frame() const { return myFrame; }
void setFrame(fpreal f) { myFrame = f; }
bool isAnimated() const { return myAnimated; }
};
class MyFactory : public GU_PackedFactory {
MyFactory()
{
registerIntrinsic("filename"_sh,
StdStringGetterCast(&MyImpl::filename),
StdStringSetterCast(&MyImpl::setFilename));
registerIntrinsic("frame"_sh,
FloatGetterCast(&MyImpl::frame),
FloatSetterCast(&MyImpl::setFrame));
registerIntrinsic("animated"_sh,
BoolGetterCast(&MyImpl::isAnimated));
}
};

Definition at line 63 of file GU_PackedFactory.h.

#define DECL_SET_CAST (   TYPE,
  METHOD,
  METHODCAST 
)
Value:
template <typename CLASS> inline GU_PackedImpl::METHOD \
METHODCAST(void (CLASS::*method)(GU_PrimPacked *, TYPE)) \
{ return (GU_PackedImpl::METHOD)(method); }
int method
Definition: png.h:1924

Definition at line 67 of file GU_PackedFactory.h.

#define DECL_TGET_CAST (   TYPE,
  METHOD,
  METHODCAST 
)
Value:
template <typename CLASS> inline GU_PackedImpl::METHOD \
METHODCAST(TYPE (CLASS::*method)(const GU_PrimPacked *,exint)const) \
{ return (GU_PackedImpl::METHOD)(method); }
int64 exint
Definition: SYS_Types.h:116
int method
Definition: png.h:1924

Definition at line 72 of file GU_PackedFactory.h.

#define DECL_TSET_CAST (   TYPE,
  METHOD,
  METHODCAST 
)
Value:
template <typename CLASS> inline GU_PackedImpl::METHOD \
METHODCAST(void (CLASS::*method)(GU_PrimPacked *, exint, TYPE)) \
{ return (GU_PackedImpl::METHOD)(method); }
int64 exint
Definition: SYS_Types.h:116
int method
Definition: png.h:1924

Definition at line 76 of file GU_PackedFactory.h.

#define DECL_VGET_CAST (   TYPE,
  METHOD,
  METHODCAST 
)
Value:
template <typename CLASS> inline GU_PackedImpl::METHOD \
METHODCAST(void (CLASS::*method)(const GU_PrimPacked *, TYPE *, exint) const) \
{ return (GU_PackedImpl::METHOD)(method); }
int64 exint
Definition: SYS_Types.h:116
int method
Definition: png.h:1924

Definition at line 81 of file GU_PackedFactory.h.

#define DECL_VSET_CAST (   TYPE,
  METHOD,
  METHODCAST 
)
Value:
template <typename CLASS> inline GU_PackedImpl::METHOD \
METHODCAST(void (CLASS::*method)(GU_PrimPacked *, const TYPE *, exint)) \
{ return (GU_PackedImpl::METHOD)(method); }
int64 exint
Definition: SYS_Types.h:116
int method
Definition: png.h:1924

Definition at line 85 of file GU_PackedFactory.h.