This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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/pcp/types.h"
14#include "pxr/usd/sdf/path.h"
15
17
18#include <vector>
19
20PXR_NAMESPACE_OPEN_SCOPE
21
23
24class PcpNodeRef;
25
31enum PcpDependencyType {
33 PcpDependencyTypeNone = 0,
34
39 PcpDependencyTypeRoot = (1 << 0),
40
43 PcpDependencyTypePurelyDirect = (1 << 1),
44
48 PcpDependencyTypePartlyDirect = (1 << 2),
49
52 PcpDependencyTypeAncestral = (1 << 3),
53
68 PcpDependencyTypeVirtual = (1 << 4),
69 PcpDependencyTypeNonVirtual = (1 << 5),
70
73 PcpDependencyTypeDirect =
74 PcpDependencyTypePartlyDirect
75 | PcpDependencyTypePurelyDirect,
76
79 PcpDependencyTypeAnyNonVirtual =
80 PcpDependencyTypeRoot
81 | PcpDependencyTypeDirect
82 | PcpDependencyTypeAncestral
83 | PcpDependencyTypeNonVirtual,
84
86 PcpDependencyTypeAnyIncludingVirtual =
87 PcpDependencyTypeAnyNonVirtual
88 | PcpDependencyTypeVirtual,
89};
90
92typedef unsigned int PcpDependencyFlags;
93
104
105 bool operator==(const PcpDependency &rhs) const {
106 return indexPath == rhs.indexPath &&
107 sitePath == rhs.sitePath &&
108 mapFunc == rhs.mapFunc;
109 }
110 bool operator!=(const PcpDependency &rhs) const {
111 return !(*this == rhs);
112 }
113};
114
115using PcpDependencyVector = std::vector<PcpDependency>;
116
122{
124 PcpDependencyFlags flags = PcpDependencyTypeNone;
126 PcpArcType arcType = PcpArcTypeRoot;
128 PcpLayerStackRefPtr layerStack;
136};
137
138using PcpCulledDependencyVector = std::vector<PcpCulledDependency>;
139
144PCP_API
145bool PcpNodeIntroducesDependency(const PcpNodeRef &n);
146
150PCP_API
151PcpDependencyFlags PcpClassifyNodeDependency(const PcpNodeRef &n);
152
153PCP_API
154std::string PcpDependencyFlagsToString(const PcpDependencyFlags flags);
155
156PXR_NAMESPACE_CLOSE_SCOPE
157
158#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:122
SdfPath unrelocatedSitePath
If relocations applied to the dependency node, this is the unrelocated site path.
Definition: dependency.h:133
PcpLayerStackRefPtr layerStack
Layer stack containing the specs the prim index depends on.
Definition: dependency.h:128
PcpMapFunction mapToRoot
The map function that applies to values from the site.
Definition: dependency.h:135
SdfPath sitePath
Path of the dependency specs in the layer stack.
Definition: dependency.h:130
PcpDependencyFlags flags
Flag representing the type of dependency.
Definition: dependency.h:124
PcpArcType arcType
Arc type for this dependency.
Definition: dependency.h:126
Description of a dependency.
Definition: dependency.h:95
SdfPath indexPath
The path in this PcpCache's root layer stack that depends on the site.
Definition: dependency.h:98
SdfPath sitePath
The site path.
Definition: dependency.h:101
PcpMapFunction mapFunc
The map function that applies to values from the site.
Definition: dependency.h:103
PcpArcType
Describes the type of arc connecting two nodes in the prim index.
Definition: types.h:27