本文整理汇总了C++中Any::nameEquals方法的典型用法代码示例。如果您正苦于以下问题:C++ Any::nameEquals方法的具体用法?C++ Any::nameEquals怎么用?C++ Any::nameEquals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Any
的用法示例。
在下文中一共展示了Any::nameEquals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: r
Texture::Visualization::Visualization(const Any& a) {
*this = Visualization();
if (a.type() == Any::ARRAY) {
if (a.nameEquals("bumpInAlpha")) {
*this = bumpInAlpha();
} else if (a.nameEquals("defaults")) {
*this = defaults();
} else if (a.nameEquals("linearRGB")) {
*this = linearRGB();
} else if (a.nameEquals("depthBuffer")) {
*this = depthBuffer();
} else if (a.nameEquals("packedUnitVector")) {
*this = packedUnitVector();
} else if (a.nameEquals("radiance")) {
*this = radiance();
} else if (a.nameEquals("reflectivity")) {
*this = reflectivity();
} else if (a.nameEquals("sRGB")) {
*this = sRGB();
} else if (a.nameEquals("unitVector")) {
*this = unitVector();
} else {
a.verify(false, "Unrecognized Visualization factory method");
}
} else {
a.verifyName("Texture::Visualization", "Visualization");
AnyTableReader r(a);
String c;
if (r.getIfPresent("channels", c)) {
channels = toChannels(c);
}
r.getIfPresent("documentGamma", documentGamma);
r.getIfPresent("invertIntensity", invertIntensity);
r.getIfPresent("max", max);
r.getIfPresent("min", min);
r.getIfPresent("layer", layer);
r.getIfPresent("mipLevel", mipLevel);
r.verifyDone();
}
}
示例2:
Matrix2::Matrix2(const Any& any) {
any.verifyName("Matrix2");
any.verifyType(Any::ARRAY);
if (any.nameEquals("Matrix2::identity")) {
*this = identity();
} else {
any.verifySize(4);
for (int r = 0; r < 3; ++r) {
for (int c = 0; c < 3; ++c) {
data[r][c] = any[r * 2 + c];
}
}
}
}