本文整理汇总了C++中GeoDataDocument::abstractView方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoDataDocument::abstractView方法的具体用法?C++ GeoDataDocument::abstractView怎么用?C++ GeoDataDocument::abstractView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoDataDocument
的用法示例。
在下文中一共展示了GeoDataDocument::abstractView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: simpleParseTest
void TestCamera::simpleParseTest()
{
QString const kmlContent (
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<kml xmlns=\"http://www.opengis.net/kml/2.2\""
" xmlns:gx=\"http://www.google.com/kml/ext/2.2\">"
"<Document>"
" <Camera id=\"myCam\">"
" <longitude>1</longitude>"
" <latitude>2</latitude>"
" <altitude>3</altitude>"
" <heading>4</heading>"
" <tilt>5</tilt>"
" <roll>6</roll>"
" <altitudeMode>relativeToGround</altitudeMode>"
" </Camera>"
"</Document>"
"</kml>" );
GeoDataDocument* dataDocument = parseKml( kmlContent );
GeoDataCamera *camera = dynamic_cast<GeoDataCamera*>( dataDocument->abstractView() );
QVERIFY( camera != 0);
GeoDataCoordinates::Unit const degree = GeoDataCoordinates::Degree;
QCOMPARE( camera->longitude( degree ), 1.0 );
QCOMPARE( camera->latitude( degree ), 2.0 );
QCOMPARE( camera->altitude(), 3.0 );
QCOMPARE( camera->heading(), 4.0 );
QCOMPARE( camera->tilt(), 5.0 );
QCOMPARE( camera->roll(), 6.0 );
QCOMPARE( camera->altitudeMode(), RelativeToGround );
delete dataDocument;
}