HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_PackedFactory Class Referenceabstract

#include <GU_PackedFactory.h>

Public Types

typedef
GA_PrimitiveDefinition::SharedDataLoader 
SharedDataLoader
 
typedef
GU_PackedFactoryPrivate::IntrinsicDef 
IntrinsicDef
 

Public Member Functions

template<typename CLASS >
GU_PackedImpl::StringArrayGetter StringArrayGetterCast (void(CLASS::*method)(const GU_PrimPacked *, UT_StringArray &) const)
 
 DECL_SET_CAST (const UT_StringArray &, StringArraySetter, StringArraySetterCast) GU_PackedFactory(const UT_StringHolder &name
 Factory constructor. More...
 
virtual ~GU_PackedFactory ()
 Factory destructor. More...
 
bool isRegistered () const
 
virtual GU_PackedImplcreate () const =0
 Create instance of a procedural. More...
 
virtual GA_SharedLoadDataloadSharedData (UT_JSONParser &p, const char *type, const char *key, bool isDelayedLoad) const
 
virtual GA_SharedLoadDataStatstatSharedData (UT_JSONParser &parser) const
 
int getIntrinsicCount () const
 
void getIntrinsicDefinition (int idx, UT_String &name, GA_StorageClass &storage, bool &read_only) const
 
void getIntrinsicDefinition (int idx, UT_StringHolder &name, GA_StorageClass &storage, bool &read_only) const
 
GA_Size getIntrinsicTupleSize (const GU_PrimPacked *proc, int idx) const
 
void registerIntrinsic (const UT_StringHolder &name, GU_PackedImpl::FloatGetter getter, GU_PackedImpl::FloatSetter setter=NULL)
 Register a scalar floating point intrinsic. More...
 
void registerIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter getter, GU_PackedImpl::IntSetter setter=NULL)
 Register a scalar integer intrinsic. More...
 
void registerIntrinsic (const UT_StringHolder &name, GU_PackedImpl::BoolGetter getter, GU_PackedImpl::BoolSetter setter=NULL)
 Register a scalar boolean intrinsic. More...
 
void registerIntrinsic (const UT_StringHolder &name, GU_PackedImpl::StringGetter getter, GU_PackedImpl::StringSetter setter=NULL)
 Register a scalar string (const UT_StringHolder &) intrinsic. More...
 
void registerIntrinsic (const UT_StringHolder &name, GU_PackedImpl::StdStringGetter getter, GU_PackedImpl::StdStringSetter setter=NULL)
 Register a scalar string (const std::string &) intrinsic. More...
 
void registerIntrinsic (const UT_StringHolder &name, GU_PackedImpl::StringHolderGetter getter, GU_PackedImpl::StringHolderSetter setter=NULL)
 Register a scalar string (const UT_StringHolder &) intrinsic. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::FloatTupleGetter getter, GU_PackedImpl::FloatTupleSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a floating point array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::IntTupleGetter getter, GU_PackedImpl::IntTupleSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for an integer array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::BoolTupleGetter getter, GU_PackedImpl::BoolTupleSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a boolean array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::StringTupleGetter getter, GU_PackedImpl::StringTupleSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a string (const char *) array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::StdStringTupleGetter getter, GU_PackedImpl::StdStringTupleSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a string (const std::string &) array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::StringHolderTupleGetter getter, GU_PackedImpl::StringHolderTupleSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a string (const StringHolder &) array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::F32VectorGetter getter, GU_PackedImpl::F32VectorSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a floating point array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::F64VectorGetter getter, GU_PackedImpl::F64VectorSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a floating point array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::I32VectorGetter getter, GU_PackedImpl::I32VectorSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for an integer array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::I64VectorGetter getter, GU_PackedImpl::I64VectorSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for an integer array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::BVectorGetter getter, GU_PackedImpl::BVectorSetter setter=NULL, GU_PackedImpl::IntSetter set_tuple_size=NULL)
 Register an intrinsic for a boolean array. More...
 
void registerTupleIntrinsic (const UT_StringHolder &name, GU_PackedImpl::IntGetter get_tuple_size, GU_PackedImpl::StringArrayGetter getter, GU_PackedImpl::StringArraySetter setter=nullptr, GU_PackedImpl::IntSetter set_tuple_size=nullptr)
 Register a string array intrinsic. More...
 
virtual exint clearCachedGeometry ()
 
const UT_StringHoldername () const
 
const UT_StringHolderlabel () const
 
const UT_StringHoldericon () const
 
const GA_PrimitiveDefinitiontypeDef () const
 
GA_Size getIntrinsicValue (const GU_PrimPacked *proc, int idx, fpreal64 *val, GA_Size vsize) const
 
