当前位置: 首页>>代码示例>>C++>>正文


C++ GeoWriter::writeElement方法代码示例

本文整理汇总了C++中GeoWriter::writeElement方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoWriter::writeElement方法的具体用法?C++ GeoWriter::writeElement怎么用?C++ GeoWriter::writeElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeoWriter的用法示例。


在下文中一共展示了GeoWriter::writeElement方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:33,代码来源:KmlLookAtTagWriter.cpp

示例2: 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;
}
开发者ID:KDE,项目名称:marble,代码行数:29,代码来源:KmlLinkTagWriter.cpp

示例3: 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;
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:55,代码来源:KmlPhotoOverlayWriter.cpp

示例4: 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;
}
开发者ID:AsherBond,项目名称:marble,代码行数:11,代码来源:KmlFlyToTagWriter.cpp

示例5: 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;
}
开发者ID:MChemodanov,项目名称:marble,代码行数:16,代码来源:KmlLookAtTagWriter.cpp

示例6: writeAltitudeMode

void KmlGroundOverlayWriter::writeAltitudeMode(GeoWriter& writer, AltitudeMode altMode)
{
    if ( altMode == ClampToGround ) {
        // clampToGround is always the default value, so we never have to write it
        return;
    }

    const QString altitudeMode = KmlGroundOverlayWriter::altitudeModeToString( altMode );
    bool const isGoogleExtension = ( altMode == ClampToSeaFloor || altMode == RelativeToSeaFloor );
    if ( isGoogleExtension ) {
        // clampToSeaFloor and relativeToSeaFloor are Google extensions that need a gx: tag namespace
        writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_altitudeMode, altitudeMode);
    } else {
        writer.writeElement( kml::kmlTag_altitudeMode, altitudeMode );
    }
}
开发者ID:KDE,项目名称:marble,代码行数:16,代码来源:KmlGroundOverlayWriter.cpp

示例7: 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;
}
开发者ID:calincru,项目名称:marble,代码行数:20,代码来源:KmlStyleMapTagWriter.cpp

示例8: 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;
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:13,代码来源:KmlDataTagWriter.cpp

示例9: writeMid

bool KmlPlacemarkTagWriter::writeMid( const GeoNode *node, GeoWriter& writer ) const
{
    const GeoDataPlacemark *placemark = static_cast<const GeoDataPlacemark*>(node);

    writer.writeOptionalElement( kml::kmlTag_styleUrl, placemark->styleUrl() );
    if ( placemark->styleUrl().isEmpty() && placemark->customStyle() ) {
        writeElement( placemark->customStyle().data(), writer );
    }

    if( placemark->geometry() ) {
        writeElement( placemark->geometry(), writer );
    }

    if( placemark->isBalloonVisible() ){
        QString string;
        string.setNum( 1 );
        writer.writeElement( kml::kmlTag_nameSpaceGx22, kml::kmlTag_balloonVisibility, string );
    }

    return true;
}
开发者ID:PayalPradhan,项目名称:marble,代码行数:21,代码来源:KmlPlacemarkTagWriter.cpp

示例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;
}
开发者ID:KDE,项目名称:marble,代码行数:39,代码来源:KmlUpdateTagWriter.cpp

示例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;
}
开发者ID:AsherBond,项目名称:marble,代码行数:39,代码来源:KmlPlacemarkTagWriter.cpp

示例12: 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;
}
开发者ID:calincru,项目名称:marble,代码行数:36,代码来源:KmlBalloonStyleTagWriter.cpp

示例13: writeElement

bool GeoTagWriter::writeElement( const GeoNode *object,
                                 GeoWriter &writer) const
{
    return writer.writeElement( object );
}
开发者ID:Earthwings,项目名称:marble,代码行数:5,代码来源:GeoTagWriter.cpp


注:本文中的GeoWriter::writeElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。