载入中...
搜索中...
未找到
EditorMaterialStudio.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
7
8#include <cstdint>
9#include <memory>
10#include <optional>
11#include <string>
12#include <vector>
13
14namespace eve::editor {
15
26
41public:
45 IMaterialPreviewRenderer& renderer);
46
48 [[nodiscard]] Result<void> setPreviewSettings(MaterialPreviewSettings settings);
50 [[nodiscard]] Result<void> beginInteraction(PropertyPath path);
52 [[nodiscard]] Result<void> updateInteraction(EditorValue value);
54 [[nodiscard]] Result<TransactionReceipt> commitInteraction();
56 [[nodiscard]] Result<void> cancelInteraction();
62 [[nodiscard]] Result<void> tick(std::uint64_t monotonicMilliseconds);
64 [[nodiscard]] Result<void> refreshPreview();
66 [[nodiscard]] Result<void> setPreviewRate(double framesPerSecond);
68 [[nodiscard]] MaterialStudioState state() const;
69
70private:
71 [[nodiscard]] SelectionSnapshot selectionFor(const MaterialDocumentTarget& material) const;
72 [[nodiscard]] Result<void> renderPreview(const MaterialDocumentTarget& material);
73 void clearInteraction();
74
75 DocumentId document_;
77 IEditorTransactionBackend& transactions_;
78 MaterialPreviewService& previews_;
79 IMaterialPreviewRenderer& renderer_;
81 std::unique_ptr<MaterialDocumentTarget> draft_;
82 std::optional<PropertyPath> activeProperty_;
83 std::optional<EditorValue> finalValue_;
84 std::uint64_t transactionSequence_ = 0;
85 std::uint64_t lastPreviewMilliseconds_ = 0;
86 std::uint64_t previewIntervalMilliseconds_ = 33;
87 bool hasPreviewTimestamp_ = false;
88 bool previewDirty_ = true;
89 Revision previewRevision_ = 0;
90 std::string previewArtifact_;
91 std::vector<EditorDiagnostic> diagnostics_;
92};
93
94} // namespace eve::editor
LogicalId target
double value
#define EVENGINE_API_EDITORS
Definition Export.h:112
std::string path
Definition PlayHost.cpp:110
Material * material
SimulationTick tick
TerrainThermalSettings settings
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
Dotted property path (layout.size) compared and persisted as text.
Definition EditingIds.h:78
Deterministic owning value tree shared by authoring hosts.
Transaction boundary consumed by editor property and other UI models.
Host boundary that owns creation and teardown of an isolated preview scene.
Revision-safe material preview request and publication service.
UI-neutral controller for coalesced material edits and revision-safe live previews.
UI-neutral, serializable material authoring target.
Candidate-first material operation target with live commit/undo publication.
eve::editing::Revision Revision
SelectionSnapshot public API.
Camera, mesh and environment settings for an isolated material preview.
Observable state for a host-rendered real-time material studio.
std::vector< EditorDiagnostic > diagnostics