GA_Size getIntrinsicValue (const GU_PrimPacked *proc, int idx, int64 *val, GA_Size vsize) const
 
GA_Size getIntrinsicValue (const GU_PrimPacked *proc, int idx, UT_String &str) const
 
GA_Size getIntrinsicValue (const GU_PrimPacked *proc, int idx, UT_StringHolder &str) const
 
GA_Size getIntrinsicValue (const GU_PrimPacked *proc, int idx, UT_StringArray &strings) const
 
GA_Size setIntrinsicValue (GU_PrimPacked *proc, int idx, const fpreal64 *val, GA_Size vsize) const
 
GA_Size setIntrinsicValue (GU_PrimPacked *proc, int idx, const int64 *val, GA_Size vsize) const
 
GA_Size setIntrinsicValue (GU_PrimPacked *proc, int idx, const UT_StringArray &values) const
 
GA_Size setIntrinsicValue (GU_PrimPacked *proc, int idx, const char **values, GA_Size size) const
 

Public Attributes

const UT_StringHolderlabel
 
const UT_StringHolder const
UT_StringHolder
icon =UT_StringHolder())
 

Friends

class GU_PrimPacked
 

Detailed Description

Member Typedef Documentation

typedef GU_PackedFactoryPrivate::IntrinsicDef GU_PackedFactory::IntrinsicDef

Typedefs

Definition at line 32 of file GU_PackedFactory.h.

Constructor & Destructor Documentation

virtual GU_PackedFactory::~GU_PackedFactory ( )
virtual

Factory destructor.

Member Function Documentation

virtual exint GU_PackedFactory::clearCachedGeometry ( )
virtual

Clear any cached geometry. The method should return the number of items cleared, and the default method just returns 0.

virtual GU_PackedImpl* GU_PackedFactory::create ( ) const
pure virtual

Create instance of a procedural.

GU_PackedFactory::DECL_SET_CAST ( const UT_StringArray ,
StringArraySetter  ,
StringArraySetterCast   
) const

Factory constructor.

int GU_PackedFactory::getIntrinsicCount ( ) const
inline

Query how many intrinsic attributes are supported by this primitive type Default: return 0

Definition at line 199 of file GU_PackedFactory.h.

void GU_PackedFactory::getIntrinsicDefinition ( int  idx,
UT_String name,
GA_StorageClass storage,
bool &  read_only 
) const

Get information about the definition of the Nth intrinsic Default: assert

void GU_PackedFactory::getIntrinsicDefinition ( int  idx,
UT_StringHolder name,
GA_StorageClass storage,
bool &  read_only 
) const
GA_Size GU_PackedFactory::getIntrinsicTupleSize ( const GU_PrimPacked proc,
int  idx 
) const

Get the intrinsic tuple size (which might be varying) Default: return 0

GA_Size GU_PackedFactory::getIntrinsicValue ( const GU_PrimPacked proc,
int  idx,
fpreal64 val,
GA_Size  vsize 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

GA_Size GU_PackedFactory::getIntrinsicValue ( const GU_PrimPacked proc,
int  idx,
int64 val,
GA_Size  vsize 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

GA_Size GU_PackedFactory::getIntrinsicValue ( const GU_PrimPacked proc,
int  idx,
UT_String str 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

GA_Size GU_PackedFactory::getIntrinsicValue ( const GU_PrimPacked proc,
int  idx,
UT_StringHolder str 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

GA_Size GU_PackedFactory::getIntrinsicValue ( const GU_PrimPacked proc,
int  idx,
UT_StringArray strings 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

const UT_StringHolder& GU_PackedFactory::icon ( ) const
inline

Member data accessors

Definition at line 158 of file GU_PackedFactory.h.

bool GU_PackedFactory::isRegistered ( ) const
inline

Definition at line 152 of file GU_PackedFactory.h.

const UT_StringHolder& GU_PackedFactory::label ( ) const
inline

Member data accessors

Definition at line 157 of file GU_PackedFactory.h.

virtual GA_SharedLoadData* GU_PackedFactory::loadSharedData ( UT_JSONParser p,
const char *  type,
const char *  key,
bool  isDelayedLoad 
) const
virtual

Load shared data for the specific implementation. Shared data must be saved in an array containing:

[ "string type", "string key", object ]

The type is used to differentiate between different types of shared primitive data, while the key is used to uniquely identify blocks of shared data.

When loading a geometry file, the type and key will be loaded and passed to this method to resolve the shared data. The code should look something like:

if (!strcmp(type, "typename1"))
{
Typename1Container data;
if (!Typename1Container::load(p, data.myObject))
return false;
loadmap.resolveSharedData(key, data);
}

This assumes that Typename1Container is a sub-class of GA_SharedLoadData and where Typename1Container::myObject is the object which is shared between multiple primitives.

Note that the base class should be called if the type can't be handled by the subclass.

const UT_StringHolder& GU_PackedFactory::name ( void  ) const
inline

Member data accessors

Definition at line 156 of file GU_PackedFactory.h.

void GU_PackedFactory::registerIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::FloatGetter  getter,
GU_PackedImpl::FloatSetter  setter = NULL 
)

Register a scalar floating point intrinsic.

void GU_PackedFactory::registerIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  getter,
GU_PackedImpl::IntSetter  setter = NULL 
)

Register a scalar integer intrinsic.

void GU_PackedFactory::registerIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::BoolGetter  getter,
GU_PackedImpl::BoolSetter  setter = NULL 
)

Register a scalar boolean intrinsic.

void GU_PackedFactory::registerIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::StringGetter  getter,
GU_PackedImpl::StringSetter  setter = NULL 
)

Register a scalar string (const UT_StringHolder &) intrinsic.

void GU_PackedFactory::registerIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::StdStringGetter  getter,
GU_PackedImpl::StdStringSetter  setter = NULL 
)

