HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LOP_SelectionRule.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: LOP Library (C++)
7  *
8  * COMMENTS: Flat list of primitive paths, or rule-based description of a
9  * collection of USD primitives.
10  *
11  */
12 
13 #ifndef __LOP_SelectionRule_h__
14 #define __LOP_SelectionRule_h__
15 
16 #include "LOP_API.h"
17 #include <HUSD/HUSD_DataHandle.h>
18 #include <HUSD/HUSD_Utils.h>
19 #include <UT/UT_StringHolder.h>
20 #include <UT/UT_StringArray.h>
21 #include <UT/UT_StringMap.h>
22 #include <UT/UT_Error.h>
23 
24 class UT_JSONWriter;
25 class UT_JSONParser;
26 class HUSD_PathSet;
27 class HUSD_TimeCode;
28 
30 {
31 public:
34 
35  bool operator==(const LOP_SelectionRule &other) const;
36  bool operator!=(const LOP_SelectionRule &other) const;
37  int hash() const;
38 
39  void save(UT_JSONWriter &writer) const;
40  bool load(UT_JSONParser &parser);
41 
42  void getExpandedPathSet(HUSD_AutoAnyLock &lock,
43  int nodeid,
44  const HUSD_TimeCode &timecode,
45  HUSD_PathSet &paths,
46  bool *may_be_time_varying = nullptr,
47  HUSD_PathSet *missing_explicit_paths = nullptr,
48  UT_ErrorSeverity *error_severity = nullptr,
49  UT_StringHolder *error = nullptr) const;
50  void getCollectionAwarePathSet(HUSD_AutoAnyLock &lock,
51  int nodeid,
52  const HUSD_TimeCode &timecode,
53  HUSD_PathSet &paths,
54  bool *may_be_time_varying = nullptr,
55  HUSD_PathSet *missing_explicit_paths = nullptr,
56  UT_ErrorSeverity *error_severity = nullptr,
57  UT_StringHolder *error = nullptr) const;
58  bool copyToFindPrims(HUSD_FindPrims &findprims,
59  int nodeid,
60  const HUSD_TimeCode &timecode,
61  UT_ErrorSeverity *error_severity = nullptr,
62  UT_StringHolder *error = nullptr) const;
63 
65  { return myPathPattern; }
67  { myPathPattern = pattern; }
68 
70  { return myTraversalDemands; }
72  { myTraversalDemands = demands; }
73 
74  const UT_StringHolder &icon() const
75  { return myIcon; }
76  void setIcon(const UT_StringHolder &icon)
77  { myIcon = icon; }
78 
80  { return myAssumeWildcardsAroundPlainTokens; }
82  { myAssumeWildcardsAroundPlainTokens = assume; }
83 
84  bool caseSensitive() const
85  { return myCaseSensitive; }
86  void setCaseSensitive(bool casesensitive)
87  { myCaseSensitive = casesensitive; }
88 
89 private:
90  UT_StringHolder myPathPattern;
91  HUSD_PrimTraversalDemands myTraversalDemands;
92  UT_StringHolder myIcon;
93  bool myAssumeWildcardsAroundPlainTokens;
94  bool myCaseSensitive;
95 };
96 
98 
99 #endif
100 
UT_StringMap< LOP_SelectionRule > LOP_SelectionRuleMap
const UT_StringHolder & getPathPattern() const
UT_ErrorSeverity
Definition: UT_Error.h:25
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
void setPathPattern(const UT_StringHolder &pattern)
HUSD_PrimTraversalDemands
Definition: HUSD_Utils.h:39
< returns > If no error
Definition: snippets.dox:2
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setCaseSensitive(bool casesensitive)
#define LOP_API
Definition: LOP_API.h:10
GLushort pattern
Definition: glad.h:2583
FMT_INLINE void assume(bool condition)
Definition: format.h:317
const UT_StringHolder & icon() const
void setIcon(const UT_StringHolder &icon)
bool assumeWildcardsAroundPlainTokens() const
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:165
bool caseSensitive() const
void setTraversalDemands(HUSD_PrimTraversalDemands demands)
HUSD_PrimTraversalDemands traversalDemands() const
void setAssumeWildcardsAroundPlainTokens(bool assume)