载入中...
搜索中...
未找到
eve::housegen::house_detail 命名空间参考

类

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 
)

在文件 HouseGenerationAlgorithms.cpp 第 95 行定义.

引用了 depth, mask, width, x , 以及 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 
)

在文件 HouseGenerationAlgorithms.cpp 第 169 行定义.

引用了 depth, mask, origin, width, x , 以及 y.

被这些函数引用 eve::housegen::house_detail::State::floor().

◆ 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.

被这些函数引用 eve::housegen::house_detail::State::floor().

◆ directionFromName()

SocketDirection eve::housegen::house_detail::directionFromName ( const std::string &  name)

◆ directionName()

std::string eve::housegen::house_detail::directionName ( SocketDirection  direction)

◆ directionRotation()

int eve::housegen::house_detail::directionRotation ( SocketDirection  direction)

◆ 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().

被这些函数引用 eve::housegen::house_detail::State::floor().

◆ 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 
)

Internal footprintMask stage helper. @cost Linear in plot cells; reuse for one floor emission.

在文件 HouseGenerationAlgorithms.cpp 第 75 行定义.

引用了 active, depth, mask, shape, width, x , 以及 y.

被这些函数引用 eve::housegen::house_detail::State::makeMask().

◆ has()

bool eve::housegen::house_detail::has ( const std::vector< std::reference_wrapper< const HouseComponent > > &  values)

在文件 HouseGenerationAlgorithms.cpp 第 18 行定义.

引用了 values.

被这些函数引用 eve::housegen::house_detail::State::configure().

◆ isOneOf()

bool eve::housegen::house_detail::isOneOf ( const std::string &  value,
std::initializer_list< const char * >  options 
)

在文件 HouseGenerationAlgorithms.cpp 第 48 行定义.

引用了 options , 以及 value.

被这些函数引用 eve::housegen::house_detail::State::configure().

◆ 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)

◆ 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 
)

◆ 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 行定义.

引用了 inside, px , 以及 py.

被这些函数引用 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 行定义.

引用了 depth, mask, pointInPolygon(), width, x , 以及 y.

被这些函数引用 eve::housegen::house_detail::State::makeMask().

◆ rotate()

SocketDirection eve::housegen::house_detail::rotate ( SocketDirection  direction,
int  degrees 
)