dependency.h
1 //
2 // Copyright 2016 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 PXR_USD_PCP_DEPENDENCY_H
25 #define PXR_USD_PCP_DEPENDENCY_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/pcp/api.h"
29 #include "pxr/usd/pcp/mapFunction.h"
30 #include "pxr/usd/sdf/path.h"
31 
33 
34 #include <vector>
35 
36 PXR_NAMESPACE_OPEN_SCOPE
37 
39 
40 class PcpNodeRef;
41 
47 enum PcpDependencyType {
49  PcpDependencyTypeNone = 0,
50 
55  PcpDependencyTypeRoot = (1 << 0),
56 
59  PcpDependencyTypePurelyDirect = (1 << 1),
60 
64  PcpDependencyTypePartlyDirect = (1 << 2),
65 
68  PcpDependencyTypeAncestral = (1 << 3),
69 
84  PcpDependencyTypeVirtual = (1 << 4),
85  PcpDependencyTypeNonVirtual = (1 << 5),
86 
89  PcpDependencyTypeDirect =
90  PcpDependencyTypePartlyDirect
91  | PcpDependencyTypePurelyDirect,
92 
95  PcpDependencyTypeAnyNonVirtual =
96  PcpDependencyTypeRoot
97  | PcpDependencyTypeDirect
98  | PcpDependencyTypeAncestral
99  | PcpDependencyTypeNonVirtual,
100 
102  PcpDependencyTypeAnyIncludingVirtual =
103  PcpDependencyTypeAnyNonVirtual
104  | PcpDependencyTypeVirtual,
105 };
106 
108 typedef unsigned int PcpDependencyFlags;
109 
120 
121  bool operator==(const PcpDependency &rhs) const {
122  return indexPath == rhs.indexPath &&
123  sitePath == rhs.sitePath &&
124  mapFunc == rhs.mapFunc;
125  }
126  bool operator!=(const PcpDependency &rhs) const {
127  return !(*this == rhs);
128  }
129 };
130 
131 using PcpDependencyVector = std::vector<PcpDependency>;
132 
138 {
140  PcpDependencyFlags flags = PcpDependencyTypeNone;
142  PcpLayerStackRefPtr layerStack;
150 };
151 
152 using PcpCulledDependencyVector = std::vector<PcpCulledDependency>;
153 
158 PCP_API
159 bool PcpNodeIntroducesDependency(const PcpNodeRef &n);
160 
164 PCP_API
165 PcpDependencyFlags PcpClassifyNodeDependency(const PcpNodeRef &n);
166 
167 PCP_API
168 std::string PcpDependencyFlagsToString(const PcpDependencyFlags flags);
169 
170 PXR_NAMESPACE_CLOSE_SCOPE
171 
172 #endif // PXR_USD_PCP_DEPENDENCY_H
Standard pointer typedefs.
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:65
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:67
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
Description of a dependency that has been culled from the corresponding prim index.
Definition: dependency.h:137
SdfPath indexPath
The path in this PcpCache's root layer stack that depends on the site.
Definition: dependency.h:114
A function that maps values from one namespace (and time domain) to another.
Definition: mapFunction.h:80
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
PcpDependencyFlags flags
Flag representing the type of dependency.
Definition: dependency.h:140
SdfPath sitePath
Path of the dependency specs in the layer stack.
Definition: dependency.h:144
SdfPath unrelocatedSitePath
If relocations applied to the dependency node, this is the unrelocated site path.
Definition: dependency.h:147
SdfPath sitePath
The site path.
Definition: dependency.h:117
Description of a dependency.
Definition: dependency.h:111
PcpLayerStackRefPtr layerStack
Layer stack containing the specs the prim index depends on.
Definition: dependency.h:142
PcpMapFunction mapToRoot
The map function that applies to values from the site.
Definition: dependency.h:149
PcpMapFunction mapFunc
The map function that applies to values from the site.
Definition: dependency.h:119