本文整理汇总了C++中aurora::GFF3Struct::getVector方法的典型用法代码示例。如果您正苦于以下问题:C++ GFF3Struct::getVector方法的具体用法?C++ GFF3Struct::getVector怎么用?C++ GFF3Struct::getVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurora::GFF3Struct
的用法示例。
在下文中一共展示了GFF3Struct::getVector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void WidgetCheckBox::load(const Aurora::GFF3Struct &gff) {
gff.getVector("COLOR", _r, _g, _b);
_a = gff.getDouble("ALPHA", 1.0);
Extend extend = createExtend(gff);
_width = extend.w;
_height = extend.h;
Widget::setPosition(extend.x, extend.y, 0.0f);
Border border = createBorder(gff);
if (!border.fill.empty()) {
_quad = new Graphics::Aurora::HighlightableGUIQuad(border.fill, 0.0f, 0.0f, extend.h * .62, extend.h * .62);
} else {
_quad = new Graphics::Aurora::GUIQuad(border.fill, 0.0f, 0.0f, extend.h * .62, extend.h * .62);
}
_quad->setPosition(extend.x, extend.y, 0.0f);
_quad->setTag(getTag());
_quad->setClickable(true);
if (border.fill.empty())
_quad->setColor(0.0f, 0.0f, 0.0f, 0.0f);
Text text = createText(gff);
if (!text.text.empty() && !text.font.empty()) {
_text = new Graphics::Aurora::HighlightableText(FontMan.get(text.font), text.text,
text.r, text.g, text.b, 1.0f);
const float hspan = extend.w - _text->getWidth();
const float vspan = extend.h - _text->getHeight();
const float x = extend.x + text.halign * hspan;
const float y = extend.y + text.valign * vspan;
_text->setPosition(x, y, -1.0f);
_text->setTag(getTag());
_text->setClickable(true);
}
if (getTextHighlightableComponent() != 0) {
setDefaultHighlighting(getTextHighlightableComponent());
}
if (getQuadHighlightableComponent() != 0) {
setDefaultHighlighting(getQuadHighlightableComponent());
}
}
示例2: catch
//.........这里部分代码省略.........
case Aurora::GFF3Struct::kFieldTypeResRef:
try {
_xml->setContents(strct.getString(field));
} catch (...) {
_xml->addProperty("base64", "true");
Common::SeekableReadStream *data = strct.getData(field);
_xml->setContents(*data);
delete data;
}
break;
case Aurora::GFF3Struct::kFieldTypeLocString:
{
Aurora::LocString locString;
strct.getLocString(field, locString);
_xml->addProperty("strref", Common::composeString(locString.getID()));
dumpLocString(locString);
}
break;
case Aurora::GFF3Struct::kFieldTypeVoid:
_xml->setContents(*strct.getData(field));
break;
case Aurora::GFF3Struct::kFieldTypeStruct:
dumpStruct(strct.getStruct(field), label);
break;
case Aurora::GFF3Struct::kFieldTypeList:
dumpList(strct.getList(field));
break;
case Aurora::GFF3Struct::kFieldTypeOrientation:
{
double a = 0.0, b = 0.0, c = 0.0, d = 0.0;
strct.getOrientation(field, a, b, c, d);
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", a));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", b));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", c));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", d));
_xml->closeTag();
_xml->breakLine();
}
break;
case Aurora::GFF3Struct::kFieldTypeVector:
{
double x = 0.0, y = 0.0, z = 0.0;
strct.getVector(field, x, y, z);
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", x));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", y));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", z));
_xml->closeTag();
_xml->breakLine();
}
break;
default:
break;
}
// Structs already close their own tag
if (type != Aurora::GFF3Struct::kFieldTypeStruct) {
_xml->closeTag();
_xml->breakLine();
}
}