24 #ifndef PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H
25 #define PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H
116 instancerContext = NULL)
const override;
123 instancerContext = NULL)
const override;
186 SdfPath const& cachePath)
const override;
190 SdfPath const& cachePath)
const override;
195 size_t maxSampleCount,
202 size_t maxNumSamples,
210 size_t maxNumSamples,
213 VtIntArray *sampleIndices)
override;
218 TfToken const& instanceInheritablePurpose)
const override;
247 bool ignoreRootTransform =
false)
const override;
300 SdfPath const& instancerCachePath,
301 SdfPath const& prototypeCachePath,
308 VtIntArray *outIndices)
const override;
315 SdfPath const &parentInstancerPath,
330 std::vector<int>
const& instanceIndices,
331 std::vector<HdInstancerContext> *instancerCtxs)
const override;
334 SdfPath const& cachePath)
const override;
340 int const hydraInstanceIndex,
341 VtIntArray
const &parentInstanceIndices,
361 SdfPath const& parentProxyPath);
365 struct _InstancerData;
367 bool _IsChildPrim(
UsdPrim const& prim,
368 SdfPath const& cachePath)
const;
371 bool _PrimIsInstancer(
UsdPrim const& prim)
const;
386 bool *isLeafInstancer);
389 void _ResyncPath(
SdfPath const& cachePath,
394 void _ResyncInstancer(
SdfPath const& instancerPath,
399 struct _ComputeInstanceMapFn;
400 VtIntArray _ComputeInstanceMap(
UsdPrim const& instancerPrim,
401 _InstancerData
const& instrData,
408 struct _ComputeInstanceMapVariabilityFn;
409 bool _ComputeInstanceMapVariability(
UsdPrim const& instancerPrim,
410 _InstancerData
const& instrData)
const;
414 _ProtoPrim
const& _GetProtoPrim(
SdfPath const& instancerPath,
420 bool _GetProtoPrimForChild(
423 _ProtoPrim
const** proto,
428 struct _ComputeInstanceTransformFn;
429 bool _ComputeInstanceTransforms(
UsdPrim const& instancer,
430 VtMatrix4dArray* transforms,
434 struct _GatherInstanceTransformTimeSamplesFn;
435 bool _GatherInstanceTransformsTimeSamples(
UsdPrim const& instancer,
437 std::vector<double>* outTimes)
441 struct _GatherInstancePrimvarTimeSamplesFn;
442 bool _GatherInstancePrimvarTimeSamples(
UsdPrim const& instancer,
445 std::vector<double>* outTimes)
450 struct _IsInstanceTransformVaryingFn;
451 bool _IsInstanceTransformVarying(
UsdPrim const& instancer)
const;
456 template<
typename T>
struct _ComputeInheritedPrimvarFn;
459 bool _ComputeInheritedPrimvar(
UsdPrim const& instancer,
464 bool _ComputeInheritedPrimvar(
UsdPrim const& instancer,
472 struct _IsInstanceInheritedPrimvarVaryingFn;
473 bool _IsInstanceInheritedPrimvarVarying(
UsdPrim const& instancer)
const;
475 struct _PopulateInstanceSelectionFn;
476 struct _GetScenePrimPathsFn;
477 struct _GetInstanceCategoriesFn;
506 template <
typename Functor>
507 void _RunForAllInstancesToDraw(
UsdPrim const& instancer, Functor* fn)
const;
508 template <
typename Functor>
509 bool _RunForAllInstancesToDrawImpl(
UsdPrim const& instancer,
510 std::vector<UsdPrim>* instanceContext,
515 size_t _CountAllInstancesToDraw(
UsdPrim const& instancer)
const;
516 size_t _CountAllInstancesToDrawImpl(
UsdPrim const& instancer,
537 struct _InstancerData {
538 _InstancerData() : numInstancesToDraw(0), refresh(false) { }
560 std::vector<PrimvarInfo> inheritedPrimvars;
571 mutable size_t numInstancesToDraw;
584 mutable std::vector<Visibility> visibility;
603 mutable bool refresh;
610 typedef std::unordered_map<SdfPath, _InstancerData, SdfPath::Hash>
612 _InstancerDataMap _instancerData;
619 _InstanceToInstancerMap;
620 _InstanceToInstancerMap _instanceToInstancerMap;
643 _PrototypeToInstancerMap;
644 _PrototypeToInstancerMap _prototypeToInstancerMap;
648 typedef std::unordered_map<SdfPath, SdfPath, SdfPath::Hash>
649 _ProtoPrimToInstancerMap;
650 _ProtoPrimToInstancerMap _protoPrimToInstancerMap;
656 #endif // PXR_USD_IMAGING_USD_IMAGING_INSTANCE_ADAPTER_H
bool GetVisible(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
PXL_API void reload()
Reload the configuration.
virtual void ProcessPrimRemoval(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
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.
HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvars(UsdPrim const &prim, SdfPath const &cachePath, HdInterpolation interpolation, const UsdImagingInstancerContext *instancerContext) const override
GT_API const UT_StringHolder time
virtual void MarkVisibilityDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
GLsizei const GLchar *const * string
virtual void ProcessPrimResync(SdfPath const &cachePath, UsdImagingIndexProxy *index) override
GLsizei const GLchar *const * path
std::vector< HdExtComputationInputDescriptor > HdExtComputationInputDescriptorVector
std::vector< VtArray< TfToken > > GetInstanceCategories(UsdPrim const &prim) override
Return an array of the categories used by each instance.
virtual void MarkRenderTagDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
VaryingRef< T > Varying(T *x)
std::vector< HdExtComputationOutputDescriptor > HdExtComputationOutputDescriptorVector
**But if you need a result
virtual SdfPath GetDataSharingId(SdfPath const &cachePath) const override
virtual void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=NULL) const override
virtual HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName) override
VtValue GetLightParamValue(const UsdPrim &prim, const SdfPath &cachePath, const TfToken ¶mName, UsdTimeCode time) const override
VtValue GetTopology(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
virtual SdfPathVector GetScenePrimPaths(SdfPath const &cachePath, std::vector< int > const &instanceIndices, std::vector< HdInstancerContext > *instancerCtxs) const override
SdfPathVector GetInstancerPrototypes(UsdPrim const &usdPrim, SdfPath const &cachePath) const override
Return the list of known prototypes of this prim.
std::vector< std::pair< SdfPath, int > > HdInstancerContext
Instancer context: a pair of instancer paths and instance indices.
virtual SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=nullptr) override
virtual bool IsInstancerAdapter() const 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
SdfPath GetMaterialId(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
The root transform provided by the delegate.
PxOsdSubdivTags GetSubdivTags(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
Get the subdiv tags for this prim.
std::string GetExtComputationKernel(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
virtual void MarkTransformDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
VtValue GetInstanceIndices(UsdPrim const &instancerPrim, SdfPath const &instancerCachePath, SdfPath const &prototypeCachePath, UsdTimeCode time) const override
virtual void MarkReprDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
GfMatrix4d GetInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time) const override
GfRange3d GetExtent(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const override
GLuint const GLchar * name
HighlightMode
Selection modes allow differentiation in selection highlight behavior.
std::vector< HdVolumeFieldDescriptor > HdVolumeFieldDescriptorVector
virtual void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=NULL) const override
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
virtual void MarkDirty(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index) override
std::set< class SdfPath > SdfPathSet
A set of SdfPaths.
virtual void MarkRefineLevelDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override
bool operator==(const PrimvarInfo &rhs) const
VtValue Get(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, VtIntArray *outIndices) const 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
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
GfMatrix4d GetTransform(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, bool ignoreRootTransform=false) const override
TfToken GetPurpose(UsdPrim const &usdPrim, SdfPath const &cachePath, TfToken const &instanceInheritablePurpose) const override
#define PXR_NAMESPACE_CLOSE_SCOPE
std::shared_ptr< UsdImagingPrimAdapter > UsdImagingPrimAdapterSharedPtr
virtual bool ShouldCullChildren() const override
HdExtComputationOutputDescriptorVector GetExtComputationOutputs(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
VtValue GetMaterialResource(const UsdPrim &prim, const SdfPath &cachePath, UsdTimeCode time) const override
The root transform provided by the delegate.
virtual HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(UsdPrim const &usdPrim, SdfPath const &id, UsdTimeCode time) const override
virtual void _RemovePrim(SdfPath const &cachePath, UsdImagingIndexProxy *index) overridefinal
Provides to paramName->UsdAttribute value mappings.
virtual ~UsdImagingInstanceAdapter()
virtual SdfPath GetScenePrimPath(SdfPath const &cachePath, int instanceIndex, HdInstancerContext *instancerContext) const override
virtual GfMatrix4d GetRelativeInstancerTransform(SdfPath const &parentInstancerPath, SdfPath const &instancerPath, UsdTimeCode time) const override
VtValue GetExtComputationInput(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &name, UsdTimeCode time, const UsdImagingInstancerContext *instancerContext) const override
UsdImagingInstanceAdapter()
bool operator<(const PrimvarInfo &rhs) const
SdfPath GetInstancerId(UsdPrim const &usdPrim, SdfPath const &cachePath) const override
Return the instancerId for this prim.
std::shared_ptr< class HdSelection > HdSelectionSharedPtr
size_t SampleInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override
bool GetDoubleSided(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
Reads double-sided from the given prim. If not authored, returns false.
HdCullStyle GetCullStyle(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time) const override
Gets the cullstyle of a specific path in the scene graph.
HdExtComputationInputDescriptorVector GetExtComputationInputs(UsdPrim const &prim, SdfPath const &cachePath, const UsdImagingInstancerContext *instancerContext) const override
std::vector< HdExtComputationPrimvarDescriptor > HdExtComputationPrimvarDescriptorVector
virtual void MarkCullStyleDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index) override