本文整理汇总了C++中OverlayComp::GetGraphic方法的典型用法代码示例。如果您正苦于以下问题:C++ OverlayComp::GetGraphic方法的具体用法?C++ OverlayComp::GetGraphic怎么用?C++ OverlayComp::GetGraphic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OverlayComp
的用法示例。
在下文中一共展示了OverlayComp::GetGraphic方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetGraphic
boolean OverlayComp::operator == (OverlayComp& comp) {
Graphic* gr = GetGraphic();
Graphic* test = comp.GetGraphic();
return
GetClassId() == comp.GetClassId() &&
GraphicEquals(gr, test);
}
示例2: Ungroup
void OverlaysComp::Ungroup (OverlayComp* parent, Clipboard* cb, Command* cmd) {
Iterator i, insertPt;
parent->First(i);
if (!parent->Done(i)) {
SetComp(parent, insertPt);
for (parent->First(i); !parent->Done(i); parent->Next(i)) {
OverlayComp* kid = (OverlayComp*) parent->GetComp(i);
cmd->Store(kid, new UngroupData(parent, kid->GetGraphic()));
}
cmd->Store(parent, new GSData(parent->GetGraphic()));
parent->Bequeath();
parent->First(i);
do {
OverlayComp* kid = (OverlayComp*)parent->GetComp(i);
parent->Remove(i);
InsertBefore(insertPt, kid);
cb->Append(kid);
} while (!parent->Done(i));
Remove(parent);
}
}
示例3: 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);
}
}
}
}
}
示例4: DeferredNotify
void OverlaysComp::DeferredNotify() {
if (_notify_deferred) {
GraphicComp::Notify();
_notify_deferred = false;
} else {
Iterator i;
for (First(i); !Done(i); Next(i)) {
OverlayComp* comp = (OverlayComp*)GetComp(i);
if (!comp->GetGraphic()->Hidden())
((OverlayComp*)GetComp(i))->DeferredNotify();
}
}
}
示例5: Uninterpret
void OverlaysComp::Uninterpret (Command* cmd) {
Editor* ed = cmd->GetEditor();
if (
(cmd->IsA(DELETE_CMD) || cmd->IsA(CUT_CMD)) &&
ed->GetComponent() != this
) {
Iterator i;
for (Last(i); !Done(i); Prev(i)) {
GetComp(i)->Uninterpret(cmd);
}
} else if (cmd->IsA(DELETE_CMD)) {
Clipboard* cb = cmd->GetClipboard();
if (cb != nil) {
Iterator i;
for (cb->Last(i); !cb->Done(i); cb->Prev(i)) {
OverlayComp* comp = (OverlayComp*) cb->GetComp(i);
RestorePosition(comp, cmd);
comp->Uninterpret(cmd);
}
Notify();
SelectClipboard(cb, ed);
unidraw->Update();
}
} else if (cmd->IsA(CUT_CMD)) {
Clipboard* cb = cmd->GetClipboard();
if (cb != nil) {
Iterator i;
for (cb->Last(i); !cb->Done(i); cb->Prev(i)) {
OverlayComp* comp = (OverlayComp*) cb->GetComp(i);
RestorePosition(comp, cmd);
comp->Uninterpret(cmd);
}
Notify();
SelectClipboard(cb, ed);
unidraw->Update();
}
} else if (cmd->IsA(PASTE_CMD)) {
Clipboard* cb = cmd->GetClipboard();
if (cb != nil) {
Selection* s = ed->GetSelection();
Iterator i, pos;
s->Clear();
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
GraphicComp* comp = cb->GetComp(i);
unidraw->CloseDependents(comp);
Remove(comp);
}
Notify();
unidraw->Update();
}
} else if (cmd->IsA(DUP_CMD)) {
Clipboard* cb = cmd->GetClipboard();
if (cb != nil) {
Selection* s = ed->GetSelection();
Iterator i;
s->Clear();
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
GraphicComp* comp = cb->GetComp(i);
unidraw->CloseDependents(comp);
Remove(comp);
}
Notify();
unidraw->Update();
}
} else if (cmd->IsA(OVGROUP_CMD)) {
OvGroupCmd* gcmd = (OvGroupCmd*) cmd;
OverlayComp* group = gcmd->GetGroup();
Component* edComp = gcmd->GetEditor()->GetComponent();
if (group == this) {
edComp->Uninterpret(gcmd);
} else if (edComp == (Component*) this) {
Clipboard* cb = cmd->GetClipboard();
Iterator i;
cb->First(i);
OverlayComp* group = (OverlayComp*) cb->GetComp(i)->GetParent();
GroupCmd* gcmd = (GroupCmd*) cmd;
unidraw->CloseDependents(group);
for (cb->Last(i); !cb->Done(i); cb->Prev(i)) {
RestorePosition((OverlayComp*)cb->GetComp(i), cmd);
}
//.........这里部分代码省略.........
示例6: Interpret
void OverlaysComp::Interpret (Command* cmd) {
Editor* ed = cmd->GetEditor();
if (
(cmd->IsA(DELETE_CMD) || cmd->IsA(CUT_CMD)) &&
ed->GetComponent() != this
) {
Iterator i;
for (First(i); !Done(i); Next(i)) {
GetComp(i)->Interpret(cmd);
}
} else if (cmd->IsA(DELETE_CMD)) {
Clipboard* cb = cmd->GetClipboard();
Selection* s = ed->GetSelection();
if (cb == nil) {
if (s->IsEmpty()) {
return;
}
cmd->SetClipboard(cb = new Clipboard);
cb->Init(s);
}
s->Clear();
Iterator i;
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
OverlayComp* comp = (OverlayComp*)cb->GetComp(i);
unidraw->CloseDependents(comp);
comp->Interpret(cmd);
StorePosition(comp, cmd);
Remove(comp);
}
Notify();
unidraw->Update();
} else if (cmd->IsA(CUT_CMD)) {
Clipboard* cb = cmd->GetClipboard();
Selection* s = ed->GetSelection();
if (cb == nil) {
if (s->IsEmpty()) {
return;
}
GraphicView* views = ed->GetViewer()->GetGraphicView();
s->Sort(views);
cmd->SetClipboard(cb = new Clipboard);
cb->Init(s);
Clipboard* globalcb = unidraw->GetCatalog()->GetClipboard();
globalcb->DeleteComps();
globalcb->CopyInit(s);
}
s->Clear();
Iterator i;
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
OverlayComp* comp = (OverlayComp*)cb->GetComp(i);
unidraw->CloseDependents(comp);
comp->Interpret(cmd);
StorePosition(comp, cmd);
Remove(comp);
}
Notify();
unidraw->Update();
} else if (cmd->IsA(PASTE_CMD)) {
Clipboard* cb = cmd->GetClipboard();
Iterator i;
if (cb == nil) {
Clipboard* globalcb = unidraw->GetCatalog()->GetClipboard();
if (globalcb->IsEmpty()) {
return;
}
cmd->SetClipboard(cb = globalcb->DeepCopy());
}
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
Append((OverlayComp*)cb->GetComp(i));
}
Notify();
SelectClipboard(cb, ed);
unidraw->Update();
} else if (cmd->IsA(DUP_CMD)) {
GraphicView* views = ed->GetViewer()->GetGraphicView();
OverlayComp* prev, *dup1;
Iterator i, pos;
Clipboard* cb = cmd->GetClipboard();
const float offset = 8;
MoveCmd move(ed, offset, offset);
if (cb == nil) {
OverlaySelection* s = (OverlaySelection*)ed->GetSelection();
if (s->IsEmpty()) {
return;
}
//.........这里部分代码省略.........