HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_LoadMasks.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_LoadMasks_h__
19 #define __HUSD_LoadMasks_h__
20 
21 #include "HUSD_API.h"
22 #include <UT/UT_StringArray.h>
23 #include <UT/UT_StringMap.h>
24 #include <UT/UT_StringSet.h>
25 
27 {
32 };
33 
35 {
36 public:
38  ~HUSD_LoadMasks();
39 
40  bool operator==(const HUSD_LoadMasks &other) const;
41  bool operator!=(const HUSD_LoadMasks &other) const
42  { return !(*this == other); }
43 
44  void save(std::ostream &os) const;
45  bool load(UT_IStream &is);
46  bool isEmpty() const;
47 
48  // Control over the stage population mask.
49  void setPopulateAll();
50  bool populateAll() const;
51 
52  void addPopulatePath(const UT_StringHolder &path);
53  void removePopulatePath(const UT_StringHolder &path,
54  bool remove_children = false);
55  void removeAllPopulatePaths();
56  void setPopulatePaths(const UT_SortedStringSet &paths);
57 
58  bool isPathPopulated(const UT_StringHolder &path,
60  HUSD_MATCH_EXACT) const;
62  { return myPopulatePaths; }
63 
64  // Control over the layer muting.
65  void addMuteLayer(const UT_StringHolder &identifier);
66  void removeMuteLayer(const UT_StringHolder &identifier);
67  void removeAllMuteLayers();
68 
69  bool isLayerMuted(const UT_StringHolder &identifier) const;
71  { return myMuteLayers; }
72 
73  // Control over the payload configuration.
74  void setLoadAll();
75  bool loadAll() const;
76 
77  void addLoadPath(const UT_StringHolder &path);
78  void removeLoadPath(const UT_StringHolder &path,
79  bool remove_children = false);
80  void removeAllLoadPaths();
81  void setLoadPaths(const UT_SortedStringSet &paths);
82 
83  // Control over variant selection fallbacks.
84  void setVariantSelectionFallbacks(
85  const UT_StringMap<UT_StringArray> &fallbacks);
86  const UT_StringMap<UT_StringArray> &variantSelectionFallbacks() const;
87 
88  // Combine two load masks, as we'd want when merging two stages.
89  void merge(const HUSD_LoadMasks &other);
90 
91  bool isPathLoaded(const UT_StringHolder &path,
93  HUSD_MATCH_EXACT) const;
95  { return myLoadPaths; }
96 
97  // Returns the original identifier unless it identifies a LOP-authored
98  // layer, in which case a string indicating the LOP node path is
99  // returned instead.
100  static UT_StringHolder getMutingIdentifier(
101  const UT_StringHolder &identifier);
102  // Return true if the provided identifier represents a desire to mute a
103  // particular LOP's layer.
104  static bool isLopMutingIdentifier(
105  const UT_StringHolder &identifier);
106 
108 
109 private:
110  UT_SortedStringSet myPopulatePaths;
111  UT_SortedStringSet myMuteLayers;
112  UT_SortedStringSet myLoadPaths;
113  UT_StringMap<UT_StringArray> myVariantSelectionFallbacks;
114  bool myPopulateAll;
115  bool myLoadAll;
116 };
117 
118 #endif
119 
const UT_SortedStringSet & muteLayers() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define HUSD_API
Definition: HUSD_API.h:31
const UT_SortedStringSet & populatePaths() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
HUSD_LoadMasksMatchStyle
bool operator!=(const HUSD_LoadMasks &other) const
const UT_SortedStringSet & loadPaths() const
static const HUSD_LoadMasks theEmptyLoadMasks
OutGridT XformOp bool bool MergePolicy merge