#include "DocSVG.h"
const char SVGOperation::PathOperationChar[] =
{
'M', 'L', 'H', 'V', 'C', 'S', 'Q', 'T', 'A', 'Z',
'm', 'l', 'h', 'v', 'c', 's', 'q', 't', 'a', 'z', ' ', ' ', ' '
};
const int SVGOperation::PathOperationArgs[] =
{
2, 2, 1, 1, 6, 4, 4, 2, 7, 0,
2, 2, 1, 1, 6, 4, 4, 2, 7, 0, 0, 0, 0
};
DocSVG::DocSVG()
{
}
DocSVG::~DocSVG()
{
}
/// Visit a document.
bool DocSVG::VisitEnter( const TiXmlDocument& doc )
{
return true;
}
/// Visit a document.
bool DocSVG::VisitExit( const TiXmlDocument& doc )
{
return true;
}
/// Visit a declaration
bool DocSVG::Visit( const TiXmlDeclaration& declaration )
{
return true;
}
/// Visit a stylesheet reference
bool DocSVG::Visit( const TiXmlStylesheetReference& stylesheet )
{
return true;
}
/// Visit a comment node
bool DocSVG::Visit( const TiXmlComment& comment )
{
return true;
}
/// Visit an unknow node
bool DocSVG::Visit( const TiXmlUnknown& unknown )
{
return true;
}
/// Visit an element.
bool DocSVG::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute )
{
if (strcmp(element.ValueTStr().c_str(), "path") == 0) {
const TiXmlAttribute* attrib = firstAttribute;
while ( attrib ) {
if (strcmp(attrib->Name(), "d") == 0) {
ParsePath(attrib->Value());
break;
} else {
attrib = attrib->Next();
}
}
}
return true;
}
/// Visit an element.
bool DocSVG::VisitExit( const TiXmlElement& element )
{
return true;
}
/// Visit a text node
bool DocSVG::Visit( const TiXmlText& text )
{
return true;
}