本文整理汇总了C++中Any::resolveStringAsFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ Any::resolveStringAsFilename方法的具体用法?C++ Any::resolveStringAsFilename怎么用?C++ Any::resolveStringAsFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Any
的用法示例。
在下文中一共展示了Any::resolveStringAsFilename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: r
Texture::Specification::Specification(const Any& any, bool assumesRGBForAuto, Dimension defaultDimension) {
*this = Specification();
assumeSRGBSpaceForAuto = assumesRGBForAuto;
dimension = defaultDimension;
if (any.type() == Any::STRING) {
filename = any.string();
if (filename == "<whiteCube>") {
filename = "<white>";
dimension = Texture::DIM_CUBE_MAP;
}
if (! beginsWith(filename, "<")) {
filename = any.resolveStringAsFilename();
if (FilePath::containsWildcards(filename)) {
// Assume this is a cube map
dimension = Texture::DIM_CUBE_MAP;
}
}
} else if ((any.type() == Any::NUMBER) ||
any.nameBeginsWith("Color4") ||
anyNameIsColor3Variant(any)) {
filename = "<white>";
encoding.readMultiplyFirst = Color4(any);
} else {
any.verifyNameBeginsWith("Texture::Specification");
AnyTableReader r(any);
r.getFilenameIfPresent("filename", filename);
r.getFilenameIfPresent("alphaFilename", alphaFilename);
r.getIfPresent("encoding", encoding);
r.getIfPresent("assumeSRGBSpaceForAuto", assumeSRGBSpaceForAuto);
{
Any a;
if (r.getIfPresent("dimension", a)) {
dimension = toDimension(a);
}
}
r.getIfPresent("generateMipMaps", generateMipMaps);
r.getIfPresent("preprocess", preprocess);
r.getIfPresent("visualization", visualization);
r.getIfPresent("cachable", cachable);
r.verifyDone();
if (! any.containsKey("dimension") && FilePath::containsWildcards(filename)) {
// Assume this is a cube map
dimension = Texture::DIM_CUBE_MAP;
}
}
}
示例2: r
ArticulatedModel::Specification::Specification(const Any& a) {
*this = Specification();
AnyTableReader r(a);
Any f;
r.getIfPresent("filename", f);
filename = f.resolveStringAsFilename();
r.getIfPresent("stripMaterials", stripMaterials);
r.getIfPresent("mergeMeshesByMaterial", mergeMeshesByMaterial);
r.getIfPresent("cleanGeometrySettings", cleanGeometrySettings);
r.getIfPresent("scale", scale);
r.getIfPresent("preprocess", preprocess);
r.verifyDone();
}
示例3: toLower
BumpMap::Specification::Specification(const Any& any) {
if (any.type() == Any::STRING) {
// Treat as a filename
texture.filename = any.resolveStringAsFilename();
texture.preprocess = Texture::Preprocess::normalMap();
} else {
for (Any::AnyTable::Iterator it = any.table().begin(); it.hasMore(); ++it) {
const std::string& key = toLower(it->key);
if (key == "texture") {
texture = it->value;
if (it->value.type() == Any::STRING) {
// Set bump map defaults
texture.preprocess = Texture::Preprocess::normalMap();
}
} else if (key == "settings") {
settings = it->value;
} else {
any.verify(false, "Illegal key: " + it->key);
}
}
}
}