HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primAdapter.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_USD_IMAGING_USD_IMAGING_PRIM_ADAPTER_H
25 #define PXR_USD_IMAGING_USD_IMAGING_PRIM_ADAPTER_H
26 
27 /// \file usdImaging/primAdapter.h
28 
29 #include "pxr/pxr.h"
35 
37 #include "pxr/imaging/hd/texture.h"
39 #include "pxr/usd/usd/attribute.h"
40 #include "pxr/usd/usd/prim.h"
41 #include "pxr/usd/usd/timeCode.h"
42 
44 
45 #include "pxr/base/tf/type.h"
46 
47 #include <memory>
48 
50 
51 class UsdPrim;
52 
53 // Forward declaration for nested class.
54 class UsdImagingDelegate;
58 
60  std::shared_ptr<class UsdImagingPrimAdapter>;
61 
62 /// \class UsdImagingPrimAdapter
63 ///
64 /// Base class for all PrimAdapters.
65 ///
67  : public std::enable_shared_from_this<UsdImagingPrimAdapter> {
68 public:
69 
70  // ---------------------------------------------------------------------- //
71  /// \name Initialization
72  // ---------------------------------------------------------------------- //
73 
75  {}
76 
78  virtual ~UsdImagingPrimAdapter();
79 
80  /// Called to populate the RenderIndex for this UsdPrim. The adapter is
81  /// expected to create one or more prims in the render index using the
82  /// given proxy.
83  virtual SdfPath Populate(UsdPrim const& prim,
85  UsdImagingInstancerContext const* instancerContext = NULL) = 0;
86 
87  // Indicates whether population traversal should be pruned based on
88  // prim-specific features (like whether it's imageable).
90  static bool ShouldCullSubtree(UsdPrim const& prim);
91 
92  // Indicates whether population traversal should be pruned based on
93  // adapter-specific features (like whether the adapter is an instance
94  // adapter, and wants to do its own population).
96  virtual bool ShouldCullChildren() const;
97 
98  // Indicates the adapter is a multiplexing adapter (e.g. PointInstancer),
99  // potentially managing its children. This flag is used in nested
100  // instancer cases to determine which adapter is assigned to which prim.
102  virtual bool IsInstancerAdapter() const;
103 
104  // Indicates whether this adapter can populate a master prim. By policy,
105  // you can't directly instance a gprim, but you can directly instance proxy
106  // objects (like cards). Note: masters don't have attributes, so an adapter
107  // opting in here needs to check if prims it's populating are master prims,
108  // and if so find a copy of the instancing prim.
110  virtual bool CanPopulateMaster() const;
111 
112  // ---------------------------------------------------------------------- //
113  /// \name Parallel Setup and Resolve
114  // ---------------------------------------------------------------------- //
115 
116  /// For the given \p prim, variability is detected and
117  /// stored in \p timeVaryingBits. Initial values are cached into the value
118  /// cache.
119  ///
120  /// This method is expected to be called from multiple threads.
121  virtual void TrackVariability(UsdPrim const& prim,
122  SdfPath const& cachePath,
123  HdDirtyBits* timeVaryingBits,
125  instancerContext = NULL) const = 0;
126 
127  /// Populates the \p cache for the given \p prim, \p time and \p
128  /// requestedBits.
129  ///
130  /// This method is expected to be called from multiple threads.
131  virtual void UpdateForTime(UsdPrim const& prim,
132  SdfPath const& cachePath,
134  HdDirtyBits requestedBits,
136  instancerContext = NULL) const = 0;
137 
138  // ---------------------------------------------------------------------- //
139  /// \name Change Processing
140  // ---------------------------------------------------------------------- //
141 
142  /// Returns a bit mask of attributes to be updated, or
143  /// HdChangeTracker::AllDirty if the entire prim must be resynchronized.
144  ///
145  /// \p changedFields contains a list of changed scene description fields
146  /// for this prim. This may be empty in certain cases, like the addition
147  /// of an inert prim spec for the given \p prim.
148  ///
149  /// The default implementation returns HdChangeTracker::AllDirty if any of
150  /// the changed fields are plugin metadata fields, HdChangeTracker::Clean
151  /// otherwise.
153  virtual HdDirtyBits ProcessPrimChange(UsdPrim const& prim,
154  SdfPath const& cachePath,
155  TfTokenVector const& changedFields);
156 
157  /// Returns a bit mask of attributes to be updated, or
158  /// HdChangeTracker::AllDirty if the entire prim must be resynchronized.
159  virtual HdDirtyBits ProcessPropertyChange(UsdPrim const& prim,
160  SdfPath const& cachePath,
161  TfToken const& propertyName) = 0;
162 
163  /// When a PrimResync event occurs, the prim may have been deleted entirely,
164  /// adapter plug-ins should override this method to free any per-prim state
165  /// that was accumulated in the adapter.
167  virtual void ProcessPrimResync(SdfPath const& cachePath,
169 
170  /// Removes all associated Rprims and dependencies from the render index
171  /// without scheduling them for repopulation.
173  virtual void ProcessPrimRemoval(SdfPath const& cachePath,
175 
176 
177  virtual void MarkDirty(UsdPrim const& prim,
178  SdfPath const& cachePath,
179  HdDirtyBits dirty,
181 
183  virtual void MarkRefineLevelDirty(UsdPrim const& prim,
184  SdfPath const& cachePath,
186 
188  virtual void MarkReprDirty(UsdPrim const& prim,
189  SdfPath const& cachePath,
191 
193  virtual void MarkCullStyleDirty(UsdPrim const& prim,
194  SdfPath const& cachePath,
196 
198  virtual void MarkRenderTagDirty(UsdPrim const& prim,
199  SdfPath const& cachePath,
201 
203  virtual void MarkTransformDirty(UsdPrim const& prim,
204  SdfPath const& cachePath,
206 
208  virtual void MarkVisibilityDirty(UsdPrim const& prim,
209  SdfPath const& cachePath,
211 
213  virtual void MarkMaterialDirty(UsdPrim const& prim,
214  SdfPath const& cachePath,
216 
218  virtual void MarkWindowPolicyDirty(UsdPrim const& prim,
219  SdfPath const& cachePath,
221 
222  // ---------------------------------------------------------------------- //
223  /// \name Computations
224  // ---------------------------------------------------------------------- //
226  virtual void InvokeComputation(SdfPath const& computationPath,
228 
229  // ---------------------------------------------------------------------- //
230  /// \name Instancing
231  // ---------------------------------------------------------------------- //
232 
233  /// Return an array of the categories used by each instance.
235  virtual std::vector<VtArray<TfToken>>
236  GetInstanceCategories(UsdPrim const& prim);
237 
238  /// Sample the instancer transform for the given prim.
239  /// \see HdSceneDelegate::SampleInstancerTransform()
241  virtual size_t
242  SampleInstancerTransform(UsdPrim const& instancerPrim,
243  SdfPath const& instancerPath,
245  size_t maxNumSamples,
246  float *sampleTimes,
247  GfMatrix4d *sampleValues);
248 
249  /// Sample the primvar for the given prim.
250  /// \see HdSceneDelegate::SamplePrimvar()
252  virtual size_t
253  SamplePrimvar(UsdPrim const& usdPrim,
254  SdfPath const& cachePath,
255  TfToken const& key,
257  size_t maxNumSamples,
258  float *sampleTimes,
259  VtValue *sampleValues);
260 
261  /// Get the subdiv tags for this prim.
263  virtual PxOsdSubdivTags GetSubdivTags(UsdPrim const& usdPrim,
264  SdfPath const& cachePath,
265  UsdTimeCode time) const;
266 
267  // ---------------------------------------------------------------------- //
268  /// \name Nested instancing support
269  // ---------------------------------------------------------------------- //
270 
271  // NOTE: This method is currently only used by PointInstancer
272  // style instances, and not instanceable-references.
273 
274  /// Returns the transform of \p protoInstancerPath relative to
275  /// \p instancerPath. \p instancerPath must be managed by this
276  /// adapter.
279  SdfPath const &instancerPath,
280  SdfPath const &protoInstancerPath,
281  UsdTimeCode time) const;
282 
283  // ---------------------------------------------------------------------- //
284  /// \name Selection
285  // ---------------------------------------------------------------------- //
286 
288  virtual SdfPath GetScenePrimPath(SdfPath const& cachePath,
289  int instanceIndex,
290  HdInstancerContext *instancerCtx) const;
291 
292  // Add the given usdPrim to the HdSelection object, to mark it for
293  // selection highlighting. cachePath is the path of the object referencing
294  // this adapter.
295  //
296  // If an instance index is provided to Delegate::PopulateSelection, it's
297  // interpreted as a hydra instance index and left unchanged (to make
298  // picking/selection round-tripping work). Otherwise, instance adapters
299  // will build up a composite instance index range at each level.
300  //
301  // Consider:
302  // /World/A (2 instances)
303  // /B (2 instances)
304  // /C (gprim)
305  // ... to select /World/A, instance 0, you want to select cartesian
306  // coordinates (0, *) -> (0, 0) and (0, 1). The flattened representation
307  // of this is:
308  // index = coordinate[0] * instance_count[1] + coordinate[1]
309  // Likewise, for one more nesting level you get:
310  // index = c[0] * count[1] * count[2] + c[1] * count[2] + c[2]
311  // ... since the adapter for /World/A has no idea what count[1+] are,
312  // this needs to be built up. The delegate initially sets
313  // parentInstanceIndices to []. /World/A sets this to [0]. /World/A/B,
314  // since it is selecting *, adds all possible instance indices:
315  // 0 * 2 + 0 = 0, 0 * 2 + 1 = 1. /World/A/B/C is a gprim, and adds
316  // instances [0,1] to its selection.
318  virtual bool PopulateSelection(
319  HdSelection::HighlightMode const& highlightMode,
320  SdfPath const &cachePath,
321  UsdPrim const &usdPrim,
322  int const hydraInstanceIndex,
323  VtIntArray const &parentInstanceIndices,
324  HdSelectionSharedPtr const &result) const;
325 
326  // ---------------------------------------------------------------------- //
327  /// \name Texture resources
328  // ---------------------------------------------------------------------- //
329 
331  virtual HdTextureResource::ID
332  GetTextureResourceID(UsdPrim const& usdPrim, SdfPath const &id,
333  UsdTimeCode time, size_t salt) const;
334 
337  GetTextureResource(UsdPrim const& usdPrim, SdfPath const &id,
338  UsdTimeCode time) const;
339 
340  // ---------------------------------------------------------------------- //
341  /// \name Volume field information
342  // ---------------------------------------------------------------------- //
343 
346  GetVolumeFieldDescriptors(UsdPrim const& usdPrim, SdfPath const &id,
347  UsdTimeCode time) const;
348 
349  // ---------------------------------------------------------------------- //
350  /// \name Utilities
351  // ---------------------------------------------------------------------- //
352 
353  /// The root transform provided by the delegate.
356 
357  /// A thread-local XformCache provided by the delegate.
359  void SetDelegate(UsdImagingDelegate* delegate);
360 
362  bool IsChildPath(SdfPath const& path) const;
363 
364  /// Returns true if the given prim is visible, taking into account inherited
365  /// visibility values. Inherited values are strongest, Usd has no notion of
366  /// "super vis/invis".
368  bool GetVisible(UsdPrim const& prim, UsdTimeCode time) const;
369 
370  /// Returns the purpose token for \p prim. If an \p instancerContext is
371  /// provided and the prim doesn't have an explicitly authored or inherited
372  /// purpose, it may inherit the instancerContext's purpose if the instance
373  /// has an explicit purpose.
376  UsdPrim const& prim,
377  UsdImagingInstancerContext const* instancerContext) const;
378 
379  /// Returns the purpose token for \p prim, but only if it is inheritable
380  /// by child prims (i.e. it is an explicitly authored purpose on the prim
381  /// itself or one of the prim's ancestors), otherwise it returns the empty
382  /// token.
384  TfToken GetInheritablePurpose(UsdPrim const& prim) const;
385 
386  /// Fetches the transform for the given prim at the given time from a
387  /// pre-computed cache of prim transforms. Requesting transforms at
388  /// incoherent times is currently inefficient.
391  bool ignoreRootTransform = false) const;
392 
393  /// Samples the transform for the given prim.
395  virtual size_t
396  SampleTransform(UsdPrim const& prim,
397  SdfPath const& cachePath,
399  size_t maxNumSamples,
400  float *sampleTimes,
401  GfMatrix4d *sampleValues);
402 
403  /// Gets the material path for the given prim, walking up namespace if
404  /// necessary.
406  SdfPath GetMaterialUsdPath(UsdPrim const& prim) const;
407 
408  /// Gets the model:drawMode attribute for the given prim, walking up
409  /// the namespace if necessary.
411  TfToken GetModelDrawMode(UsdPrim const& prim);
412 
413  /// Computes the per-prototype instance indices for a UsdGeomPointInstancer.
414  /// XXX: This needs to be defined on the base class, to have access to the
415  /// delegate, but it's a clear violation of abstraction. This call is only
416  /// legal for prims of type UsdGeomPointInstancer; in other cases, the
417  /// returned array will be empty and the computation will issue errors.
420  UsdTimeCode time) const;
421 
422  // ---------------------------------------------------------------------- //
423  /// \name Render Index Compatibility
424  // ---------------------------------------------------------------------- //
425 
426  /// Returns true if the adapter can be populated into the target index.
427  virtual bool IsSupported(UsdImagingIndexProxy const* index) const {
428  return true;
429  }
430 
431 protected:
433 
434  template <typename T>
435  T _Get(UsdPrim const& prim, TfToken const& attrToken,
436  UsdTimeCode time) const {
437  T value;
438  prim.GetAttribute(attrToken).Get<T>(&value, time);
439  return value;
440  }
441 
442  template <typename T>
443  void _GetPtr(UsdPrim const& prim, TfToken const& key, UsdTimeCode time,
444  T* out) const {
445  prim.GetAttribute(key).Get<T>(out, time);
446  }
447 
450 
452  UsdPrim _GetPrim(SdfPath const& usdPath) const;
453 
454  // Returns the prim adapter for the given \p prim, or an invalid pointer if
455  // no adapter exists. If \p prim is an instance and \p ignoreInstancing
456  // is \c true, the instancing adapter will be ignored and an adapter will
457  // be looked up based on \p prim's type.
460  _GetPrimAdapter(UsdPrim const& prim, bool ignoreInstancing = false) const;
461 
464  _GetAdapter(TfToken const& adapterKey) const;
465 
466  // XXX: Transitional API
467  // Returns the instance proxy prim path for a USD-instanced prim, given the
468  // instance chain leading to that prim. The paths are sorted from more to
469  // less local; the first path is the prim path (possibly in master), then
470  // instance paths (possibly in master); the last path is the prim or
471  // instance path in the scene.
474  SdfPathVector const& instancerChain) const;
475 
478 
479  // Converts \p cachePath to the path in the render index.
481  SdfPath _ConvertCachePathToIndexPath(SdfPath const& cachePath) const;
482 
483  // Converts \p indexPath to the path in the USD stage
485  SdfPath _ConvertIndexPathToCachePath(SdfPath const& indexPath) const;
486 
487  // Returns the material binding purpose from the renderer delegate.
490 
491  // Returns the material context from the renderer delegate.
494 
495  // Returns true if render delegate wants primvars to be filtered based.
496  // This will filter the primvars based on the bound material primvar needs.
498  bool _IsPrimvarFilteringNeeded() const;
499 
500  // Returns the shader source type from the render delegate.
503 
504  // Returns \c true if \p usdPath is included in the scene delegate's
505  // invised path list.
507  bool _IsInInvisedPaths(SdfPath const& usdPath) const;
508 
509  // Determines if an attribute is varying and if so, sets the given
510  // \p dirtyFlag in the \p dirtyFlags and increments a perf counter. Returns
511  // true if the attribute is varying.
512  //
513  // If \p exists is non-null, _IsVarying will store whether the attribute
514  // was found. If the attribute is not found, it counts as non-varying.
515  //
516  // This only sets the dirty bit, never un-sets. The caller is responsible
517  // for setting the initial state correctly.
519  bool _IsVarying(UsdPrim prim, TfToken const& attrName,
520  HdDirtyBits dirtyFlag, TfToken const& perfToken,
521  HdDirtyBits* dirtyFlags, bool isInherited,
522  bool* exists = nullptr) const;
523 
524  // Determines if the prim's transform (CTM) is varying and if so, sets the
525  // given \p dirtyFlag in the \p dirtyFlags and increments a perf counter.
526  // Returns true if the prim's transform is varying.
527  //
528  // This only sets the dirty bit, never un-sets. The caller is responsible
529  // for setting the initial state correctly.
531  bool _IsTransformVarying(UsdPrim prim,
532  HdDirtyBits dirtyFlag,
533  TfToken const& perfToken,
534  HdDirtyBits* dirtyFlags) const;
535 
536  // Convenience method for adding or updating a primvar descriptor.
537  // Role defaults to empty token (none).
539  void _MergePrimvar(
541  TfToken const& name,
543  TfToken const& role = TfToken()) const;
544 
545  // Convenience method for removing a primvar descriptor.
547  void _RemovePrimvar(
549  TfToken const& name) const;
550 
551  // Convenience method for computing a primvar. THe primvar will only be
552  // added to the list in the valueCache if there is no primvar of the same
553  // name already present. Thus, "local" primvars should be merged before
554  // inherited primvars.
556  void _ComputeAndMergePrimvar(UsdPrim const& prim,
557  SdfPath const& cachePath,
558  UsdGeomPrimvar const& primvar,
560  UsdImagingValueCache* valueCache,
561  HdInterpolation *interpOverride = nullptr)
562  const;
563 
564  // Returns true if the property name has the "primvars:" prefix.
566  static bool _HasPrimvarsPrefix(TfToken const& propertyName);
567 
568  // Convenience methods to figure out what changed about the primvar and
569  // return the appropriate dirty bit.
570  // Caller can optionally pass in a dirty bit to set for primvar value
571  // changes. This is useful for attributes that have a special dirty bit
572  // such as normals and widths.
573  //
574  // Handle USD attributes that are treated as primvars by Hydra. This
575  // requires the interpolation to be passed in, as well as the primvar
576  // name passed to Hydra.
579  UsdPrim const& prim,
580  SdfPath const& cachePath,
581  TfToken const& propertyName,
582  TfToken const& primvarName,
583  HdInterpolation const& primvarInterp,
584  HdDirtyBits valueChangeDirtyBit = HdChangeTracker::DirtyPrimvar) const;
585 
586  // Handle UsdGeomPrimvars that use the "primvars:" prefix, while also
587  // accommodating inheritance.
590  UsdPrim const& prim,
591  SdfPath const& cachePath,
592  TfToken const& propertyName,
593  HdDirtyBits valueChangeDirtyBit = HdChangeTracker::DirtyPrimvar,
594  bool inherited = true) const;
595 
596  virtual void _RemovePrim(SdfPath const& cachePath,
598 
601 
604  _GetCoordSysBindings(UsdPrim const& prim) const;
605 
608  _GetInheritedPrimvars(UsdPrim const& prim) const;
609 
612 
615 
617  bool _DoesDelegateSupportCoordSys() const;
618 
619  // Conversion functions between usd and hydra enums.
621  static HdInterpolation _UsdToHdInterpolation(TfToken const& usdInterp);
623  static TfToken _UsdToHdRole(TfToken const& usdRole);
624 
625 private:
626  UsdImagingDelegate* _delegate;
627 };
628 
630 public:
631  virtual UsdImagingPrimAdapterSharedPtr New() const = 0;
632 };
633 
634 template <class T>
636 public:
638  {
639  return std::make_shared<T>();
640  }
641 };
642 
643 
645 
646 #endif // PXR_USD_IMAGING_USD_IMAGING_PRIM_ADAPTER_H
static USDIMAGING_API bool _HasPrimvarsPrefix(TfToken const &propertyName)
Returns true if the adapter can be populated into the target index.
virtual HdDirtyBits ProcessPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName)=0
virtual USDIMAGING_API PxOsdSubdivTags GetSubdivTags(UsdPrim const &usdPrim, SdfPath const &cachePath, UsdTimeCode time) const
Get the subdiv tags for this prim.
std::shared_ptr< class HdTextureResource > HdTextureResourceSharedPtr
GLuint const GLchar * name
Definition: glew.h:1814
UsdImagingValueCache::Key Keys
Returns true if the adapter can be populated into the target index.
Definition: primAdapter.h:432
virtual UsdImagingPrimAdapterSharedPtr New() const =0
bool Get(T *value, UsdTimeCode time=UsdTimeCode::Default()) const
Definition: attribute.h:431
#define USDIMAGING_API
Definition: api.h:40
T _Get(UsdPrim const &prim, TfToken const &attrToken, UsdTimeCode time) const
Returns true if the adapter can be populated into the target index.
Definition: primAdapter.h:435
USDIMAGING_API bool IsChildPath(SdfPath const &path) const
The root transform provided by the delegate.
virtual USDIMAGING_API bool CanPopulateMaster() const
USDIMAGING_API void SetDelegate(UsdImagingDelegate *delegate)
A thread-local XformCache provided by the delegate.
USDIMAGING_API VtArray< VtIntArray > GetPerPrototypeIndices(UsdPrim const &prim, UsdTimeCode time) const
GT_API const UT_StringHolder time
GLuint index
Definition: glew.h:1814
virtual USDIMAGING_API size_t SampleTransform(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, GfMatrix4d *sampleValues)
Samples the transform for the given prim.
uint32_t HdDirtyBits
Definition: types.h:127
USDIMAGING_API UsdImaging_InheritedPrimvarStrategy::value_type _GetInheritedPrimvars(UsdPrim const &prim) const
Returns true if the adapter can be populated into the target index.
OIIO_API bool exists(const std::string &path)
USDIMAGING_API GfMatrix4d GetTransform(UsdPrim const &prim, UsdTimeCode time, bool ignoreRootTransform=false) const
USDIMAGING_API SdfPath GetMaterialUsdPath(UsdPrim const &prim) const
virtual USDIMAGING_API void MarkRenderTagDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
USDIMAGING_API UsdPrim _GetPrim(SdfPath const &usdPath) const
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API void MarkVisibilityDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
USDIMAGING_API bool _IsTransformVarying(UsdPrim prim, HdDirtyBits dirtyFlag, TfToken const &perfToken, HdDirtyBits *dirtyFlags) const
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API HdTextureResource::ID GetTextureResourceID(UsdPrim const &usdPrim, SdfPath const &id, UsdTimeCode time, size_t salt) const
USDIMAGING_API HdDirtyBits _ProcessPrefixedPrimvarPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName, HdDirtyBits valueChangeDirtyBit=HdChangeTracker::DirtyPrimvar, bool inherited=true) const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API UsdImaging_CollectionCache & _GetCollectionCache() const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API Usd_PrimFlagsConjunction _GetDisplayPredicate() const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API SdfPath _ConvertCachePathToIndexPath(SdfPath const &cachePath) const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API const UsdImagingPrimAdapterSharedPtr & _GetAdapter(TfToken const &adapterKey) const
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API bool ShouldCullChildren() const
virtual USDIMAGING_API void ProcessPrimResync(SdfPath const &cachePath, UsdImagingIndexProxy *index)
USDIMAGING_API bool GetVisible(UsdPrim const &prim, UsdTimeCode time) const
USDIMAGING_API bool _IsPrimvarFilteringNeeded() const
Returns true if the adapter can be populated into the target index.
Base class of all factory types.
Definition: type.h:73
std::vector< std::pair< SdfPath, int > > HdInstancerContext
Instancer context: a pair of instancer paths and instance indices.
Definition: sceneDelegate.h:61
GLuint interp
Definition: glew.h:8277
USDIMAGING_API bool _IsInInvisedPaths(SdfPath const &usdPath) const
Returns true if the adapter can be populated into the target index.
virtual void _RemovePrim(SdfPath const &cachePath, UsdImagingIndexProxy *index)=0
Returns true if the adapter can be populated into the target index.
USDIMAGING_API void _RemovePrimvar(HdPrimvarDescriptorVector *vec, TfToken const &name) const
Returns true if the adapter can be populated into the target index.
Definition: token.h:87
static USDIMAGING_API HdInterpolation _UsdToHdInterpolation(TfToken const &usdInterp)
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API HdTextureResourceSharedPtr GetTextureResource(UsdPrim const &usdPrim, SdfPath const &id, UsdTimeCode time) const
USDIMAGING_API void _ComputeAndMergePrimvar(UsdPrim const &prim, SdfPath const &cachePath, UsdGeomPrimvar const &primvar, UsdTimeCode time, UsdImagingValueCache *valueCache, HdInterpolation *interpOverride=nullptr) const
Returns true if the adapter can be populated into the target index.
static USDIMAGING_API TfToken _UsdToHdRole(TfToken const &usdRole)
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API std::vector< VtArray< TfToken > > GetInstanceCategories(UsdPrim const &prim)
Return an array of the categories used by each instance.
virtual SdfPath Populate(UsdPrim const &prim, UsdImagingIndexProxy *index, UsdImagingInstancerContext const *instancerContext=NULL)=0
virtual USDIMAGING_API void MarkWindowPolicyDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
virtual USDIMAGING_API void MarkReprDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
virtual void UpdateForTime(UsdPrim const &prim, SdfPath const &cachePath, UsdTimeCode time, HdDirtyBits requestedBits, UsdImagingInstancerContext const *instancerContext=NULL) const =0
USDIMAGING_API TfToken _GetMaterialBindingPurpose() const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API const UsdImagingPrimAdapterSharedPtr & _GetPrimAdapter(UsdPrim const &prim, bool ignoreInstancing=false) const
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API void MarkCullStyleDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
USDIMAGING_API bool _IsVarying(UsdPrim prim, TfToken const &attrName, HdDirtyBits dirtyFlag, TfToken const &perfToken, HdDirtyBits *dirtyFlags, bool isInherited, bool *exists=nullptr) const
Returns true if the adapter can be populated into the target index.
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:446
static USDIMAGING_API bool ShouldCullSubtree(UsdPrim const &prim)
USDIMAGING_API TfToken GetPurpose(UsdPrim const &prim, UsdImagingInstancerContext const *instancerContext) const
Definition: types.h:166
HighlightMode
Selection modes allow differentiation in selection highlight behavior.
Definition: selection.h:55
Definition: path.h:288
std::vector< HdVolumeFieldDescriptor > HdVolumeFieldDescriptorVector
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:209
virtual USDIMAGING_API ~UsdImagingPrimAdapter()
USDIMAGING_API UsdTimeCode _GetTimeWithOffset(float offset) const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API TfToken _GetMaterialNetworkSelector() const
Returns true if the adapter can be populated into the target index.
GLsizei const GLchar *const * path
Definition: glew.h:6461
virtual USDIMAGING_API bool IsInstancerAdapter() const
USDIMAGING_API SdfPath _ConvertIndexPathToCachePath(SdfPath const &indexPath) const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API TfToken GetModelDrawMode(UsdPrim const &prim)
virtual void MarkDirty(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits dirty, UsdImagingIndexProxy *index)=0
virtual USDIMAGING_API GfMatrix4d GetRelativeInstancerTransform(SdfPath const &instancerPath, SdfPath const &protoInstancerPath, UsdTimeCode time) const
USDIMAGING_API void _MergePrimvar(HdPrimvarDescriptorVector *vec, TfToken const &name, HdInterpolation interp, TfToken const &role=TfToken()) const
Returns true if the adapter can be populated into the target index.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1346
USDIMAGING_API TfToken GetInheritablePurpose(UsdPrim const &prim) const
USDIMAGING_API SdfPath _GetPrimPathFromInstancerChain(SdfPathVector const &instancerChain) const
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API void MarkMaterialDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
virtual USDIMAGING_API void ProcessPrimRemoval(SdfPath const &cachePath, UsdImagingIndexProxy *index)
virtual USDIMAGING_API HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(UsdPrim const &usdPrim, SdfPath const &id, UsdTimeCode time) const
void _GetPtr(UsdPrim const &prim, TfToken const &key, UsdTimeCode time, T *out) const
Returns true if the adapter can be populated into the target index.
Definition: primAdapter.h:443
virtual USDIMAGING_API size_t SampleInstancerTransform(UsdPrim const &instancerPrim, SdfPath const &instancerPath, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, GfMatrix4d *sampleValues)
HdInterpolation
Definition: enums.h:194
USDIMAGING_API GfMatrix4d GetRootTransform() const
The root transform provided by the delegate.
USDIMAGING_API GfInterval _GetCurrentTimeSamplingInterval()
Returns true if the adapter can be populated into the target index.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
USDIMAGING_API UsdImaging_CoordSysBindingStrategy::value_type _GetCoordSysBindings(UsdPrim const &prim) const
Returns true if the adapter can be populated into the target index.
std::shared_ptr< UsdImagingPrimAdapter > UsdImagingPrimAdapterSharedPtr
virtual USDIMAGING_API void MarkRefineLevelDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
virtual bool IsSupported(UsdImagingIndexProxy const *index) const
Returns true if the adapter can be populated into the target index.
Definition: primAdapter.h:427
GLuint64EXT * result
Definition: glew.h:14007
virtual USDIMAGING_API size_t SamplePrimvar(UsdPrim const &usdPrim, SdfPath const &cachePath, TfToken const &key, UsdTimeCode time, size_t maxNumSamples, float *sampleTimes, VtValue *sampleValues)
std::shared_ptr< PrimvarRecord > value_type
virtual USDIMAGING_API HdDirtyBits ProcessPrimChange(UsdPrim const &prim, SdfPath const &cachePath, TfTokenVector const &changedFields)
virtual USDIMAGING_API void MarkTransformDirty(UsdPrim const &prim, SdfPath const &cachePath, UsdImagingIndexProxy *index)
virtual UsdImagingPrimAdapterSharedPtr New() const
Definition: primAdapter.h:637
std::vector< HdPrimvarDescriptor > HdPrimvarDescriptorVector
virtual USDIMAGING_API SdfPath GetScenePrimPath(SdfPath const &cachePath, int instanceIndex, HdInstancerContext *instancerCtx) const
USDIMAGING_API HdDirtyBits _ProcessNonPrefixedPrimvarPropertyChange(UsdPrim const &prim, SdfPath const &cachePath, TfToken const &propertyName, TfToken const &primvarName, HdInterpolation const &primvarInterp, HdDirtyBits valueChangeDirtyBit=HdChangeTracker::DirtyPrimvar) const
Returns true if the adapter can be populated into the target index.
std::shared_ptr< class HdSelection > HdSelectionSharedPtr
Definition: selection.h:40
USD_API UsdAttribute GetAttribute(const TfToken &attrName) const
GLsizei const GLfloat * value
Definition: glew.h:1849
virtual void TrackVariability(UsdPrim const &prim, SdfPath const &cachePath, HdDirtyBits *timeVaryingBits, UsdImagingInstancerContext const *instancerContext=NULL) const =0
USDIMAGING_API TfTokenVector _GetShaderSourceTypes() const
Returns true if the adapter can be populated into the target index.
USDIMAGING_API UsdImagingValueCache * _GetValueCache() const
Returns true if the adapter can be populated into the target index.
Definition: value.h:174
virtual USDIMAGING_API void InvokeComputation(SdfPath const &computationPath, HdExtComputationContext *context)
USDIMAGING_API bool _DoesDelegateSupportCoordSys() const
Returns true if the adapter can be populated into the target index.
virtual USDIMAGING_API bool PopulateSelection(HdSelection::HighlightMode const &highlightMode, SdfPath const &cachePath, UsdPrim const &usdPrim, int const hydraInstanceIndex, VtIntArray const &parentInstanceIndices, HdSelectionSharedPtr const &result) const
GLintptr offset
Definition: glew.h:1682