24 #ifndef PXR_USD_SDF_NAMESPACE_EDIT_H 25 #define PXR_USD_SDF_NAMESPACE_EDIT_H 30 #include "pxr/usd/sdf/api.h" 31 #include "pxr/usd/sdf/path.h" 33 #include <boost/operators.hpp> 40 PXR_NAMESPACE_OPEN_SCOPE
48 boost::equality_comparable<SdfNamespaceEdit> {
59 static const Index
Same = -2;
66 Index index_ =
AtEnd) :
92 const Path& newParentPath,
105 const Path& newParentPath,
116 SDF_API
bool operator==(
const This& rhs)
const;
135 boost::equality_comparable<SdfNamespaceEditDetail> {
146 const std::string&
reason);
169 return lhs < rhs ? lhs : rhs;
226 _edits.push_back(edit);
293 bool fixBackpointers =
true)
const;
299 PXR_NAMESPACE_CLOSE_SCOPE
301 #endif // PXR_USD_SDF_NAMESPACE_EDIT_H static const Index AtEnd
Special index that means at the end.
std::vector< SdfNamespaceEditDetail > SdfNamespaceEditDetailVector
A sequence of SdfNamespaceEditDetail.
static This Reparent(const Path ¤tPath, const Path &newParentPath, Index index)
Returns a namespace edit to reparent the prim or property at currentPath to be under newParentPath at...
Path newPath
Path of the object when this edit ends.
SdfNamespaceEditDetail::Result CombineResult(SdfNamespaceEditDetail::Result lhs, SdfNamespaceEditDetail::Result rhs)
Combine two results, yielding Error over Unbatched over Okay.
SDF_API SdfPath ReplacePrefix(const SdfPath &oldPrefix, const SdfPath &newPrefix, bool fixTargetPaths=true) const
Returns a path with all occurrences of the prefix path oldPrefix replaced with the prefix path newPre...
static This Remove(const Path ¤tPath)
Returns a namespace edit that removes the object at currentPath.
SDF_API SdfPath GetParentPath() const
Return the path that identifies this path's namespace parent.
static This Reorder(const Path ¤tPath, Index index)
Returns a namespace edit to reorder the prim or property at currentPath to index index.
Token for efficient comparison, assignment, and hashing of known strings.
SdfNamespaceEdit()
The default edit maps the empty path to the empty path.
std::function< bool(const SdfPath &)> HasObjectAtPath
Functor that returns true iff an object exists at the given path.
SdfNamespaceEditDetail::Result CombineUnbatched(SdfNamespaceEditDetail::Result other)
Combine a result with Unbatched, yielding Error over Unbatched over Okay.
SdfNamespaceEditDetail::Result CombineError(SdfNamespaceEditDetail::Result)
Combine a result with Error, yielding Error over Unbatched over Okay.
A description of an arbitrarily complex namespace edit.
void Add(const SdfNamespaceEdit::Path ¤tPath, const SdfNamespaceEdit::Path &newPath, SdfNamespaceEdit::Index index=SdfNamespaceEdit::AtEnd)
Add a namespace edit.
Result
Validity of an edit.
static const Index Same
Special index that means don't move.
std::vector< SdfNamespaceEdit > SdfNamespaceEditVector
A sequence of SdfNamespaceEdit.
A path value used to locate objects in layers or scenegraphs.
std::function< bool(const SdfNamespaceEdit &, std::string *)> CanEdit
Functor that returns true iff the namespace edit will succeed.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
SdfNamespaceEdit edit
The edit.
static This ReparentAndRename(const Path ¤tPath, const Path &newParentPath, const TfToken &name, Index index)
Returns a namespace edit to reparent the prim or property at currentPath to be under newParentPath at...
SDF_API SdfPath ReplaceName(TfToken const &newName) const
Return a copy of this path with its final component changed to newName.
Path currentPath
Path of the object when this edit starts.
Detailed information about a namespace edit.
Index index
Index for prim insertion.
SDF_API bool Process(SdfNamespaceEditVector *processedEdits, const HasObjectAtPath &hasObjectAtPath, const CanEdit &canEdit, SdfNamespaceEditDetailVector *details=NULL, bool fixBackpointers=true) const
Validate the edits and generate a possibly more efficient edit sequence.
static SDF_API const SdfPath & EmptyPath()
The empty path value, equivalent to SdfPath().
void Add(const SdfNamespaceEdit &edit)
Add a namespace edit.
Edit will succeed as a batch.
const SdfNamespaceEditVector & GetEdits() const
Returns the edits.
SDF_API SdfBatchNamespaceEdit()
Create an empty sequence of edits.
std::string reason
The reason the edit will not succeed cleanly.
static This Rename(const Path ¤tPath, const TfToken &name)
Returns a namespace edit that renames the prim or property at currentPath to name.
Edit will succeed but not batched.
SdfNamespaceEdit(const Path ¤tPath_, const Path &newPath_, Index index_=AtEnd)
The fully general edit.