当前位置: 首页>>代码示例>>C++>>正文


C++ Selection::Append方法代码示例

本文整理汇总了C++中Selection::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::Append方法的具体用法?C++ Selection::Append怎么用?C++ Selection::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Selection的用法示例。


在下文中一共展示了Selection::Append方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateManipulator

Manipulator* NarrowTool::CreateManipulator (Viewer* v, Event& e,Transformer*){
    Manipulator* m = nil;
    _popup = false;
    GraphicView* views = v->GetGraphicView();
    if (!e.shift_is_down()) {
        Selection* s = v->GetSelection(), *newSel = new Selection;
        
        s->Clear();
        ComputeViewPath(e, views, newSel);
        
        if (!newSel->IsEmpty()) {
            Iterator i;
            newSel->First(i);
            GraphicView* gv = newSel->GetView(i);
            
            s->Append(gv);
            s->Update();

            m = CreatePopupManip(newSel, v);
            _popup = true;
        }
        
        delete newSel;
    } else {
        m = new NarrowManip(v);
    }
    return m;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:28,代码来源:ibtools.c

示例2: CreateManipulator

Manipulator* ScaleTool::CreateManipulator (
    Viewer* v, Event& e, Transformer* rel
) {
    GraphicView* views = v->GetGraphicView();
    Selection* s = v->GetSelection(), *newSel;
    GraphicView* gv;
    Manipulator* m = nil;
    Iterator i;

    newSel = views->ViewIntersecting(e.x-SLOP, e.y-SLOP, e.x+SLOP, e.y+SLOP);
    if (newSel->IsEmpty()) {
	s->Clear();
    } else {
        newSel->First(i);
	gv = newSel->GetView(i);

	if (s->Includes(gv)) {
            s->Remove(gv);
            s->Prepend(gv);
        } else {
	    s->Clear();
	    s->Append(gv);
	    s->Update();
	}
        m = gv->CreateManipulator(v, e, rel, this);
    }
    delete newSel;
    return m;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:29,代码来源:scale.c

示例3: from

PictSelection::PictSelection (Graphic* gs) : (gs) {
    valid = true;
}

// PictSelection knows it's the outermost PictSelection because it was
// called with a FILE* pointer, so it must read a version number, skip
// over its name, read its graphic state and children, and scale
// itself back to screen coordinates when it's finished.

PictSelection::PictSelection (FILE* stream, State* state) : (nil) {
    int fd = fileno(stream);
    istream from(fd);
    ReadVersion(from);
    ReadGridSpacing(from);
    if (versionnumber < 3) {
	Skip(from);
    }
    ReadPictGS(from, state);
    ReadChildren(from, state);
    ScaleToScreenCoords();
    valid = from.good();
}

// Copy returns a copy of the PictSelection.

Graphic* PictSelection::Copy () {
    Selection* copy = new PictSelection(this);
    for (First(); !AtEnd(); Next()) {
	copy->Append(GetCurrent()->Copy());
    }
    return copy;
}

// HasChildren returns true so Idraw can ungroup this Picture.

boolean PictSelection::HasChildren () {
    return Picture::HasChildren();
}

// Propagate must preserve the PictSelection's transformation matrix
// if it has any.

void PictSelection::Propagate () {
    Transformer* original = GetTransformer();
    if (original != nil) {
	original->Reference();
	Selection::Propagate();
	SetTransformer(original);
	delete original;
    } else {
	Selection::Propagate();
    }
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:53,代码来源:slpict.c

示例4: SelectViewsOf

void OverlaysComp::SelectViewsOf (OverlayComp* comp, Editor* ed) {
    Selection* s = ed->GetSelection();
    s->Clear();
    Viewer* viewer;

    for (int i = 0; (viewer = ed->GetViewer(i)) != nil; ++i) {
        GraphicView* views = viewer->GetGraphicView();
        GraphicView* view = views->GetGraphicView(comp);

        if (view != nil) s->Append(view);
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:12,代码来源:ovcomps.c

示例5: SelectClipboard

void OverlaysComp::SelectClipboard (Clipboard* cb, Editor* ed) {
    Selection* s = ed->GetSelection();
    s->Clear();
    Viewer* viewer;
    Iterator i;

    for (int j = 0; (viewer = ed->GetViewer(j)) != nil; ++j) {
        for (cb->First(i); !cb->Done(i); cb->Next(i)) {
            GraphicView* views = viewer->GetGraphicView();
            GraphicView* view = views->GetGraphicView(cb->GetComp(i));

            if (view != nil) s->Append(view);
        }
    }
    ((OverlaySelection*)s)->Reserve();
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:16,代码来源:ovcomps.c

示例6: Reserve

void LinkSelection::Reserve() {
#if 0
  fprintf(stderr, "LinkSelection::Reserve\n");
#endif
  CompIdTable* table = ((DrawServ*)unidraw)->compidtable();

  /* clear anything that was in the previous selection, but not in this one */
  Selection* lastsel = _editor->last_selection();
  if (!lastsel) return;
  Iterator lt;
  lastsel->First(lt);
  Iterator it;
  while (!lastsel->Done(lt)) {
    First(it);
    boolean match = false;
    while (!Done(it) && !match) {
      if(GetView(it)==lastsel->GetView(lt)) 
	match = true;
      else 
	Next(it);
    }
    if (!match) {
      OverlayComp* comp = ((OverlayView*)lastsel->GetView(lt))->GetOverlayComp();
      void* ptr = nil;
      table->find(ptr, (void*)comp);
      if (ptr) {
	GraphicId* grid = (GraphicId*)ptr;
	grid->selected(NotSelected);
	((DrawServ*)unidraw)->grid_message(grid);
      }
    }
    lastsel->Remove(lt);
  }


  /* remove anything from selection that has a remote selector */
  First(it);
  while (!Done(it)) {
    int removed = false;
    OverlayView* view = GetView(it);
    OverlayComp* comp = view ? view->GetOverlayComp() : nil;
    void* ptr = nil;
    table->find(ptr, (void*)comp);
    if (ptr) {
      GraphicId* grid = (GraphicId*)ptr;
      if (grid->selector() && 
	  ((DrawServ*)unidraw)->sessionid()!=grid->selector()) {
	
	Remove(it);
	removed = true;
	
	if (grid->selected()==NotSelected) {
	  
	  /* make a request to select this in the future */
	  grid->selected(WaitingToBeSelected);
	  ((DrawServ*)unidraw)->grid_message(grid);
	} 
	
      } else {
	if (grid->selected()!=LocallySelected) {
	  grid->selected(LocallySelected);
	  ((DrawServ*)unidraw)->grid_message(grid);
	}
      }
      
    }
    if (!removed) 
      Next(it);
  }

  /* store copy of selection */
  First(it);
  while (!Done(it)) {
    lastsel->Append(GetView(it));
    Next(it);
  }
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:77,代码来源:linkselection.c


注:本文中的Selection::Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。