예제 #1
0
void CBasinSadlListView::pasteClip(const Clip& clp)
{
  Elev_intvl prom;
  Elevation omp;
  CPromDoc *doc=GetDocument();
  Basin_saddle *new_bs;
  list_fmt.set(GetDocument()->data);
  doc->tree_flip_drain();
  int old_size=GetListCtrl().GetItemCount();
  unsigned i,n=clp.ftr_count();
  doc->update_sadl_prom_info();
  if (list_filter.ridge) doc->update_ridge_info();
  for (i=0; i<n; ++i) {
    new_bs=(Basin_saddle *)clp.list[i];
    list_filter.get_prom(new_bs->prom,prom.high,omp);
    prom.low=new_bs->extreme_prom(LO_END);
    bs_list.push_back(PromListItem(*new_bs,prom));
    if (list_filter.offmap)
      bs_list.back().offmap_prom=omp;
    if (doc->is_drainage)
      bs_list.back().transform(-1);
    AddBlankItem(*new_bs,clp.type[i]);
  }
  doc->tree_flip_drain();
  for (i=0; i<n; ++i)
    UpdateItem(i+old_size);
  setItemIndicators();
}
예제 #2
0
bool CBasinSadlListView::CanPaste(const Clip& clp) const
{
  unsigned n=clp.ftr_count();
  for (unsigned i=0; i<n; ++i)
    if (clp.type[i]!=FT_BASINSADL) return false;
  return true;
}