载入中...
搜索中...
未找到
ArchSpaceDocument.cpp
浏览该文件的文档.
15eve::Result<void> ok() { return eve::Result<void>::success(eve::Status::success(eve::StatusCode::Applied)); }
47void appendBox(MeshBake& bake, const Vec3& a, const Vec3& b, double thickness, double height, const std::string& id) {
62 static constexpr std::uint32_t faces[12][3] = {{0, 1, 2}, {0, 2, 3}, {4, 6, 5}, {4, 7, 6}, {0, 3, 7}, {0, 7, 4},
72void appendSlab(MeshBake& bake, const std::vector<Vec2>& poly, double y, double thickness, const std::string& id) {
129 case NodeKind::Level: return isFinite(node.elevation) && isFinite(node.height) && node.height > kEps;
131 return isFinite(node.start) && isFinite(node.end) && isFinite(node.thickness) && isFinite(node.height) &&
139 return isFinite(node.t) && node.t >= 0.0 && node.t <= 1.0 && isFinite(node.width) && node.width > kEps &&
140 isFinite(node.openingHeight) && node.openingHeight > kEps && isFinite(node.sill) && node.sill >= 0.0;
142 return !node.regionAId.empty() && node.regionAId.size() <= 128 && node.regionBId.size() <= 128 &&
169 eve::DiagnosticCode::Conflict, "ArchSpace node id already exists", "id", {}, "archspace.document"));
271eve::Result<void> Document::createRoom(const std::string& levelId, const std::string& roomId, std::string roomName,
321eve::Result<void> Document::createWall(const std::string& levelId, const std::string& wallId, std::string wallName,
340eve::Result<void> Document::createOpening(const std::string& wallId, const std::string& openingId,
361eve::Result<void> Document::placeItem(const std::string& levelId, const std::string& itemId, std::string itemName,
379eve::Result<void> Document::createRegion(const std::string& levelId, const std::string& regionId,
399eve::Result<void> Document::createPortal(const std::string& levelId, const std::string& portalId,
416 eve::DiagnosticCode::NotFound, "ArchSpace portal regionB must be a zone on the level", "regionBId", {},
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
Authoritative ArchSpace document (Pascal-like node graph).
Definition ArchSpaceDocument.h:26
eve::Result< void > createWall(const std::string &levelId, const std::string &wallId, std::string wallName, Vec2 start, Vec2 end, double height, double thickness)
Insert a single wall under an existing level.
Definition ArchSpaceDocument.cpp:321
eve::Result< void > createRegion(const std::string &levelId, const std::string ®ionId, std::string regionName, std::vector< Vec2 > polygon)
Create a Region (Zone) without perimeter walls — dungeon rooms / cave chambers.
Definition ArchSpaceDocument.cpp:379
eve::Result< void > eraseCascade(const std::string &id)
Delete a node and every descendant. Root deletion clears the document.
Definition ArchSpaceDocument.cpp:208
Node * findMutable(const std::string &id)
Borrow a mutable node by id. @ownership Non-owning pointer into this document's node map; do not free...
Definition ArchSpaceDocument.cpp:96
eve::Result< void > placeItem(const std::string &levelId, const std::string &itemId, std::string itemName, std::string catalogId, Vec3 position, double yawDegrees=0.0)
Place a catalog item on an existing level.
Definition ArchSpaceDocument.cpp:361
eve::Result< void > bootstrap(const std::string &siteId, const std::string &buildingId, const std::string &levelId, double levelHeight=3.0)
Create site → building → level skeleton when the document is empty.
Definition ArchSpaceDocument.cpp:235
const Node * find(const std::string &id) const
Borrow a node by id. @ownership Non-owning pointer into this document's node map; do not free....
Definition ArchSpaceDocument.cpp:91
std::vector< std::string > diagnostics() const
Collect structural and geometric diagnostics as human-readable lines.
Definition ArchSpaceDocument.cpp:431
eve::Result< void > createPortal(const std::string &levelId, const std::string &portalId, std::string portalName, std::string regionAId, std::string regionBId, PassageMask passageMask, Vec3 position)
Create a level-hosted portal connecting two regions.
Definition ArchSpaceDocument.cpp:399
eve::Result< void > replace(Node node)
Replace authored fields while preserving id, kind, parent and children.
Definition ArchSpaceDocument.cpp:192
eve::Result< void > setTopology(TopologyKind topology)
Set topology dialect.
Definition ArchSpaceDocument.cpp:230
eve::Result< void > insert(Node node)
Insert a validated node and link it into the parent child list.
Definition ArchSpaceDocument.cpp:166
MeshBake bakeMesh() const
Build wall boxes (with opening cutouts), slabs and item markers for viewport upload.
Definition ArchSpaceDocument.cpp:461
TopologyKind topology() const noexcept
Topology dialect for authoring helpers and SpaceQuery.
Definition ArchSpaceDocument.h:38
eve::Result< void > createOpening(const std::string &wallId, const std::string &openingId, std::string openingName, OpeningKind kind, double t, double width, double height, double sill=0.0)
Insert a door/window opening on an existing wall.
Definition ArchSpaceDocument.cpp:340
eve::Result< void > createRoom(const std::string &levelId, const std::string &roomId, std::string roomName, std::vector< Vec2 > polygon, double wallHeight, double wallThickness, double slabThickness)
Create a closed room: perimeter walls + slab + zone under an existing level.
Definition ArchSpaceDocument.cpp:271
Definition ArchSpace.cpp:14
OpeningKind
Opening semantic used by doors and windows hosted on walls.
Definition ArchSpaceTypes.h:27
void appendWallWithOpenings(MeshBake &bake, const Node &wall, double elevation, const std::vector< const Node * > &openings)
Bake one wall with merged opening cavities and explicit reveal liners.
Definition ArchSpaceCatalog.cpp:135
void appendCatalogItem(MeshBake &bake, const std::string &itemId, const std::string &catalogId, const Vec3 &position, double yawDegrees)
Append yaw-oriented catalog geometry into a mesh bake.
Definition ArchSpaceCatalog.cpp:120
NodeKind
Stable node kind discriminator for the architectural document.
Definition ArchSpaceTypes.h:13
@ Portal
Level-hosted portal connecting two regions (dungeon/cave or free openings).
@ Opening
@ Building
TopologyKind
Document topology dialect. Storage stays one node graph; semantics and authoring helpers differ by di...
Definition ArchSpaceTypes.h:33
@ Architectural
void appendBox(MeshBuild &mesh, V3 center, V3 side, V3 up, V3 forward, float hx, float hy, float hz, RoadMaterial material)
Module-private road bake implementation helper.
Definition RoadBake.cpp:402
@ InvalidArgument
@ NotFound
@ PreconditionViolation
@ Conflict
@ Applied
Renderer-neutral triangle mesh rebuilt from the document.
Definition ArchSpaceTypes.h:133
One authored architectural node. Only fields for the active kind are meaningful.
Definition ArchSpaceTypes.h:63