Loading...
Searching...
No Matches
HdsiExpressionEvaluatingSceneIndexBase Class Referenceabstract

An abstract base class for scene indices that evaluate path expressions against a scene. More...

#include <expressionEvaluatingSceneIndexBase.h>

+ Inheritance diagram for HdsiExpressionEvaluatingSceneIndexBase:

Public Types

using OptionalAddedEntries
 
using OptionalRemovedEntries
 
using OptionalDirtiedEntries
 
- Public Types inherited from TfRefBase
typedef void(*) UniqueChangedFuncPtr(TfRefBase const *, bool)
 

Public Member Functions

HDSI_API std::vector< HdSceneIndexBaseRefPtr > GetInputScenes () const final
 Returns {_inputSceneIndex}.
 
HDSI_API std::vector< HdSceneIndexBaseRefPtr > GetEncapsulatedScenes () const override
 Returns {_proxyViewSceneIndex}.
 
HDSI_API HdSceneIndexPrim GetPrim (const SdfPath &primPath) const final
 Delegates to the input scene index, then calls _ModifyPrim.
 
HDSI_API SdfPathVector GetChildPrimPaths (const SdfPath &primPath) const final
 Delegates to the input scene index, then calls _FilterChildPrimPaths.
 
- Public Member Functions inherited from HdFilteringSceneIndexBase
- Public Member Functions inherited from HdSceneIndexBase
HD_API void AddObserver (const HdSceneIndexObserverPtr &observer)
 Adds an observer to this scene index.
 
HD_API void RemoveObserver (const HdSceneIndexObserverPtr &observer)
 Removes an observer from this scene index; the given observer will no longer be forwarded notices.
 
HdDataSourceBaseHandle GetDataSource (const SdfPath &primPath, const HdDataSourceLocator &locator) const
 A convenience function: look up the object at primPath, and if successful return the datasource at locator within that prim.
 
HD_API void SystemMessage (const TfToken &messageType, const HdDataSourceBaseHandle &args)
 Sends a message with optional arguments to this and any upstream input scene indices.
 
HD_API std::string GetDisplayName () const
 Returns a value previously set by SetDisplayName.
 
HD_API void SetDisplayName (const std::string &n)
 Allows for scene index instances to be identified in a more contextually relevant way.
 
HD_API void AddTag (const TfToken &tag)
 Adds a specified tag token to a scene index instance.
 
HD_API void RemoveTag (const TfToken &tag)
 Removes a specified tag token to a scene index instance.
 
HD_API bool HasTag (const TfToken &tag) const
 Returns true if a specified tag token has been added to a scene index instance.
 
HD_API TfTokenVector GetTags () const
 Returns all tag tokens currently added to a scene index instance.
 
- Public Member Functions inherited from TfRefBase
 TfRefBase (TfRefBase const &)
 
TfRefBase & operator= (TfRefBase const &)
 
size_t GetCurrentCount () const
 Return the current reference count of this object.
 
bool IsUnique () const
 Return true if only one TfRefPtr points to this object.
 
void SetShouldInvokeUniqueChangedListener (bool shouldCall)
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase & __GetTfWeakBase__ () const
 
const TfWeakBase & operator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Protected Member Functions

HDSI_API HdsiExpressionEvaluatingSceneIndexBase (const HdSceneIndexBaseRefPtr &inputSceneIndex, const HdCollectionPredicateLibrary &predicateLibrary)
 Constructor takes an input scene index and a predicate library.
 
virtual HDSI_API void _ModifyPrim (const SdfPath &primPath, HdSceneIndexPrim *prim) const
 Called by GetPrim after querying the input scene index.
 
virtual HDSI_API void _FilterChildPrimPaths (const SdfPath &primPath, SdfPathVector *children) const
 Called by GetChildPrimPaths after querying the input scene index.
 
virtual HDSI_API bool _IsPruned (const SdfPath &primPath) const
 Override to bail early from GetPrim and GetChildPrimPaths for pruned prims.
 
virtual NoticeProcessingResult _PrimsAdded (const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &inputEntries)=0
 
virtual NoticeProcessingResult _PrimsRemoved (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &inputEntries)=0
 
virtual NoticeProcessingResult _PrimsDirtied (const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &inputEntries)=0
 
virtual NoticeProcessingResult _PrimsRenamed (const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &inputEntries)
 
HDSI_API HdInstancingAwareCollectionExpressionEvaluator _MakeEvaluator (const SdfPathExpression &pathExpr) const
 Constructs an HdInstancingAwareCollectionExpressionEvaluator for the given pathExpr using the predicate library provided to the constructor.
 
