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(); }
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; }
void MgLayer::copy(const MgObject& src) { MgShapes::copy(src); if (src.isKindOf(Type())) { const MgLayer& layer = (const MgLayer&)src; _flags = layer._flags; } }
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; } }
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); }
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; }
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); }
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; }
void MgBaseShape::copy(const MgObject& src) { if (src.isKindOf(Type())) _copy((const MgBaseShape&)src); }
bool MgBaseShape::equals(const MgObject& src) const { return src.isKindOf(Type()) && _equals((const MgBaseShape&)src); }