All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 PCP_NAMESPACE_EDITS_H
25 #define 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 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 // Forward declarations:
38 class PcpChanges;
39 class PcpCacheChanges;
40 class Pcp_Dependencies;
42 class PcpLifeboat;
43 class PcpNodeRef;
44 class PcpMapFunction;
45 
47 TF_DECLARE_WEAK_AND_REF_PTRS(Pcp_LayerStackRegistry);
48 SDF_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 
81  struct LayerStackSite {
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 
136 PCP_API
138 PcpComputeNamespaceEdits(const PcpCache *primaryCache,
139  const std::vector<PcpCache*>& caches,
140  const SdfPath& curPath,
141  const SdfPath& newPath,
142  const SdfLayerHandle& relocatesLayer);
143 
144 PXR_NAMESPACE_CLOSE_SCOPE
145 
146 #endif // PCP_NAMESPACE_EDITS_H
Must fixup relocates.
Sites that must respond to a namespace edit.
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:65
Describes Pcp changes.
Definition: changes.h:171
Must fixup inherits.
Layer stack site that must respond to a namespace edit.
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:65
EditType type
Type of edit.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:91
Base class for all Sdf spec classes.
Definition: spec.h:51
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
SdfPath sitePath
Path of site needing fix.
Must namespace edit spec.
Must fixup references.
PcpLayerStackPtr layerStack
Layer stack needing fix.
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:287
Types of changes per cache.
Definition: changes.h:97
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...
size_t cacheIndex
Index of cache of site.
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.
Must fixup specializes.
Structure used to temporarily retain layers and layerStacks within a code block.
Definition: changes.h:139
Cache site that must respond to a namespace edit.
LayerStackSites invalidLayerStackSites
Layer stack sites that are affected by a namespace edit but cannot respond properly.
Arguments used to identify a layer stack.