Dedicated visual material/reaction Catalog editor with transactional draft admission. 更多...
#include <PixelWorldCatalogPanel.h>
Public 成员函数 | |
| ~PixelWorldCatalogPanel () | |
| Pixel world catalog panel. | |
| PixelWorldCatalogPanel (const PixelWorldCatalogPanel &)=delete | |
| PixelWorldCatalogPanel & | operator= (const PixelWorldCatalogPanel &)=delete |
| PixelWorldCatalogPanel (PixelWorldCatalogPanel &&other) | |
| Pixel world catalog panel. | |
| PixelWorldCatalogPanel & | operator= (PixelWorldCatalogPanel &&other) |
| Operator =. | |
| const eve::pixelworld::MaterialCatalog & | draft () const noexcept |
| Current validated immutable draft. | |
| std::uint64_t | revision () const noexcept |
| Monotonic local draft revision, advanced only by accepted mutations. | |
| std::size_t | selectedMaterialIndex () const noexcept |
| Selected material index, always valid for the current nonempty draft. | |
| std::optional< std::size_t > | selectedReactionIndex () const noexcept |
| Selected reaction index when at least one binary rule exists. | |
| std::optional< std::size_t > | selectedPhaseIndex () const noexcept |
| Selected phase-rule index when at least one transition exists. | |
| std::vector< MaterialCard > | materialCards () const |
| Project deterministic cards for the material browser. | |
| eve::Result< void > | selectMaterial (std::size_t index) |
| Select a material by canonical index without mutating the Catalog. | |
| eve::Result< void > | selectReaction (std::size_t index) |
| Select a binary reaction rule by canonical index. | |
| eve::Result< void > | selectPhase (std::size_t index) |
| Select a phase-transition rule by canonical index. | |
| eve::Result< CatalogDraftReceipt > | replaceMaterial (eve::pixelworld::MaterialDefinition definition) |
| Replace one material definition after validating the entire reconstructed Catalog. | |
| eve::Result< CatalogDraftReceipt > | replaceReaction (std::size_t index, eve::pixelworld::MaterialReactionRule rule) |
| Replace one binary rule after validating the entire reconstructed Catalog. | |
| eve::Result< CatalogDraftReceipt > | addReaction (eve::pixelworld::MaterialReactionRule rule) |
| Add a binary rule and select its canonical post-validation position. | |
| eve::Result< CatalogDraftReceipt > | removeReaction (std::size_t index) |
| Remove one binary rule transactionally. | |
| eve::Result< CatalogDraftReceipt > | replacePhase (std::size_t index, eve::pixelworld::MaterialPhaseRule rule) |
| Replace one phase rule after validating the entire reconstructed Catalog. | |
| eve::Result< CatalogDraftReceipt > | addPhase (eve::pixelworld::MaterialPhaseRule rule) |
| Add a phase rule and select its canonical post-validation position. | |
| eve::Result< CatalogDraftReceipt > | removePhase (std::size_t index) |
| Remove one phase rule transactionally. | |
| eve::Result< std::string > | document () const |
| Encode the current validated draft using the canonical versioned JSON codec. | |
| eve::Result< CatalogDraftReceipt > | loadDocument (std::string_view catalogJson) |
| Replace the draft from a validated document; failure leaves all panel state intact. | |
| eve::Result< eve::pixelworld::PixelCatalogReloadReceipt > | apply (eve::pixelworld::PixelWorldControlService &control, std::uint64_t worldId, std::uint64_t expectedFingerprint) const |
| Apply the draft through the canonical paused-world authority path. | |
| eve::Result< eve::ui::UIHostHandle > | open () |
| Mount or reveal the panel in the UI ECS world and publish its current tree. | |
| void | close () |
| Hide the mounted panel without discarding its validated draft. | |
| bool | isOpen () const |
| True while the panel has a live, visible UI host. | |
| eve::Result< void > | refresh () |
| Reconcile the mounted host with the latest draft and selection state. | |
| eve::ui::UIHostHandle | host () const noexcept |
| Mounted UI host handle, or an empty handle before open(). | |
| eve::ui::WidgetDesc | buildWidgetTree () |
| Build a dedicated material browser, property inspector and rule editor visual tree. | |
| const std::string & | statusText () const noexcept |
| Last callback diagnostic rendered in the panel status bar. | |
静态 Public 成员函数 | |
| static eve::Result< PixelWorldCatalogPanel > | create (std::string_view catalogJson) |
| Decode and validate a versioned Catalog document into a fresh panel draft. | |
| static PixelWorldCatalogPanel | builtIn () |
| Create a panel over the canonical built-in Catalog. | |
详细描述
Dedicated visual material/reaction Catalog editor with transactional draft admission.
The panel owns an immutable validated draft and never owns or retains a PixelWorld pointer. Every edit reconstructs a complete candidate Catalog and publishes it only after validation. apply() borrows the control service synchronously and reaches the runtime authority through its generation-aware world registry. All methods are owner-thread-only and invoke no unknown callbacks except callbacks explicitly embedded in a returned WidgetDesc tree. The panel must outlive any mounted tree because those callbacks borrow this.
在文件 PixelWorldCatalogPanel.h 第 47 行定义.
构造及析构函数说明
◆ ~PixelWorldCatalogPanel()
| eve::pixelworld_editor::PixelWorldCatalogPanel::~PixelWorldCatalogPanel | ( | ) |
Pixel world catalog panel.
在文件 PixelWorldCatalogPanel.cpp 第 104 行定义.
引用了 host(), eve::ui::UIHost::resolve() , 以及 eve::ui::window().
◆ PixelWorldCatalogPanel() [1/2]
|
delete |
◆ PixelWorldCatalogPanel() [2/2]
| eve::pixelworld_editor::PixelWorldCatalogPanel::PixelWorldCatalogPanel | ( | PixelWorldCatalogPanel && | other | ) |
成员函数说明
◆ addPhase()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::addPhase | ( | eve::pixelworld::MaterialPhaseRule | rule | ) |
Add a phase rule and select its canonical post-validation position.
在文件 PixelWorldCatalogPanel.cpp 第 272 行定义.
引用了 definitions, eve::pixelworld::MaterialPhaseRule::id, index, eve::pixelworld::MaterialCatalog::phaseRules(), reactions , 以及 size.
◆ addReaction()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::addReaction | ( | eve::pixelworld::MaterialReactionRule | rule | ) |
Add a binary rule and select its canonical post-validation position.
在文件 PixelWorldCatalogPanel.cpp 第 238 行定义.
引用了 definitions, eve::pixelworld::MaterialReactionRule::id, index, eve::pixelworld::MaterialCatalog::reactions(), reactions , 以及 size.
◆ apply()
| eve::Result< PixelCatalogReloadReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::apply | ( | eve::pixelworld::PixelWorldControlService & | control, |
| std::uint64_t | worldId, | ||
| std::uint64_t | expectedFingerprint | ||
| ) | const |
Apply the draft through the canonical paused-world authority path.
在文件 PixelWorldCatalogPanel.cpp 第 307 行定义.
引用了 document(), eve::Result< T >::failure() , 以及 eve::pixelworld::PixelWorldControlService::reloadMaterialCatalog().
◆ buildWidgetTree()
| eve::ui::WidgetDesc eve::pixelworld_editor::PixelWorldCatalogPanel::buildWidgetTree | ( | ) |
Build a dedicated material browser, property inspector and rule editor visual tree.
在文件 PixelWorldCatalogPanel.cpp 第 375 行定义.
引用了 eve::pixelworld::MaterialDefinition::blastResistance, eve::pixelworld::MaterialDefinition::boilingTemperature, eve::ui::WidgetDesc::checked, eve::pixelworld::MaterialDefinition::defaultLifetime, eve::pixelworld::MaterialDefinition::defaultTemperature, eve::pixelworld::MaterialCatalog::definition(), eve::pixelworld::MaterialCatalog::definitions(), eve::pixelworld::MaterialDefinition::density, eve::pixelworld::MaterialDefinition::displayRgba, eve::pixelworld::MaterialDefinition::flammable, eve::pixelworld::MaterialDefinition::heatCapacity, eve::pixelworld::MaterialDefinition::id, eve::pixelworld::MaterialDefinition::ignitionTemperature, image, index, material, eve::pixelworld::MaterialDefinition::meltingTemperature, eve::pixelworld::MaterialDefinition::name, replaceMaterial(), size, eve::pixelworld::MaterialDefinition::state, eve::pixelworld::MaterialDefinition::tags, eve::pixelworld::MaterialDefinition::thermalConductivity, value , 以及 eve::pixelworld::MaterialDefinition::viscosity.
被这些函数引用 refresh().
◆ builtIn()
|
static |
Create a panel over the canonical built-in Catalog.
在文件 PixelWorldCatalogPanel.cpp 第 149 行定义.
引用了 eve::pixelworld::MaterialCatalog::builtIn().
被这些函数引用 eve::pixelworld_editor::PixelWorldEditorModule::openCatalog().
◆ close()
| void eve::pixelworld_editor::PixelWorldCatalogPanel::close | ( | ) |
Hide the mounted panel without discarding its validated draft.
在文件 PixelWorldCatalogPanel.cpp 第 343 行定义.
引用了 host() , 以及 eve::ui::UIHost::resolve().
◆ create()
|
static |
Decode and validate a versioned Catalog document into a fresh panel draft.
在文件 PixelWorldCatalogPanel.cpp 第 141 行定义.
引用了 eve::pixelworld::decodeMaterialCatalogJson(), eve::Result< T >::failure() , 以及 eve::Result< T >::success().
◆ document()
| eve::Result< std::string > eve::pixelworld_editor::PixelWorldCatalogPanel::document | ( | ) | const |
Encode the current validated draft using the canonical versioned JSON codec.
在文件 PixelWorldCatalogPanel.cpp 第 294 行定义.
引用了 eve::pixelworld::encodeMaterialCatalogJson().
被这些函数引用 apply().
◆ draft()
|
inlinenoexcept |
Current validated immutable draft.
在文件 PixelWorldCatalogPanel.h 第 64 行定义.
◆ host()
|
inlinenoexcept |
Mounted UI host handle, or an empty handle before open().
在文件 PixelWorldCatalogPanel.h 第 121 行定义.
被这些函数引用 close(), isOpen(), open(), operator=(), refresh() , 以及 ~PixelWorldCatalogPanel().
◆ isOpen()
| bool eve::pixelworld_editor::PixelWorldCatalogPanel::isOpen | ( | ) | const |
True while the panel has a live, visible UI host.
在文件 PixelWorldCatalogPanel.cpp 第 347 行定义.
引用了 host() , 以及 eve::ui::UIHost::resolve().
◆ loadDocument()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::loadDocument | ( | std::string_view | catalogJson | ) |
Replace the draft from a validated document; failure leaves all panel state intact.
在文件 PixelWorldCatalogPanel.cpp 第 298 行定义.
引用了 eve::pixelworld::decodeMaterialCatalogJson(), definitions, eve::Result< T >::failure() , 以及 reactions.
◆ materialCards()
| std::vector< MaterialCard > eve::pixelworld_editor::PixelWorldCatalogPanel::materialCards | ( | ) | const |
Project deterministic cards for the material browser.
在文件 PixelWorldCatalogPanel.cpp 第 153 行定义.
引用了 eve::pixelworld::MaterialCatalog::canPhaseTransition(), eve::pixelworld::MaterialCatalog::canReact(), eve::pixelworld::MaterialCatalog::definitions(), index , 以及 size.
◆ open()
| eve::Result< eve::ui::UIHostHandle > eve::pixelworld_editor::PixelWorldCatalogPanel::open | ( | ) |
Mount or reveal the panel in the UI ECS world and publish its current tree.
在文件 PixelWorldCatalogPanel.cpp 第 316 行定义.
引用了 eve::ui::UIHost::createHost(), eve::Diagnostic::error(), eve::Result< T >::failure(), host(), eve::PreconditionViolation, refresh(), eve::ui::UIHost::resolve() , 以及 eve::Result< T >::success().
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
| PixelWorldCatalogPanel & eve::pixelworld_editor::PixelWorldCatalogPanel::operator= | ( | PixelWorldCatalogPanel && | other | ) |
Operator =.
在文件 PixelWorldCatalogPanel.cpp 第 123 行定义.
引用了 host(), refresh(), eve::ui::UIHost::resolve() , 以及 eve::ui::window().
◆ refresh()
| eve::Result< void > eve::pixelworld_editor::PixelWorldCatalogPanel::refresh | ( | ) |
Reconcile the mounted host with the latest draft and selection state.
在文件 PixelWorldCatalogPanel.cpp 第 352 行定义.
引用了 buildWidgetTree(), eve::Diagnostic::error(), eve::Result< T >::failure(), host(), eve::PreconditionViolation, eve::ui::UIHost::resolve() , 以及 eve::Result< T >::success().
被这些函数引用 open(), operator=() , 以及 PixelWorldCatalogPanel().
◆ removePhase()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::removePhase | ( | std::size_t | index | ) |
Remove one phase rule transactionally.
在文件 PixelWorldCatalogPanel.cpp 第 284 行定义.
引用了 definitions, eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, eve::pixelworld::MaterialCatalog::phaseRules() , 以及 reactions.
◆ removeReaction()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::removeReaction | ( | std::size_t | index | ) |
Remove one binary rule transactionally.
在文件 PixelWorldCatalogPanel.cpp 第 251 行定义.
引用了 definitions, eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, eve::pixelworld::MaterialCatalog::reactions() , 以及 reactions.
◆ replaceMaterial()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::replaceMaterial | ( | eve::pixelworld::MaterialDefinition | definition | ) |
Replace one material definition after validating the entire reconstructed Catalog.
在文件 PixelWorldCatalogPanel.cpp 第 215 行定义.
引用了 definitions, eve::pixelworld::MaterialCatalog::definitions(), eve::Diagnostic::error(), index, eve::InvalidArgument , 以及 reactions.
被这些函数引用 buildWidgetTree().
◆ replacePhase()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::replacePhase | ( | std::size_t | index, |
| eve::pixelworld::MaterialPhaseRule | rule | ||
| ) |
Replace one phase rule after validating the entire reconstructed Catalog.
在文件 PixelWorldCatalogPanel.cpp 第 261 行定义.
引用了 definitions, eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, eve::pixelworld::MaterialCatalog::phaseRules() , 以及 reactions.
◆ replaceReaction()
| eve::Result< CatalogDraftReceipt > eve::pixelworld_editor::PixelWorldCatalogPanel::replaceReaction | ( | std::size_t | index, |
| eve::pixelworld::MaterialReactionRule | rule | ||
| ) |
Replace one binary rule after validating the entire reconstructed Catalog.
在文件 PixelWorldCatalogPanel.cpp 第 227 行定义.
引用了 definitions, eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, eve::pixelworld::MaterialCatalog::reactions() , 以及 reactions.
◆ revision()
|
inlinenoexcept |
Monotonic local draft revision, advanced only by accepted mutations.
在文件 PixelWorldCatalogPanel.h 第 66 行定义.
◆ selectedMaterialIndex()
|
inlinenoexcept |
Selected material index, always valid for the current nonempty draft.
在文件 PixelWorldCatalogPanel.h 第 68 行定义.
◆ selectedPhaseIndex()
|
inlinenoexcept |
Selected phase-rule index when at least one transition exists.
在文件 PixelWorldCatalogPanel.h 第 72 行定义.
◆ selectedReactionIndex()
|
inlinenoexcept |
Selected reaction index when at least one binary rule exists.
在文件 PixelWorldCatalogPanel.h 第 70 行定义.
◆ selectMaterial()
| eve::Result< void > eve::pixelworld_editor::PixelWorldCatalogPanel::selectMaterial | ( | std::size_t | index | ) |
Select a material by canonical index without mutating the Catalog.
在文件 PixelWorldCatalogPanel.cpp 第 166 行定义.
引用了 eve::pixelworld::MaterialCatalog::definitions(), eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument , 以及 eve::Result< T >::success().
◆ selectPhase()
| eve::Result< void > eve::pixelworld_editor::PixelWorldCatalogPanel::selectPhase | ( | std::size_t | index | ) |
Select a phase-transition rule by canonical index.
在文件 PixelWorldCatalogPanel.cpp 第 184 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, eve::pixelworld::MaterialCatalog::phaseRules() , 以及 eve::Result< T >::success().
◆ selectReaction()
| eve::Result< void > eve::pixelworld_editor::PixelWorldCatalogPanel::selectReaction | ( | std::size_t | index | ) |
Select a binary reaction rule by canonical index.
在文件 PixelWorldCatalogPanel.cpp 第 175 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, eve::pixelworld::MaterialCatalog::reactions() , 以及 eve::Result< T >::success().
◆ statusText()
|
inlinenoexcept |
Last callback diagnostic rendered in the panel status bar.
在文件 PixelWorldCatalogPanel.h 第 126 行定义.
该类的文档由以下文件生成:
- src/modules/pixelworld/editor/PixelWorldCatalogPanel.h
- src/modules/pixelworld/editor/PixelWorldCatalogPanel.cpp