コード例 #1
0
void gstTextureManager::GetOverlayList(
    const TexTile& tile,
    std::vector<gstTextureGuard> &draw_list, const bool is_mercator_preview) {
  khLockGuard guard(textureMapMutex);

  gstBBox tilebox(tile.xx, tile.xx + tile.grid,
                  tile.yy, tile.yy + tile.grid);
  if (is_mercator_preview) {
    // If Mercator projection, expect image bounding box in meter;
    // So convert viewable tile to meter for intersection test.
    tilebox.init(khTilespace::DeNormalizeMeter(tilebox.w),
                 khTilespace::DeNormalizeMeter(tilebox.e),
                 khTilespace::DeNormalizeMeter(tilebox.s),
                 khTilespace::DeNormalizeMeter(tilebox.n));
  } else {
    // If Flat projection, expect image bounding box in degree;
    // So convert viewable tile to degree for intersection test.
    tilebox.init(khTilespace::Denormalize(tilebox.w),
                 khTilespace::Denormalize(tilebox.e),
                 khTilespace::Denormalize(tilebox.s),
                 khTilespace::Denormalize(tilebox.n));
  }

  for (std::map<uint, gstTextureGuard>::iterator it = texture_map_.begin();
       it != texture_map_.end(); ++it) {
    gstTextureGuard tex = it->second;
    if (tex && tex->enabled() && tex != base_texture_) {
      if (tilebox.Intersect(tex->bbox()))
        draw_list.push_back(tex);
    }
  }
}
コード例 #2
0
ファイル: FabArray.cpp プロジェクト: qinyubo/BoxLib
Box 
MFIter::growntilebox (int ng) const 
{
    Box bx = tilebox();
    if (ng < -100) ng = fabArray.nGrow();
    const Box& vbx = validbox();
    for (int d=0; d<BL_SPACEDIM; ++d) {
	if (bx.smallEnd(d) == vbx.smallEnd(d)) {
	    bx.growLo(d, ng);
	}
	if (bx.bigEnd(d) == vbx.bigEnd(d)) {
	    bx.growHi(d, ng);
	}
    }
    return bx;
}