Esempio n. 1
0
/*!
 * \brief ImageArea::mousePressEvent
 * \param e
 */
void ImageArea::mousePressEvent(QMouseEvent* e)
{
    if (e->button() == Qt::LeftButton) {
        rectnotdrawing = false;
        setX1(e->x());
        setY1(e->y());
        setX1(std::min(e->x(), ImageStorage::getInstance().getImageWidth() - 1));
        setY1(std::min(e->y(), ImageStorage::getInstance().getImageHeight() - 1));
    }
}
Esempio n. 2
0
QRealRectangle::QRealRectangle(qreal x1, qreal y1, qreal x2, qreal y2, Item* parent)
	:Item(parent), mRectangleImpl()
{
	mNeedScalingRect = true;
	setPen(QPen(Qt::black));
	setBrush(QBrush(QColor(), Qt::NoBrush));
	mDomElementType = pictureType;
	setX1(x1);
	setY1(y1);
	setX2(x2);
	setY2(y2);
}
Esempio n. 3
0
/*!
 * \brief ImageArea::ImageArea
 * \param parent
 */
ImageArea::ImageArea(QWidget* parent)
    : QWidget(parent)
    , ui(new Ui::ImageArea)
    , rectnotdrawing(true)
{
    setX1(0);
    setX2(ImageStorage::getInstance().getImageWidth() - 1);
    setY1(0);
    setX2(ImageStorage::getInstance().getImageHeight() - 1);
    ui->setupUi(this);
    update();
}
Esempio n. 4
0
//----------------------------------------------------------
void Rect::lerp(const Rect & rect, float p) {

    float _x1 = coc::lerp(getX1(), rect.getX1(), p);
    float _x2 = coc::lerp(getX2(), rect.getX2(), p);
    float _y1 = coc::lerp(getY1(), rect.getY1(), p);
    float _y2 = coc::lerp(getY2(), rect.getY2(), p);

    setX1(_x1);
    setX2(_x2);
    setY1(_y1);
    setY2(_y2);
}
Esempio n. 5
0
PointPort::PointPort(qreal x, qreal y, Item *parent) : Item(parent), mPointImpl(), mType("NonTyped")
{
	mNeedScalingRect = true;
	mRadius = 2;
	setX1(x - mRadius * 1.6);
	setY1(y - mRadius * 1.6);
	setX2(x + mRadius * 1.6);
	setY2(y + mRadius * 1.6);
	mUnrealRadius = mRadius * 1.6;
	setPen(QPen(Qt::blue));
	setBrush(QBrush(Qt::blue, Qt::SolidPattern));
	mDomElementType = portType;
}
Esempio n. 6
0
QRealRectangle::QRealRectangle(const QRealRectangle &other)
	:Item(), mRectangleImpl()
{
	mNeedScalingRect = other.mNeedScalingRect ;
	setPen(other.pen());
	setBrush(other.brush());
	mDomElementType = pictureType;
	setX1(other.x1());
	setX2(other.x2());
	setY1(other.y1());
	setY2(other.y2());
	mListScalePoint = other.mListScalePoint;
	setPos(other.x(), other.y());
}
Esempio n. 7
0
PointPort::PointPort(const PointPort &other)
	:Item(), mPointImpl()
{
	mNeedScalingRect = other.mNeedScalingRect ;
	setPen(other.pen());
	setBrush(other.brush());
	mDomElementType = portType;
	setX1(other.x1());
	setX2(other.x2());
	setY1(other.y1());
	setY2(other.y2());
	mRadius = other.mRadius;
	mListScalePoint = other.mListScalePoint;
	mType = other.mType;
	setPos(other.x(), other.y());
}
Esempio n. 8
0
void Rect::setRect( RectBase rect ) {
    setX1(rect.x1);
    setY1(rect.y1);
    setX2(rect.x2);
    setY2(rect.y2);
}