本文整理汇总了C++中Pixel::loadXml方法的典型用法代码示例。如果您正苦于以下问题:C++ Pixel::loadXml方法的具体用法?C++ Pixel::loadXml怎么用?C++ Pixel::loadXml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pixel
的用法示例。
在下文中一共展示了Pixel::loadXml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readXml
bool Scene::readXml(TiXmlElement* e)
{
string objName;
TiXmlElement* child = e->FirstChildElement();
while(child != NULL)
{
if(child->ValueStr() == "pixel")
{
if((objName = Xml::getAttrString(child, "name")) != "")
{
Pixel* p = new Pixel(objName, getOscRootAddress());
p->loadXml(child);
addObject(p);
LOG_DEBUG << "Scene \"" << _name << "\": Loaded pixel \"" << objName << "\" \""
<< p->getOscRootAddress() << "\"" << std::endl;
}
else
{
LOG_WARN << "Scene \"" << _name << "\": cannot load pixel without name, line "
<< child->Row() << endl;
}
}
else if(child->ValueStr() == "line")
{
if((objName = Xml::getAttrString(child, "name")) != "")
{
Line* l = new Line(objName, getOscRootAddress());
l->loadXml(child);
addObject(l);
LOG_DEBUG << "Scene \"" << _name << "\": Loaded line \"" << objName << "\" \""
<< l->getOscRootAddress() << "\"" << std::endl;
}
else
{
LOG_WARN << "Scene \"" << _name << "\": cannot load line without name, line "
<< child->Row() << endl;
}
}
else if(child->ValueStr() == "rect")
{
if((objName = Xml::getAttrString(child, "name")) != "")
{
Rect* r = new Rect(objName, getOscRootAddress());
r->loadXml(child);
addObject(r);
LOG_DEBUG << "Scene \"" << _name << "\": Loaded rect \"" << objName << "\" \""
<< r->getOscRootAddress() << "\"" << std::endl;
}
else
{
LOG_WARN << "Scene \"" << _name << "\": cannot load rect without name, line "
<< child->Row() << endl;
}
}
else if(child->ValueStr() == "bitmap")
{
if((objName = Xml::getAttrString(child, "name")) != "")
{
Bitmap* b = new Bitmap(objName, getOscRootAddress());
b->loadXml(child);
addObject(b);
LOG_DEBUG << "Scene \"" << _name << "\": Loaded bitmap \"" << objName << "\" \""
<< b->getOscRootAddress() << "\"" << std::endl;
}
else
{
LOG_WARN << "Scene \"" << _name << "\": cannot load bitmap without name, line "
<< child->Row() << endl;
}
}
else if(child->ValueStr() == "sprite")
{
if((objName = Xml::getAttrString(child, "name")) != "")
{
Sprite* s = new Sprite(objName, getOscRootAddress());
s->loadXml(child);
addObject(s);
LOG_DEBUG << "Scene \"" << _name << "\": Loaded sprite \"" << objName << "\" \""
<< s->getOscRootAddress() << "\"" << std::endl;
}
else
{
LOG_WARN << "Scene \"" << _name << "\": cannot load sprite without name, line "
<< child->Row() << endl;
}
}
else if(child->ValueStr() == "image")
{
if((objName = Xml::getAttrString(child, "name")) != "")
//.........这里部分代码省略.........