예제 #1
0
bool QLandmarkFileHandlerLmx::writeLandmark(const QLandmark &landmark)
{
    m_writer->writeStartElement(m_ns, "landmark");

    if (!landmark.name().isEmpty())
        m_writer->writeTextElement(m_ns, "name", landmark.name());

    if (!landmark.description().isEmpty())
        m_writer->writeTextElement(m_ns, "description", landmark.description());

    if (landmark.coordinate().isValid())
        if (!writeCoordinates(landmark))
            return false;

    if (landmark.radius() > 0)
        m_writer->writeTextElement(m_ns, "coverageRadius", QString::number(landmark.radius()));

    if (!writeAddressInfo(landmark))
        return false;

    if (!landmark.url().isEmpty())
        if (!writeMediaLink(landmark))
            return false;

    if (m_option != QLandmarkManager::ExcludeCategoryData) {
        for (int i = 0; i < landmark.categoryIds().size(); ++i) {
            if (!writeCategory(landmark.categoryIds().at(i)))
                return false;
        }
    }

    m_writer->writeEndElement();

    return true;
}
예제 #2
0
	void writeScale(std::string &fStr, float fX, float fY, float fZ, int fTab) {
		int _i;
		for (_i = 0; _i<fTab; _i++) {
			fStr.append("\t");
		}
		fStr.append("<scale>\n");
		writeCoordinates(fStr, fX, fY, fZ, fTab + 1);
		for (_i = 0; _i<fTab; _i++) {
			fStr.append("\t");
		}
		fStr.append("</scale>\n");
	}
예제 #3
0
	void writeRotation(std::string &fStr, float	fX, float fY, float fZ, int fTab) {
		int _i;
		for (_i = 0; _i<fTab; _i++) {
			fStr.append("\t");
		}
		fStr.append("<rotation>\n");
		writeCoordinates(fStr, fX, fY, fZ, fTab + 1);
		for (_i = 0; _i<fTab; _i++) {
			fStr.append("\t");
		}
		fStr.append("</rotation>\n");
	}