예제 #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();
}
예제 #2
0
파일: mglayer.cpp 프로젝트: Vito2015/vgcore
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
0
파일: mglayer.cpp 프로젝트: Vito2015/vgcore
void MgLayer::copy(const MgObject& src)
{
    MgShapes::copy(src);
    if (src.isKindOf(Type())) {
        const MgLayer& layer = (const MgLayer&)src;
        _flags = layer._flags;
    }
}
예제 #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;
    }
}
예제 #5
0
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
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;
}
예제 #7
0
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
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;
}
예제 #9
0
void MgBaseShape::copy(const MgObject& src) {
    if (src.isKindOf(Type()))
        _copy((const MgBaseShape&)src);
}
예제 #10
0
bool MgBaseShape::equals(const MgObject& src) const {
    return src.isKindOf(Type()) && _equals((const MgBaseShape&)src);
}