Exemplo n.º 1
0
QPair<QPointF, QPointF> XmlLoader::readLinePortOfXandY(QDomElement const &start, QDomElement const &end)
{
    initListScalePoint();
    QPair<QString, bool> pointX1 = readScaleCoord("startx", start);
    QPair<QString, bool> pointX2 = readScaleCoord("endx", end);
    QPair<QString, bool> pointY1 = readScaleCoord("starty", start);
    QPair<QString, bool> pointY2 = readScaleCoord("endy", end);
    return calcLineOfXandY(pointX1, pointX2, pointY1, pointY2);
}
Exemplo n.º 2
0
XmlLoader::XmlLoader(Scene *scene)
{
    mScene = scene;
    initListScalePoint();
    mStrX = 0;
    mStrY = 0;
    mFloorY = 0;
    mReadFile = true;
}
Exemplo n.º 3
0
QPair<QPointF, QPointF> XmlLoader::readLineOfXandY(QDomElement const &docItem)
{
    initListScalePoint();
    QPair<QString, bool> pointX1 = readScaleCoord("x1", docItem);
    QPair<QString, bool> pointX2 = readScaleCoord("x2", docItem);
    QPair<QString, bool> pointY1 = readScaleCoord("y1", docItem);
    QPair<QString, bool> pointY2 = readScaleCoord("y2", docItem);
    return calcLineOfXandY(pointX1, pointX2, pointY1, pointY2);
}
Exemplo n.º 4
0
Item::Item(graphicsUtils::AbstractItem* parent)
	: AbstractItem(parent), mDomElementType(noneType)
	, mScalingState(noneScale)
{
	mNeedScalingRect = false;
	setFlag(QGraphicsItem::ItemIsSelectable, true);
	setFlag(QGraphicsItem::ItemIsMovable, true);
	mBrush.setColor(mPen.color());
	mZValue = 0;
	initListScalePoint();
}
Exemplo n.º 5
0
Arquivo: item.cpp Projeto: nfrey/qreal
Item::Item(QGraphicsItem* parent)
	: QGraphicsItem(parent), mDomElementType(noneType), mDragState(None)
	, mScalingState(noneScale), mX1(0), mY1(0), mX2(0), mY2(0)
{
	mNeedScalingRect = false;
	setFlag(QGraphicsItem::ItemIsSelectable, true);
	setFlag(QGraphicsItem::ItemIsMovable, true);
	mBrush.setColor(mPen.color());
	mZValue = 0;
	initListScalePoint();
}
Exemplo n.º 6
0
QPointF XmlLoader::readXandY(QDomElement const &docItem)
{
    initListScalePoint();
    QPair<QString, bool> pointX = readScaleCoord("x", docItem);
    QPair<QString, bool> pointY = readScaleCoord("y", docItem);

    qreal x = pointX.first.toDouble() + mDrift.x();
    qreal y = pointY.first.toDouble() + mDrift.y();

    checkScale(pointX, QPair<QString, bool>("", false), pointY, QPair<QString, bool>("", false));
    return QPointF(x, y);
}
Exemplo n.º 7
0
QRectF XmlLoader::readRectOfXandY(QDomElement const &docItem)
{
    initListScalePoint();
    QPair<QString, bool> pointX1 = readScaleCoord("x1", docItem);
    QPair<QString, bool> pointX2 = readScaleCoord("x2", docItem);
    QPair<QString, bool> pointY1 = readScaleCoord("y1", docItem);
    QPair<QString, bool> pointY2 = readScaleCoord("y2", docItem);

    qreal x1 = pointX1.first.toDouble() + mDrift.x();
    qreal x2 = pointX2.first.toDouble() + mDrift.x();
    qreal y1 = pointY1.first.toDouble() + mDrift.y();
    qreal y2 = pointY2.first.toDouble() + mDrift.y();

    checkScale(pointX1, pointX2, pointY1, pointY2);

    return QRectF(x1, y1, x2 - x1, y2 - y1);
}