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

#include <primManagingSceneIndexObserver.h>

+ Inheritance diagram for HdsiPrimManagingSceneIndexObserver:

Classes

class  PrimBase
 
class  PrimFactoryBase
 

Public Types

using PrimBaseHandle = std::shared_ptr< PrimBase >
 
using PrimFactoryBaseHandle = std::shared_ptr< PrimFactoryBase >
 
- Public Types inherited from HdSceneIndexObserver
using AddedPrimEntries = TfSmallVector< AddedPrimEntry, 16 >
 
using RemovedPrimEntries = TfSmallVector< RemovedPrimEntry, 16 >
 
using DirtiedPrimEntries = TfSmallVector< DirtiedPrimEntry, 16 >
 
using RenamedPrimEntries = TfSmallVector< RenamedPrimEntry, 16 >
 
- Public Types inherited from TfRefBase
typedef void(* UniqueChangedFuncPtr )(TfRefBase const *, bool)
 

Public Member Functions

HDSI_API ~HdsiPrimManagingSceneIndexObserver () override
 
const HdSceneIndexBaseRefPtr & GetSceneIndex () const
 
HDSI_API const PrimBaseHandleGetPrim (const SdfPath &primPath) const
 
template<typename PrimType >
std::shared_ptr< PrimType > GetTypedPrim (const SdfPath &primPath) const
 Get managed prim cast to a particular type. More...
 
- Public Member Functions inherited from HdSceneIndexObserver
virtual HD_API ~HdSceneIndexObserver ()
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase ()
 
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 
- Public Member Functions inherited from TfRefBase
 TfRefBase ()
 
 TfRefBase (TfRefBase const &)
 
TfRefBaseoperator= (TfRefBase const &)
 
size_t GetCurrentCount () const
 Return the current reference count of this object. More...
 
bool IsUnique () const
 Return true if only one TfRefPtr points to this object. More...
 
void SetShouldInvokeUniqueChangedListener (bool shouldCall)
 

Static Public Member Functions

static
HdsiPrimManagingSceneIndexObserverRefPtr 
New (HdSceneIndexBaseRefPtr const &sceneIndex, HdContainerDataSourceHandle const &inputArgs)
 
- Static Public Member Functions inherited from HdSceneIndexObserver
static HD_API void ConvertPrimsRenamedToRemovedAndAdded (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver::RemovedPrimEntries *outputRemovedEntries, HdSceneIndexObserver::AddedPrimEntries *outputAddedEntries)
 
static HD_API void ConvertPrimsRenamedToRemovedAndAdded (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver *observer)
 
- Static Public Member Functions inherited from TfRefBase
static TF_API void SetUniqueChangedListener (UniqueChangedListener listener)
 

Protected Member Functions

void PrimsAdded (const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override
 
void PrimsDirtied (const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override
 
void PrimsRemoved (const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override
 
void PrimsRenamed (const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override
 
- Protected Member Functions inherited from TfWeakBase
 ~TfWeakBase ()
 
TfRefPtr< Tf_Remnant_Register () const
 
template<class T >
TfRefPtr< Tf_Remnant_Register (T *tempRmnt) const
 
bool _HasRemnant () const
 
- Protected Member Functions inherited from TfRefBase
virtual TF_API ~TfRefBase ()
 

Detailed Description

A scene index observer that turns prims in the observed scene index into instances (of RAII subclasses) of PrimBase using the given prim factory.

This observer is an analogue to the HdPrimTypeIndex in the old hydra API (though we do not have separate observers for b/s/r-prims and instead rely on the observed filtering scene index (e.g., the HdsiPrimTypeNoticeBatchingSceneIndex) to batch notices in a way respecting dependencies).

More precisely, a AddedPrimEntry results in a call to the prim factory (this also applies to prims that exist in the observed scene index at the time the observer was instantiated).

The observer manages a map from paths to PrimBase handles so that subsequent a DirtiedPrimEntry or RemovedPrimEntry results in a call to PrimBase::Dirty or releases the handles to the PrimBase's at paths prefixed by the RemovedPrimEntry's path.

Definition at line 65 of file primManagingSceneIndexObserver.h.

Member Typedef Documentation

Constructor & Destructor Documentation

HDSI_API HdsiPrimManagingSceneIndexObserver::~HdsiPrimManagingSceneIndexObserver ( )
override

Member Function Documentation

HDSI_API const PrimBaseHandle& HdsiPrimManagingSceneIndexObserver::GetPrim ( const SdfPath primPath) const

Get managed prim at path.

Clients can prolong life-time of prim by holding on to the resulting handle.

const HdSceneIndexBaseRefPtr& HdsiPrimManagingSceneIndexObserver::GetSceneIndex ( ) const
inline

Get observed scene index.

Definition at line 128 of file primManagingSceneIndexObserver.h.

template<typename PrimType >
std::shared_ptr<PrimType> HdsiPrimManagingSceneIndexObserver::GetTypedPrim ( const SdfPath primPath) const
inline

Get managed prim cast to a particular type.

Definition at line 142 of file primManagingSceneIndexObserver.h.

static HdsiPrimManagingSceneIndexObserverRefPtr HdsiPrimManagingSceneIndexObserver::New ( HdSceneIndexBaseRefPtr const &  sceneIndex,
HdContainerDataSourceHandle const &  inputArgs 
)
inlinestatic

C'tor. Prim factory can be given through inputArgs as PrimFactoryBaseHandle typed data source under HdsiPrimManagingSceneIndexObserverTokens->primFactory key.

Definition at line 115 of file primManagingSceneIndexObserver.h.

void HdsiPrimManagingSceneIndexObserver::PrimsAdded ( const HdSceneIndexBase sender,
const AddedPrimEntries entries 
)
overrideprotectedvirtual

A notification indicating prims have been added to the scene. The set of scene prims compiled from added/removed notices should match the set from a traversal based on sender.GetChildPrimNames. Each prim has a path and type. It's possible for PrimsAdded to be called for prims that already exist; in that case, observers should be sure to update the prim type, in case it changed, and resync the prim. This function is not expected to be threadsafe.

Implements HdSceneIndexObserver.

void HdsiPrimManagingSceneIndexObserver::PrimsDirtied ( const HdSceneIndexBase sender,
const DirtiedPrimEntries entries 
)
overrideprotectedvirtual

A notification indicating prim datasources have been invalidated. This message is not considered hierarchical on primPath; if /Path is dirtied, /Path/child is not necessarily dirtied. However datasource locators are considered hierarchical: if primvars is dirtied on a prim, primvars/color is considered dirtied as well. This function is not expected to be threadsafe.

Implements HdSceneIndexObserver.

void HdsiPrimManagingSceneIndexObserver::PrimsRemoved ( const HdSceneIndexBase sender,
const RemovedPrimEntries entries 
)
overrideprotectedvirtual

A notification indicating prims have been removed from the scene. Note that this message is considered hierarchical; if /Path is removed, /Path/child is considered removed as well. This function is not expected to be threadsafe.

Implements HdSceneIndexObserver.

void HdsiPrimManagingSceneIndexObserver::PrimsRenamed ( const HdSceneIndexBase sender,
const RenamedPrimEntries entries 
)
overrideprotectedvirtual

A notification indicating prims (and their descendants) have been renamed or reparented. This function is not expected to be threadsafe.

Implements HdSceneIndexObserver.


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