Beispiel #1
0
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();
}
Beispiel #2
0
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;
}
Beispiel #3
0
void MgLayer::copy(const MgObject& src)
{
    MgShapes::copy(src);
    if (src.isKindOf(Type())) {
        const MgLayer& layer = (const MgLayer&)src;
        _flags = layer._flags;
    }
}
Beispiel #4
0
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);
}
Beispiel #6
0
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);
}
Beispiel #8
0
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;
}
Beispiel #9
0
void MgBaseShape::copy(const MgObject& src) {
    if (src.isKindOf(Type()))
        _copy((const MgBaseShape&)src);
}
Beispiel #10
0
bool MgBaseShape::equals(const MgObject& src) const {
    return src.isKindOf(Type()) && _equals((const MgBaseShape&)src);
}