Example #1
0
void addXmlColors(
	TiXmlElement *rootElement,
	const ColorMap &colors,
	bool /*old*/)
{
	TiXmlElement *colorsElement = new TiXmlElement("Colors");

	for (ColorMap::const_iterator it = colors.begin(); it != colors.end(); it++)
	{
		unsigned int ldrawNum = it->first;
		const Color &color = it->second;
		TiXmlElement *colorElement = new TiXmlElement("Color");
		char numberBuf[128];

		sprintf(numberBuf, "%d", ldrawNum);
		addElement(colorElement, "LDrawNumber", numberBuf);
		addElement(colorElement, "POVName", color.lgeoName);
		//if (old)
		//{
		//	addElement(colorElement, "POVVersion", "3.0");
		//}
		addElement(colorElement, "Dependency", "LGColors");
		if (color.transparent)
		{
			addElement(colorElement, "IoR", "lg_ior");
		}
		colorsElement->LinkEndChild(colorElement);
	}
	rootElement->LinkEndChild(colorsElement);
}