Single mutable owner of imported terrain tiles and their complete-channel history. Caller-thread affine, synchronous, callback-free. Imported tiles are owned; mesh inputs are borrowed until return. Returned tile values own storage. Same-build deterministic floating arithmetic, no clocks or RNG. History publishes once after every tile succeeds. Snapshot schema procgen.road.terrain version 2 requires originY; version 1 migrates missing originY to zero. Unknown object fields are ignored; unsupported versions and malformed known fields reject atomically. Restore replaces current data and undo/redo history atomically; no external tile pointer or receipt survives. 更多...
#include <RoadTerrainWorkspace.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| RoadTerrainWorkspace () | |
| Construct an empty terrain owner. | |
| ~RoadTerrainWorkspace () | |
| Destroy owned tiles and history. | |
| RoadTerrainWorkspace (RoadTerrainWorkspace &&) noexcept | |
| Transfer ownership; moved-from objects can be initialized again. | |
| RoadTerrainWorkspace & | operator= (RoadTerrainWorkspace &&) noexcept |
| Transfer ownership and release the previous history. | |
| RoadTerrainWorkspace (const RoadTerrainWorkspace &)=delete | |
| RoadTerrainWorkspace & | operator= (const RoadTerrainWorkspace &)=delete |
| Result< int > | initialize (std::vector< RoadTerrainTile > tiles) |
| Validate and import complete tile values, clearing history atomically. @cost Linear in all channel samples and tree instances, amortized at import boundaries. | |
| Result< int > | apply (const MeshBuild &mesh, const RoadTerrainWriteOptions &options) |
| Evaluate road coverage and publish height, texture, details, trees and selected holes together. Bridge surfaces never paint/clear terrain. Tunnel heights and vegetation roofs remain intact unless holes are selected. Splat coverage times opacity raises the selected weight only when greater than its current weight; other layers retain their relative proportions. Zero preserves splats while independent channels execute. No quantization. @cost Raster work is bounded by maximumWork; each transaction copies bounded retained history before publishing. | |
| Result< int > | applyBatch (std::span< const RoadTerrainWrite > writes, std::size_t maximumWork) |
| Apply ordered per-road policies as one complete-channel history frame. | |
| Result< int > | undo () |
| Restore the previous complete-channel value; no mutation when history is exhausted. Selects an owned immutable history frame by cursor, without copying channel storage. | |
| Result< int > | redo () |
| Restore the next complete-channel value; no mutation when history is exhausted. Selects an owned immutable history frame by cursor, without copying channel storage. | |
| Result< RoadTerrainTile > | copyTile (const std::string &id) const |
| Copy one tile snapshot; returned data never aliases the owner. @cost Linear in this tile's channel storage, amortized at renderer/save boundaries. | |
| Result< Value > | capture () const |
| Encode current data and the complete undo/redo history as an owning canonical Value. @cost Linear in retained history storage, amortized at save boundaries. | |
| Result< int > | restore (const Value &snapshot) |
| Validate schema, channel topology and every historical frame before one atomic owner replacement. @cost Linear in encoded history storage, amortized at load boundaries. | |
详细描述
Single mutable owner of imported terrain tiles and their complete-channel history. Caller-thread affine, synchronous, callback-free. Imported tiles are owned; mesh inputs are borrowed until return. Returned tile values own storage. Same-build deterministic floating arithmetic, no clocks or RNG. History publishes once after every tile succeeds. Snapshot schema procgen.road.terrain version 2 requires originY; version 1 migrates missing originY to zero. Unknown object fields are ignored; unsupported versions and malformed known fields reject atomically. Restore replaces current data and undo/redo history atomically; no external tile pointer or receipt survives.
在文件 RoadTerrainWorkspace.h 第 59 行定义.
构造及析构函数说明
◆ RoadTerrainWorkspace() [1/3]
| eve::procgen::road::RoadTerrainWorkspace::RoadTerrainWorkspace | ( | ) |
Construct an empty terrain owner.
在文件 RoadTerrainWorkspace.cpp 第 167 行定义.
◆ ~RoadTerrainWorkspace()
|
default |
Destroy owned tiles and history.
◆ RoadTerrainWorkspace() [2/3]
|
defaultnoexcept |
Transfer ownership; moved-from objects can be initialized again.
◆ RoadTerrainWorkspace() [3/3]
|
delete |
成员函数说明
◆ apply()
| Result< int > eve::procgen::road::RoadTerrainWorkspace::apply | ( | const MeshBuild & | mesh, |
| const RoadTerrainWriteOptions & | options | ||
| ) |
Evaluate road coverage and publish height, texture, details, trees and selected holes together. Bridge surfaces never paint/clear terrain. Tunnel heights and vegetation roofs remain intact unless holes are selected. Splat coverage times opacity raises the selected weight only when greater than its current weight; other layers retain their relative proportions. Zero preserves splats while independent channels execute. No quantization. @cost Raster work is bounded by maximumWork; each transaction copies bounded retained history before publishing.
- 返回
- Changed channel element count; any failure preserves every tile and the redo branch.
在文件 RoadTerrainWorkspace.cpp 第 180 行定义.
引用了 applyBatch(), mesh, options , 以及 write.
◆ applyBatch()
| Result< int > eve::procgen::road::RoadTerrainWorkspace::applyBatch | ( | std::span< const RoadTerrainWrite > | writes, |
| std::size_t | maximumWork | ||
| ) |
Apply ordered per-road policies as one complete-channel history frame.
- 参数
-
writes Nonempty borrowed operations (at most 4096); referenced meshes must survive this call. maximumWork Shared work budget across every road and tile; each operation also retains its own cap.
- 返回
- Summed per-operation changed element counts; failure preserves current state and redo history. @cost One retained-history candidate plus bounded raster work summed over the operations, per explicit build.
- 注解
- Owner-thread only, synchronous, no callbacks. Overlap follows input order; no reference overlap parity claim.
在文件 RoadTerrainWorkspace.cpp 第 184 行定义.
引用了 eve::procgen::road::RoadTerrainConformOptions::blendDistance, eve::procgen::road::RoadTerrainConformOptions::cellSize, changed, eve::procgen::road::conformHeightmapToRoadWithReceipt(), coverage, d, eve::Result< T >::failure(), frame, eve::procgen::Heightmap::getWidth(), ground, height, eve::procgen::road::RoadTerrainTile::heights, eve::procgen::road::RoadTerrainConformOptions::heightScale, eve::procgen::road::RoadTerrainTile::holes, mask, eve::procgen::road::RoadTerrainConformOptions::maximumWork, eve::procgen::road::RoadTerrainConformOptions::maxVerticalDelta, mesh, options, eve::procgen::road::RoadTerrainConformOptions::originX, eve::procgen::road::RoadTerrainConformOptions::originY, eve::procgen::road::RoadTerrainConformOptions::originZ, size, eve::procgen::road::RoadTerrainTile::splatLayers, eve::Result< T >::success(), target, u, value, weight , 以及 write.
被这些函数引用 apply() , 以及 eve::procgen::road::RoadTerrainPlan::apply().
◆ capture()
Encode current data and the complete undo/redo history as an owning canonical Value. @cost Linear in retained history storage, amortized at save boundaries.
在文件 RoadTerrainWorkspaceCodec.cpp 第 147 行定义.
◆ copyTile()
| Result< RoadTerrainTile > eve::procgen::road::RoadTerrainWorkspace::copyTile | ( | const std::string & | id | ) | const |
Copy one tile snapshot; returned data never aliases the owner. @cost Linear in this tile's channel storage, amortized at renderer/save boundaries.
在文件 RoadTerrainWorkspace.cpp 第 306 行定义.
◆ initialize()
| Result< int > eve::procgen::road::RoadTerrainWorkspace::initialize | ( | std::vector< RoadTerrainTile > | tiles | ) |
Validate and import complete tile values, clearing history atomically. @cost Linear in all channel samples and tree instances, amortized at import boundaries.
- 返回
- Imported tile count, or a structured diagnostic leaving this owner unchanged.
在文件 RoadTerrainWorkspace.cpp 第 171 行定义.
引用了 count, eve::Result< T >::failure(), eve::Result< T >::success(), tiles, valid , 以及 eve::procgen::road::detail::validateTerrainTiles().
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
defaultnoexcept |
Transfer ownership and release the previous history.
◆ redo()
| Result< int > eve::procgen::road::RoadTerrainWorkspace::redo | ( | ) |
Restore the next complete-channel value; no mutation when history is exhausted. Selects an owned immutable history frame by cursor, without copying channel storage.
在文件 RoadTerrainWorkspace.cpp 第 301 行定义.
◆ restore()
◆ undo()
| Result< int > eve::procgen::road::RoadTerrainWorkspace::undo | ( | ) |
Restore the previous complete-channel value; no mutation when history is exhausted. Selects an owned immutable history frame by cursor, without copying channel storage.
在文件 RoadTerrainWorkspace.cpp 第 296 行定义.
引用了 eve::Result< T >::success() , 以及 u.
该类的文档由以下文件生成:
- src/modules/procgen/road/RoadTerrainWorkspace.h
- src/modules/procgen/road/RoadTerrainWorkspace.cpp
- src/modules/procgen/road/RoadTerrainWorkspaceCodec.cpp