HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
USD_CustomTraverse.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 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 _GUSD_USD_CUSTOMTRAVERSE_H_
25 #define _GUSD_USD_CUSTOMTRAVERSE_H_
26 
27 #include "pxr/pxr.h"
28 
29 #include "USD_Traverse.h"
30 
31 #include <UT/UT_StringMMPattern.h>
32 
34 
35 /** A traversal implementation offering users full configuration
36  over many aspects of traversal.*/
38 {
39 public:
40  enum TriState
41  {
45  };
46 
47  struct Opts : public GusdUSD_Traverse::Opts
48  {
50  ~Opts() override {}
51 
52  void Reset() override;
53  bool Configure(
54  OP_Parameters& parms, fpreal t) override;
55 
56  /** Methods for matching components by wildcard pattern.
57  Note that for all methods, an empty pattern is treated
58  as equivalent to '*'. I.e., an empty pattern matches everything.
59  @{ */
60  bool SetKindsByPattern(const char* pattern,
61  bool caseSensitive=true,
62  std::string* err=nullptr);
63 
64  bool SetPurposesByPattern(const char* pattern,
65  bool caseSensitive=true,
66  std::string* err=nullptr);
67 
68  bool SetTypesByPattern(const char* pattern,
69  bool caseSensitive=true,
70  std::string* err=nullptr);
71 
72  void SetNamePattern(const char* pattern,
73  bool caseSensitive=true);
74 
75  void SetPathPattern(const char* pattern,
76  bool caseSensitive=true);
77  /** @} */
78 
79  /** Create a predicate matching all of the configurable
80  options that refer to prim flags.*/
82 
83 
90  };
91 
92  Opts* CreateOpts() const override { return new Opts; }
93 
94  bool FindPrims(const UsdPrim& root,
96  GusdPurposeSet purposes,
97  UT_Array<UsdPrim>& prims,
98  bool skipRoot=true,
99  const GusdUSD_Traverse::Opts* opts=nullptr
100  ) const override;
101 
102  bool FindPrims(const UT_Array<UsdPrim>& roots,
103  const GusdDefaultArray<UsdTimeCode>& times,
104  const GusdDefaultArray<GusdPurposeSet>& purposes,
106  bool skipRoot=true,
107  const GusdUSD_Traverse::Opts* opts=nullptr
108  ) const override;
109 
110  static void Initialize();
111 };
112 
114 
115 #endif /*_GUSD_USD_CUSTOMTRAVERSE_H_*/
GT_API const UT_StringHolder time
GLdouble GLdouble t
Definition: glew.h:1403
bool SetTypesByPattern(const char *pattern, bool caseSensitive=true, std::string *err=nullptr)
void SetNamePattern(const char *pattern, bool caseSensitive=true)
static void Initialize()
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
Usd_PrimFlagsPredicate MakePredicate() const
Methods for USD scene traversal.
Definition: prim.h:132
bool FindPrims(const UsdPrim &root, UsdTimeCode time, GusdPurposeSet purposes, UT_Array< UsdPrim > &prims, bool skipRoot=true, const GusdUSD_Traverse::Opts *opts=nullptr) const override
bool SetPurposesByPattern(const char *pattern, bool caseSensitive=true, std::string *err=nullptr)
GLubyte * pattern
Definition: glew.h:5741
Opts * CreateOpts() const override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1375
fpreal64 fpreal
Definition: SYS_Types.h:277
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
bool SetKindsByPattern(const char *pattern, bool caseSensitive=true, std::string *err=nullptr)
bool Configure(OP_Parameters &parms, fpreal t) override
void SetPathPattern(const char *pattern, bool caseSensitive=true)
GusdPurposeSet
Definition: purpose.h:39