本文整理汇总了C++中MgObject类的典型用法代码示例。如果您正苦于以下问题:C++ MgObject类的具体用法?C++ MgObject怎么用?C++ MgObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MgObject类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copy
void MgShape::copy(const MgObject& src)
{
if (src.isKindOf(Type())) {
const MgShape& _src = (const MgShape&)src;
shape()->copy(*_src.shapec());
context()->copy(*_src.contextc());
setTag(_src.getTag());
if (!getParent() && 0 == getID()) {
setParent(_src.getParent(), _src.getID());
}
}
else if (src.isKindOf(MgBaseShape::Type())) {
shape()->copy(src);
}
shape()->update();
}
示例2: equals
bool MgLayer::equals(const MgObject& src) const
{
if (src.isKindOf(Type()) && MgShapes::equals(src)) {
const MgLayer& layer = (const MgLayer&)src;
return _flags == layer._flags;
}
return false;
}
示例3: copy
void MgLayer::copy(const MgObject& src)
{
MgShapes::copy(src);
if (src.isKindOf(Type())) {
const MgLayer& layer = (const MgLayer&)src;
_flags = layer._flags;
}
}
示例4: copy
void MgShapeDoc::copy(const MgObject& src)
{
if (src.isKindOf(Type())) {
const MgShapeDoc& doc = (const MgShapeDoc&)src;
im->xf = doc.im->xf;
im->rectW = doc.im->rectW;
im->viewScale = doc.im->viewScale;
}
}
示例5: equals
bool MgRecordShape::equals(const MgObject& src) const
{
if (src.isKindOf(Type())) {
const MgRecordShape& p = (const MgRecordShape&)src;
if (_items.size() != p._items.size() || _sid != p._sid)
return false;
}
return MgBaseShape::equals(src);
}
示例6: equals
bool MgShape::equals(const MgObject& src) const
{
bool ret = false;
if (src.isKindOf(Type())) {
const MgShape& _src = (const MgShape&)src;
ret = shapec()->equals(*_src.shapec())
&& contextc()->equals(*_src.contextc())
&& getTag() == _src.getTag();
}
return ret;
}
示例7: copy
void MgRecordShape::copy(const MgObject& src)
{
if (src.isKindOf(Type()) && this != &src) {
const MgRecordShape& p = (const MgRecordShape&)src;
_clear();
for (ITEMS::const_iterator it = p._items.begin(); it != p._items.end(); ++it) {
ICmd* item = createItem((*it)->type());
item->copy(**it);
_items.push_back(item);
}
_sid = p._sid;
}
MgBaseShape::copy(src);
}
示例8: equals
bool MgShapeDoc::equals(const MgObject& src) const
{
if (src.isKindOf(Type())) {
const MgShapeDoc& doc = (const MgShapeDoc&)src;
if (im->xf != doc.im->xf
|| im->layers.size() != doc.im->layers.size()) {
return false;
}
for (unsigned i = 0; i < im->layers.size(); i++) {
if (!im->layers[i]->equals(*(doc.im->layers[i]))) {
return false;
}
}
return true;
}
return false;
}
示例9: MgLayer
MgObject* MgLayer::clone() const
{
MgObject* p = new MgLayer(doc(), -1);
p->copy(*this);
return p;
}
示例10: MgShapeDoc
MgObject* MgShapeDoc::clone() const
{
MgObject* p = new MgShapeDoc();
p->copy(*this);
return p;
}