载入中...
搜索中...
未找到
GpuAgentsEditorModule.cpp
浏览该文件的文档.
2
3#include "common/Capability.h"
5
6#include <simplesquirrel/simplesquirrel.hpp>
7
8#include <string_view>
9#include <utility>
10#include <vector>
11
13namespace {
14
17 auto target = std::make_unique<gpuagents_editing::GpuAgentsDocumentTarget>(id.value());
18 const auto snapshot = request.find("snapshot");
19 if (snapshot != request.end()) {
20 auto loaded = target->loadSnapshot(snapshot->second);
21 if (!loaded.ok()) {
23 }
24 }
26 owned.target = std::move(target);
27 return eve::editing::applied<editor::AutomationOwnedTarget>(std::move(owned));
28}
29
30} // namespace
31
33
34std::vector<std::string_view> GpuAgentsAutomationTargetFactory::types() const { return {"gpuagents-effect"}; }
35
37 const editor::TargetId& target, std::string_view type, const editor::EditorValue::Object& request) {
38 if (type != "gpuagents-effect") {
39 return eve::editing::failed<editor::AutomationOwnedTarget>(editor::EditorStatus::Rejected,
40 editor::RuleId("editor.gpuagents.factory.type"),
41 "Unsupported GPU Agents automation target type");
42 }
43 return makeTarget(target, request);
44}
45
47 eve::cap::addListener<editor::IEditorAutomationTargetFactory>(factory_.get());
48}
49
51 eve::cap::removeListener<editor::IEditorAutomationTargetFactory>(factory_.get());
52}
53
54void GpuAgentsEditorModule::expose(ssq::Table& table) { table.addClass(name, GpuAgentsEditorModule::create, false); }
55
56void GpuAgentsEditorModule::expose(ssq::Class&) {}
57
58} // namespace eve::gpuagents_editor
LogicalId target
double value
ActiveSource owned
const GltfImportRequest & request
std::string name
#define Module_IMPL(ModuleName, newExpr)
Definition Module.h:26
Move-only operation result carrying either a value or Status.
Definition Result.h:155
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
std::map< std::string, Value > Object
Creates schema-driven GPU Agents documents for editor automation. @ownership Returned targets own the...
std::vector< std::string_view > types() const override
Accepted GPU Agents target type names.
editor::Result< editor::AutomationOwnedTarget > create(const editor::TargetId &target, std::string_view type, const editor::EditorValue::Object &request) override
Create a GPU Agents document and optionally load its snapshot request field.
Composition adapter that publishes the GPU Agents automation-target factory. @ownership Owns the regi...
~GpuAgentsEditorModule() override
Gpu agents editor module.
Target plus optional borrowed-dependency owner returned by an automation factory.
std::unique_ptr< IEditableTarget > target