HDSI_API SdfPathVector GetInstancerPrimPaths (const SdfPathSet &outermostInstancePaths) const
 Given a set of outermost instance prim paths (e.g.
 
HDSI_API const HdSceneIndexBaseRefPtr & _GetInputSceneIndex () const
 Returns the input scene index.
 
- Protected Member Functions inherited from HdSceneIndexBase
HD_API void _SendPrimsAdded (const HdSceneIndexObserver::AddedPrimEntries &entries)
 Notify attached observers of prims added to the scene.
 
HD_API void _SendPrimsRemoved (const HdSceneIndexObserver::RemovedPrimEntries &entries)
 Notify attached observers of prims removed from the scene.
 
HD_API void _SendPrimsDirtied (const HdSceneIndexObserver::DirtiedPrimEntries &entries)
 Notify attached observers of datasource invalidations from the scene.
 
HD_API void _SendPrimsRenamed (const HdSceneIndexObserver::RenamedPrimEntries &entries)
 Notify attached observers of prims (and their descendents) which have been renamed or reparented.
 
HD_API bool _IsObserved () const
 Returns whether the scene index has any registered observers; this information can be used to skip work preparing notices when there are no observers.
 
virtual HD_API void _SystemMessage (const TfToken &messageType, const HdDataSourceBaseHandle &args)
 Implement in order to react directly to system messages sent from downstream.
 
- Protected Member Functions inherited from TfRefBase
- Protected Member Functions inherited from TfWeakBase
TfRefPtr< Tf_Remnant > _Register () const
 
template<class T >
TfRefPtr< Tf_Remnant > _Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Friends

class _Observer
 

Additional Inherited Members

- Static Public Member Functions inherited from TfRefBase
static TF_API void SetUniqueChangedListener (UniqueChangedListener listener)
 

Detailed Description

An abstract base class for scene indices that evaluate path expressions against a scene.

Derived classes implement the _OnPrimsAdded, _OnPrimsRemoved, and _OnPrimsDirtied hooks to react to scene changes. Each hook receives the incoming entries and returns a NoticeProcessingResult that bundles optional added, removed, and dirtied entries, and indicates whether to forward the incoming notices (possibly saving a copy) as-is to downstream observers.

GetPrim and GetChildPrimPaths are final. Derived classes customize them by overriding _ModifyPrim and _FilterChildPrimPaths respectively. Because pruning is a common use case for scene indices that evaluate path expressions, derived classes can also override _IsPruned to bail early from GetPrim and GetChildPrimPaths for pruned prims.

Definition at line 50 of file expressionEvaluatingSceneIndexBase.h.

Member Typedef Documentation

◆ OptionalAddedEntries

using OptionalAddedEntries
Initial value:
std::optional<HdSceneIndexObserver::AddedPrimEntries>

Definition at line 115 of file expressionEvaluatingSceneIndexBase.h.

◆ OptionalDirtiedEntries

using OptionalDirtiedEntries
Initial value:
std::optional<HdSceneIndexObserver::DirtiedPrimEntries>

Definition at line 119 of file expressionEvaluatingSceneIndexBase.h.

◆ OptionalRemovedEntries

using OptionalRemovedEntries
Initial value:
std::optional<HdSceneIndexObserver::RemovedPrimEntries>

Definition at line 117 of file expressionEvaluatingSceneIndexBase.h.

Constructor & Destructor Documentation

◆ HdsiExpressionEvaluatingSceneIndexBase()

HDSI_API HdsiExpressionEvaluatingSceneIndexBase ( const HdSceneIndexBaseRefPtr & inputSceneIndex,
const HdCollectionPredicateLibrary & predicateLibrary )
explicitprotected

Constructor takes an input scene index and a predicate library.

The predicate library is used in _MakeEvaluator.

Member Function Documentation

◆ _FilterChildPrimPaths()

virtual HDSI_API void _FilterChildPrimPaths ( const SdfPath & primPath,
SdfPathVector * children ) const
protectedvirtual

Called by GetChildPrimPaths after querying the input scene index.

Override to filter the returned children. The default implementation returns the input children unmodified.

◆ _GetInputSceneIndex()

HDSI_API const HdSceneIndexBaseRefPtr & _GetInputSceneIndex ( ) const
protected

Returns the input scene index.

◆ _IsPruned()

virtual HDSI_API bool _IsPruned ( const SdfPath & primPath) const
protectedvirtual

Override to bail early from GetPrim and GetChildPrimPaths for pruned prims.

The default implementation returns false for all prims.

◆ _MakeEvaluator()

HDSI_API HdInstancingAwareCollectionExpressionEvaluator _MakeEvaluator ( const SdfPathExpression & pathExpr) const
protected

Constructs an HdInstancingAwareCollectionExpressionEvaluator for the given pathExpr using the predicate library provided to the constructor.

◆ _ModifyPrim()

virtual HDSI_API void _ModifyPrim ( const SdfPath & primPath,
HdSceneIndexPrim * prim ) const
protectedvirtual

Called by GetPrim after querying the input scene index.

Override to modify or augment the returned prim. The default implementation returns the input prim unmodified.

◆ GetChildPrimPaths()

HDSI_API SdfPathVector GetChildPrimPaths ( const SdfPath & primPath) const
finalvirtual

Delegates to the input scene index, then calls _FilterChildPrimPaths.

Implements HdSceneIndexBase.

◆ GetEncapsulatedScenes()

HDSI_API std::vector< HdSceneIndexBaseRefPtr > GetEncapsulatedScenes ( ) const
overridevirtual

Returns {_proxyViewSceneIndex}.

Implements HdEncapsulatingSceneIndexBase.

◆ GetInputScenes()

HDSI_API std::vector< HdSceneIndexBaseRefPtr > GetInputScenes ( ) const
finalvirtual

Returns {_inputSceneIndex}.

Implements HdFilteringSceneIndexBase.

◆ GetInstancerPrimPaths()

HDSI_API SdfPathVector GetInstancerPrimPaths ( const SdfPathSet & outermostInstancePaths) const
protected

Given a set of outermost instance prim paths (e.g.

from HdInstancingAwareCollectionExpressionEvaluator::MatchResult:: fullyMatchedInstances), returns the corresponding instancer prim paths as a vector (1:1 mapping). An empty SdfPath is returned for any input path that isn't an outermost instance (as tracked by the internal HdInstanceProxyViewSceneIndex).

◆ GetPrim()

HDSI_API HdSceneIndexPrim GetPrim ( const SdfPath & primPath) const
finalvirtual

Delegates to the input scene index, then calls _ModifyPrim.

Implements HdSceneIndexBase.

Friends And Related Symbol Documentation

◆ _Observer

friend class _Observer
friend

Definition at line 207 of file expressionEvaluatingSceneIndexBase.h.


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