本文整理汇总了C++中Transformer::Rotate方法的典型用法代码示例。如果您正苦于以下问题:C++ Transformer::Rotate方法的具体用法?C++ Transformer::Rotate怎么用?C++ Transformer::Rotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transformer
的用法示例。
在下文中一共展示了Transformer::Rotate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InterpretManipulator
Command* TextOvView::InterpretManipulator (Manipulator* m) {
Viewer* v = m->GetViewer();
Editor* ed = v->GetEditor();
Tool* tool = m->GetTool();
Command* cmd = nil;
if (tool->IsA(GRAPHIC_COMP_TOOL) || tool->IsA(RESHAPE_TOOL)) {
TextManip* tm = (TextManip*) m;
int size;
const char* text = tm->GetText(size);
if (size == 0) {
if (tool->IsA(RESHAPE_TOOL)) {
cmd = new OvDeleteCmd(ed);
} else {
v->Update(); // to repair text display-incurred damage
}
} else {
Coord xpos, ypos;
tm->GetPosition(xpos, ypos);
Painter* p = tm->GetPainter();
Transformer* rel = tm->GetPainter()->GetTransformer();
int lineHt = tm->GetLineHeight();
Graphic* pg = GetGraphicComp()->GetGraphic();
TextGraphic* textgr = new TextGraphic(text, lineHt, pg);
if (tool->IsA(GRAPHIC_COMP_TOOL)) {
textgr->SetTransformer(nil);
}
if (rel != nil) {
if (v->GetOrientation()==Rotated && !tool->IsA(RESHAPE_TOOL))
rel->Rotate(-90);
rel->InvTransform(xpos, ypos);
}
if (v->GetOrientation()==Rotated && !tool->IsA(RESHAPE_TOOL))
textgr->Rotate(90.0);
textgr->Translate(xpos, ypos);
textgr->FillBg(false);
textgr->SetFont((PSFont*) p->GetFont());
textgr->SetColors((PSColor*) p->GetFgColor(), nil);
if (tool->IsA(GRAPHIC_COMP_TOOL)) {
cmd = new PasteCmd(ed, new Clipboard(new TextOvComp(textgr)));
} else {
cmd = new ReplaceCmd(ed, new TextOvComp(textgr));
}
}
} else {
cmd = OverlayView::InterpretManipulator(m);
}
return cmd;
}
示例2: do_draw
void do_draw (
Painter* painter, Canvas* canvas, float rotate, float scalex, float scaley
) {
Transformer* oldt = painter->GetTransformer();
Transformer t;
t.Rotate(rotate);
t.Scale(scalex, scaley);
painter->SetTransformer(&t);
painter->FillPolygon(canvas, poly1_x, poly1_y, poly1_count);
painter->FillPolygon(canvas, poly2_x, poly2_y, poly2_count);
painter->SetTransformer(oldt);
}