本文整理汇总了C++中GeoHeightField::takeHeightField方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoHeightField::takeHeightField方法的具体用法?C++ GeoHeightField::takeHeightField怎么用?C++ GeoHeightField::takeHeightField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoHeightField
的用法示例。
在下文中一共展示了GeoHeightField::takeHeightField方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
{
heightFields.push_back( geoHF );
}
}
}
//If any of the layers produced valid data then it's not considered a fallback
if ( out_isFallback )
{
*out_isFallback = (numFallbacks == heightFields.size());
//OE_NOTICE << "Num fallbacks=" << numFallbacks << " numHeightFields=" << heightFields.size() << " is fallback " << *out_isFallback << std::endl;
}
if ( heightFields.size() == 0 )
{
//If we got no heightfields but were requested to fallback, create an empty heightfield.
if ( fallback )
{
out_result = HeightFieldUtils::createReferenceHeightField( keyToUse.getExtent(), defElevSize, defElevSize );
return true;
}
else
{
//We weren't requested to fallback so just return.
return false;
}
}
else if (heightFields.size() == 1)
{
if ( lowestLOD == key.getLevelOfDetail() )
{
//If we only have on heightfield, just return it.
out_result = heightFields[0].takeHeightField();
}
else
{
GeoHeightField geoHF = heightFields[0].createSubSample( key.getExtent(), interpolation);
out_result = geoHF.takeHeightField();
hfInitialized = true;
}
}
else
{
//If we have multiple heightfields, we need to composite them together.
unsigned int width = 0;
unsigned int height = 0;
for (GeoHeightFieldVector::const_iterator i = heightFields.begin(); i < heightFields.end(); ++i)
{
if (i->getHeightField()->getNumColumns() > width)
width = i->getHeightField()->getNumColumns();
if (i->getHeightField()->getNumRows() > height)
height = i->getHeightField()->getNumRows();
}
out_result = new osg::HeightField();
out_result->allocate( width, height );
//Go ahead and set up the heightfield so we don't have to worry about it later
double minx, miny, maxx, maxy;
key.getExtent().getBounds(minx, miny, maxx, maxy);
double dx = (maxx - minx)/(double)(out_result->getNumColumns()-1);
double dy = (maxy - miny)/(double)(out_result->getNumRows()-1);
const SpatialReference* keySRS = keyToUse.getProfile()->getSRS();