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
editContext.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_USD_EDIT_CONTEXT_H
8#define PXR_USD_USD_EDIT_CONTEXT_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/usd/api.h"
12#include "pxr/usd/usd/editTarget.h"
14
15#include <memory>
16#include <utility>
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20
22
51{
52 UsdEditContext(UsdEditContext const &) = delete;
53 UsdEditContext &operator=(UsdEditContext const &) = delete;
54public:
60 USD_API
61 explicit UsdEditContext(const UsdStagePtr &stage);
62
71 USD_API
72 UsdEditContext(const UsdStagePtr &stage, const UsdEditTarget &editTarget);
73
84 USD_API
85 UsdEditContext(const std::pair<UsdStagePtr, UsdEditTarget > &stageTarget);
86
89 USD_API
91
92private:
93 // The stage this context is bound to.
94 UsdStagePtr _stage;
95
96 // The stage's original EditTarget.
97 UsdEditTarget _originalEditTarget;
98};
99
100PXR_NAMESPACE_CLOSE_SCOPE
101
102#endif // PXR_USD_USD_EDIT_CONTEXT_H
A utility class to temporarily modify a stage's current EditTarget during an execution scope.
Definition: editContext.h:51
USD_API UsdEditContext(const std::pair< UsdStagePtr, UsdEditTarget > &stageTarget)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API ~UsdEditContext()
Restore the stage's original EditTarget if this context's stage is valid.
USD_API UsdEditContext(const UsdStagePtr &stage)
Construct without modifying stage's current EditTarget.
USD_API UsdEditContext(const UsdStagePtr &stage, const UsdEditTarget &editTarget)
Construct and save stage's current EditTarget to restore on destruction, then invoke stage->SetEditTa...
Defines a mapping from scene graph paths to Sdf spec paths in a SdfLayer where edits should be direct...
Definition: editTarget.h:64
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
Definition: stage.h:136
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:45