载入中...
搜索中...
未找到
MaterialEditor.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
8
9#include <string_view>
10
11namespace eve::material_editor {
12
20public:
22 explicit MaterialEditor(std::string targetId);
32 [[nodiscard]] editing::Result<void> configureWorkspace(editor::EditorWorkspace& workspace) const;
37 [[nodiscard]] editing::Result<void> setProperties(const editing::Value::Object& properties);
39 [[nodiscard]] editing::Result<void> setProperty(std::string_view path, const editing::Value& value);
41 [[nodiscard]] editing::Result<editing::Value> read(std::string_view path) const;
43 [[nodiscard]] editing::Value schema() const;
45 [[nodiscard]] editing::Value snapshot() const;
49 [[nodiscard]] editing::Result<void> restore(const editing::Value& snapshot);
55 [[nodiscard]] bool canUndo() const { return transactions_.canUndo(); }
57 [[nodiscard]] bool canRedo() const { return transactions_.canRedo(); }
59 [[nodiscard]] std::uint64_t revision() const { return target_.revision(); }
60
61private:
62 editing::SelectionSnapshot selection() const;
66 std::uint64_t sequence_ = 0;
67};
68
69} // namespace eve::material_editor
#define EVENGINE_API_EDITORS
Definition Export.h:112
std::function< Numbers(b3JointId)> read
std::map< std::string, PropertyRule > properties
Snapshot snapshot
std::string path
Definition PlayHost.cpp:111
std::uint32_t targetId
Object::Ptr value
Move-only operation result carrying either a value or Status.
Definition Result.h:176
In-process authority for a single editable runtime or document target.
Deterministic owning value tree shared by authoring hosts.
std::map< std::string, Value > Object
Composition model shared by project-specific developer and runtime editors.
Local transaction coordinator backed by an injected edit authority.
UI-neutral, serializable material authoring target.
Owned, UI-neutral material document with atomic patches and undo/redo. @ownership Owns the document,...
MaterialEditor(const MaterialEditor &)=delete
Self-referencing authority/history make editor instances immovable.
MaterialEditor(MaterialEditor &&)=delete
Move construction is unavailable.
MaterialEditor & operator=(MaterialEditor &&)=delete
Move assignment is unavailable.
bool canUndo() const
Query whether undo is available.
std::uint64_t revision() const
Current authoritative document revision.
bool canRedo() const
Query whether redo is available.
MaterialEditor & operator=(const MaterialEditor &)=delete
Copy assignment is unavailable.
SelectionSnapshot public API.