示例#1
0
文件: RArc.cpp 项目: Alpha-Kand/qcad
bool RArc::stretch(const RPolyline& area, const RVector& offset) {
    bool ret = false;

    if (area.contains(getStartPoint()) && area.contains(getEndPoint())) {
        return move(offset);
    }

    if (area.contains(getStartPoint())) {
        moveStartPoint(getStartPoint() + offset);
        ret = true;
    }
    else if (area.contains(getEndPoint())) {
        moveEndPoint(getEndPoint() + offset);
        ret = true;
    }

    return ret;
}
示例#2
0
文件: RRay.cpp 项目: Alpha-Kand/qcad
bool RRay::stretch(const RPolyline& area, const RVector& offset) {
    bool ret = false;

    if (area.contains(basePoint)) {
        basePoint += offset;
        ret = true;
    }

    return ret;
}
示例#3
0
/**
 * Moves this vector by offset if it is inside the given area.
 */
RVector RVector::stretch(const RPolyline& area, const RVector& offset) {
    if (area.contains(*this)) {
        return move(offset);
    }
    return *this;
}