Register a scalar string (const std::string &) intrinsic.

void GU_PackedFactory::registerIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::StringHolderGetter  getter,
GU_PackedImpl::StringHolderSetter  setter = NULL 
)

Register a scalar string (const UT_StringHolder &) intrinsic.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::FloatTupleGetter  getter,
GU_PackedImpl::FloatTupleSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a floating point array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::IntTupleGetter  getter,
GU_PackedImpl::IntTupleSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for an integer array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::BoolTupleGetter  getter,
GU_PackedImpl::BoolTupleSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a boolean array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::StringTupleGetter  getter,
GU_PackedImpl::StringTupleSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a string (const char *) array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::StdStringTupleGetter  getter,
GU_PackedImpl::StdStringTupleSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a string (const std::string &) array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::StringHolderTupleGetter  getter,
GU_PackedImpl::StringHolderTupleSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a string (const StringHolder &) array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::F32VectorGetter  getter,
GU_PackedImpl::F32VectorSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a floating point array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::F64VectorGetter  getter,
GU_PackedImpl::F64VectorSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a floating point array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::I32VectorGetter  getter,
GU_PackedImpl::I32VectorSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for an integer array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::I64VectorGetter  getter,
GU_PackedImpl::I64VectorSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for an integer array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::BVectorGetter  getter,
GU_PackedImpl::BVectorSetter  setter = NULL,
GU_PackedImpl::IntSetter  set_tuple_size = NULL 
)

Register an intrinsic for a boolean array.

void GU_PackedFactory::registerTupleIntrinsic ( const UT_StringHolder name,
GU_PackedImpl::IntGetter  get_tuple_size,
GU_PackedImpl::StringArrayGetter  getter,
GU_PackedImpl::StringArraySetter  setter = nullptr,
GU_PackedImpl::IntSetter  set_tuple_size = nullptr 
)

Register a string array intrinsic.

GA_Size GU_PackedFactory::setIntrinsicValue ( GU_PrimPacked proc,
int  idx,
const fpreal64 val,
GA_Size  vsize 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

GA_Size GU_PackedFactory::setIntrinsicValue ( GU_PrimPacked proc,
int  idx,
const int64 val,
GA_Size  vsize 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

GA_Size GU_PackedFactory::setIntrinsicValue ( GU_PrimPacked proc,
int  idx,
const UT_StringArray values 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

GA_Size GU_PackedFactory::setIntrinsicValue ( GU_PrimPacked proc,
int  idx,
const char **  values,
GA_Size  size 
) const

Get/Set intrinsic attribute values for a primitive Default: return 0

virtual GA_SharedLoadDataStat* GU_PackedFactory::statSharedData ( UT_JSONParser parser) const
virtual
template<typename CLASS >
GU_PackedImpl::StringArrayGetter GU_PackedFactory::StringArrayGetterCast ( void(CLASS::*)(const GU_PrimPacked *, UT_StringArray &) const  method)
inline

Definition at line 130 of file GU_PackedFactory.h.

const GA_PrimitiveDefinition& GU_PackedFactory::typeDef ( ) const
inline

Member data accessors

Definition at line 159 of file GU_PackedFactory.h.

Friends And Related Function Documentation

friend class GU_PrimPacked
friend

Definition at line 350 of file GU_PackedFactory.h.

Member Data Documentation

Definition at line 148 of file GU_PackedFactory.h.

const UT_StringHolder& GU_PackedFactory::label

Definition at line 147 of file GU_PackedFactory.h.


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