Loading...
Searching...
No Matches
dependency.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_PCP_DEPENDENCY_H
8#define PXR_USD_PCP_DEPENDENCY_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/pcp/api.h"
12#include "pxr/usd/pcp/mapFunction.h"
13#include "pxr/usd/sdf/path.h"
14
16
17#include <vector>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
22
23class PcpNodeRef;
24
30enum PcpDependencyType {
32 PcpDependencyTypeNone = 0,
33
38 PcpDependencyTypeRoot = (1 << 0),
39
42 PcpDependencyTypePurelyDirect = (1 << 1),
43
47 PcpDependencyTypePartlyDirect = (1 << 2),
48
51 PcpDependencyTypeAncestral = (1 << 3),
52
67 PcpDependencyTypeVirtual = (1 << 4),
68 PcpDependencyTypeNonVirtual = (1 << 5),
69
72 PcpDependencyTypeDirect =
73 PcpDependencyTypePartlyDirect
74 | PcpDependencyTypePurelyDirect,
75
78 PcpDependencyTypeAnyNonVirtual =
79 PcpDependencyTypeRoot
80 | PcpDependencyTypeDirect
81 | PcpDependencyTypeAncestral
82 | PcpDependencyTypeNonVirtual,
83
85 PcpDependencyTypeAnyIncludingVirtual =
86 PcpDependencyTypeAnyNonVirtual
87 | PcpDependencyTypeVirtual,
88};
89
91typedef unsigned int PcpDependencyFlags;
92
103
104 bool operator==(const PcpDependency &rhs) const {
105 return indexPath == rhs.indexPath &&
106 sitePath == rhs.sitePath &&
107 mapFunc == rhs.mapFunc;
108 }
109 bool operator!=(const PcpDependency &rhs) const {
110 return !(*this == rhs);
111 }
112};
113
114using PcpDependencyVector = std::vector<PcpDependency>;
115
121{
123 PcpDependencyFlags flags = PcpDependencyTypeNone;
125 PcpLayerStackRefPtr layerStack;
133};
134
135using PcpCulledDependencyVector = std::vector<PcpCulledDependency>;
136
141PCP_API
142bool PcpNodeIntroducesDependency(const PcpNodeRef &n);
143
147PCP_API
148PcpDependencyFlags PcpClassifyNodeDependency(const PcpNodeRef &n);
149
150PCP_API
151std::string PcpDependencyFlagsToString(const PcpDependencyFlags flags);
152
153PXR_NAMESPACE_CLOSE_SCOPE
154
155#endif // PXR_USD_PCP_DEPENDENCY_H
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:50
A function that maps values from one namespace (and time domain) to another.
Definition: mapFunction.h:65
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:47
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72
Description of a dependency that has been culled from the corresponding prim index.
Definition: dependency.h:121
SdfPath unrelocatedSitePath
If relocations applied to the dependency node, this is the unrelocated site path.
Definition: dependency.h:130
PcpLayerStackRefPtr layerStack
Layer stack containing the specs the prim index depends on.
Definition: dependency.h:125
PcpMapFunction mapToRoot
The map function that applies to values from the site.
Definition: dependency.h:132
SdfPath sitePath
Path of the dependency specs in the layer stack.
Definition: dependency.h:127
PcpDependencyFlags flags
Flag representing the type of dependency.
Definition: dependency.h:123
Description of a dependency.
Definition: dependency.h:94
SdfPath indexPath
The path in this PcpCache's root layer stack that depends on the site.
Definition: dependency.h:97
SdfPath sitePath
The site path.
Definition: dependency.h:100
PcpMapFunction mapFunc
The map function that applies to values from the site.
Definition: dependency.h:102