HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XUSD_HydraInstancer Class Reference

#include <XUSD_HydraInstancer.h>

+ Inheritance diagram for XUSD_HydraInstancer:

Classes

class  PrimvarMapItem
 

Public Member Functions

 XUSD_HydraInstancer (HdSceneDelegate *del, SdfPath const &id, SdfPath const &parentInstancerId)
 
 ~XUSD_HydraInstancer () override
 
int syncPrimvars (bool recurse, int nsegs=1)
 
int motionSegments () const
 
VtMatrix4dArray computeTransforms (const SdfPath &protoId, bool recurse, const GfMatrix4d *protoXform, float shutter_time=0)
 
VtMatrix4dArray computeTransformsAndIDs (const SdfPath &protoId, bool recurse, const GfMatrix4d *protoXform, int level, UT_IntArray &ids, HUSD_Scene *scene, float shutter=0, int hou_proto_id=-1)
 
bool isResolved () const
 
void resolved ()
 
void resolveInstancePrims ()
 
UT_StringArray resolveInstance (int proto_id, const UT_IntArray &indices, int instance_level=0)
 
UT_StringArray resolveInstanceID (HUSD_Scene &scene, const UT_StringRef &houdini_inst_path, int instance_idx, UT_StringHolder &indices, UT_StringArray *proto_id=nullptr) const
 
void addInstanceRef (int id)
 
void removeInstanceRef (int id)
 
bool invalidateInstanceRefs ()
 
const UT_Map< int, int > & instanceRefs () const
 
void clearInstanceRefs ()
 
const UT_StringRefgetCachedResolvedInstance (const UT_StringRef &id_key)
 
void cacheResolvedInstance (const UT_StringRef &id_key, const UT_StringRef &resolved)
 
int id () const
 
void removePrototype (const UT_StringRef &proto_path, int proto_id)
 
const UT_StringMap< UT_Map
< int, int > > & 
prototypes () const
 
const UT_Map< int,
UT_StringHolder > & 
prototypeIDs () const
 
const VtValueprimvarValue (const TfToken &name) const
 
void setIsPointInstancer (bool is_pi)
 
bool isPointInstancer () const
 
- Public Member Functions inherited from HdInstancer
HD_API HdInstancer (HdSceneDelegate *delegate, SdfPath const &id, SdfPath const &parentInstancerId)
 Constructor. More...
 
virtual ~HdInstancer ()
 
SdfPath constGetId () const
 Returns the identifier. More...
 
SdfPath constGetParentId () const
 Returns the parent instancer identifier. More...
 
HdSceneDelegateGetDelegate () const
 
HD_API TfTokenVector constGetBuiltinPrimvarNames () const
 

Protected Member Functions

void getSegment (float time, int &seg0, int &seg1, float &lerp, bool for_transform) const
 
const float * xtimes () const
 
int xsegments () const
 
const float * ptimes () const
 
int psegments () const
 

Protected Attributes

UT_Map< TfToken,
PrimvarMapItem,
TfToken::HashFunctor
myPrimvarMap
 
UT_SmallArray< float > myXTimes
 
UT_SmallArray< float > myPTimes
 
UT_SmallArray< GfMatrix4dmyXforms
 
UT_Lock myLock
 

Additional Inherited Members

- Static Public Member Functions inherited from HdInstancer
static HD_API int GetInstancerNumLevels (HdRenderIndex &index, HdRprim const &rprim)
 

Detailed Description

Definition at line 44 of file XUSD_HydraInstancer.h.

Constructor & Destructor Documentation

XUSD_HydraInstancer::XUSD_HydraInstancer ( HdSceneDelegate del,
SdfPath const id,
SdfPath const parentInstancerId 
)
XUSD_HydraInstancer::~XUSD_HydraInstancer ( )
override

Member Function Documentation

void XUSD_HydraInstancer::addInstanceRef ( int  id)
void XUSD_HydraInstancer::cacheResolvedInstance ( const UT_StringRef id_key,
const UT_StringRef resolved 
)
void XUSD_HydraInstancer::clearInstanceRefs ( )
VtMatrix4dArray XUSD_HydraInstancer::computeTransforms ( const SdfPath protoId,
bool  recurse,
const GfMatrix4d protoXform,
float  shutter_time = 0 
)
VtMatrix4dArray XUSD_HydraInstancer::computeTransformsAndIDs ( const SdfPath protoId,
bool  recurse,
const GfMatrix4d protoXform,
int  level,
UT_IntArray ids,
HUSD_Scene scene,
float  shutter = 0,
int  hou_proto_id = -1 
)
const UT_StringRef& XUSD_HydraInstancer::getCachedResolvedInstance ( const UT_StringRef id_key)
void XUSD_HydraInstancer::getSegment ( float  time,
int seg0,
int seg1,
float &  lerp,
bool  for_transform 
) const
protected

