//! Convenience method. void MvdXmlWriter::writeOpenTag(const QString &name, const MvdAttribute &a1, const MvdAttribute &a2, const MvdAttribute &a3) { MvdAttributeMap a; if (!a1.first.isEmpty()) a.insert(a1.first, a1.second); if (!a2.first.isEmpty()) a.insert(a2.first, a2.second); if (!a3.first.isEmpty()) a.insert(a3.first, a3.second); writeOpenTag(name, a); }
void myParserEDM::Qt_setColor(char *property, int r, int g, int b, int alpha) { char asc[80]; writeOpenProperty(property); sprintf(asc,"color alpha=\"%d\"", alpha); writeOpenTag(asc, "", ""); sprintf(asc,"%d", r); writeTaggedString("red", asc); sprintf(asc,"%d", g); writeTaggedString("green", asc); sprintf(asc,"%d", b); writeTaggedString("blue", asc); writeCloseTag("color"); writeCloseProperty(); }
// Zai added void myParserEDM::writeFontProperties(int size, bool bold) { char asc[MAX_ASCII]; writeOpenProperty("font"); writeOpenTag("font", "", ""); sprintf(asc, "%d", (int)(((double)size*0.7)+0.5)); writeTaggedString("pointsize", asc); if (bold && size > 14){ // std::string trueString; // trueString.append("true"); sprintf(asc, "%s", "true"); writeTaggedString("bold", asc); } writeCloseTag("font"); writeCloseProperty(); }
void myParserEDM::writeRectangleDimensions(int x, int y, int w, int h) { char asc[MAX_ASCII]; writeOpenProperty("geometry"); writeOpenTag("rect", "", ""); sprintf(asc, "%d", x); writeTaggedString("x", asc); sprintf(asc, "%d", y); writeTaggedString("y", asc); sprintf(asc, "%d", w); writeTaggedString("width", asc); sprintf(asc, "%d", h); writeTaggedString("height", asc); writeCloseTag("rect"); writeCloseProperty(); }
void myParserEDM::Qt_writeOpenTag(char *tag, char *typ, char *value) { writeOpenTag(tag, typ, value); }