7#ifndef PXR_USD_PCP_LAYER_RELOCATES_EDIT_BUILDER_H
8#define PXR_USD_PCP_LAYER_RELOCATES_EDIT_BUILDER_H
13#include "pxr/usd/pcp/api.h"
14#include "pxr/usd/pcp/errors.h"
16#include "pxr/usd/sdf/path.h"
22PXR_NAMESPACE_OPEN_SCOPE
61 const PcpLayerStackPtr &layerStack,
62 const SdfLayerHandle &addNewRelocatesLayer =
nullptr);
137 std::string *whyNot =
nullptr);
154 std::string *whyNot =
nullptr);
184 void _UpdateExistingRelocates(
187 void _RemoveRelocatesWithErrors(
const PcpErrorVector &errors);
189 mutable std::optional<SdfRelocatesMap> _relocatesMap;
192 SdfLayerHandleSet _layersWithRelocatesChanges;
193 size_t _editForNewRelocatesIndex = ~0;
207PXR_NAMESPACE_CLOSE_SCOPE
Utility class for building up a map of valid relocates and producing the layer metadata edits that ca...
PCP_API PcpLayerRelocatesEditBuilder(const PcpLayerStackPtr &layerStack, const SdfLayerHandle &addNewRelocatesLayer=nullptr)
Constructor that initializes the relocates map from the given layerStack.
std::vector< LayerRelocatesEdit > LayerRelocatesEdits
List of relocates edits to perform on all layers.
PCP_API bool Relocate(const SdfPath &sourcePath, const SdfPath &targetPath, std::string *whyNot=nullptr)
Updates the relocates map and layer edits so that sourcePath is moved to targetPath in the edited rel...
PCP_API LayerRelocatesEdits GetEdits() const
Returns a list of edits to perform on the layers of the layer stack this builder was initialized with...
PCP_API const SdfRelocatesMap & GetEditedRelocatesMap() const
Returns a map of relocates composed from the edited layer relocates.
PCP_API bool RemoveRelocate(const SdfPath &sourcePath, std::string *whyNot=nullptr)
Updates the relocates map and layer edits so that the relocate with sourcePath is removed from the ed...
std::pair< SdfLayerHandle, SdfRelocates > LayerRelocatesEdit
An edit is a layer and an SdfRelocates value to set in the layer's 'layerRelocates' metatdata.
Represents a stack of layers that contribute opinions to composition.
A scene description container that can combine with other such containers to form simple component as...
A path value used to locate objects in layers or scenegraphs.
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
std::vector< SdfRelocate > SdfRelocates
A vector of relocation source path to target path pairs.
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.