Loading...
Searching...
No Matches
namespaceEdits.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_NAMESPACE_EDITS_H
25#define PXR_USD_PCP_NAMESPACE_EDITS_H
26
27#include "pxr/pxr.h"
28#include "pxr/usd/pcp/api.h"
29#include "pxr/usd/pcp/cache.h"
30#include "pxr/base/tf/hashset.h"
31
32#include <string>
33#include <vector>
34
35PXR_NAMESPACE_OPEN_SCOPE
36
37// Forward declarations:
38class PcpChanges;
39class PcpCacheChanges;
40class Pcp_Dependencies;
42class PcpLifeboat;
43class PcpNodeRef;
44class PcpMapFunction;
45
47TF_DECLARE_WEAK_AND_REF_PTRS(Pcp_LayerStackRegistry);
48SDF_DECLARE_HANDLES(SdfSpec);
49
52
55 enum EditType {
62 };
63
64 void Swap(PcpNamespaceEdits& rhs)
65 {
66 cacheSites.swap(rhs.cacheSites);
69 }
70
72 struct CacheSite {
73 size_t cacheIndex;
76 };
77 typedef std::vector<CacheSite> CacheSites;
78
82 size_t cacheIndex;
84 PcpLayerStackPtr layerStack;
88 };
89 typedef std::vector<LayerStackSite> LayerStackSites;
90
92 CacheSites cacheSites;
93
95 LayerStackSites layerStackSites;
96
101 LayerStackSites invalidLayerStackSites;
102};
103
136PCP_API
138PcpComputeNamespaceEdits(const PcpCache *primaryCache,
139 const std::vector<PcpCache*>& caches,
140 const SdfPath& curPath,
141 const SdfPath& newPath,
142 const SdfLayerHandle& relocatesLayer);
143
144PXR_NAMESPACE_CLOSE_SCOPE
145
146#endif // PXR_USD_PCP_NAMESPACE_EDITS_H
Types of changes per cache.
Definition: changes.h:117
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:94
Describes Pcp changes.
Definition: changes.h:193
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:67
Arguments used to identify a layer stack.
Structure used to temporarily retain layers and layerStacks within a code block.
Definition: changes.h:161
A function that maps values from one namespace (and time domain) to another.
Definition: mapFunction.h:82
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:64
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Base class for all Sdf spec classes.
Definition: spec.h:50
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
Sites that must respond to a namespace edit.
SdfPath newPath
New path of site.
LayerStackSites layerStackSites
Layer stack sites that must respond to a namespace edit.
CacheSites cacheSites
Cache sites that must respond to a namespace edit.
size_t cacheIndex
Index of cache of site.
SdfPath sitePath
Path of site needing fix.
PcpLayerStackPtr layerStack
Layer stack needing fix.
SdfPath oldPath
Old path of site.
EditType
Types of namespace edits that a given layer stack site could need to perform to respond to a namespac...
@ EditSpecializes
Must fixup specializes.
@ EditRelocate
Must fixup relocates.
@ EditReference
Must fixup references.
@ EditPath
Must namespace edit spec.
@ EditInherit
Must fixup inherits.
@ EditPayload
Must fixup payload.
LayerStackSites invalidLayerStackSites
Layer stack sites that are affected by a namespace edit but cannot respond properly.
Cache site that must respond to a namespace edit.
Layer stack site that must respond to a namespace edit.