本文整理汇总了C++中Graphic::GetTransformer方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphic::GetTransformer方法的具体用法?C++ Graphic::GetTransformer怎么用?C++ Graphic::GetTransformer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphic
的用法示例。
在下文中一共展示了Graphic::GetTransformer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void TransformerFunc::execute() {
ComValue objv(stack_arg(0));
ComValue transv(stack_arg(0));
reset_stack();
if (objv.object_compview()) {
ComponentView* compview = (ComponentView*)objv.obj_val();
if (compview && compview->GetSubject()) {
OverlayComp* comp = (OverlayComp*)compview->GetSubject();
Graphic* gr = comp->GetGraphic();
if (gr) {
Transformer* trans = gr->GetTransformer();
if (transv.is_unknown() || !transv.is_array() || transv.array_val()->Number()!=6) {
AttributeValueList* avl = new AttributeValueList();
float a00, a01, a10, a11, a20, a21;
trans->matrix(a00, a01, a10, a11, a20, a21);
avl->Append(new AttributeValue(a00));
avl->Append(new AttributeValue(a01));
avl->Append(new AttributeValue(a10));
avl->Append(new AttributeValue(a11));
avl->Append(new AttributeValue(a20));
avl->Append(new AttributeValue(a21));
ComValue retval(avl);
push_stack(retval);
} else {
float a00, a01, a10, a11, a20, a21;
AttributeValueList* avl = transv.array_val();
Iterator it;
AttributeValue* av;
avl->First(it);
av = avl->GetAttrVal(it);
a00 = av->float_val();
avl->Next(it);
av = avl->GetAttrVal(it);
a01 = av->float_val();
avl->Next(it);
av = avl->GetAttrVal(it);
a10 = av->float_val();
avl->Next(it);
av = avl->GetAttrVal(it);
a11 = av->float_val();
avl->Next(it);
av = avl->GetAttrVal(it);
a20 = av->float_val();
avl->Next(it);
av = avl->GetAttrVal(it);
a21 = av->float_val();
Transformer t(a00, a01, a10, a11, a20, a21);
*gr->GetTransformer()=t;
ComValue compval(new OverlayViewRef(comp), comp->class_symid());
push_stack(compval);
}
}
}
}
}
示例2: Definition
boolean PSLink::Definition (ostream& out) {
LinkComp* comp = (LinkComp*) GetSubject();
Graphic* link = comp->GetGraphic();
Line* line = comp->GetLine();
Transformer* link_t = link->GetTransformer();
Transformer* line_t = line->GetTransformer();
Transformer* temp_t = new Transformer(line_t);
Resource::ref(link_t);
temp_t->postmultiply(*link_t);
link->SetTransformer(temp_t);
Coord x0, y0, x1, y1;
line->GetOriginal(x0, y0, x1, y1);
out << "Begin " << MARK << " Line\n";
MinGS(out);
out << MARK << "\n";
out << x0 << " " << y0 << " " << x1 << " " << y1 << " Line\n";
out << "End\n\n";
link->SetTransformer(link_t);
Resource::unref(link_t);
Resource::unref(temp_t);
return out.good();
}
示例3: getExtent
void Picture::getExtent (
float& l, float& b, float& cx, float& cy, float& tol, Graphic* gs
) {
Extent e;
float right, top, dummy1, dummy2;
if (extentCached()) {
getCachedExtent(e._left, e._bottom, e._cx, e._cy, e._tol);
} else {
if (IsEmpty()) {
l = b = cx = cy = tol = 0.0;
return;
} else {
Iterator i;
FullGraphic gstemp;
Transformer ttemp;
Extent te;
gstemp.SetTransformer(&ttemp);
First(i);
Graphic* gr = GetGraphic(i);
concatGSGraphic(gr, gr, gs, &gstemp);
concatTransformerGraphic(gr, nil, gr->GetTransformer(), &ttemp);
getExtentGraphic(gr, e._left,e._bottom,e._cx,e._cy,e._tol,&gstemp);
for (Next(i); !Done(i); Next(i)) {
gr = GetGraphic(i);
concatGSGraphic(gr, gr, gs, &gstemp);
concatTransformerGraphic(gr,nil, gr->GetTransformer(), &ttemp);
getExtentGraphic(
gr, te._left, te._bottom, te._cx, te._cy, te._tol, &gstemp
);
e.Merge(te);
}
cacheExtent(e._left, e._bottom, e._cx, e._cy, e._tol);
gstemp.SetTransformer(nil); // to avoid deleting ttemp explicitly
}
}
right = 2*e._cx - e._left;
top = 2*e._cy - e._bottom;
transformRect(e._left, e._bottom, right, top, l, b, dummy1, dummy2, gs);
transform(e._cx, e._cy, cx, cy, gs);
tol = e._tol;
}
示例4: Write
void LinkComp::Write (ostream& out) {
GraphicComp::Write(out);
Line* line = GetLine();
WriteTransformer(line->GetTransformer(), out);
unidraw->GetCatalog()->WriteComponent(_conn1, out);
unidraw->GetCatalog()->WriteComponent(_conn2, out);
Graphic* parent = line->Parent();
WriteBgFilled(parent->BgFilled(), out);
WriteColor(parent->GetFgColor(), out);
WriteColor(parent->GetBgColor(), out);
WriteBrush(parent->GetBrush(), out);
WriteTransformer(parent->GetTransformer(), out);
}