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