HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bboxCache.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_USD_GEOM_BBOX_CACHE_H
25 #define PXR_USD_USD_GEOM_BBOX_CACHE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/usdGeom/api.h"
32 #include "pxr/base/gf/bbox3d.h"
33 #include "pxr/base/tf/hash.h"
34 #include "pxr/base/tf/hashmap.h"
36 
37 #include <optional>
38 
40 
41 
42 class UsdGeomModelAPI;
43 
44 /// \class UsdGeomBBoxCache
45 ///
46 /// Caches bounds by recursively computing and aggregating bounds of children in
47 /// world space and aggregating the result back into local space.
48 ///
49 /// The cache is configured for a specific time and
50 /// \ref UsdGeomImageable::GetPurposeAttr() set of purposes. When querying a
51 /// bound, transforms and extents are read either from the time specified or
52 /// UsdTimeCode::Default(), following \ref Usd_ValueResolution standard
53 /// time-sample value resolution. As noted in SetIncludedPurposes(), changing
54 /// the included purposes does not invalidate the cache, because we cache
55 /// purpose along with the geometric data.
56 ///
57 /// Child prims that are invisible at the requested time are excluded when
58 /// computing a prim's bounds. However, if a bound is requested directly for an
59 /// excluded prim, it will be computed. Additionally, only prims deriving from
60 /// UsdGeomImageable are included in child bounds computations.
61 ///
62 /// Unlike standard UsdStage traversals, the traversal performed by the
63 /// UsdGeomBBoxCache includes prims that are unloaded (see UsdPrim::IsLoaded()).
64 /// This makes it possible to fetch bounds for a UsdStage that has been opened
65 /// without \em forcePopulate , provided the unloaded model prims have authored
66 /// extent hints (see UsdGeomModelAPI::GetExtentsHint()).
67 ///
68 /// This class is optimized for computing tight <b>untransformed "object"
69 /// space</b> bounds for component-models. In the absence of component models,
70 /// bounds are optimized for world-space, since there is no other easily
71 /// identifiable space for which to optimize, and we cannot optimize for every
72 /// prim's local space without performing quadratic work.
73 ///
74 /// The TfDebug flag, USDGEOM_BBOX, is provided for debugging.
75 ///
76 /// Warnings:
77 /// * This class should only be used with valid UsdPrim objects.
78 ///
79 /// * This cache does not listen for change notifications; the user is
80 /// responsible for clearing the cache when changes occur.
81 ///
82 /// * Thread safety: instances of this class may not be used concurrently.
83 ///
84 /// * Plugins may be loaded in order to compute extents for prim types provided
85 /// by that plugin. See UsdGeomBoundable::ComputeExtentFromPlugins
86 ///
88 {
89 public:
90  /// Construct a new BBoxCache for a specific \p time and set of
91  /// \p includedPurposes.
92  ///
93  /// Only prims with a purpose that matches the \p includedPurposes will be
94  /// considered when accumulating child bounds. See UsdGeomImageable for
95  /// allowed purpose values.
96  ///
97  /// If \p useExtentsHint is true, then when computing the bounds for any
98  /// model-root prim, if the prim is visible at \p time, we will fetch its
99  /// extents hint (via UsdGeomModelAPI::GetExtentsHint()). If it is authored,
100  /// we use it to compute the bounding box for the selected combination of
101  /// includedPurposes by combining bounding box hints that have been cached
102  /// for various values of purposes.
103  ///
104  /// If \p ignoreVisibility is true invisible prims will be included during
105  /// bounds computations.
106  ///
109  bool useExtentsHint=false, bool ignoreVisibility=false);
110 
111  /// Copy constructor.
113  UsdGeomBBoxCache(UsdGeomBBoxCache const &other);
114 
115  /// Copy assignment.
117  UsdGeomBBoxCache &operator=(UsdGeomBBoxCache const &other);
118 
119  /// Compute the bound of the given prim in world space, leveraging any
120  /// pre-existing, cached bounds.
121  ///
122  /// The bound of the prim is computed, including the transform (if any)
123  /// authored on the node itself, and then transformed to world space.
124  ///
125  /// Error handling note: No checking of \p prim validity is performed. If
126  /// \p prim is invalid, this method will abort the program; therefore it is
127  /// the client's responsibility to ensure \p prim is valid.
129  GfBBox3d ComputeWorldBound(const UsdPrim& prim);
130 
131  /// Computes the bound of the prim's descendents in world space while
132  /// excluding the subtrees rooted at the paths in \p pathsToSkip.
133  ///
134  /// Additionally, the parameter \p primOverride overrides the local-to-world
135  /// transform of the prim and \p ctmOverrides is used to specify overrides
136  /// the local-to-world transforms of certain paths underneath the prim.
137  ///
138  /// This leverages any pre-existing, cached bounds, but does not include the
139  /// transform (if any) authored on the prim itself.
140  ///
141  /// See ComputeWorldBound() for notes on performance and error handling.
144  const UsdPrim &prim,
145  const SdfPathSet &pathsToSkip,
146  const GfMatrix4d &primOverride,
148 
149 
150  /// Compute the bound of the given prim in the space of an ancestor prim,
151  /// \p relativeToAncestorPrim, leveraging any pre-existing cached bounds.
152  ///
153  /// The computed bound excludes the local transform at
154  /// \p relativeToAncestorPrim. The computed bound may be incorrect if
155  /// \p relativeToAncestorPrim is not an ancestor of \p prim.
156  ///
159  const UsdPrim &relativeToAncestorPrim);
160 
161  /// Computes the oriented bounding box of the given prim, leveraging any
162  /// pre-existing, cached bounds.
163  ///
164  /// The computed bound includes the transform authored on the prim itself,
165  /// but does not include any ancestor transforms (it does not include the
166  /// local-to-world transform).
167  ///
168  /// See ComputeWorldBound() for notes on performance and error handling.
170  GfBBox3d ComputeLocalBound(const UsdPrim& prim);
171 
172  /// Computes the bound of the prim's children leveraging any pre-existing,
173  /// cached bounds, but does not include the transform (if any) authored on
174  /// the prim itself.
175  ///
176  /// \b IMPORTANT: while the BBox does not contain the local transformation,
177  /// in general it may still contain a non-identity transformation matrix to
178  /// put the bounds in the correct space. Therefore, to obtain the correct
179  /// axis-aligned bounding box, the client must call ComputeAlignedRange().
180  ///
181  /// See ComputeWorldBound() for notes on performance and error handling.
184 
185  /// \overload
186  /// Computes the bound of the prim's descendents while excluding the
187  /// subtrees rooted at the paths in \p pathsToSkip. Additionally, the
188  /// parameter \p ctmOverrides is used to specify overrides to the CTM values
189  /// of certain paths underneath the prim. The CTM values in the
190  /// \p ctmOverrides map are in the space of the given prim, \p prim.
191  ///
192  /// This leverages any pre-existing, cached bounds, but does not include the
193  /// transform (if any) authored on the prim itself.
194  ///
195  /// \b IMPORTANT: while the BBox does not contain the local transformation,
196  /// in general it may still contain a non-identity transformation matrix to
197  /// put the bounds in the correct space. Therefore, to obtain the correct
198  /// axis-aligned bounding box, the client must call ComputeAlignedRange().
199  ///
200  /// See ComputeWorldBound() for notes on performance and error handling.
203  const UsdPrim &prim,
204  const SdfPathSet &pathsToSkip,
206 
207  /// Compute the bound of the given point instances in world space.
208  ///
209  /// The bounds of each instance is computed and then transformed to world
210  /// space. The \p result pointer must point to \p numIds GfBBox3d instances
211  /// to be filled.
213  bool
215  const UsdGeomPointInstancer& instancer,
216  int64_t const *instanceIdBegin,
217  size_t numIds,
218  GfBBox3d *result);
219 
220  /// Compute the bound of the given point instance in world space.
221  ///
222  GfBBox3d
224  const UsdGeomPointInstancer& instancer, int64_t instanceId) {
225  GfBBox3d ret;
226  ComputePointInstanceWorldBounds(instancer, &instanceId, 1, &ret);
227  return ret;
228  }
229 
230  /// Compute the bounds of the given point instances in the space of an
231  /// ancestor prim \p relativeToAncestorPrim. Write the results to
232  /// \p result.
233  ///
234  /// The computed bound excludes the local transform at
235  /// \p relativeToAncestorPrim. The computed bound may be incorrect if
236  /// \p relativeToAncestorPrim is not an ancestor of \p prim.
237  ///
238  /// The \p result pointer must point to \p numIds GfBBox3d instances to be
239  /// filled.
241  bool
243  const UsdGeomPointInstancer &instancer,
244  int64_t const *instanceIdBegin,
245  size_t numIds,
246  const UsdPrim &relativeToAncestorPrim,
247  GfBBox3d *result);
248 
249  /// Compute the bound of the given point instance in the space of an
250  /// ancestor prim \p relativeToAncestorPrim.
251  GfBBox3d
253  const UsdGeomPointInstancer &instancer,
254  int64_t instanceId,
255  const UsdPrim &relativeToAncestorPrim) {
256  GfBBox3d ret;
258  instancer, &instanceId, 1, relativeToAncestorPrim, &ret);
259  return ret;
260  }
261 
262  /// Compute the oriented bounding boxes of the given point instances.
263  ///
264  /// The computed bounds include the transform authored on the instancer
265  /// itself, but does not include any ancestor transforms (it does not
266  /// include the local-to-world transform).
267  ///
268  /// The \p result pointer must point to \p numIds GfBBox3d instances to be
269  /// filled.
271  bool
273  const UsdGeomPointInstancer& instancer,
274  int64_t const *instanceIdBegin,
275  size_t numIds,
276  GfBBox3d *result);
277 
278  /// Compute the oriented bounding boxes of the given point instances.
279  GfBBox3d
281  const UsdGeomPointInstancer& instancer,
282  int64_t instanceId) {
283  GfBBox3d ret;
284  ComputePointInstanceLocalBounds(instancer, &instanceId, 1, &ret);
285  return ret;
286  }
287 
288 
289  /// Computes the bound of the given point instances, but does not include
290  /// the transform (if any) authored on the instancer itself.
291  ///
292  /// \b IMPORTANT: while the BBox does not contain the local transformation,
293  /// in general it may still contain a non-identity transformation matrix to
294  /// put the bounds in the correct space. Therefore, to obtain the correct
295  /// axis-aligned bounding box, the client must call ComputeAlignedRange().
296  ///
297  /// The \p result pointer must point to \p numIds GfBBox3d instances to be
298  /// filled.
300  bool
302  const UsdGeomPointInstancer& instancer,
303  int64_t const *instanceIdBegin,
304  size_t numIds,
305  GfBBox3d *result);
306 
307  /// Computes the bound of the given point instances, but does not include
308  /// the instancer's transform.
309  GfBBox3d
311  const UsdGeomPointInstancer& instancer,
312  int64_t instanceId) {
313  GfBBox3d ret;
315  instancer, &instanceId, 1, &ret);
316  return ret;
317  }
318 
319  /// Clears all pre-cached values.
321  void Clear();
322 
323  /// Indicate the set of \p includedPurposes to use when resolving child
324  /// bounds. Each child's purpose must match one of the elements of this set
325  /// to be included in the computation; if it does not, child is excluded.
326  ///
327  /// Note the use of *child* in the docs above, purpose is ignored for the
328  /// prim for whose bounds are directly queried.
329  ///
330  /// Changing this value <b>does not invalidate existing caches</b>.
332  void SetIncludedPurposes(const TfTokenVector& includedPurposes);
333 
334  /// Get the current set of included purposes.
335  const TfTokenVector& GetIncludedPurposes() { return _includedPurposes; }
336 
337  /// Returns whether authored extent hints are used to compute
338  /// bounding boxes.
339  bool GetUseExtentsHint() const {
340  return _useExtentsHint;
341  }
342 
343  /// Returns whether prim visibility should be ignored when computing
344  /// bounding boxes.
345  bool GetIgnoreVisibility() const {
346  return _ignoreVisibility;
347  }
348 
349  /// Use the new \p time when computing values and may clear any existing
350  /// values cached for the previous time. Setting \p time to the current time
351  /// is a no-op.
353  void SetTime(UsdTimeCode time);
354 
355  /// Get the current time from which this cache is reading values.
356  UsdTimeCode GetTime() const { return _time; }
357 
358  /// Set the base time value for this bbox cache. This value is used only
359  /// when computing bboxes for point instancer instances (see
360  /// ComputePointInstanceWorldBounds(), for example). See
361  /// UsdGeomPointInstancer::ComputeExtentAtTime() for more information. If
362  /// unset, the bbox cache uses its time (GetTime() / SetTime()) for this
363  /// value.
364  ///
365  /// Note that setting the base time does not invalidate any cache entries.
366  void SetBaseTime(UsdTimeCode baseTime) {
367  _baseTime = baseTime;
368  }
369 
370  /// Return the base time if set, otherwise GetTime(). Use HasBaseTime() to
371  /// observe if a base time has been set.
373  return _baseTime.value_or(GetTime());
374  }
375 
376  /// Clear this cache's baseTime if one has been set. After calling this,
377  /// the cache will use its time as the baseTime value.
378  void ClearBaseTime() {
379  _baseTime = std::nullopt;
380  }
381 
382  /// Return true if this cache has a baseTime that's been explicitly set,
383  /// false otherwise.
384  bool HasBaseTime() const {
385  return static_cast<bool>(_baseTime);
386  }
387 
388 private:
389  // Worker task.
390  class _BBoxTask;
391 
392  // Helper object for computing bounding boxes for instance prototypes.
393  class _PrototypeBBoxResolver;
394 
395  // Map of purpose tokens to associated bboxes.
396  typedef std::map<TfToken, GfBBox3d, TfTokenFastArbitraryLessThan>
397  _PurposeToBBoxMap;
398 
399  // Each individual prim will have it's own entry in the bbox cache. When
400  // instancing is involved we store the prototype prims and their children in
401  // the cache for use by each prim that instances each prototype. However,
402  // because of the way we compute and inherit purpose, we may end up needed
403  // to compute multitple different bboxes for prototypes and their children
404  // if the prims that instance them would cause these prototypes to inherit a
405  // different purpose value when the prims under the prototype don't have an
406  // authored purpose of their own.
407  //
408  // This struct is here to represent a prim and the purpose that it would
409  // inherit from the prim that instances it. It is used as the key for the
410  // map of prim's to the cached entries, allowing prims in prototypes to have
411  // more than one bbox cache entry for each distinct context needed to
412  // appropriately compute for all instances. instanceInheritablePurpose will
413  // always be empty for prims that aren't prototypes or children of
414  // prototypes, meaning that prims not in prototypes will only have one
415  // context each.
416  struct _PrimContext {
417  // The prim itself
418  UsdPrim prim;
419 
420  // The purpose that would be inherited from the instancing prim if this
421  // prim does not have an explicit purpose.
422  TfToken instanceInheritablePurpose;
423 
424  _PrimContext() = default;
425  explicit _PrimContext(const UsdPrim &prim_,
426  const TfToken &purpose = TfToken())
427  : prim(prim_), instanceInheritablePurpose(purpose) {};
428 
429  bool operator==(const _PrimContext &rhs) const {
430  return prim == rhs.prim &&
431  instanceInheritablePurpose == rhs.instanceInheritablePurpose;
432  }
433 
434  // Convenience stringify for debugging.
435  std::string ToString() const;
436  };
437 
438  template<typename TransformType>
439  GfBBox3d _ComputeBoundWithOverridesHelper(
440  const UsdPrim &prim,
441  const SdfPathSet &pathsToSkip,
442  const TransformType &primOverride,
444 
445  bool
446  _ComputePointInstanceBoundsHelper(
447  const UsdGeomPointInstancer &instancer,
448  int64_t const *instanceIdBegin,
449  size_t numIds,
450  GfMatrix4d const &xform,
451  GfBBox3d *result);
452 
453  // Returns true if the \p prim should be included during child bounds
454  // accumulation.
455  bool _ShouldIncludePrim(const UsdPrim& prim);
456 
457  // True if \p attr or \p query may return different values given different
458  // time queries. Note that a true result implies the attribute may have no
459  // value, a default value or a single time sample value.
460  bool _IsVarying(const UsdAttribute& attr);
461  bool _IsVarying(const UsdAttributeQuery& query);
462 
463  // Populate the local bbox for the requested prim, without the
464  // local-to-world transform or local transform applied. Return true when
465  // bbox volume > 0.
466  bool _Resolve(const UsdPrim& prim, _PurposeToBBoxMap *bboxes);
467 
468  // Resolves a single prim. This method must be thread safe. Assumes the
469  // cache entry has been created for \p prim.
470  //
471  // \p inverseComponentCtm is used to combine all the child bboxes in
472  // component-relative space.
473  void _ResolvePrim(_BBoxTask* task,
474  const _PrimContext& prim,
475  const GfMatrix4d &inverseComponentCtm);
476 
477  struct _Entry {
478  _Entry()
479  : isComplete(false)
480  , isVarying(false)
481  , isIncluded(false)
482  { }
483 
484  // The cached bboxes for the various values of purpose token.
485  _PurposeToBBoxMap bboxes;
486 
487  // Queries for attributes that need to be re-computed at each
488  // time for this entry. This will be invalid for non-varying entries.
489  std::shared_ptr<UsdAttributeQuery[]> queries;
490 
491  // Computed purpose info of the prim that's associated with the entry.
492  // This data includes the prim's actual computed purpose as well as
493  // whether this purpose is inheritable by child prims.
494  UsdGeomImageable::PurposeInfo purposeInfo;
495 
496  // True when data in the entry is valid.
497  bool isComplete;
498 
499  // True when the entry varies over time.
500  bool isVarying;
501 
502  // True when the entry is visible.
503  bool isIncluded;
504  };
505 
506  // Returns the cache entry for the given \p prim if one already exists.
507  // If no entry exists, creates (but does not resolve) entries for
508  // \p prim and all of its descendents. In this case, the prototype prims
509  // whose bounding boxes need to be resolved in order to resolve \p prim
510  // will be returned in \p prototypePrimContexts.
511  _Entry* _FindOrCreateEntriesForPrim(
512  const _PrimContext& prim,
513  std::vector<_PrimContext> *prototypePrimContexts);
514 
515  // Returns the combined bounding box for the currently included set of
516  // purposes given a _PurposeToBBoxMap.
517  GfBBox3d _GetCombinedBBoxForIncludedPurposes(
518  const _PurposeToBBoxMap &bboxes);
519 
520  // Populates \p bbox with the bounding box computed from the authored
521  // extents hint. Based on the included purposes, the extents in the
522  // extentsHint attribute are combined together to compute the bounding box.
523  bool _GetBBoxFromExtentsHint(
524  const UsdGeomModelAPI &geomModel,
525  const UsdAttributeQuery &extentsHintQuery,
526  _PurposeToBBoxMap *bboxes);
527 
528  // Returns whether the children of the given prim can be pruned
529  // from the traversal to pre-populate entries.
530  bool _ShouldPruneChildren(const UsdPrim &prim, _Entry *entry);
531 
532  // Helper function for computing a prim's purpose info efficiently by
533  // using the parent entry's cached computed purpose info and caching it
534  // its cache entry.
535  // Optionally this can recursively compute and cache the purposes for any
536  // existing parent entries in the cache that haven't had their purposes
537  // computed yet.
538  template <bool IsRecursive>
539  void _ComputePurposeInfo(_Entry *entry, const _PrimContext &prim);
540 
541  // Helper to determine if we should use extents hints for \p prim.
542  inline bool _UseExtentsHintForPrim(UsdPrim const &prim) const;
543 
544  // Specialize TfHashAppend for TfHash
545  template <typename HashState>
546  friend void TfHashAppend(HashState& h, const _PrimContext &key)
547  {
548  h.Append(key.prim);
549  h.Append(key.instanceInheritablePurpose);
550  }
551 
552  // Need hash_value for hboost to key cache entries by prim context.
553  friend size_t hash_value(const _PrimContext &key) { return TfHash{}(key); }
554 
555  typedef TfHash _PrimContextHash;
556  typedef TfHashMap<_PrimContext, _Entry, _PrimContextHash> _PrimBBoxHashMap;
557 
558  // Finds the cache entry for the prim context if it exists.
559  _Entry *_FindEntry(const _PrimContext &primContext)
560  {
561  return TfMapLookupPtr(_bboxCache, primContext);
562  }
563 
564  // Returns the cache entry for the prim context, adding it if doesn't
565  // exist.
566  _Entry *_InsertEntry(const _PrimContext &primContext)
567  {
568  return &(_bboxCache[primContext]);
569  }
570 
571  WorkDispatcher _dispatcher;
572  UsdTimeCode _time;
573  std::optional<UsdTimeCode> _baseTime;
574  TfTokenVector _includedPurposes;
575  UsdGeomXformCache _ctmCache;
576  _PrimBBoxHashMap _bboxCache;
577  bool _useExtentsHint;
578  bool _ignoreVisibility;
579 };
580 
581 
583 
584 #endif // PXR_USD_USD_GEOM_BBOX_CACHE_H
USDGEOM_API GfBBox3d ComputeUntransformedBound(const UsdPrim &prim)
USDGEOM_API bool ComputePointInstanceLocalBounds(const UsdGeomPointInstancer &instancer, int64_t const *instanceIdBegin, size_t numIds, GfBBox3d *result)
GLenum query
Definition: glad.h:2772
USDGEOM_API void SetIncludedPurposes(const TfTokenVector &includedPurposes)
bool HasBaseTime() const
Definition: bboxCache.h:384
USDGEOM_API GfBBox3d ComputeWorldBoundWithOverrides(const UsdPrim &prim, const SdfPathSet &pathsToSkip, const GfMatrix4d &primOverride, const TfHashMap< SdfPath, GfMatrix4d, SdfPath::Hash > &ctmOverrides)
GT_API const UT_StringHolder time
USDGEOM_API GfBBox3d ComputeLocalBound(const UsdPrim &prim)
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
USDGEOM_API bool ComputePointInstanceWorldBounds(const UsdGeomPointInstancer &instancer, int64_t const *instanceIdBegin, size_t numIds, GfBBox3d *result)
**But if you need a result
Definition: thread.h:613
bool GetIgnoreVisibility() const
Definition: bboxCache.h:345
USDGEOM_API void Clear()
Clears all pre-cached values.
bool GetUseExtentsHint() const
Definition: bboxCache.h:339
USDGEOM_API bool ComputePointInstanceUntransformedBounds(const UsdGeomPointInstancer &instancer, int64_t const *instanceIdBegin, size_t numIds, GfBBox3d *result)
Definition: hash.h:477
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
USDGEOM_API UsdGeomBBoxCache & operator=(UsdGeomBBoxCache const &other)
Copy assignment.
Definition: token.h:87
void ClearBaseTime()
Definition: bboxCache.h:378
friend size_t hash_value(const _PrimContext &key)
Definition: bboxCache.h:553
Container::mapped_type * TfMapLookupPtr(Container &map, Key const &key)
Definition: stl.h:141
GfBBox3d ComputePointInstanceRelativeBound(const UsdGeomPointInstancer &instancer, int64_t instanceId, const UsdPrim &relativeToAncestorPrim)
Definition: bboxCache.h:252
USDGEOM_API bool ComputePointInstanceRelativeBounds(const UsdGeomPointInstancer &instancer, int64_t const *instanceIdBegin, size_t numIds, const UsdPrim &relativeToAncestorPrim, GfBBox3d *result)
Definition: prim.h:133
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
void SetBaseTime(UsdTimeCode baseTime)
Definition: bboxCache.h:366
GfBBox3d ComputePointInstanceUntransformedBound(const UsdGeomPointInstancer &instancer, int64_t instanceId)
Definition: bboxCache.h:310
friend void TfHashAppend(HashState &h, const _PrimContext &key)
Definition: bboxCache.h:546
std::set< class SdfPath > SdfPathSet
A set of SdfPaths.
Definition: path.h:209
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
GfBBox3d ComputePointInstanceLocalBound(const UsdGeomPointInstancer &instancer, int64_t instanceId)
Compute the oriented bounding boxes of the given point instances.
Definition: bboxCache.h:280
GfBBox3d ComputePointInstanceWorldBound(const UsdGeomPointInstancer &instancer, int64_t instanceId)
Definition: bboxCache.h:223
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
USDGEOM_API void SetTime(UsdTimeCode time)
UsdTimeCode GetBaseTime() const
Definition: bboxCache.h:372
#define USDGEOM_API
Definition: api.h:40
USDGEOM_API GfBBox3d ComputeWorldBound(const UsdPrim &prim)
USDGEOM_API GfBBox3d ComputeRelativeBound(const UsdPrim &prim, const UsdPrim &relativeToAncestorPrim)
USDGEOM_API UsdGeomBBoxCache(UsdTimeCode time, TfTokenVector includedPurposes, bool useExtentsHint=false, bool ignoreVisibility=false)
const TfTokenVector & GetIncludedPurposes()
Get the current set of included purposes.
Definition: bboxCache.h:335
UsdTimeCode GetTime() const
Get the current time from which this cache is reading values.
Definition: bboxCache.h:356