HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utils.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_IMAGING_USDVIEWQ_UTILS_H
8 #define PXR_USD_IMAGING_USDVIEWQ_UTILS_H
9 
10 #include "pxr/pxr.h"
12 #include "pxr/usd/usd/prim.h"
13 #include "pxr/usd/usd/timeCode.h"
14 
15 #include <vector>
16 
18 
19 
20 class UsdStage;
21 
22 /// \class UsdviewqUtils
23 ///
24 /// Performance enhancing utilities for usdview.
25 ///
27 public:
28 
29  struct PrimInfo {
30  PrimInfo(const UsdPrim &prim, const UsdTimeCode time);
31 
33  bool isActive;
35  bool isDefined;
36  bool isAbstract;
38  bool isInstance;
42  bool visVaries;
43  std::string name;
44  std::string typeName;
45  std::string displayName;
46  };
47 
48  /// For the given \p stage and \p schemaType, return all active, defined
49  /// prims that either match the schemaType exactly or are a descendant type.
50  //
51  // Furthermore, this method is not intended to be used publically,
52  // ultimately Usd will have better core support for fast prim
53  // filtering by typeName.
55  static
56  std::vector<UsdPrim> _GetAllPrimsOfType(UsdStagePtr const &stage,
57  TfType const& schemaType);
58 
59  /// Fetch prim-related data in batch to to speed up Qt treeview item
60  /// population. Takes a time argument so that we can evaluate the prim's
61  /// visibiity if it is imageable.
63  static UsdviewqUtils::PrimInfo GetPrimInfo(const UsdPrim &prim,
64  const UsdTimeCode time);
65 };
66 
67 
69 
70 #endif //PXR_USD_IMAGING_USDVIEWQ_UTILS_H
std::string name
Definition: utils.h:43
GT_API const UT_StringHolder time
static USDVIEWQ_API UsdviewqUtils::PrimInfo GetPrimInfo(const UsdPrim &prim, const UsdTimeCode time)
#define USDVIEWQ_API
Definition: api.h:23
std::string displayName
Definition: utils.h:45
Definition: prim.h:116
PrimInfo(const UsdPrim &prim, const UsdTimeCode time)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
bool isVisibilityInherited
Definition: utils.h:41
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
static USDVIEWQ_API std::vector< UsdPrim > _GetAllPrimsOfType(UsdStagePtr const &stage, TfType const &schemaType)
std::string typeName
Definition: utils.h:44