类 | |
| struct | State |
函数 | |
| const HouseComponent * | pick (const std::vector< std::reference_wrapper< const HouseComponent > > &choices, std::mt19937 &rng) |
| Borrow a weighted component from library-backed choices. @ownership Borrowed; the session's library owns the component. @nullable Yes when no compatible component exists. @lifetime Until the owning session library is replaced or destroyed; used only within one stage. @thread Session owner thread only; no callbacks. | |
| bool | has (const std::vector< std::reference_wrapper< const HouseComponent > > &values) |
| bool | isRotationAllowed (const HouseComponent &component, int rotation) |
| bool | isWindowComponent (const HouseComponent *component) |
| std::vector< std::reference_wrapper< const HouseComponent > > | facadeVariant (const std::vector< std::reference_wrapper< const HouseComponent > > &choices, bool wantWindow) |
| Internal facadeVariant stage helper. @cost Linear in component choices; amortized across one facade placement. | |
| bool | isOneOf (const std::string &value, std::initializer_list< const char * > options) |
| SocketDirection | directionFromName (const std::string &name) |
| std::string | directionName (SocketDirection direction) |
| int | directionRotation (SocketDirection direction) |
| std::vector< uint8_t > | footprintMask (const std::string &shape, int width, int depth, int inset) |
| Internal footprintMask stage helper. @cost Linear in plot cells; reuse for one floor emission. | |
| bool | active (const std::vector< uint8_t > &mask, int width, int depth, int x, int y) |
| bool | pointInPolygon (float px, float py, const std::vector< HousePolygonPoint > &poly) |
| Ray-casting point-in-polygon test in corner coordinates. | |
| std::vector< uint8_t > | polygonMask (const std::vector< HousePolygonPoint > &poly, int width, int depth, int inset) |
| Rasterize an arbitrary closed polygon onto the cell grid (cell centers inside). | |
| SocketDirection | rotate (SocketDirection direction, int degrees) |
| std::vector< std::reference_wrapper< const HouseComponent > > | compatibleOnFace (const std::vector< std::reference_wrapper< const HouseComponent > > &choices, SocketDirection face, int rotation) |
| Internal compatibleOnFace stage helper. @cost Component choices times sockets; used for one facade placement. | |
| std::optional< std::pair< int, int > > | findInteriorCell (const std::vector< uint8_t > &mask, int width, int depth) |
| First active cell that is interior (all four orthogonal neighbours active). | |
| void | appendRoomRegions (int width, int depth, const std::vector< uint8_t > &mask, const std::string &roomType, int floorZ, std::vector< HouseRoom > &rooms) |
| eve::Result< void > | partitionFloor (int width, int depth, const std::vector< uint8_t > &mask, const std::vector< std::string > &roomTypes, std::mt19937 &rng, const std::vector< std::reference_wrapper< const HouseComponent > > &innerWall, const std::vector< std::reference_wrapper< const HouseComponent > > &innerDoor, std::vector< HouseInstance > &instances, std::vector< HouseRoom > &rooms, int floorZ) |
| Partition active cells into exact, rectangular rooms and emit mask-safe boundaries. | |
函数说明
◆ active()
| bool eve::housegen::house_detail::active | ( | const std::vector< uint8_t > & | mask, |
| int | width, | ||
| int | depth, | ||
| int | x, | ||
| int | y | ||
| ) |
◆ appendRoomRegions()
| void eve::housegen::house_detail::appendRoomRegions | ( | int | width, |
| int | depth, | ||
| const std::vector< uint8_t > & | mask, | ||
| const std::string & | roomType, | ||
| int | floorZ, | ||
| std::vector< HouseRoom > & | rooms | ||
| ) |
◆ compatibleOnFace()
| std::vector< std::reference_wrapper< const HouseComponent > > eve::housegen::house_detail::compatibleOnFace | ( | const std::vector< std::reference_wrapper< const HouseComponent > > & | choices, |
| SocketDirection | face, | ||
| int | rotation | ||
| ) |
Internal compatibleOnFace stage helper. @cost Component choices times sockets; used for one facade placement.
在文件 HouseGenerationAlgorithms.cpp 第 132 行定义.
引用了 c, choices, isRotationAllowed(), out, rotate() , 以及 rotation.
◆ directionFromName()
| SocketDirection eve::housegen::house_detail::directionFromName | ( | const std::string & | name | ) |
◆ directionName()
| std::string eve::housegen::house_detail::directionName | ( | SocketDirection | direction | ) |
在文件 HouseGenerationAlgorithms.cpp 第 61 行定义.
引用了 direction, eve::housegen::East, eve::housegen::South , 以及 eve::housegen::West.
◆ directionRotation()
| int eve::housegen::house_detail::directionRotation | ( | SocketDirection | direction | ) |
在文件 HouseGenerationAlgorithms.cpp 第 68 行定义.
引用了 direction, eve::housegen::East, eve::housegen::South , 以及 eve::housegen::West.
◆ facadeVariant()
| std::vector< std::reference_wrapper< const HouseComponent > > eve::housegen::house_detail::facadeVariant | ( | const std::vector< std::reference_wrapper< const HouseComponent > > & | choices, |
| bool | wantWindow | ||
| ) |
Internal facadeVariant stage helper. @cost Linear in component choices; amortized across one facade placement.
在文件 HouseGenerationAlgorithms.cpp 第 32 行定义.
引用了 choices , 以及 isWindowComponent().
◆ findInteriorCell()
| std::optional< std::pair< int, int > > eve::housegen::house_detail::findInteriorCell | ( | const std::vector< uint8_t > & | mask, |
| int | width, | ||
| int | depth | ||
| ) |
First active cell that is interior (all four orthogonal neighbours active).
Internal findInteriorCell stage helper. @cost Linear in plot cells; find one stair column per house.
在文件 HouseGenerationAlgorithms.cpp 第 155 行定义.
引用了 active, depth, dx, dy, mask, width, x , 以及 y.
被这些函数引用 eve::housegen::house_detail::State::configure() , 以及 eve::housegen::HouseGeneration::emitFloor().
◆ footprintMask()
| std::vector< uint8_t > eve::housegen::house_detail::footprintMask | ( | const std::string & | shape, |
| int | width, | ||
| int | depth, | ||
| int | inset | ||
| ) |
◆ has()
| bool eve::housegen::house_detail::has | ( | const std::vector< std::reference_wrapper< const HouseComponent > > & | values | ) |
在文件 HouseGenerationAlgorithms.cpp 第 18 行定义.
引用了 values.
◆ isOneOf()
| bool eve::housegen::house_detail::isOneOf | ( | const std::string & | value, |
| std::initializer_list< const char * > | options | ||
| ) |
在文件 HouseGenerationAlgorithms.cpp 第 48 行定义.
◆ isRotationAllowed()
| bool eve::housegen::house_detail::isRotationAllowed | ( | const HouseComponent & | component, |
| int | rotation | ||
| ) |
在文件 HouseGenerationAlgorithms.cpp 第 20 行定义.
引用了 rotation , 以及 eve::housegen::HouseComponent::rotations.
被这些函数引用 compatibleOnFace() , 以及 partitionFloor().
◆ isWindowComponent()
| bool eve::housegen::house_detail::isWindowComponent | ( | const HouseComponent * | component | ) |
在文件 HouseGenerationAlgorithms.cpp 第 26 行定义.
引用了 eve::housegen::HouseComponent::id , 以及 eve::housegen::HouseComponent::tags.
被这些函数引用 facadeVariant().
◆ partitionFloor()
| eve::Result< void > eve::housegen::house_detail::partitionFloor | ( | int | width, |
| int | depth, | ||
| const std::vector< uint8_t > & | mask, | ||
| const std::vector< std::string > & | roomTypes, | ||
| std::mt19937 & | rng, | ||
| const std::vector< std::reference_wrapper< const HouseComponent > > & | innerWall, | ||
| const std::vector< std::reference_wrapper< const HouseComponent > > & | innerDoor, | ||
| std::vector< HouseInstance > & | instances, | ||
| std::vector< HouseRoom > & | rooms, | ||
| int | floorZ | ||
| ) |
Partition active cells into exact, rectangular rooms and emit mask-safe boundaries.
在文件 HouseGenerationAlgorithms.cpp 第 197 行定义.
引用了 a, area, b, boundary, cell, depth, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::housegen::HouseComponent::id, isRotationAllowed(), mask, eve::NotFound, origin, pick(), rotation, source, eve::Result< T >::success(), target, eve::Unsupported, width, x , 以及 y.
◆ pick()
| const HouseComponent * eve::housegen::house_detail::pick | ( | const std::vector< std::reference_wrapper< const HouseComponent > > & | choices, |
| std::mt19937 & | rng | ||
| ) |
Borrow a weighted component from library-backed choices. @ownership Borrowed; the session's library owns the component. @nullable Yes when no compatible component exists. @lifetime Until the owning session library is replaced or destroyed; used only within one stage. @thread Session owner thread only; no callbacks.
在文件 HouseGenerationAlgorithms.cpp 第 4 行定义.
引用了 choices, roll, target , 以及 eve::housegen::HouseComponent::weight.
被这些函数引用 eve::housegen::house_detail::State::floor() , 以及 partitionFloor().
◆ pointInPolygon()
| bool eve::housegen::house_detail::pointInPolygon | ( | float | px, |
| float | py, | ||
| const std::vector< HousePolygonPoint > & | poly | ||
| ) |
Ray-casting point-in-polygon test in corner coordinates.
在文件 HouseGenerationAlgorithms.cpp 第 100 行定义.
被这些函数引用 polygonMask().
◆ polygonMask()
| std::vector< uint8_t > eve::housegen::house_detail::polygonMask | ( | const std::vector< HousePolygonPoint > & | poly, |
| int | width, | ||
| int | depth, | ||
| int | inset | ||
| ) |
Rasterize an arbitrary closed polygon onto the cell grid (cell centers inside).
Internal polygonMask stage helper. @cost Plot cells times polygon vertices; prepare once per floor.
在文件 HouseGenerationAlgorithms.cpp 第 111 行定义.
◆ rotate()
| SocketDirection eve::housegen::house_detail::rotate | ( | SocketDirection | direction, |
| int | degrees | ||
| ) |
在文件 HouseGenerationAlgorithms.cpp 第 119 行定义.
引用了 degrees, direction, eve::housegen::Down, eve::housegen::East, eve::housegen::North, eve::housegen::South, eve::housegen::Up , 以及 eve::housegen::West.
被这些函数引用 compatibleOnFace().