|
osgEarth 2.1.1
|
Functions | |
| TileKey | makeTileKey (const Projected *ps, const ProjectedOptions *pjoptions) |
| HeightField * | resampleHeightField (HeightField *hf, unsigned newDim) |
| TileKey seamless::anonymous_namespace{Projected.cpp}::makeTileKey | ( | const Projected * | ps, |
| const ProjectedOptions * | pjoptions | ||
| ) |
Definition at line 64 of file Projected.cpp.
{
Vec2d ll, ur;
pjoptions->getPatchExtents(ll, ur);
double levelFactor = pow(2.0, pjoptions->getPatchLevel());
int x = static_cast<int>(ll.x() * levelFactor);
int y = static_cast<int>(ll.y() * levelFactor);
return TileKey(pjoptions->getPatchLevel(), x, y,
ps->getMap()->getProfile());
}
Here is the call graph for this function:
Here is the caller graph for this function:| HeightField* seamless::anonymous_namespace{Projected.cpp}::resampleHeightField | ( | HeightField * | hf, |
| unsigned | newDim | ||
| ) |
Definition at line 75 of file Projected.cpp.
{
const unsigned nCols = hf->getNumColumns();
const unsigned nRows = hf->getNumRows();
if (nCols == newDim && nRows == newDim)
return hf;
HeightField* result = new HeightField;
result->allocate(newDim, newDim);
result->setOrigin(hf->getOrigin());
result->setXInterval(hf->getXInterval() * static_cast<float>(nCols)
/ static_cast<float>(newDim));
result->setYInterval(hf->getYInterval() * static_cast<float>(nRows)
/ static_cast<float>(newDim));
for (unsigned r = 0; r < newDim; ++r)
{
for (unsigned c = 0; c < newDim; ++c)
{
float height
= HeightFieldUtils::getHeightAtNormalizedLocation(
hf, static_cast<double>(c) / (newDim - 1),
static_cast<double>(r) / (newDim - 1), INTERP_BILINEAR);
result->setHeight(c, r, height);
}
}
return result;
}
}
Here is the call graph for this function:
Here is the caller graph for this function:
1.7.3