本文整理汇总了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;
};
}
示例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;
};
}
}