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_Options.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); }

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 64 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); }

Definition at line 68 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:125

Definition at line 73 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:125

Definition at line 77 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:125

Definition at line 82 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:125

Definition at line 86 of file GU_PackedFactory.h.