载入中...
搜索中...
未找到
ArchSpaceQuery.cpp
浏览该文件的文档.
41 return Vec3{wall->start.x + (wall->end.x - wall->start.x) * opening.t, opening.sill + opening.openingHeight * 0.5,
90 const auto a = nearestRegionId(document, portal.levelId, Vec2{mid.x + n.x * offset, mid.z + n.z * offset});
91 const auto b = nearestRegionId(document, portal.levelId, Vec2{mid.x - n.x * offset, mid.z - n.z * offset});
166 if (portal.regionAId == regionId || portal.regionBId == regionId) out.push_back(std::move(portal));
171eve::Result<bool> SpaceQuery::regionsConnected(const std::string& regionAId, const std::string& regionBId) const {
182 eve::DiagnosticCode::NotFound, "ArchSpace region id is unknown", "regionId", {}, "archspace.query"));
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
Authoritative ArchSpace document (Pascal-like node graph).
Definition ArchSpaceDocument.h:26
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
const std::unordered_map< std::string, Node > & nodes() const noexcept
Definition ArchSpaceDocument.h:33
TopologyKind topology() const noexcept
Topology dialect for authoring helpers and SpaceQuery.
Definition ArchSpaceDocument.h:38
std::vector< std::string > strata() const
Level (stratum) ids in document iteration order.
Definition ArchSpaceQuery.cpp:120
eve::Result< bool > regionsConnected(const std::string ®ionAId, const std::string ®ionBId) const
Whether two regions share a portal path (undirected, same connected component).
Definition ArchSpaceQuery.cpp:171
std::vector< SpaceRegion > regions() const
All Zone regions as SpaceRegion snapshots.
Definition ArchSpaceQuery.cpp:129
std::vector< SpacePortal > portals() const
Wall openings and level portals as SpacePortal snapshots.
Definition ArchSpaceQuery.cpp:149
std::vector< SpaceAnchor > anchorsIn(const std::string ®ionId) const
Item anchors whose position lies inside the region polygon (same level).
Definition ArchSpaceQuery.cpp:209
SpaceQuery(const Document &document) noexcept
Bind to an existing document. @ownership Non-owning borrow of document; caller retains ownership....
Definition ArchSpaceQuery.cpp:114
std::optional< SpaceRegion > regionAt(Vec2 xz, const std::string &levelId) const
First region whose polygon contains the XZ point on the given level.
Definition ArchSpaceQuery.cpp:139
std::vector< SpacePortal > portalsFrom(const std::string ®ionId) const
Portals that touch the given region id.
Definition ArchSpaceQuery.cpp:162
Definition ArchSpace.cpp:14
@ Portal
Level-hosted portal connecting two regions (dungeon/cave or free openings).
@ Opening
TopologyKind
Document topology dialect. Storage stays one node graph; semantics and authoring helpers differ by di...
Definition ArchSpaceTypes.h:33
@ Architectural
bool pointInPolygon(float px, float py, const std::vector< HousePolygonPoint > &poly)
Ray-casting point-in-polygon test in corner coordinates.
Definition HouseGenerationAlgorithms.cpp:100
@ InvalidArgument
@ NotFound
Definition Container.h:602
One authored architectural node. Only fields for the active kind are meaningful.
Definition ArchSpaceTypes.h:63