All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
32 #include <vector>
33 
34 PXR_NAMESPACE_OPEN_SCOPE
35 
36 class PcpNodeRef;
37 
43 enum PcpDependencyType {
45  PcpDependencyTypeNone = 0,
46 
51  PcpDependencyTypeRoot = (1 << 0),
52 
55  PcpDependencyTypePurelyDirect = (1 << 1),
56 
60  PcpDependencyTypePartlyDirect = (1 << 2),
61 
64  PcpDependencyTypeAncestral = (1 << 3),
65 
80  PcpDependencyTypeVirtual = (1 << 4),
81  PcpDependencyTypeNonVirtual = (1 << 5),
82 
85  PcpDependencyTypeDirect =
86  PcpDependencyTypePartlyDirect
87  | PcpDependencyTypePurelyDirect,
88 
91  PcpDependencyTypeAnyNonVirtual =
92  PcpDependencyTypeRoot
93  | PcpDependencyTypeDirect
94  | PcpDependencyTypeAncestral
95  | PcpDependencyTypeNonVirtual,
96 
98  PcpDependencyTypeAnyIncludingVirtual =
99  PcpDependencyTypeAnyNonVirtual
100  | PcpDependencyTypeVirtual,
101 };
102 
104 typedef unsigned int PcpDependencyFlags;
105 
116 
117  bool operator==(const PcpDependency &rhs) const {
118  return indexPath == rhs.indexPath &&
119  sitePath == rhs.sitePath &&
120  mapFunc == rhs.mapFunc;
121  }
122  bool operator!=(const PcpDependency &rhs) const {
123  return !(*this == rhs);
124  }
125 };
126 
127 typedef std::vector<PcpDependency> PcpDependencyVector;
128 
133 PCP_API
134 bool PcpNodeIntroducesDependency(const PcpNodeRef &n);
135 
139 PCP_API
140 PcpDependencyFlags PcpClassifyNodeDependency(const PcpNodeRef &n);
141 
142 PCP_API
143 std::string PcpDependencyFlagsToString(const PcpDependencyFlags flags);
144 
145 PXR_NAMESPACE_CLOSE_SCOPE
146 
147 #endif // PXR_USD_PCP_DEPENDENCY_H
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:67
SdfPath indexPath
The path in this PcpCache&#39;s root layer stack that depends on the site.
Definition: dependency.h:110
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:288
SdfPath sitePath
The site path.
Definition: dependency.h:113
Description of a dependency.
Definition: dependency.h:107
PcpMapFunction mapFunc
The map function that applies to values from the site.
Definition: dependency.h:115