本文整理汇总了C++中GraphicView::ConnectorIntersecting方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicView::ConnectorIntersecting方法的具体用法?C++ GraphicView::ConnectorIntersecting怎么用?C++ GraphicView::ConnectorIntersecting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicView
的用法示例。
在下文中一共展示了GraphicView::ConnectorIntersecting方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Manipulating
boolean ConnectManip::Manipulating (Event& e) {
GraphicView* views = GetViewer()->GetGraphicView();
Rubberband* r = GetRubberband();
float cx, cy;
if (r == nil) {
return false;
}
if (e.eventType == MotionEvent) {
_target = views->ConnectorIntersecting(
e.x-SLOP, e.y-SLOP, e.x+SLOP, e.y+SLOP
);
if (_target == nil) {
r->Track(e.x, e.y);
} else {
_target->GetGraphic()->GetCenter(cx, cy);
r->Track(Math::round(cx), Math::round(cy));
}
} else if (e.eventType == UpEvent) {
r->Erase();
return false;
}
return true;
}
示例2: CreateLinkCompManip
Manipulator* LinkView::CreateLinkCompManip (
Viewer* v, Event& e, Transformer* rel, Tool* tool
) {
GraphicView* views = v->GetGraphicView();
Selection* s = v->GetSelection();
RubberGroup* rg = new RubberGroup(nil, nil);
float x, y, tx, ty;
Coord cx = 0, rad = PIN_RAD, dum1 = 0, dum2 = 0;
ConnectorView* target = views->ConnectorIntersecting(
e.x-SLOP, e.y-SLOP, e.x+SLOP, e.y+SLOP
);
s->Clear();
if (target != nil) {
target->GetConnector()->GetCenter(x, y);
rel->Transform(x, y, tx, ty);
e.x = Math::round(tx);
e.y = Math::round(ty);
}
if (rel != nil) {
rel->Transform(cx, dum1);
rel->Transform(rad, dum2);
rad = abs(rad - cx);
}
rg->Append(
new RubberLine(nil, nil, e.x, e.y, e.x, e.y),
new FixedPin(nil, nil, e.x, e.y, rad),
new SlidingPin(nil, nil, e.x, e.y, rad, e.x, e.y)
);
return new ConnectManip(v, rg, rel, tool);
}
示例3: CreateManipulator
Manipulator* ConnectTool::CreateManipulator (
Viewer* v, Event& e, Transformer* rel
) {
GraphicView* views = v->GetGraphicView();
Selection* s = v->GetSelection();
Manipulator* m = nil;
_source = views->ConnectorIntersecting(
e.x-SLOP, e.y-SLOP, e.x+SLOP, e.y+SLOP
);
if (_source == nil) {
s->Clear();
} else {
m = _source->CreateManipulator(v, e, rel, this);
}
return m;
}
示例4: InterpLinkCompManip
Command* LinkView::InterpLinkCompManip (Manipulator* m) {
Viewer* v = m->GetViewer();
Editor* ed = v->GetEditor();
GraphicView* views = v->GetGraphicView();
BrushVar* brVar = (BrushVar*) ed->GetState("BrushVar");
ConnectManip* cm = (ConnectManip*) m;
Transformer* rel = cm->GetTransformer();
RubberGroup* rg = (RubberGroup*) cm->GetRubberband();
RubberLine* rl = (RubberLine*) rg->First();
Coord x0, y0, x1, y1;
Connector* c1, *c2;
ConnectorView* target1, *target2;
MacroCmd* macro = new MacroCmd(ed);
rl->GetCurrent(x0, y0, x1, y1);
if (rel != nil) {
rel = new Transformer(rel);
rel->Invert();
}
Graphic* pg = GetGraphicComp()->GetGraphic();
Line* line = new Line(x0, y0, x1, y1, pg);
if (brVar != nil) line->SetBrush(brVar->GetBrush());
line->SetTransformer(rel);
Unref(rel);
LinkComp* linkComp = NewSubject(line);
linkComp->GetConnectors(c1, c2);
macro->Append(new PasteCmd(ed, new Clipboard(linkComp)));
target1 = views->ConnectorIntersecting(x0-SLOP, y0-SLOP, x0+SLOP, y0+SLOP);
target2 = views->ConnectorIntersecting(x1-SLOP, y1-SLOP, x1+SLOP, y1+SLOP);
if (target1 != nil) {
macro->Append(new ConnectCmd(ed, c1, target1->GetConnector()));
}
if (target2 != nil) {
macro->Append(new ConnectCmd(ed, c2, target2->GetConnector()));
}
return macro;
}