本文整理汇总了C++中GeoWriter::writeEndElement方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoWriter::writeEndElement方法的具体用法?C++ GeoWriter::writeEndElement怎么用?C++ GeoWriter::writeEndElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoWriter
的用法示例。
在下文中一共展示了GeoWriter::writeEndElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeMultipolygon
void OsmRelationTagWriter::writeMultipolygon( const GeoDataPolygon& polygon,
const OsmPlacemarkData& osmData, GeoWriter& writer )
{
writer.writeStartElement( osm::osmTag_relation );
OsmObjectAttributeWriter::writeAttributes( osmData, writer );
OsmTagTagWriter::writeTags( osmData, writer );
writer.writeStartElement( osm::osmTag_member );
QString memberId = QString::number( osmData.memberReference( -1 ).id() );
writer.writeAttribute( "type", "way" );
writer.writeAttribute( "ref", memberId );
writer.writeAttribute( "role", "outer" );
writer.writeEndElement();
for ( int index = 0; index < polygon.innerBoundaries().size(); ++index ) {
writer.writeStartElement( osm::osmTag_member );
QString memberId = QString::number( osmData.memberReference( index ).id() );
writer.writeAttribute( "type", "way" );
writer.writeAttribute( "ref", memberId );
writer.writeAttribute( "role", "inner" );
writer.writeEndElement();
}
writer.writeEndElement();
}
示例2: write
bool KmlPolygonTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
{
const GeoDataPolygon *polygon = static_cast<const GeoDataPolygon*>( node );
writer.writeStartElement( kml::kmlTag_Polygon );
writer.writeStartElement( "outerBoundaryIs" );
writeElement( &polygon->outerBoundary(), writer );
writer.writeEndElement();
const QVector<GeoDataLinearRing>& linearRings = polygon->innerBoundaries();
if (linearRings.size() > 0) {
writer.writeStartElement( "innerBoundaryIs" );
for ( int i = 0; i < linearRings.size(); ++i ) {
const GeoDataLinearRing& ring = linearRings[i];
writeElement( &ring, writer );
}
writer.writeEndElement();
}
writer.writeEndElement();
return true;
}
示例3: write
bool KmlLookAtTagWriter::write( const GeoNode *node,
GeoWriter& writer ) const
{
const GeoDataLookAt *lookAt = static_cast<const GeoDataLookAt*>(node);
writer.writeStartElement( kml::kmlTag_LookAt );
KmlObjectTagWriter::writeIdentifiers( writer, lookAt );
if (lookAt->timeStamp().when().isValid()) {
writer.writeStartElement("gx:TimeStamp");
writer.writeElement("when", lookAt->timeStamp().when().toString(Qt::ISODate));
writer.writeEndElement();
}
if( lookAt->timeSpan().isValid() ){
writer.writeStartElement("gx:TimeSpan");
if (lookAt->timeSpan().begin().when().isValid())
writer.writeElement("begin", lookAt->timeSpan().begin().when().toString(Qt::ISODate));
if (lookAt->timeSpan().end().when().isValid())
writer.writeElement("end", lookAt->timeSpan().end().when().toString(Qt::ISODate));
writer.writeEndElement();
}
writer.writeOptionalElement( "longitude", QString::number( lookAt->longitude( GeoDataCoordinates::Degree ), 'f', 10 ) );
writer.writeOptionalElement( "latitude", QString::number( lookAt->latitude( GeoDataCoordinates::Degree ), 'f', 10 ) );
writer.writeOptionalElement( "altitude", QString::number( lookAt->altitude(), 'f', 10 ) );
writer.writeOptionalElement( "range", QString::number( lookAt->range(), 'f', 10 ) );
KmlGroundOverlayWriter::writeAltitudeMode( writer, lookAt->altitudeMode() );
writer.writeEndElement();
return true;
}
示例4: writeMid
bool KmlPhotoOverlayWriter::writeMid( const GeoNode *node, GeoWriter &writer ) const
{
KmlOverlayTagWriter::writeMid( node, writer );
const GeoDataPhotoOverlay *photo_overlay =
static_cast<const GeoDataPhotoOverlay*>( node );
// rotation
QString const rotation = QString::number( photo_overlay->rotation(), 'f', 3 );
writer.writeOptionalElement( kml::kmlTag_rotation, rotation, "0.000" );
// ViewVolume
writer.writeStartElement( kml::kmlTag_ViewVolume );
writer.writeOptionalElement<qreal>( kml::kmlTag_leftFov, photo_overlay->viewVolume().leftFov(), 0 );
writer.writeOptionalElement<qreal>( kml::kmlTag_rightFov, photo_overlay->viewVolume().rightFov(), 0 );
writer.writeOptionalElement<qreal>( kml::kmlTag_bottomFov, photo_overlay->viewVolume().bottomFov(), 0 );
writer.writeOptionalElement<qreal>( kml::kmlTag_topFov, photo_overlay->viewVolume().topFov(), 0 );
writer.writeOptionalElement<qreal>( kml::kmlTag_near, photo_overlay->viewVolume().near(), 0 );
writer.writeEndElement();
// ImagePyramid
writer.writeStartElement( kml::kmlTag_ImagePyramid );
writer.writeOptionalElement<int>( kml::kmlTag_tileSize, photo_overlay->imagePyramid().tileSize(), 256 );
writer.writeOptionalElement<int>( kml::kmlTag_maxWidth, photo_overlay->imagePyramid().maxWidth() );
writer.writeOptionalElement<int>( kml::kmlTag_maxHeight, photo_overlay->imagePyramid().maxHeight() );
switch ( photo_overlay->imagePyramid().gridOrigin() )
{
case GeoDataImagePyramid::LowerLeft:
writer.writeElement( kml::kmlTag_gridOrigin, "lowerLeft" );
break;
case GeoDataImagePyramid::UpperLeft:
writer.writeElement( kml::kmlTag_gridOrigin, "upperLeft" );
break;
}
writer.writeEndElement();
// Point
writeElement( &photo_overlay->point(), writer );
// shape
switch ( photo_overlay->shape() )
{
case GeoDataPhotoOverlay::Rectangle:
break;
case GeoDataPhotoOverlay::Cylinder:
writer.writeElement( kml::kmlTag_shape, "cylinder" );
break;
case GeoDataPhotoOverlay::Sphere:
writer.writeElement( kml::kmlTag_shape, "sphere" );
break;
}
return true;
}
示例5: write
bool KmlPointTagWriter::write( const GeoNode *node,
GeoWriter& writer ) const
{
const GeoDataPoint *point = static_cast<const GeoDataPoint*>(node);
writer.writeStartElement( kml::kmlTag_Point );
writer.writeStartElement("coordinates");
QString coordinateString;
//FIXME: this should be using the GeoDataCoordinates::toString but currently
// it is not including the altitude and is adding an extra space after commas
coordinateString += QString::number( point->coordinates().longitude( GeoDataCoordinates::Degree ), 'f', 10 );
coordinateString += ',' ;
coordinateString += QString::number( point->coordinates().latitude( GeoDataCoordinates::Degree ) , 'f', 10 );
if( point->coordinates().altitude() ) {
coordinateString += ',';
coordinateString += QString::number( point->coordinates().altitude() , 'f' , 10);
}
writer.writeCharacters( coordinateString );
writer.writeEndElement();
writer.writeEndElement();
return true;
}
示例6: write
bool KmlLinkTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
{
const GeoDataLink *link = static_cast<const GeoDataLink*>( node );
writer.writeStartElement( kml::kmlTag_Link );
KmlObjectTagWriter::writeIdentifiers( writer, link );
writer.writeElement( kml::kmlTag_href, link->href() );
QString const refreshMode = refreshModeToString( link->refreshMode() );
writer.writeOptionalElement( kml::kmlTag_refreshMode, refreshMode, "onChange" );
writer.writeElement( kml::kmlTag_refreshInterval, QString::number( link->refreshInterval() ) );
QString const viewRefreshMode = viewRefreshModeToString( link->viewRefreshMode() );
writer.writeOptionalElement( kml::kmlTag_viewRefreshMode, viewRefreshMode, "never" );
writer.writeElement( kml::kmlTag_viewRefreshTime, QString::number( link->viewRefreshTime() ) );
writer.writeElement( kml::kmlTag_viewBoundScale, QString::number( link->viewBoundScale() ) );
writer.writeOptionalElement( kml::kmlTag_viewFormat, link->viewFormat());
writer.writeOptionalElement( kml::kmlTag_httpQuery, link->httpQuery());
writer.writeEndElement();
return true;
}
示例7: write
bool KmlFlyToTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
{
const GeoDataFlyTo *flyTo = static_cast<const GeoDataFlyTo*>( node );
writer.writeStartElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_FlyTo );
writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_duration, QString::number( flyTo->duration()) );
QString const flyToModeString = flyTo->flyToMode() == GeoDataFlyTo::Smooth ? "smooth" : "bounce";
writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_flyToMode, flyToModeString );
writeElement( flyTo->view(), writer );
writer.writeEndElement();
return true;
}
示例8: write
bool KmlStyleMapTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
{
const GeoDataStyleMap *map = static_cast<const GeoDataStyleMap*>( node );
writer.writeStartElement( kml::kmlTag_StyleMap );
KmlObjectTagWriter::writeIdentifiers( writer, map );
QMapIterator<QString, QString> iter( *map );
while ( iter.hasNext() ) {
iter.next();
writer.writeStartElement( kml::kmlTag_Pair );
writer.writeElement( kml::kmlTag_key, iter.key() );
writer.writeElement( kml::kmlTag_styleUrl, iter.value() );
writer.writeEndElement();
}
writer.writeEndElement();
return true;
}
示例9: write
bool DgmlMapTagWriter::write(const GeoNode *node, GeoWriter& writer) const
{
const GeoSceneMap *map = static_cast<const GeoSceneMap*>( node );
writer.writeStartElement( dgml::dgmlTag_Map );
writer.writeAttribute( "bgcolor", map->backgroundColor().name() );
writer.writeAttribute( "labelColor", map->labelColor().name() );
writer.writeStartElement( "canvas" );
writer.writeEndElement();
writer.writeStartElement( "target" );
writer.writeEndElement();
for( int i = 0; i < map->layers().count(); ++i )
{
writeElement( map->layers().at( i ), writer );
}
writer.writeEndElement();
return true;
}
示例10: write
bool KmlUpdateTagWriter::write( const GeoNode *node, GeoWriter& writer ) const
{
const GeoDataUpdate *update = static_cast<const GeoDataUpdate*>( node );
KmlObjectTagWriter::writeIdentifiers( writer, update );
writer.writeStartElement( kml::kmlTag_Update );
writer.writeElement( kml::kmlTag_targetHref, update->targetHref() );
if( update->change() && update->change()->size() > 0 ) {
writer.writeStartElement( kml::kmlTag_Change );
QVector<GeoDataFeature*>::ConstIterator it = update->change()->constBegin();
QVector<GeoDataFeature*>::ConstIterator const end = update->change()->constEnd();
for ( ; it != end; ++it ) {
writeElement( *it, writer );
}
writer.writeEndElement();
} else if( update->create() && update->create()->size() > 0 ) {
writer.writeStartElement( kml::kmlTag_Create );
QVector<GeoDataFeature*>::ConstIterator it = update->create()->constBegin();
QVector<GeoDataFeature*>::ConstIterator const end = update->create()->constEnd();
for ( ; it != end; ++it ) {
writeElement( *it, writer );
}
writer.writeEndElement();
} else if( update->getDelete() && update->getDelete()->size() > 0 ) {
writer.writeStartElement( kml::kmlTag_Delete );
QVector<GeoDataFeature*>::ConstIterator it = update->getDelete()->constBegin();
QVector<GeoDataFeature*>::ConstIterator const end = update->getDelete()->constEnd();
for ( ; it != end; ++it ) {
writeElement( *it, writer );
}
writer.writeEndElement();
}
writer.writeEndElement();
return true;
}
示例11: write
bool KmlPlacemarkTagWriter::write( const GeoNode *node,
GeoWriter& writer ) const
{
const GeoDataPlacemark *placemark = static_cast<const GeoDataPlacemark*>(node);
writer.writeStartElement( kml::kmlTag_Placemark );
writer.writeOptionalElement( "name", placemark->name() );
writer.writeElement( kml::kmlTag_visibility, QString::number( placemark->isVisible() ) );
writer.writeOptionalElement( kml::kmlTag_styleUrl, placemark->styleUrl() );
if( !placemark->description().isEmpty() ) {
writer.writeStartElement( "description" );
if( placemark->descriptionIsCDATA() ) {
writer.writeCDATA( placemark->description() );
} else {
writer.writeCharacters( placemark->description() );
}
writer.writeEndElement();
}
if( !placemark->extendedData().isEmpty() ){
writeElement( &placemark->extendedData(), writer );
}
if( placemark->geometry() ) {
writeElement( placemark->geometry(), writer );
}
if( placemark->lookAt() ){
writeElement( placemark->lookAt(), writer );
}
if( placemark->timeStamp().when().isValid() )
writeElement( &placemark->timeStamp(), writer );
writer.writeEndElement();
return true;
}
示例12: write
bool KmlDataTagWriter::write( const GeoNode *node,
GeoWriter& writer ) const
{
const GeoDataData *data = static_cast<const GeoDataData*>( node );
writer.writeStartElement( kml::kmlTag_Data );
writer.writeAttribute( "name", data->name() );
writer.writeOptionalElement( kml::kmlTag_displayName, data->displayName() );
writer.writeElement( "value", data->value().toString() );
writer.writeEndElement();
return true;
}
示例13: write
bool KmlBalloonStyleTagWriter::write( const GeoNode *node,
GeoWriter& writer ) const
{
const GeoDataBalloonStyle *balloonStyle = static_cast<const GeoDataBalloonStyle*>( node );
bool const isEmpty = balloonStyle->backgroundColor() == QColor( Qt::white ) &&
balloonStyle->textColor() == QColor( Qt::black ) &&
balloonStyle->text().isEmpty() &&
balloonStyle->displayMode() == GeoDataBalloonStyle::Default;
if ( isEmpty ) {
return true;
}
writer.writeStartElement( kml::kmlTag_BalloonStyle );
KmlObjectTagWriter::writeIdentifiers( writer, balloonStyle );
QString const backgroundColor = KmlColorStyleTagWriter::formatColor( balloonStyle->backgroundColor() );
writer.writeOptionalElement( kml::kmlTag_bgColor, backgroundColor, "ffffffff" );
QString const textColor = KmlColorStyleTagWriter::formatColor( balloonStyle->textColor() );
writer.writeOptionalElement( kml::kmlTag_textColor, textColor, "ff000000" );
QString const textString = balloonStyle->text();
if ( textString.contains( QRegExp( "[<>&]" ) ) ) {
writer.writeStartElement( kml::kmlTag_text );
writer.writeCDATA( textString );
writer.writeEndElement();
} else {
writer.writeOptionalElement( kml::kmlTag_text, textString );
}
if ( balloonStyle->displayMode() == GeoDataBalloonStyle::Hide ) {
writer.writeElement( kml::kmlTag_displayMode, "hide" );
}
writer.writeEndElement();
return true;
}
示例14: write
bool KmlLatLonQuadWriter::write( const GeoNode *node,
GeoWriter& writer ) const
{
const GeoDataLatLonQuad *latLonQuad = static_cast<const GeoDataLatLonQuad*>( node );
if ( latLonQuad->isValid() ) {
writer.writeStartElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_LatLonQuad );
writer.writeStartElement( kml::kmlTag_coordinates );
writer.writeCharacters( QString::number( latLonQuad->bottomLeftLongitude( GeoDataCoordinates::Degree ) ) );
writer.writeCharacters( QString( ',' ) );
writer.writeCharacters( QString::number( latLonQuad->bottomLeftLatitude( GeoDataCoordinates::Degree ) ) );
writer.writeCharacters( QString( ' ' ) );
writer.writeCharacters( QString::number( latLonQuad->bottomRightLongitude( GeoDataCoordinates::Degree ) ) );
writer.writeCharacters( QString( ',' ) );
writer.writeCharacters( QString::number( latLonQuad->bottomRightLatitude( GeoDataCoordinates::Degree ) ) );
writer.writeCharacters( QString( ' ' ) );
writer.writeCharacters( QString::number( latLonQuad->topRightLongitude( GeoDataCoordinates::Degree ) ) );
writer.writeCharacters( QString( ',' ) );
writer.writeCharacters( QString::number( latLonQuad->topRightLatitude( GeoDataCoordinates::Degree ) ) );
writer.writeCharacters( QString( ' ' ) );
writer.writeCharacters( QString::number( latLonQuad->topLeftLongitude( GeoDataCoordinates::Degree ) ) );
writer.writeCharacters( QString( ',' ) );
writer.writeCharacters( QString::number( latLonQuad->topLeftLatitude( GeoDataCoordinates::Degree ) ) );
writer.writeEndElement();
writer.writeEndElement();
}
return true;
}
示例15: write
bool KmlLookAtTagWriter::write( const GeoNode *node,
GeoWriter& writer ) const
{
const GeoDataLookAt *lookAt = static_cast<const GeoDataLookAt*>(node);
writer.writeStartElement( kml::kmlTag_LookAt );
writer.writeElement( "longitude", QString::number( lookAt->longitude( GeoDataCoordinates::Degree ), 'f', 10 ) );
writer.writeElement( "latitude", QString::number( lookAt->latitude( GeoDataCoordinates::Degree ), 'f', 10 ) );
writer.writeElement( "altitude", QString::number( lookAt->altitude(), 'f', 10 ) );
writer.writeElement( "range", QString::number( lookAt->range(), 'f', 10 ) );
writer.writeEndElement();
return true;
}