载入中...
搜索中...
未找到
eve::procgen::ShapeGrammar类 参考

Module-based shape grammar expanded continuously along a 3D polyline. 更多...

#include <ShapeGrammar.h>

Public 成员函数

void clear ()
 Remove every registered symbol and diagnostic.
 
bool addModule (const std::string &symbol, const std::string &asset, float length, float weight=1.f)
 Register a weighted asset variant for a symbol.
 
bool removeModule (const std::string &symbol)
 Removes module.
 
bool hasModule (const std::string &symbol) const
 True when module.
 
int getModuleCount () const
 Returns the module count.
 
std::string getModuleSymbol (int index) const
 Returns the module symbol.
 
int getVariantCount (const std::string &symbol) const
 Returns the variant count.
 
std::string getVariantAsset (const std::string &symbol, int index) const
 Returns the variant asset.
 
float getVariantLength (const std::string &symbol, int index) const
 Returns the variant length.
 
bool validate (const std::string &grammar)
 Parse and validate grammar without generating output.
 
PointSet * generate (const std::string &grammar, PointSet *controlPoints, uint32_t seed, bool acceptIncomplete)
 Expand grammar along control points.
 
std::string getError () const
 Returns the error.
 
std::string debugReport () const
 Debug report.
 

详细描述

Module-based shape grammar expanded continuously along a 3D polyline.

Grammar syntax follows UE PCG's useful subset: comma-separated symbols, bracket groups, * (zero or more), + (one or more), and an integer repeat suffix. Module symbols do not contain decimal digits, which are reserved for exact repetition. Repetitions fill available spline length without crossing its end.

在文件 ShapeGrammar.h 第 27 行定义.

成员函数说明

◆ addModule()

bool eve::procgen::ShapeGrammar::addModule ( const std::string &  symbol,
const std::string &  asset,
float  length,
float  weight = 1.f 
)

Register a weighted asset variant for a symbol.

在文件 ShapeGrammar.cpp 第 67 行定义.

引用了 length , 以及 weight.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ clear()

void eve::procgen::ShapeGrammar::clear ( )

Remove every registered symbol and diagnostic.

在文件 ShapeGrammar.cpp 第 58 行定义.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ debugReport()

std::string eve::procgen::ShapeGrammar::debugReport ( ) const

Debug report.

在文件 ShapeGrammar.cpp 第 183 行定义.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ generate()

PointSet * eve::procgen::ShapeGrammar::generate ( const std::string &  grammar,
PointSet *  controlPoints,
uint32_t  seed,
bool  acceptIncomplete 
)

Expand grammar along control points.

参数
acceptIncompleteKeep a final module only when it fully fits; when false, generation fails if mandatory grammar cannot fit the spline.

在文件 ShapeGrammar.cpp 第 131 行定义.

引用了 cursor, eve::procgen::PointSet::getCount(), output, point, seed, eve::procgen::ProcgenPoint::seed, validate() , 以及 variant.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ getError()

std::string eve::procgen::ShapeGrammar::getError ( ) const

Returns the error.

在文件 ShapeGrammar.cpp 第 182 行定义.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ getModuleCount()

int eve::procgen::ShapeGrammar::getModuleCount ( ) const

Returns the module count.

在文件 ShapeGrammar.cpp 第 84 行定义.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ getModuleSymbol()

std::string eve::procgen::ShapeGrammar::getModuleSymbol ( int  index) const

Returns the module symbol.

在文件 ShapeGrammar.cpp 第 85 行定义.

引用了 index.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ getVariantAsset()

std::string eve::procgen::ShapeGrammar::getVariantAsset ( const std::string &  symbol,
int  index 
) const

Returns the variant asset.

在文件 ShapeGrammar.cpp 第 92 行定义.

引用了 found , 以及 index.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ getVariantCount()

int eve::procgen::ShapeGrammar::getVariantCount ( const std::string &  symbol) const

Returns the variant count.

在文件 ShapeGrammar.cpp 第 88 行定义.

引用了 found.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ getVariantLength()

float eve::procgen::ShapeGrammar::getVariantLength ( const std::string &  symbol,
int  index 
) const

Returns the variant length.

在文件 ShapeGrammar.cpp 第 98 行定义.

引用了 found , 以及 index.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ hasModule()

bool eve::procgen::ShapeGrammar::hasModule ( const std::string &  symbol) const

True when module.

在文件 ShapeGrammar.cpp 第 83 行定义.

被这些函数引用 eve::procgen::exposeShapeGrammar() , 以及 validate().

◆ removeModule()

bool eve::procgen::ShapeGrammar::removeModule ( const std::string &  symbol)

Removes module.

在文件 ShapeGrammar.cpp 第 78 行定义.

被这些函数引用 eve::procgen::exposeShapeGrammar().

◆ validate()

bool eve::procgen::ShapeGrammar::validate ( const std::string &  grammar)

Parse and validate grammar without generating output.

在文件 ShapeGrammar.cpp 第 105 行定义.

引用了 element , 以及 hasModule().

被这些函数引用 eve::procgen::exposeShapeGrammar() , 以及 generate().


该类的文档由以下文件生成: