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
70  { return myMuteLayers.contains(identifier); }
72  { return myMuteLayers; }
73 
74  // Control over the payload configuration.
75  void setLoadAll();
76  bool loadAll() const;
77 
78  void addLoadPath(const UT_StringHolder &path);
79  void removeLoadPath(const UT_StringHolder &path,
80  bool remove_children = false);
81  void removeAllLoadPaths();
82  void setLoadPaths(const UT_SortedStringSet &paths);
83 
84  // Control over variant selection fallbacks.
85  void setVariantSelectionFallbacks(
86  const UT_StringMap<UT_StringArray> &fallbacks);
87  const UT_StringMap<UT_StringArray> &variantSelectionFallbacks() const;
88 
89  // Combine two load masks, as we'd want when merging two stages.
90  void merge(const HUSD_LoadMasks &other);
91 
92  bool isPathLoaded(const UT_StringHolder &path,
94  HUSD_MATCH_EXACT) const;
96  { return myLoadPaths; }
97 
99 
100 private:
101  UT_SortedStringSet myPopulatePaths;
102  UT_SortedStringSet myMuteLayers;
103  UT_SortedStringSet myLoadPaths;
104  UT_StringMap<UT_StringArray> myVariantSelectionFallbacks;
105  bool myPopulateAll;
106  bool myLoadAll;
107 };
108 
109 #endif
110 
const UT_SortedStringSet & muteLayers() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define HUSD_API
Definition: HUSD_API.h:32
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
bool isLayerMuted(const UT_StringHolder &identifier) const