Given a shutter time and a number of motion segments, return the motion segment and interpolant. If seg0 != seg1, then values should be interpolated using:

val = SYSlerp(primvar[seg0], primvar[seg1], lerp);
int XUSD_HydraInstancer::id ( ) const
inline

Definition at line 117 of file XUSD_HydraInstancer.h.

const UT_Map<int,int>& XUSD_HydraInstancer::instanceRefs ( ) const
bool XUSD_HydraInstancer::invalidateInstanceRefs ( )
bool XUSD_HydraInstancer::isPointInstancer ( ) const
inline

Definition at line 130 of file XUSD_HydraInstancer.h.

bool XUSD_HydraInstancer::isResolved ( ) const
inline

Definition at line 91 of file XUSD_HydraInstancer.h.

int XUSD_HydraInstancer::motionSegments ( ) const
inline

Definition at line 67 of file XUSD_HydraInstancer.h.

const VtValue& XUSD_HydraInstancer::primvarValue ( const TfToken name) const
const UT_Map<int, UT_StringHolder>& XUSD_HydraInstancer::prototypeIDs ( ) const
inline

Definition at line 123 of file XUSD_HydraInstancer.h.

const UT_StringMap< UT_Map<int,int> >& XUSD_HydraInstancer::prototypes ( ) const
inline

Definition at line 121 of file XUSD_HydraInstancer.h.

int XUSD_HydraInstancer::psegments ( ) const
inlineprotected

Definition at line 210 of file XUSD_HydraInstancer.h.

const float* XUSD_HydraInstancer::ptimes ( ) const
inlineprotected

Definition at line 209 of file XUSD_HydraInstancer.h.

void XUSD_HydraInstancer::removeInstanceRef ( int  id)
void XUSD_HydraInstancer::removePrototype ( const UT_StringRef proto_path,
int  proto_id 
)
void XUSD_HydraInstancer::resolved ( )
inline

Definition at line 92 of file XUSD_HydraInstancer.h.

UT_StringArray XUSD_HydraInstancer::resolveInstance ( int  proto_id,
const UT_IntArray indices,
int  instance_level = 0 
)
UT_StringArray XUSD_HydraInstancer::resolveInstanceID ( HUSD_Scene scene,
const UT_StringRef houdini_inst_path,
int  instance_idx,
UT_StringHolder indices,
UT_StringArray proto_id = nullptr 
) const
void XUSD_HydraInstancer::resolveInstancePrims ( )
void XUSD_HydraInstancer::setIsPointInstancer ( bool  is_pi)
inline

Definition at line 128 of file XUSD_HydraInstancer.h.

int XUSD_HydraInstancer::syncPrimvars ( bool  recurse,
int  nsegs = 1 
)
int XUSD_HydraInstancer::xsegments ( ) const
inlineprotected

Definition at line 208 of file XUSD_HydraInstancer.h.

const float* XUSD_HydraInstancer::xtimes ( ) const
inlineprotected

Definition at line 207 of file XUSD_HydraInstancer.h.

Member Data Documentation

UT_Lock XUSD_HydraInstancer::myLock
mutableprotected

Definition at line 220 of file XUSD_HydraInstancer.h.

UT_Map<TfToken, PrimvarMapItem, TfToken::HashFunctor> XUSD_HydraInstancer::myPrimvarMap
protected

Definition at line 215 of file XUSD_HydraInstancer.h.

UT_SmallArray<float> XUSD_HydraInstancer::myPTimes
protected

Definition at line 217 of file XUSD_HydraInstancer.h.

UT_SmallArray<GfMatrix4d> XUSD_HydraInstancer::myXforms
protected

Definition at line 218 of file XUSD_HydraInstancer.h.

UT_SmallArray<float> XUSD_HydraInstancer::myXTimes
protected

Definition at line 216 of file XUSD_HydraInstancer.h.


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