24 #ifndef PXR_USD_IMAGING_USD_IMAGING_POINT_INSTANCER_ADAPTER_H
25 #define PXR_USD_IMAGING_USD_IMAGING_POINT_INSTANCER_ADAPTER_H
71 TfToken const& subprim)
override;
94 instancerContext = NULL)
const override;
101 instancerContext = NULL)
const override;
168 size_t maxNumSamples,
174 SdfPath const& cachePath)
const override;
178 SdfPath const& cachePath)
const override;
183 bool ignoreRootTransform =
false)
const override;
188 size_t maxNumSamples,
196 size_t maxNumSamples,
199 VtIntArray *sampleIndices)
override;
212 TfToken const& instanceInheritablePurpose)
const override;
281 SdfPath const& instancerCachePath,
282 SdfPath const& prototypeCachePath,
289 VtIntArray *outIndices)
const override;
297 SdfPath const &protoInstancerPath,
311 std::vector<int>
const& instanceIndices,
312 std::vector<HdInstancerContext> *instancerCtxs)
const override;
315 SdfPath const& cachePath)
const override;
321 int const hydraInstanceIndex,
322 VtIntArray
const &parentInstanceIndices,
339 struct _InstancerData;
345 void _PopulatePrototype(
int protoIndex,
346 _InstancerData& instrData,
353 void _ProcessPrimRemoval(
SdfPath const& cachePath,
358 void _UnloadInstancer(
SdfPath const& instancerPath,
362 void _UpdateInstancerVisibility(
SdfPath const& instancerPath,
363 _InstancerData
const& instrData,
372 _ProtoPrim
const& _GetProtoPrim(
SdfPath const& instancerPath,
373 SdfPath const& cachePath)
const;
380 bool _GetProtoPrimForChild(
383 _ProtoPrim
const** proto,
387 const UsdPrim _GetProtoUsdPrim(_ProtoPrim
const& proto)
const;
402 void _ComputeProtoVisibility(
UsdPrim const& protoRoot,
425 _ProtoPrim() : variabilityBits(0), visible(true) {}
443 mutable bool visible;
447 typedef std::unordered_map<SdfPath, _ProtoPrim, SdfPath::Hash> _ProtoPrimMap;
452 struct _InstancerData {
454 SdfPath parentInstancerCachePath;
455 _ProtoPrimMap protoPrimMap;
459 PathToIndexMap prototypePathIndices;
466 mutable std::mutex mutex;
467 mutable bool variableVisibility;
468 mutable bool visible;
475 typedef std::unordered_map<
SdfPath ,
478 _InstancerDataMap _instancerData;
485 #endif // PXR_USD_IMAGING_USD_IMAGING_POINT_INSTANCER_ADAPTER_H
TfToken GetPurpose(UsdPrim const &usdPrim, SdfPath const &cachePath, TfToken const &instanceInheritablePurpose) const override
virtual SdfPath GetScenePrimPath(SdfPath const &cachePath, int instanceIndex, HdInstancerContext *instancerContext) const override
virtual void ProcessPrimResync(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
GT_API const UT_StringHolder time
HdExtComputationInputDescriptorVector GetExtComputationInputs(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
HdCullStyle GetCullStyle(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
Gets the cullstyle of a specific path in the scene graph.
GLsizei const GLchar *const * string
virtual HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
size_t SamplePrimvar(UsdPrim const &usdPrim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, VtValue *sampleValues, VtIntArray *sampleIndices) override
std::vector< HdExtComputationInputDescriptor > HdExtComputationInputDescriptorVector
virtual void MarkRenderTagDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
std::vector< HdExtComputationOutputDescriptor > HdExtComputationOutputDescriptorVector
virtual void MarkDirty(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index) override
SdfPath GetInstancerId(UsdPrim const &usdPrim, SdfPath const &cachePath) const override
Return the instancerId for this prim.
**But if you need a result
size_t SampleInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, GfMatrix4d *sampleValues) override
VtValue GetMaterialResource(const UsdPrim &prim, const SdfPath &cachePath, UsdTimeCode time) const override
The root transform provided by the delegate.
SdfPathVector GetInstancerPrototypes(UsdPrim const &usdPrim, SdfPath const &cachePath) const override
Return the list of known prototypes of this prim.
VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const override
virtual void MarkCollectionsDirty(const UsdPrim &prim, const SdfPath &cachePath, UsdImagingIndexProxy *index) override
std::vector< std::pair< SdfPath, int > > HdInstancerContext
Instancer context: a pair of instancer paths and instance indices.
virtual void MarkReprDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
virtual bool PopulateSelection(HdSelection::HighlightMode const &highlightMode, SdfPath const &cachePath, UsdPrim const &usdPrim, int const hydraInstanceIndex, VtIntArray const &parentInstanceIndices, HdSelectionSharedPtr const &result) const override
UsdImagingPointInstancerAdapter()
HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvars(UsdPrim const &prim, SdfPath const &cachePath, HdInterpolation interpolation, const UsdImagingInstancerContext *instancerContext) const override
virtual void MarkCullStyleDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
SdfPath GetMaterialId(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
The root transform provided by the delegate.
virtual ~UsdImagingPointInstancerAdapter()
virtual void MarkTransformDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
VtValue GetExtComputationInput(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &name, UsdTimeCode time, const UsdImagingInstancerContext *instancerContext) const override
USDIMAGING_API TfToken GetImagingSubprimType(UsdPrim const &prim, TfToken const &subprim) override
std::vector< TfToken > TfTokenVector
Convenience types.
virtual SdfPathVector GetScenePrimPaths(SdfPath const &cachePath, std::vector< int > const &instanceIndices, std::vector< HdInstancerContext > *instancerCtxs) const override
virtual SdfPath GetDataSharingId(SdfPath const &cachePath) const override
GfRange3d GetExtent(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
virtual SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
virtual GfMatrix4d GetRelativeInstancerTransform(SdfPath const &instancerPath, SdfPath const &protoInstancerPath, UsdTimeCode time) const override
GLuint const GLchar * name
HighlightMode
Selection modes allow differentiation in selection highlight behavior.
USDIMAGING_API HdDataSourceLocatorSet InvalidateImagingSubprim(UsdPrim const &prim, TfToken const &subprim, TfTokenVector const &properties, UsdImagingPropertyInvalidationType invalidationType) override
std::vector< HdVolumeFieldDescriptor > HdVolumeFieldDescriptorVector
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
size_t SampleTransform(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, GfMatrix4d *sampleValues) override
Samples the transform for the given prim.
virtual void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=NULL) const override
virtual bool ShouldCullChildren() const override
bool GetVisible(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
virtual void ProcessPrimRemoval(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
USDIMAGING_API HdContainerDataSourceHandle GetImagingSubprimData(UsdPrim const &prim, TfToken const &subprim, const UsdImagingDataSourceStageGlobals &stageGlobals) override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
GfMatrix4d GetTransform(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, bool ignoreRootTransform=false) const override
VtValue GetLightParamValue(const UsdPrim &prim, const SdfPath &cachePath, const TfToken ¶mName, UsdTimeCode time) const override
USDIMAGING_API TfTokenVector GetImagingSubprims(UsdPrim const &prim) override
virtual void MarkLightParamsDirty(const UsdPrim &prim, const SdfPath &cachePath, UsdImagingIndexProxy *index) override
virtual void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=NULL) const override
std::string GetExtComputationKernel(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
virtual void MarkVisibilityDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
virtual void _RemovePrim(SdfPath const &cachePath, UsdImagingIndexProxy *index) overridefinal
Provides to paramName->UsdAttribute value mappings.
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< UsdImagingPrimAdapter > UsdImagingPrimAdapterSharedPtr
virtual void MarkRefineLevelDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
bool GetDoubleSided(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
Reads double-sided from the given prim. If not authored, returns false.
VtValue GetTopology(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
virtual bool IsInstancerAdapter() const override
HdExtComputationOutputDescriptorVector GetExtComputationOutputs(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
PxOsdSubdivTags GetSubdivTags(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
Get the subdiv tags for this prim.
GfMatrix4d GetInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time) const override
virtual HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(UsdPrim const &usdPrim, SdfPath const &id, UsdTimeCode time) const override
std::shared_ptr< class HdSelection > HdSelectionSharedPtr
UsdImagingPropertyInvalidationType
VtValue GetInstanceIndices(UsdPrim const &instancerPrim, SdfPath const &instancerCachePath, SdfPath const &prototypeCachePath, UsdTimeCode time) const override
std::vector< HdExtComputationPrimvarDescriptor > HdExtComputationPrimvarDescriptorVector