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


C++ GeoDataLineString::unpack方法代码示例

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


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

示例1: unpack

void GeoDataPlacemark::unpack( QDataStream& stream )
{
    detach();
    p()->m_geometry->setParent( this );
    GeoDataFeature::unpack( stream );

    stream >> p()->m_countrycode;
    stream >> p()->m_area;
    stream >> p()->m_population;
    int geometryId;
    stream >> geometryId;
    switch( geometryId ) {
        case InvalidGeometryId:
            break;
        case GeoDataPointId:
            {
            GeoDataPoint* point = new GeoDataPoint;
            point->unpack( stream );
            delete p()->m_geometry;
            p()->m_geometry = point;
            }
            break;
        case GeoDataLineStringId:
            {
            GeoDataLineString* lineString = new GeoDataLineString;
            lineString->unpack( stream );
            delete p()->m_geometry;
            p()->m_geometry = lineString;
            }
            break;
        case GeoDataLinearRingId:
            {
            GeoDataLinearRing* linearRing = new GeoDataLinearRing;
            linearRing->unpack( stream );
            delete p()->m_geometry;
            p()->m_geometry = linearRing;
            }
            break;
        case GeoDataPolygonId:
            {
            GeoDataPolygon* polygon = new GeoDataPolygon;
            polygon->unpack( stream );
            delete p()->m_geometry;
            p()->m_geometry = polygon;
            }
            break;
        case GeoDataMultiGeometryId:
            {
            GeoDataMultiGeometry* multiGeometry = new GeoDataMultiGeometry;
            multiGeometry->unpack( stream );
            delete p()->m_geometry;
            p()->m_geometry = multiGeometry;
            }
            break;
        case GeoDataModelId:
            break;
        default: break;
    };
}
开发者ID:calincru,项目名称:marble,代码行数:59,代码来源:GeoDataPlacemark.cpp

示例2: unpack

void GeoDataMultiGeometry::unpack( QDataStream& stream )
{
    detach();
    GeoDataGeometry::unpack( stream );

    int size = 0;

    stream >> size;

    for( int i = 0; i < size; i++ ) {
        int geometryId;
        stream >> geometryId;
        switch( geometryId ) {
        case InvalidGeometryId:
            break;
        case GeoDataPointId:
        {
            GeoDataPoint *point = new GeoDataPoint;
            point->unpack( stream );
            p()->m_vector.append( point );
        }
        break;
        case GeoDataLineStringId:
        {
            GeoDataLineString *lineString = new GeoDataLineString;
            lineString->unpack( stream );
            p()->m_vector.append( lineString );
        }
        break;
        case GeoDataLinearRingId:
        {
            GeoDataLinearRing *linearRing = new GeoDataLinearRing;
            linearRing->unpack( stream );
            p()->m_vector.append( linearRing );
        }
        break;
        case GeoDataPolygonId:
        {
            GeoDataPolygon *polygon = new GeoDataPolygon;
            polygon->unpack( stream );
            p()->m_vector.append( polygon );
        }
        break;
        case GeoDataMultiGeometryId:
        {
            GeoDataMultiGeometry *multiGeometry = new GeoDataMultiGeometry;
            multiGeometry->unpack( stream );
            p()->m_vector.append( multiGeometry );
        }
        break;
        case GeoDataModelId:
            break;
        default:
            break;
        };
    }
}
开发者ID:utkuaydin,项目名称:marble,代码行数:57,代码来源:GeoDataMultiGeometry.cpp


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