Owned, UI-neutral material document with atomic patches and undo/redo. @ownership Owns the document, authority and transaction history; snapshots are detached values. @threadaffinity Owner thread only. No callbacks are invoked by this facade. @reentrancy Calls must not overlap. No runtime object pointers are retained. 更多...
#include <MaterialEditor.h>
Public 成员函数 | |
| MaterialEditor (std::string targetId) | |
| Create a document with the canonical material defaults. | |
| MaterialEditor (const MaterialEditor &)=delete | |
| Self-referencing authority/history make editor instances immovable. | |
| MaterialEditor & | operator= (const MaterialEditor &)=delete |
| Copy assignment is unavailable. | |
| MaterialEditor (MaterialEditor &&)=delete | |
| Move construction is unavailable. | |
| MaterialEditor & | operator= (MaterialEditor &&)=delete |
| Move assignment is unavailable. | |
| editing::Result< void > | configureWorkspace (editor::EditorWorkspace &workspace) const |
| Install default panels atomically; callers may customize the workspace afterwards. | |
| editing::Result< void > | setProperties (const editing::Value::Object &properties) |
| Apply a property patch as one undo record; invalid patches leave document and history unchanged. | |
| editing::Result< void > | setProperty (std::string_view path, const editing::Value &value) |
| Set one schema property through the same atomic patch path. | |
| editing::Result< editing::Value > | read (std::string_view path) const |
| Read a property; unknown paths return NotFound rather than a default value. | |
| editing::Value | schema () const |
| Return detached schema metadata for custom inspectors. | |
| editing::Value | snapshot () const |
| Return the canonical versioned material snapshot. | |
| editing::Result< void > | restore (const editing::Value &snapshot) |
| Import a canonical versioned snapshot as one undoable edit; failure preserves state. @cost Full-document validation and history construction; amortize at document open/import boundaries. | |
| editing::Result< editor::TransactionReceipt > | undo () |
| Undo the latest patch. | |
| editing::Result< editor::TransactionReceipt > | redo () |
| Redo the latest undone patch. | |
| bool | canUndo () const |
| Query whether undo is available. | |
| bool | canRedo () const |
| Query whether redo is available. | |
| std::uint64_t | revision () const |
| Current authoritative document revision. | |
详细描述
Owned, UI-neutral material document with atomic patches and undo/redo. @ownership Owns the document, authority and transaction history; snapshots are detached values. @threadaffinity Owner thread only. No callbacks are invoked by this facade. @reentrancy Calls must not overlap. No runtime object pointers are retained.
在文件 MaterialEditor.h 第 19 行定义.
构造及析构函数说明
◆ MaterialEditor() [1/3]
|
explicit |
Create a document with the canonical material defaults.
- 参数
-
targetId Stable nonempty document id.
在文件 MaterialEditor.cpp 第 14 行定义.
引用了 eve::material_editing::MaterialDocumentTarget::targetId().
◆ MaterialEditor() [2/3]
|
delete |
Self-referencing authority/history make editor instances immovable.
◆ MaterialEditor() [3/3]
|
delete |
Move construction is unavailable.
成员函数说明
◆ canRedo()
|
inline |
Query whether redo is available.
在文件 MaterialEditor.h 第 57 行定义.
◆ canUndo()
|
inline |
Query whether undo is available.
在文件 MaterialEditor.h 第 55 行定义.
◆ configureWorkspace()
| Result< void > eve::material_editor::MaterialEditor::configureWorkspace | ( | editor::EditorWorkspace & | workspace | ) | const |
Install default panels atomically; callers may customize the workspace afterwards.
在文件 MaterialEditor.cpp 第 28 行定义.
引用了 descriptor, eve::Result< T >::failure(), id, eve::editor::WorkspacePanelDescriptor::id, region , 以及 title.
◆ operator=() [1/2]
|
delete |
Copy assignment is unavailable.
◆ operator=() [2/2]
|
delete |
Move assignment is unavailable.
引用了 snapshot.
◆ read()
Read a property; unknown paths return NotFound rather than a default value.
在文件 MaterialEditor.cpp 第 113 行定义.
引用了 path , 以及 eve::material_editing::MaterialDocumentTarget::read().
◆ redo()
| Result< editor::TransactionReceipt > eve::material_editor::MaterialEditor::redo | ( | ) |
Redo the latest undone patch.
在文件 MaterialEditor.cpp 第 153 行定义.
◆ restore()
| Result< void > eve::material_editor::MaterialEditor::restore | ( | const editing::Value & | snapshot | ) |
Import a canonical versioned snapshot as one undoable edit; failure preserves state. @cost Full-document validation and history construction; amortize at document open/import boundaries.
在文件 MaterialEditor.cpp 第 144 行定义.
引用了 loaded, eve::material_editing::MaterialDocumentTarget::loadSnapshot(), setProperties() , 以及 snapshot().
◆ revision()
|
inline |
Current authoritative document revision.
在文件 MaterialEditor.h 第 59 行定义.
◆ schema()
| Value eve::material_editor::MaterialEditor::schema | ( | ) | const |
Return detached schema metadata for custom inspectors.
在文件 MaterialEditor.cpp 第 121 行定义.
引用了 choices, properties , 以及 eve::material_editing::MaterialDocumentTarget::schema().
◆ setProperties()
| Result< void > eve::material_editor::MaterialEditor::setProperties | ( | const editing::Value::Object & | properties | ) |
Apply a property patch as one undo record; invalid patches leave document and history unchanged.
- 参数
-
properties Detached path-to-value object, borrowed for this call. @cost More expensive than a property read; batch related changes to amortize schema validation.
在文件 MaterialEditor.cpp 第 57 行定义.
引用了 eve::editor::LocalTransactionBackend::append(), eve::editing::TransactionSpec::baseRevision, eve::editor::LocalTransactionBackend::begin(), eve::editor::LocalTransactionBackend::commit(), committed, current, descriptor, eve::editor::LocalTransactionBackend::discard(), eve::Result< T >::failure(), eve::editing::PropertySchema::find(), eve::editing::TransactionSpec::id, input, eve::editing::TransactionSpec::label, eve::editing::noOp(), operation, path, properties, eve::material_editing::MaterialDocumentTarget::read(), eve::editing::EditableTargetState::revision(), eve::material_editing::MaterialDocumentTarget::schema(), eve::editing::TransactionSpec::target, eve::material_editing::MaterialDocumentTarget::targetId() , 以及 value.
被这些函数引用 restore() , 以及 setProperty().
◆ setProperty()
| Result< void > eve::material_editor::MaterialEditor::setProperty | ( | std::string_view | path, |
| const editing::Value & | value | ||
| ) |
Set one schema property through the same atomic patch path.
在文件 MaterialEditor.cpp 第 53 行定义.
引用了 path, setProperties() , 以及 value.
◆ snapshot()
| Value eve::material_editor::MaterialEditor::snapshot | ( | ) | const |
Return the canonical versioned material snapshot.
在文件 MaterialEditor.cpp 第 142 行定义.
引用了 eve::material_editing::MaterialDocumentTarget::snapshotValue().
被这些函数引用 restore().
◆ undo()
| Result< editor::TransactionReceipt > eve::material_editor::MaterialEditor::undo | ( | ) |
Undo the latest patch.
在文件 MaterialEditor.cpp 第 152 行定义.
该类的文档由以下文件生成:
- src/modules/graphics/material/editor/MaterialEditor.h
- src/modules/graphics/material/editor/MaterialEditor.cpp