Complete metadata and parameter schema shared by every procgen recipe family. 更多...
#include <ParamSchema.h>
Public 成员函数 | |
| const ParamDescriptor * | find (const std::string &key) const |
| Find one parameter descriptor by stable key. | |
| void | applyDefaults (Params ¶ms) const |
| Fill missing Params values from this schema. | |
| int | getParamCount () const |
| Return the number of reflected parameters. | |
| std::string | getId () const |
| Return the stable recipe id. | |
| std::string | getDisplayName () const |
| Return the human-readable recipe name. | |
| std::string | getCategory () const |
| Return the recipe browser category. | |
| std::string | getParamKey (int index) const |
| Return a parameter key by index. | |
| std::string | getParamLabel (int index) const |
| Return a parameter label by index. | |
| std::string | getParamDescription (int index) const |
| Return parameter help text by index. | |
| std::string | getParamCategory (int index) const |
| Return a parameter category by index. | |
| std::string | getParamKind (int index) const |
| Return the portable parameter kind. | |
| std::string | getParamDefault (int index) const |
| Return the schema default encoded as text. | |
| bool | paramHasMinimum (int index) const |
| Test whether a numeric minimum exists. | |
| bool | paramHasMaximum (int index) const |
| Test whether a numeric maximum exists. | |
| float | getParamMinimum (int index) const |
| Return a numeric minimum. | |
| float | getParamMaximum (int index) const |
| Return a numeric maximum. | |
| float | getParamStep (int index) const |
| Return the suggested numeric editing step. | |
| bool | isParamAdvanced (int index) const |
| Test whether compact inspectors should hide the field. | |
| int | getParamChoiceCount (int index) const |
| Return the number of choices for one parameter. | |
| std::string | getParamChoice (int paramIndex, int choiceIndex) const |
| Return one choice. | |
静态 Public 成员函数 | |
| static RecipeDescriptor | grid (std::string id, std::string displayName, std::string category, int minimumWidth, int minimumHeight, int maximumWidth=4096, int maximumHeight=4096) |
| Create a schema with common seed, width and height parameters. | |
Public 属性 | |
| std::string | id |
| std::string | displayName |
| std::string | category |
| std::vector< ParamDescriptor > | params |
详细描述
Complete metadata and parameter schema shared by every procgen recipe family.
在文件 ParamSchema.h 第 52 行定义.
成员函数说明
◆ applyDefaults()
| void eve::procgen::RecipeDescriptor::applyDefaults | ( | Params & | params | ) | const |
Fill missing Params values from this schema.
- 参数
-
params Values to update.
在文件 ParamSchema.cpp 第 91 行定义.
引用了 eve::procgen::Boolean, eve::procgen::Choice, eve::procgen::Float, eve::procgen::Integer, params, eve::procgen::String , 以及 values.
被这些函数引用 eve::procgen::MeshRecipeRegistry::applyDefaults(), eve::procgen::GeneratorRegistry::applyDefaults(), eve::procgen::PbrRecipeRegistry::applyDefaults() , 以及 eve::procgen::TextureRecipeRegistry::applyDefaults().
◆ find()
| const ParamDescriptor * eve::procgen::RecipeDescriptor::find | ( | const std::string & | key | ) | const |
Find one parameter descriptor by stable key.
- 参数
-
key Parameter key.
- 返回
- Schema-owned descriptor or nullptr.
在文件 ParamSchema.cpp 第 85 行定义.
引用了 params.
◆ getCategory()
|
inline |
◆ getDisplayName()
|
inline |
◆ getId()
|
inline |
◆ getParamCategory()
| std::string eve::procgen::RecipeDescriptor::getParamCategory | ( | int | index | ) | const |
Return a parameter category by index.
- 参数
-
index Parameter index.
- 返回
- Category or empty text.
在文件 ParamSchema.cpp 第 123 行定义.
引用了 at, eve::procgen::ParamDescriptor::category , 以及 index.
◆ getParamChoice()
| std::string eve::procgen::RecipeDescriptor::getParamChoice | ( | int | paramIndex, |
| int | choiceIndex | ||
| ) | const |
Return one choice.
- 参数
-
paramIndex Parameter index. choiceIndex Choice index.
- 返回
- Choice or empty text.
在文件 ParamSchema.cpp 第 181 行定义.
引用了 at , 以及 eve::procgen::ParamDescriptor::choices.
◆ getParamChoiceCount()
| int eve::procgen::RecipeDescriptor::getParamChoiceCount | ( | int | index | ) | const |
Return the number of choices for one parameter.
- 参数
-
index Parameter index.
- 返回
- Choice count.
在文件 ParamSchema.cpp 第 176 行定义.
引用了 at, eve::procgen::ParamDescriptor::choices , 以及 index.
◆ getParamCount()
|
inline |
Return the number of reflected parameters.
- 返回
- Parameter count.
在文件 ParamSchema.h 第 71 行定义.
引用了 params.
◆ getParamDefault()
| std::string eve::procgen::RecipeDescriptor::getParamDefault | ( | int | index | ) | const |
Return the schema default encoded as text.
- 参数
-
index Parameter index.
- 返回
- Encoded default or empty text.
在文件 ParamSchema.cpp 第 141 行定义.
引用了 at, eve::procgen::ParamDescriptor::defaultValue , 以及 index.
◆ getParamDescription()
| std::string eve::procgen::RecipeDescriptor::getParamDescription | ( | int | index | ) | const |
Return parameter help text by index.
- 参数
-
index Parameter index.
- 返回
- Help text or empty text.
在文件 ParamSchema.cpp 第 118 行定义.
引用了 at, eve::procgen::ParamDescriptor::description , 以及 index.
◆ getParamKey()
| std::string eve::procgen::RecipeDescriptor::getParamKey | ( | int | index | ) | const |
Return a parameter key by index.
- 参数
-
index Parameter index.
- 返回
- Key or empty text.
在文件 ParamSchema.cpp 第 108 行定义.
引用了 at, index , 以及 eve::procgen::ParamDescriptor::key.
◆ getParamKind()
| std::string eve::procgen::RecipeDescriptor::getParamKind | ( | int | index | ) | const |
Return the portable parameter kind.
- 参数
-
index Parameter index.
- 返回
- int, float, bool, string, choice, or empty text.
在文件 ParamSchema.cpp 第 128 行定义.
引用了 at, eve::procgen::Boolean, eve::procgen::Choice, eve::procgen::Float, index, eve::procgen::Integer, eve::procgen::ParamDescriptor::kind , 以及 eve::procgen::String.
◆ getParamLabel()
| std::string eve::procgen::RecipeDescriptor::getParamLabel | ( | int | index | ) | const |
Return a parameter label by index.
- 参数
-
index Parameter index.
- 返回
- Label or empty text.
在文件 ParamSchema.cpp 第 113 行定义.
引用了 at, eve::procgen::ParamDescriptor::displayName , 以及 index.
◆ getParamMaximum()
| float eve::procgen::RecipeDescriptor::getParamMaximum | ( | int | index | ) | const |
Return a numeric maximum.
- 参数
-
index Parameter index.
- 返回
- Maximum or zero.
在文件 ParamSchema.cpp 第 161 行定义.
引用了 at, index , 以及 eve::procgen::ParamDescriptor::maximum.
◆ getParamMinimum()
| float eve::procgen::RecipeDescriptor::getParamMinimum | ( | int | index | ) | const |
Return a numeric minimum.
- 参数
-
index Parameter index.
- 返回
- Minimum or zero.
在文件 ParamSchema.cpp 第 156 行定义.
引用了 at, index , 以及 eve::procgen::ParamDescriptor::minimum.
◆ getParamStep()
| float eve::procgen::RecipeDescriptor::getParamStep | ( | int | index | ) | const |
Return the suggested numeric editing step.
- 参数
-
index Parameter index.
- 返回
- Step or zero.
在文件 ParamSchema.cpp 第 166 行定义.
引用了 at, index , 以及 eve::procgen::ParamDescriptor::step.
◆ grid()
|
static |
Create a schema with common seed, width and height parameters.
- 参数
-
id Stable recipe id. displayName Display name. category Browser category. minimumWidth Minimum width. minimumHeight Minimum height. maximumWidth Maximum width. maximumHeight Maximum height.
- 返回
- Recipe metadata.
在文件 ParamSchema.cpp 第 73 行定义.
引用了 category, displayName, id, eve::procgen::ParamDescriptor::integer() , 以及 params.
被这些函数引用 eve::procgen::makeTextureRecipeDescriptor(), eve::procgen::GeneratorRegistry::registerBuiltins(), eve::procgen::TextureRecipeRegistry::registerBuiltins(), eve::procgen::road::registerRoadTextureRecipes(), eve::procgen::registerTerrainHeightmapAlgorithm() , 以及 eve::procgen::registerWfcSimple().
◆ isParamAdvanced()
| bool eve::procgen::RecipeDescriptor::isParamAdvanced | ( | int | index | ) | const |
Test whether compact inspectors should hide the field.
- 参数
-
index Parameter index.
- 返回
- Advanced flag.
在文件 ParamSchema.cpp 第 171 行定义.
引用了 eve::procgen::ParamDescriptor::advanced, at , 以及 index.
◆ paramHasMaximum()
| bool eve::procgen::RecipeDescriptor::paramHasMaximum | ( | int | index | ) | const |
Test whether a numeric maximum exists.
- 参数
-
index Parameter index.
- 返回
- True when bounded above.
在文件 ParamSchema.cpp 第 151 行定义.
引用了 at, eve::procgen::ParamDescriptor::hasMaximum , 以及 index.
◆ paramHasMinimum()
| bool eve::procgen::RecipeDescriptor::paramHasMinimum | ( | int | index | ) | const |
Test whether a numeric minimum exists.
- 参数
-
index Parameter index.
- 返回
- True when bounded below.
在文件 ParamSchema.cpp 第 146 行定义.
引用了 at, eve::procgen::ParamDescriptor::hasMinimum , 以及 index.
类成员变量说明
◆ category
| std::string eve::procgen::RecipeDescriptor::category |
◆ displayName
| std::string eve::procgen::RecipeDescriptor::displayName |
◆ id
| std::string eve::procgen::RecipeDescriptor::id |
在文件 ParamSchema.h 第 53 行定义.
被这些函数引用 grid(), eve::procgen::GeneratorRegistry::registerAlgorithm(), eve::procgen::registerCablePbrRecipes(), eve::procgen::registerFloorPbrRecipes(), eve::procgen::registerHexTerrainAlgorithms(), eve::procgen::PbrRecipeRegistry::registerPbrRecipe(), eve::procgen::MeshRecipeRegistry::registerRecipe() , 以及 eve::procgen::TextureRecipeRegistry::registerRecipe().
◆ params
| std::vector<ParamDescriptor> eve::procgen::RecipeDescriptor::params |
在文件 ParamSchema.h 第 56 行定义.
被这些函数引用 applyDefaults(), find(), grid(), eve::procgen::MeshRecipeRegistry::registerBuiltins(), eve::procgen::TextureRecipeRegistry::registerBuiltins(), eve::procgen::registerCastleMeshRecipe(), eve::procgen::registerCaveMeshRecipe(), eve::procgen::registerHexTerrainAlgorithms(), eve::procgen::registerLinearStructureRecipes(), eve::procgen::registerLSystemRecipes(), eve::procgen::registerMeshDeformationGeometryRecipes(), eve::procgen::road::registerRoadMeshRecipes() , 以及 eve::procgen::road::registerRoadTextureRecipes().
该结构体的文档由以下文件生成:
- src/modules/procgen/ParamSchema.h
- src/modules/procgen/ParamSchema.cpp