예제 #1
0
파일: Tile.cpp 프로젝트: AeroGlass/g3m
void Tile::ancestorChangedElevationData(Tile* ancestor){

  if (ancestor->getLevel() > _elevationDataLevel){
    ElevationData* subView = createElevationDataSubviewFromAncestor(ancestor);
    if (subView != NULL){
      setElevationData(subView, ancestor->getLevel());
    }
  }

  if (_subtiles != NULL) {
    const int subtilesSize = _subtiles->size();
    for (int i = 0; i < subtilesSize; i++) {
      Tile* subtile = _subtiles->at(i);
      subtile->ancestorChangedElevationData(this);
    }
  }
}
예제 #2
0
파일: Tile.cpp 프로젝트: AeroGlass/g3m
void Tile::setElevationData(ElevationData* ed, int level){
  if (_elevationDataLevel < level){

    if (_elevationData != NULL){
      delete _elevationData;
    }

    _elevationData = ed;
    _elevationDataLevel = level;
    _mustActualizeMeshDueToNewElevationData = true;

    //If the elevation belongs to tile's level, we notify the sub-tree
    if (isElevationDataSolved()){
      if (_subtiles != NULL) {
        const int subtilesSize = _subtiles->size();
        for (int i = 0; i < subtilesSize; i++) {
          Tile* subtile = _subtiles->at(i);
          subtile->ancestorChangedElevationData(this);
        }
      }
    }

  }
}